Hello, I want to reserve 256 bytes of SRM portion for custom msg between bootloader and application. I have modified .sct file as attached. Please let me know if there is any issue. Also I will run below code, please let me know if anything wrong.
extern uint32_t Image$$EXE_REGION_RAM_BOOTLOADER_MSG$$Base[];
const uint32_t secret_key= 0xACD3F90B;
//__attribute__((optimize("O0")))
// Disable optimization for this function
#pragma clang optimize off
void write_dummy_msg_in_ram(void) {
volatile uint8_t *volatile BOOTLOADER_MSG_ADDRESS = (volatile uint8_t *)Image$$EXE_REGION_RAM_BOOTLOADER_MSG$$Base;
uint8_t len = 0;
//memcpy((uint8_t *)BOOTLOADER_MSG_ADDRESS,(uint8_t *) secret_key, 4);
//len = 4;
BOOTLOADER_MSG_ADDRESS[len++] = 0x10;
BOOTLOADER_MSG_ADDRESS[len++] = 0x12;
BOOTLOADER_MSG_ADDRESS[len++] = 0x14;
BOOTLOADER_MSG_ADDRESS[len++] = 0x16;
BOOTLOADER_MSG_ADDRESS[len++] = 0x18;
BOOTLOADER_MSG_ADDRESS[len++] = 0x20;
}
#define REGION_CODE_SRAM_L_START (REGION_RAM_INTERRUPT_VECTOR_START + REGION_RAM_INTERRUPT_VECTOR_SIZE)
#define REGION_CODE_SRAM_L_SIZE 0x00008000
#define REGION_BOOTLOADER_MSG_STRT (REGION_CODE_SRAM_L_START + REGION_CODE_SRAM_L_SIZE)
#define REGION_BOOTLOADER_MSG_SIZE 0x100
#define REGION_DATA_SRAM_L_START (REGION_BOOTLOADER_MSG_STRT + REGION_BOOTLOADER_MSG_SIZE)
#define REGION_DATA_SRAM_L_SIZE 0x00007B00
Also during compilation, I get below error. Any way to handle it.
C:\Users\CHANDA~1\AppData\Local\Temp\pa4d8-3(21): warning: L6312W: Empty Execution region description for region EXE_REGION_RAM_BOOTLOADER_MSG