What length of time is the watchdog configured for? The bootloaders
should turn it off, but I may need to move the code earlier in the
initialization -- although even the shortest nominal timeout should be
plenty to run the bootloader startup code.
One thing that springs to mind is that Windows won't acknowledge
devices dropping off and back on the bus very quickly; it will become
confused and won't attempt a re-enumeration. The procedure I generally
follow in my bootloaders when I need to do this is to turn off the USB
interface, wait around 500ms, then perform the jump or watchdog reset.
That time seems sufficient to make the host realize the device needs
to be enumerated again to detect the new firmware.
- Dean
On Oct 17, 2:17 pm, Peter Kwan <
peterk.v...@gmail.com> wrote:
> The sequence is. I connect the unit which is USB bus powered. It comes
> up as COM16. I trigger the watchdog by doing while(1); and the unit
> disconnects and is no longer in the Device Manager list. The unit does
> USB_Init() every 4 seconds but it never is acknowledged. I unplug the
> unit and plug it back in again. It appears as COM16 in DeviceManager
> but this time it doesn't appear in the list of available COM ports for
> my terminal program. However, if I unplug it for longer, say five
> minutes then will start normally.
> Fortunately it isn't a big deal for me as I don't intend to use it
> under Windows.
>
> On 17 October 2012 12:39, Sebastian Steppeler <
sebion7...@googlemail.com> wrote:
>
>
>
>
>
>
>
> > okay I ment just the port beeing allocated by i.e. a terminal program. its
> > irrelevant if there is actual data throughput.
> > is your usb device bus powered?
> > is the device not listed in the hardware list when you replug it on windows?
> > or is it just not available as com port?
>
> > 2012/10/17 Peter Kwan <
peterk.v...@gmail.com>
>
> >> There is no data being transferred at the time that I trigger the
> >> watchdog. The unattached flag that gets set is one I can trace using
> >> JTAG debug looking at USB_DeviceState. Also the Windows sound signals
> >> a disconnected USB device. On both Windows and Linux it then stays
> >> disconnected, ignoring my call to USB_Init(). On Windows if I unplug
> >> and then replug it boots like normal but Windows thinks that the port
> >> doesn't exist. But on Linux it starts correctly and everything is
> >> working.
>
> >> Peter
>
> >> On 17 October 2012 10:33, Sebastian Steppeler <
sebion7...@googlemail.com>
> >> wrote:
> >> > what happens if you do a hardware reset? does it work then?
> >> > If you have a program talking to the virtual serial and you disconnect
> >> > the
> >> > usb port while it is running you might get into trouble with a blocked
> >> > driver.
> >> > where did you get the info about the device state, that it is
> >> > unattached?
>
> >> > regards,
> >> > Sebastian
>
> >> > 2012/10/17 Peter Kwan <
peterk.v...@gmail.com>