Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years, 7 months ago.
Get USB to Work on DISCO-F429ZI
I am trying a very simple example:
#include "mbed.h" #include "USBSerial.h" USBSerial serial; int main() { while (1); }
In theory, that should enable the USB Hardware as CDC Device and allow Windows to find it (at least). Note: USBHid or any other Devicetype shows exactly the same behaviour.
Issues: 1. MBED runs into a halt: "This board does not have a hardware USB driver" (mbed_usb_phy.cpp:26). This can be fixed easily by changing the file "tragets.json" adding "USBDEVICE" to the "device_has_add"-List for the DISCO-F429 board. Then, it runs at least, but still does not enumerate in windows. 2. Now, windows at least recognizes that there is something hanging at the USB port and tries to enumerate it, but it cannot be recognized. The "USB Device Tree Viewer" says that there was an error requesting the device description.
Running the same Board with a CubeMX generated basic project works fine, so it clearly is no Hardware issue. I also tried the identical code on the Nucleo-F429ZI (same µC, different PCB and preipheral connections) and it works as expected beeing recognized in Windows immediately.
To dig deeper, I tried to replace all USB related HAL-Files (that I recognized) by known working versions from the CubeMX generated code without any success. Debugging showed that the USB related IRQ gets executed several times, but I don't see what's wrong. It never calls the function providing the descriptor data.
To me, it looks like that there is a issue with the USB-HS Module that is used here instead of the typically used USB-FS Module (e.g. on the Nucleo-F429ZI). The MBED code supports the USB-HS-Module, but inside the code itself, it looks more like a place-holder, e.g. The HS-Module has a much larger FIFO Memory, but the code only uses the amount that is also available in the FS-Modules. Replacing that part of the code by the cubeMX generated code also did not help. Maybe there is something else that is missing for USB-HS.
Any hint would be highly appreciated.
Thanks,
Thomas
It seems that I found solution. If a add next idle hook asign to empty function USB detected properly: rtos::Kernel::attach_idle_hook(my_idle_hook);
posted by Slava Popov 02 Jul 2019Can you post an example? I tried that idle_hook on my Disco429 but it did not work, but maybe I did it wrong.
posted by Thomas Buck 02 Jul 2019My main.cpp