Hi Chandre, 1. To erase/program the sectors in bank0, you have to execute the flash API related code from a separate flash bank, or from SRAM. To copy the sections to SRAM: a. define the output sections which includes all the API related function, then allocate them to flash for loading and SRAM for run b. in main() or startup(), please copy those output sections to SRAM (please refer to the example in bootloader) Copying only the F021 APIs to SRAM is not enough. The following functions should be copied to RAM too: a. Fapi_UserDefinedFunctions.obj b. functions who call the F021 APIs So the output sections should include those objects. 2. It is nice to copy the variables or constants (for example flash sectors defined in my flash_defines.h) to SRAM too. .const : {} palign=8 load=FLASH0 |FLASH1, run = SRAM, LOAD_START(constLoadStart), RUN_START(constRunStart), SIZE(constLoadSize)
↧