This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Scatter file with code on either side of a flash config block

I find myself stuck trying to create a working scatter file. I am using the Keil compiler, mbed-os, and an STM32F407VG (1meg flash). I want to create a flash image that reserves flash sectors 3 and 4 (0x0800C000, 16K and 0x08010000, 64K) for in-app programming (config) space. I prefer these sectors because they are the right size for my needs as opposed to the ones higher in the address map.

However, my .text sections are larger than will fit below FLASH_SECTOR_3, and thus some .o files must end up above the end of FLASH_SECTOR_4. All attempts to create two ER's so far have resulted in a distribution of code that puts all of the .o's in the larger upper regions and then the initial BLX to SystemInit fails (it appears to try to branch to an incorrect address).

Anyway, if anyone has an example of reserving out a flash sector with code living happily on both sides of the reserved block, that would be much appreciated.