This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Is there any documentation for the ROM based USB boot loader? I need to know the following things.
Will it upon startup, notice if there is no program in FLASH, and therefore boot-up with DFU to look for an update over USB? (how does the device know to use USB/DFU?).
Will it upon receiving a call of ROM_UpdateUSB(0); wait for an update infinitely?
What happens if, while waiting for an update, it is powered down and back up? (Will it run FLASH program, or still be waiting for an update?).
Are any of these things configurable for ROM USB Boot Loader, if so how?
Actually we were just discussing yesterday in a team meeting how the ROM boot loader documentation is scattered and hard to find.
Alexander Wardlow said:Will it upon startup, notice if there is no program in FLASH, and therefore boot-up with DFU to look for an update over USB? (how does the device know to use USB/DFU?).
On startup, the CPU starts executing from the ROM. It checks the BOOT_CFG register to see if it must check a pin and go into boot loader mode. If not directed to boot loader mode by the BOOT_CFG register, it checks the first 8 bytes of the flash. If the first 4 bytes contain a valid stack address and the next 4 bytes a valid reset vector, then the CPU starts execution by loading the stack pointer and jumping to the address pointed to by the reset vector. If not, the CPU goes into a loop checking for valid boot loader commands from UART0, I2C0, SSI0, USB0 or Ethernet.
Alexander Wardlow said:Will it upon receiving a call of ROM_UpdateUSB(0); wait for an update infinitely?
Yes.
Alexander Wardlow said:What happens if, while waiting for an update, it is powered down and back up? (Will it run FLASH program, or still be waiting for an update?).
The process will repeat. If the device was running from flash and ROM_UpdateUSB(0) was called, the CPU will go back to executing from flash again. If that flash program calls ROM_UpdateUSB(0) again, it will go back to trying to do a DFU update. The issue is if power is lost during an update, the flash may be only partially erased or partially programmed.
Alexander Wardlow said:Are any of these things configurable for ROM USB Boot Loader, if so how?
When executed at reset because the flash is blank, no. When called from the application code, ROM_UpdateUSB(uint8_t *pui8USBBootROMInfo) expects the application to configure the pins and the PLL. It also accepts a pointer to an array that configures the vendor ID, product ID, bus- versus selfpowered, maximum power, device version, and USB strings.
Thanks Bob Crosby. Just one more thing however. In the first question where it is looking for valid commands from USB0, does this include commands via dfuprog.exe?