Hi team,
Here's an issue from the customer may need your help:
The bootloader currently uses bank0 for the IAP program, bank1 for the app program, and external memory for the firmware package when upgrading the programming. There are 2 problems with the upgrade:
1) Erase on IAP upgrade, call the function uint32_t Fapi_BlockErase( UINT32_t Bank, UINT32_t ulAddr, UINT32_t size). Unable to read function status = Flash_Erase_Check((uint32_t)ulAddr, size), monolithic exception occurred after execution.
2) After programing UINT32_t Fapi_BlockProgram( UINT32_t Bank, UINT32_t Flash_Address, UINT32_t Data_Address, UINT32_t. SizeInBytes), and executing UINT32_t Flash_Program_Check(UINT32_t Program_Start_Address, UINT32_t Source_Start_Address, UINT32_t. No_off_bytes), the monolithic cannot work properly.
The IAP program link script is configured as follows:
MEMORY
{
VECTORS (X) : origin=0x00000000 length=0x00000020
FLASH_API (RX) : origin=0x00000020 length=0x000014E0
FLASH0 (RX) : origin=0x00001500 length=0x00180000-0x00001500
// FLASH1 (RX) : origin=0x00180000 length=0x00180000
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RW) : origin=0x08001500 length=0x0003EB00
/* USER CODE BEGIN (2) */
/* USER CODE END */
}
/* USER CODE BEGIN (3) */
/* USER CODE END */
/*----------------------------------------------------------------------------*/
/* Section Configuration */
SECTIONS
{
.intvecs : {} > VECTORS
flashAPI :
{
..\Debug\F021\source\Fapi_UserDefinedFunctions.obj (.text)
..\Debug\F021\source\bl_flash.obj (.text)
--library=..\F021\F021_API_CortexR4_BE.lib < FlashStateMachine.IssueFsmCommand.obj
FlashStateMachine.SetActiveBank.obj
FlashStateMachine.InitializeFlashBanks.obj
FlashStateMachine.EnableMainSectors.obj
FlashStateMachine.IssueFsmCommand.obj
FlashStateMachine.ScaleFclk.obj
Init.obj
Utilities.CalculateEcc.obj
Utilities.WaitDelay.obj
Utilities.CalculateFletcher.obj
Read.MarginByByte.obj
Read.Common.obj
Read.FlushPipeline.obj
Read.WdService.obj
Async.WithAddress.obj
Program.obj > (.text)
} load = FLASH_API, run = RAM, LOAD_START(api_load), RUN_START(api_run), SIZE(api_size)
.text : {} > FLASH0
.const : {} > FLASH0
.cinit : {} > FLASH0
.pinit : {} > FLASH0
.bss : {} > RAM
.data : {} > RAM
.sysmem : {} > RAM
/* USER CODE BEGIN (4) */
/* USER CODE END */
}
Could you help check this case? Thanks.
Best Regards,
Cherry