cancel
Showing results for 
Search instead for 
Did you mean: 

VCP Loopback Example - Not Working with DFU

connect
Associate II
Posted on December 16, 2013 at 15:15

Hi all, hoping to get a couple of pointers here as I'm a little stuck on this one.

The just of it: I have a program adapted from the VCP loopback example. It runs beautifully at 0x8000000. When I jump to it (at 0x8004000) from my DFU bootloader, the program still runs but the VCP never appears on the host computer.

Other bits of info:

1.) Interrupts work, as does every other bit of the code.

2.) The DFU works well - it loads and runs this program as well as several other programs without a hitch, some of them are FreeRTOS based. Never had an issue before.

3.) The VCP works 100% when not loaded by the DFU. When loaded by the DFU, the the program runs as exactly as expected, apart from the VCP being unavailable.

4.) Device is a F103CBT6.

Any ideas greatly appreciated.

Thanks

#dfu #usb #bootloader #vcp
1 REPLY 1
chen
Associate II
Posted on December 19, 2013 at 12:29

Hi

Can you clarify some things for me please?

Are you using the built in software upgrader (DFU)?

When you jump to 0x8004000 - is this starting your own application?

Is your application using FreeRTOS or not?

I have not used the DFU before myself so tell me - does the DFU use the VirtualComPort?

What I think is happening is that the DFU is using the VCP. Windows detects the VCP and enumerates it.

When you jump to your application, the USB driver is taken down inside the STM32 and then you application starts a new instance of the USB driver.

his happens so fast that Windows does not detect that the VCP has been taken down and so it does not re-enumerate.

You can test this by unplugging and re-inserting the USB - does it now enumerate?

If this is the case - you can force a 'soft disconnet' on the USB port in the STM32