I guess it's obvious, but you could use a power switch or use an
external circuit to control power.

Matt.

On Feb 11, 12:31 pm, Jim Gregory <[email protected]> wrote:
> I'm currently programming an 18f2550 using the usbbootloader.py
> running on Debian Linux and using the bootloader autostart code taken
> from 18F4550_usb_bootloader_autostart.jal in the "samples" directory.
> I have the BOOT_DELAY_IN_SECONDS set to 8.
>
> It will work reliably if I unplug my development board from the
> computer, start usbbootloader.py (as root) on my PC, then plug the USB
> line from my development board back into the PC while usbbootloader.py
> is running.
>
> What I would *like* to do, however, is invoke bootloading from a
> switch on the development board while the program on the chip is
> running normally.  My reset code is simply:
>
>    if reset_pin == low then
>         asm goto 0x000
>    end if
>
> This will cause the chip to reset and my computer to disconnect the
> device & wait the required 8 seconds.  However, usbbootloader.py fails
> to reprogram the chip, returning:
>
> Traceback (most recent call last):
>   File "/home/jimg/uc/pic/jallib24/usb_bootloader/UsbBootLoader.py",
> line 543, in <module>
>     print"Boot device version number " +
> str( test_loader.WaitForDevice() )
>   File "/home/jimg/uc/pic/jallib24/usb_bootloader/UsbBootLoader.py",
> line 118, in WaitForDevice
>     usb_driver = UsbBootLoaderDriver()
>   File "/home/jimg/uc/pic/jallib24/usb_bootloader/
> UsbBootLoaderDriver.py", line 93, in __init__
>     self.device = self.device_descriptor.get_device()
>   File "/home/jimg/uc/pic/jallib24/usb_bootloader/
> UsbBootLoaderDriver.py", line 38, in get_device
>     buses = usb.busses()
>   File "/usr/local/lib/python2.6/dist-packages/usb/legacy.py", line
> 333, in busses
>     return (Bus(),)
>   File "/usr/local/lib/python2.6/dist-packages/usb/legacy.py", line
> 329, in __init__
>     self.devices = [Device(d) for d in core.find(find_all=True)]
>   File "/usr/local/lib/python2.6/dist-packages/usb/legacy.py", line
> 314, in __init__
>     self.configurations = [Configuration(c) for c in dev]
>   File "/usr/local/lib/python2.6/dist-packages/usb/core.py", line 723,
> in __iter__
>     yield Configuration(self, i)
>   File "/usr/local/lib/python2.6/dist-packages/usb/core.py", line 419,
> in __init__
>     configuration
>   File "/usr/local/lib/python2.6/dist-packages/usb/backend/
> libusb10.py", line 471, in get_configuration_descriptor
>     config, byref(cfg)))
>   File "/usr/local/lib/python2.6/dist-packages/usb/backend/
> libusb10.py", line 403, in _check
>     raise USBError(_str_error[ret], ret, _libusb_errno[ret])
> usb.core.USBError: [Errno 5] Input/output error
>
> I've tried various time delays without success.  Does anyone have any
> suggestions on how I might be able to make this work?
>
> -Jim

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to