Other Parts Discussed in Thread: HALCOGEN
I finally got back getting my application code to write the necessary "magic number" to memory to initiate a firmware update, and was able to get things working. Assuming the upload worked correctly, there should be a Blinky_FEE.zip file attached that contains a full project for a TMS570 Launchpad that alternates blinking the two on-board LEDs. If a CAN message with ID = 0x001 is sent with data = 0xFFA5A5A5A5, the "magic number" is overwritten and the board is reset, causing the bootloader to wait for a new image.
I will be using FEE in my application to hold state values between power cycles, so I added that to this project to ensure no conflicts with the F021 FAPI functions.I am using the FAPI functions, basically copied from the bootloader source and wrapped in example code from the "Advanced F021 Flash API Erase/Program Usage" application report (SPNA148).
Bank 7 sectors 1 and 2 are reserved for my state variables; I used sector 15 (0xF020 F000) for the magic number location to prevent interference.
I've been able to switch back and forth between the binary from this project and my actual application using the bootloader with no issues, and am very happy to finally get this working. However, I am concerned that I may be missing something that will come back to bite me later, so if anyone has time to look at `setMagicNumber()` in `bsp.c`, I'd appreciate it.
- Tom