Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


USB CDC Host demo (FS or HS) STM32F7 Discovery

Firstly, no issues with debugging / SW4STM32. All good. Thank you :-)

The demo however, queries an attached device, and ends with the message “No registered class for this device.” This is on the FS and HS examples from 1.0.3 F7 cube firmware examples.

I was looking for somewhere there was a list of supported classes maybe, or to associate a connected VID/PID with a class... Maybe I’ve missed that. Otherwise, it reads the serial number, VID, PID and info from the attached device, so I’m assuming that it’s ok.

I did only solder two USB type B sockets together back to back, so there’s no ID line, only power and D+/D-. (two cables plugged back to back in other words.) These won’t be swapped or anything, but like I said, it’s coming up ok with VID/PID and other info ok.

Any ideas?

normaly you need esd proctedtion and serial terminal resistor to get a clean usb connection.
I have done sucessull USB wiring on a nucleo wiht only resistor (see any eval baord schematic for detauls).

I’m not sure to ge the issue but if you’r code and wring is correct pluging the device to some host it shall appear .
On windows it will show as unkown device and if you install ST VCP driver its will appear as a “COM” port

if you plug it to a linux hots it will apear as an usb cdc/ascm tty usable out of the box.


Hi,
not sure if this is still relevant for you - but I encountered the same thing and in the moment Í´m investigating on the same issues like you with an FTDI USB device.
With this FTDI device the STM32 USB CDC device example code is also telling me “No registered class for this device”. This happens when using FS and HS example code on the STM32F7 Discovery board. It also happens when I use eg. a MSC device like a memory stick (for sure...)

So, when I used another STM4 Discovery board as a USB device and run on that device the STM32 USB device VCP (virtual com port) example and connected that board with the USB CDC host board - both boards talked to each other. So this seems to be step one for me. Now I have to figure out whats the difference between the STM32 VCP and the “real” FTDI cable...


Thanks McMarkus / diabolo38.
Just to be clear, I want to run a USB CDC Host project on the F7 discovery.

McMarkus, are you saying you got the CDC Host project to work ok on an STM32F4 discovery board? If so, which one? I’ll try with 407 / 429i boards and see what happens...


Hello Diabolo38,
Yes, I´ve got the USB CDC Host working on F7 discovery and also on F4 discovery (407).
But the USB CDC Host just works for me when the other client side is also a STM32 disco board and runs STMs VCP (virtual com port). Then both parties can send and receive data.
But I could not manage to run my USB DCD host together with an FTDI chip (FTDI cable) which runs as client.
But this is my intention...

So:
- STM CDC Host to STM VCP (Client) => WORKS
- STM CDC Host to FTDI VCP (Client) => DOES NOT WORK RIGHT NOW
- STM CDC Host to any other serial2USB converter (Prolific, SiliconLabs, ...) => DOES NOT WORK RIGHT NOW

If anyone can help...


So just now I realized that the FTDI chip does not act like CDC device...
Thats why it doesnt work right now.

I had notice you had finished that the F7 aUSB act linke an USB_CDC VSP. Well, a s far as i am now, my interface support code does not running., yet. The code attempt to connect as a High Speed Device and the pc response that this could not start becaue a driver is missing (code 28 error in the device Manager) .
I am interessting in your solution, generated by CubeMX and i guess, your VSP handler. In the code i had previously worked and connect, i am able to send a string to the pc but i cound not found any receiver routine.

Would you share your code ????
Juppeck

I had done the work around the CDC-USB issues i reported and asked before. The virtual serial port firmware runs as expected now and does not need any serial driver support installation for windows 10 x64.
I am impressed how many answers where posted around this issue. It seems none other has got this before. Well, i will save my solution an the experiences aroud the cubeMX generated gerneic code too.

Hi.

I am interested in your findings and solutions.
Would you share your code?

Thanks.

Hi,

Yes, would be definitely interesting.

Julien

The CDC support realized with HAL instead the obsolete and unavailable support of stdlib in STM32F7 and newer. My solution don’t requires any thirdparty driver - just the regular CDC interface of Windows 10 is used. This was the advertizing block. In the mean time, i had selled the entire project to customer.
The main problem of the HAL USB.CDC support was the understanding of the callback routine. Different as is assumed, the HAL support routines works quite similar as a regular RS232 interface. You need to define a ring-buffer for rx and tx, a handler routine for outgoing and incomming data and a control handler who signalize in case of an received and the send request.
In addition, their is also a callback available who signalize the application if the usb plug is removed or plugged in.
I had used this as a trigger to start an rtos thread to support the routines for rx and tx.
In several weeks i had attempt to find a vaild example or a more detaild description about the HAL support of the CDC class, i was unsuccessful.
The older stdlib handling of cdc that regulary used by the F1,3,4 Series, is quite different and not helpful to solve. Similar the documentation of HAL. This is more a quick reference as a documentation and also unhelpfully. A good way to understand how the IF is required to be programmed is watching the source code.

I wish you good luck to solve.

Well, i had found an example for an USB-CDC HAL based upon STm32F746 Disco board. This project is more complex, but i assume that you know how the USB-Support routines needs to be handled.
you need to download the “STM32_USB_Device_Library” sources and enable the HAL support for the USB.
Both are available by CubeMX and could be preconfigured for just a test. The attached File SRC.ZIP are the main fsource files that requires the both source codes from st. It uses the HS-USB port of the STM32F7 Disco board.
I assume this could be used on the other F7 Nucleos too, but i had not done them as now.
The packed source files are snipps - this is not an entire project. This shoudl explain how the interface needs to be handled.
If everythings is working fine, a COM device must be available in teh device manager of Windows 10, without installing a driver. The speed setting of the PC program, who open the virtual serial port, is unimportant - i usualy uses 115KBit/s.
I had added some comments in german to explain the functionality. Well, just use goolge xlator.
Generaly, you need to declare a routines for HS or FS USB. You need to have an ringbuffer for incomming and outgoing characters. The USB port handles the port by using an IRQ and their ISR.
The routes working proper in a freeRTOS environment too.

MX_USB_DEVICE_Init(); // init USB CDC Device 0)
{
sprintf (cp, “Got frame of length %d: %s “, len, buf);
GUI_DispStringAt (cp, 0, 230); // empfangene Zeichenkette ausgeben
}
}
osDelay(10);
}
}

.................................
And this is a sender call from STM to the PC - not magic

Len = strlen(uhrzeit);
CDC_Transmit_FS ( (uint8_t *) uhrzeit, Len); //! USB2.0 480Mbit



I hope this will helps you to solve your issues.