Hey All,
Noobish question, but I want to make sure I do this the right way and not in a "it just works" way. I wrote a bootloader for updating my device, and I want to be able to reset the micro from the application and start the update process, but only when the application requests it, the reasoning being I do not want to add all the code to the function that jumps to the application or determines to stay in bootloader mode to check the SPI flash for a new bootloader version.
The bootloader is based off the Microsoft UF2 bootloader, and it already contains a method for persisting a "Magic" value in RAM across a reset (But never when there is an application), this location is a 32 bit value at the top of RAM (HSRAM_ADDR + HSRAM_SIZE-4). When there is a specific value at that memory location, the bootloader stays in the bootloader, and if not, it starts the application. I just did a dirty additions of another magic that would put it in a firmware update mode not really expecting it to work, shocker, it didnt. If I run the line `*MAGIC_LOCATION = 0x67737973;` the micro just halts and doesn't go to the nest line which is a reset.
Before I keep fiddling to get this to work, is there a right way to do this?
Thank you,
Samuel