Tool/software: Code Composer Studio
Hopefully the formatting on this comes out decently.
I have modified the linker command script to create a data section and a code section for doing self programming on my controller.
.update_buffer : {} > 0x4800 /* buffer data for temporarily holding new firmware */ .update_code : {} > 0xC800 /* code for updating firmware */
And in code I have the following
#define MAX_UPDATE_SIZE 0x8000 #pragma DATA_SECTION(update_storage, ".update_buffer") uint8_t update_storage[MAX_UPDATE_SIZE] = { [0 ... MAX_UPDATE_SIZE-1] = 0 }; #pragma CODE_SECTION(do_firmware_update, ".update_code") void do_firmware_update() { }
The map file generated during build shows things work as expected, except for the presence of mpu_ctl0_value near the middle of my update_storage area.
00004800 update_storage 0000a501 mpu_ctl0_value 0000c800 do_firmware_update
What is mpu_ctl0_value used for? Can I move it?