I wondered if one could use a vusb-based bootloader and still use the USB connection in ones' main firmware.
Say I have device that uses the USB conncetion e.g. to switch a few relays controlled by the connected PC. I then press a button to put the device in bootloader mode. I then update the firmware over the same USB connection, the device resets and I can switch the relays again over USB. Would that at all be possible?
I guess one would have to change a few compile time options to runtime stuff in v-usb but maybe a ready-made bootloader exists? Does someone know of one?
USB bootloader with program using usb?
Re: USB bootloader with program using usb?
USBaspLoader and variations allow this on devices with bootloader support (separate interrupt vectors for bootloader). I use such a setup all the time and it's great. Some allow various ways of entering bootloader: for a few seconds on device being plugged in, when reset is pressed, etc.
Re: USB bootloader with program using usb?
Ah, thanks. Would you mind giving me a kick start by posting the firmware and schematic of one of your simpler or a minimal projects? I find it easier to learn from examples.
Re: USB bootloader with program using usb?
The simplest approach is to get one (or two) USBasp hardware boards and flash USBaspLoader on it. Then you can load a new program into the board and use it as a development board with I/O and USB. If you have two of these or one and another ICSP programmer, I'll post one that's configured and ready to build and flash.