SVL bootloader fails to erase upper half of flash

Hi,

The SVL bootloader code (the firmware that runs on the Artemis, not the scripts that run on the PC side) contains a logic error that causes issues when programming large flash images.

The flash on the Apollo3 chip is divided into two instances, each of which is divided into 64 pages. Instance 0’s pages are numbered 0-63, and instance 1’s pages are also numbered 0-63. The bootloader code keeps track of the flash page number when erasing flash during programming. However, it doesn’t handle the page number rolling over to 0 once the upper flash instance is reached. As a result, it will never erase any pages in the upper flash instance. This causes erratic behavior once the application size exceeds ~450K or so - the board will program and run fine on the first attempt, but will hang after all subsequent programming attempts as the upper half of flash gets corrupted (due to the failure to erase before reprogramming).

I have implemented a local workaround, but it would be nice to get an official fix for this.

Post the same/similar message here https://github.com/sparkfun/Apollo3_Uploader_SVL/issues to see about getting an engineer assigned to look @