Other Parts Discussed in Thread: HALCOGEN
Hi,
I am trying to erase and write a sector in bank0 so according to "The F021 Flash API library cannot be executed from the same bank as the active bank selected for the API commands to operate on. the F021 Flash API must be executed from RAM." For this I am trying to copy APIs into RAM. but I get a warning saying no matching section for Fapi_UserDefinedFunctions.obj which is kind strange and gets hung in dataEntry . my linker script and assembly code for copying into RAM are as below. I need some support here
regards
Usha
MEMORY
{
/* USER CODE BEGIN (2) */
/* USER CODE END */
VECTORS (X) : origin=0x00000000 length=0x00000020
FLASH_API (RX) : origin=0x00000020 length=0x000014E0
FLASH0 (RX) : origin=0x00001500 length=0x001FEB00
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RW) : origin=0x08001500 length=0x00006B00
/* USER CODE BEGIN (3) */
/* USER CODE END */
}
SECTIONS
{
/* USER CODE BEGIN (5) */
/* USER CODE END */
.intvecs : {} > VECTORS
flashAPI :
{
../Debug/source/Fapi_UserDefinedFunctions.obj (.text)
../Debug/source/ra_f021.obj (.text)
--library= F021_API_CortexR4_BE_L2FMC_V3D16.lib (.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
FEE_TEXT_SECTION : {} > FLASH0
FEE_CONST_SECTION : {} > FLASH0
FEE_DATA_SECTION : {} > RAM
/* USER CODE BEGIN (6) */
/* USER CODE END */
}
;-------------------------------------------------------------------------------
;
; Copy the Flash API from flash to SRAM.
;
.def _copyAPI2RAM_
.asmfunc
_copyAPI2RAM_
.ref api_load
flash_load .word api_load
.ref api_run
flash_run .word api_run
.ref api_size
flash_size .word api_size
ldr r0, flash_load
ldr r1, flash_run
ldr r2, flash_size
add r2, r1, r2
copy_loop1:
ldr r3, [r0], #4
str r3, [r1], #4
cmp r1, r2
blt copy_loop1
bx lr
.endasmfunc


