FW update using dfu-util problem

General discussion on mikroBasic PRO for ARM.
Post Reply
Author
Message
vxristodoulou
Posts: 8
Joined: 10 Jan 2017 01:59

FW update using dfu-util problem

#1 Post by vxristodoulou » 07 Jan 2021 23:56

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,

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: FW update using dfu-util problem

#2 Post by filip » 11 Jan 2021 09:23

Hi,

If you use USB HID bootloader to upload the CDC_Demo, does this work ?

Regards,
Filip.

vxristodoulou
Posts: 8
Joined: 10 Jan 2017 01:59

Re: FW update using dfu-util problem

#3 Post by vxristodoulou » 12 Jan 2021 17:10

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!

AntiMember
Posts: 135
Joined: 02 Jan 2020 19:00

Re: FW update using dfu-util problem

#4 Post by AntiMember » 12 Jan 2021 19:41

In general, you need to reconnect USB after downloading code.

vxristodoulou
Posts: 8
Joined: 10 Jan 2017 01:59

Re: FW update using dfu-util problem

#5 Post by vxristodoulou » 12 Jan 2021 20:47

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.

Post Reply

Return to “mikroBasic PRO for ARM General”