Hi,
I've been successfully using the USB HID Bootloader to program my STM32. For a couple reasons, I need to update the FW using dfu-util in a MacOS terminal. Using this method, my code is also successfully programmed.
Both methods above work fine when I program a simple LED_blink code. When I use a code that implements the USB (CDC_Demo), the code doesn't start to run, if I programmed it using the second method (dfu-util).
Any ideas what might be wrong? Is it possible that my code does't know where to start? If so, why it happens only when I use the CDC_Demo and not the LED_Blink?
Thank you in advance,
FW update using dfu-util problem
Re: FW update using dfu-util problem
Hi,
If you use USB HID bootloader to upload the CDC_Demo, does this work ?
Regards,
Filip.
If you use USB HID bootloader to upload the CDC_Demo, does this work ?
Regards,
Filip.
-
- Posts: 8
- Joined: 10 Jan 2017 01:59
Re: FW update using dfu-util problem
When I use the USB HID Bootloader everything works fine. I narrowed down the problem and seems that the code stucks in the loop below.
WHILE(USBDEV_GETDEVICESTATE() <> _USB_DEV_STATE_CONFIGURED)
WEND
which means the USB device is never configured/enumerated. If I remove this loop, the rest of my code runs properly.
It is unclear to me what is different when I use dfu-util that causes the USB to not be configured.
Your support on this will be much appreciated. Thanks!
WHILE(USBDEV_GETDEVICESTATE() <> _USB_DEV_STATE_CONFIGURED)
WEND
which means the USB device is never configured/enumerated. If I remove this loop, the rest of my code runs properly.
It is unclear to me what is different when I use dfu-util that causes the USB to not be configured.
Your support on this will be much appreciated. Thanks!
-
- Posts: 135
- Joined: 02 Jan 2020 19:00
Re: FW update using dfu-util problem
In general, you need to reconnect USB after downloading code.
-
- Posts: 8
- Joined: 10 Jan 2017 01:59
Re: FW update using dfu-util problem
Thank you for your input AntiMenber. When using the MikroE bootloader, re-connecting the USB is not really necessary as everything works fine.
Though, I have done this after programming with dfu-util but didn't help much.
Though, I have done this after programming with dfu-util but didn't help much.