cancel
Showing results for 
Search instead for 
Did you mean: 

Reset device peripherials after remapping

infoinfo978
Associate II
Posted on January 31, 2014 at 15:38

Hey guys,

I am already running an application with USB in VCP mode, and I developed a circuit, that would rise voltage on boot0-pin to enter the bootloader after a reset is done trough the watchdog...

My problem is that I have to disconnect the USB-plug to get the device detected in DFU mode after the watchdog did a reset. So my idea is to configure the UBS D+ and D- pins as outputs, and pull them low shortly before the reset...

Unfortunately just defining them as output does not work. I also tried to reset the peripherial clocks, but it would not work. Any ideas how I can felicitate this software driven usb-disconnect?

thanks and best regards!
3 REPLIES 3
chen
Associate II
Posted on January 31, 2014 at 17:17

Hi

You can fake a USB disconnect

    // set bit SDIS in OTG_FS_DCTL reg

    USB_OTG_dev.regs.DREGS->DCTL |= 0x02;

infoinfo978
Associate II
Posted on January 31, 2014 at 18:59

Hey, thanks!

I just gave it a try, but it's not working yet. The device disconnects, but it does not reconnect in DFU-Mode, still have to toggle the plug. Any further ideas?

Hi

You can fake a USB disconnect

    // set bit SDIS in OTG_FS_DCTL reg

    USB_OTG_dev.regs.DREGS->DCTL |= 0x02;

chen
Associate II
Posted on January 31, 2014 at 19:30

Hi

''and I developed a circuit, that would rise voltage on boot0-pin to enter the bootloader after a reset is done trough the watchdog...''

'' The device disconnects, but it does not reconnect in DFU-Mode, still have to toggle the plug. Any further ideas? ''

So the soft disconnect works.

After the reboot, are you sure your circuit pulls the boot0 pin(s) high?

Are you sure it is running the built in DFU code?

Once it starts the built in DFU code - you are in the hands of the built in code.