I am trying to update a boot loader using the boot loader itself. my code is based off the spna189.zip sample code. My bootloader can update the software after the boot loader with out any issue, but when i try to enable the bootloader update and update the bootloader itself the code crashes at the Erase step, I have updated the sections code in the linker command as other articles have suggested, and changed the calls to Fapi_enableMainBankSectors(0xFFFF);
What else could i be missing?
My linker file
/* Memory Map */
MEMORY
{
VECTORS (X) : origin=0x00000000 length=0x00000020
FLASH_API (RX) : origin=0x00000020 length=0x00003FE0
FLASHBOOT (RX) : origin=0x00012000 length=0x00012000
STACKS (RW) : origin=0x08000000 length=0x00002000
RAM (RW) : origin=0x08002000 length=0x0003E000
/* USER CODE BEGIN (2) */
// Provider configuration area in flash. Used to configure IP address,
// subnet mask, default gateway, MAC address, and device ID
// used by the bootloader.
PROVIDER_CFG_AND_STATUS (RW) : origin=0x00004000 length=0x00008000
/* USER CODE END */
}
/* USER CODE BEGIN (3) */
/* USER CODE END */
/*----------------------------------------------------------------------------*/
/* Section Configuration */
SECTIONS
{
.intvecs : {} > VECTORS
flashAPI :
{
../Debug_HDK/src/Fapi_UserDefinedFunctions.obj (.text)
../Debug_HDK/src/bl_flash.obj (.text)
../Debug_HDK/src/bl_dcan.obj (.text)
../Debug_HDK/src/bl_flash.obj (.const)
//../Debug_HDK/src/uartstdio.obj (.text)
--library= ../../lib/F021_API_CortexR4_LE.lib (.text)
} load = FLASH_API, run = RAM, LOAD_START(api_load), RUN_START(api_run), SIZE(api_size)
.text : {} > FLASHBOOT
.const : {} > FLASHBOOT
.cinit : {} > FLASHBOOT
.pinit : {} > FLASHBOOT
.bss : {} > RAM
.data : {} > RAM
.sysmem : {} > RAM
/* USER CODE BEGIN (4) */
/* USER CODE END */
}