Hi,
I have a bootloader program stored in "FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x003E800" and my application program is stored in "FLASH (rx) : ORIGIN = 0x0003E800, LENGTH = 0x00C1800".
I am using a S3A7 which have 1M flash.
I have a .hex file stored in a external memory. While running the bootloader program, I need to read the .hex file from the external memory and overwrite the application in the address 0x0003E800.
My flash driver is configured as follows:
I am able to open it without any errors using:
if(flash.p_api->open(flash.p_ctrl, flash.p_cfg) != SSP_SUCCESS)
But when I call the write function I am getting a "SSP_ERR_WRITE_FAILED":
result = flash.p_api->write(flash.p_ctrl, buffer, APP_START_ADDR + fw_itr, part_size);
APP_START_ADDR = 0x0003E800, fw_itr = 0 (in the first iteration) and part_size = 1024.