This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM42 SPI bootloader, unresolved symbol "api_load"

Hi

I'm trying to get a SPI Bootloader example up and running on my Hercules RM42 HDK. More specifically I've downloaded the SafetyMCU_Bootloader_v1.2.0.zip file and am trying to run the project contained in "./SafetyMCU_Bootloader/RM42/boot_spi"

My problem is this: When trying to build the RM42 project, I end up with a few linker errors:

"unresolved symbol api_load, first referenced in ./src/sys_core.obj"
"unresolved symbol api_run, first referenced in ./src/sys_core.obj"
"unresolved symbol api_size, first referenced in ./src/sys_core.obj"


The reference is from this snippet of ./src/sys_core.asm :


;-------------------------------------------------------------------------------
;
; 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


I am linking to the following files in my project:

rtsv7R4_A_le_eabi.lib
F021_API_CortexR4_LE_v3D16.lib
libc.a

Can anyone help me get past this problem ? :)

I am compiling on a Windows 7 64bit, using CCS 5.4, F021 flash API 1.51.0.

  • Hello Mikkel,

    Thanks for your post. I have forwarded your issue to our bootloader expert. They should get back with you soon.

  • Hello Mikkel,

    Please check if you have cmd file activated. The section for API is defined in cmd file.

    Regards,

    QJ

  • Activating the linker-script sure helped ;)

    Now I have another question. It's regarding the application report SPNA157: What is the reason for copying the bootloader to SRAM and executing from there? I've skimmed the papers for the F021 flash controller, and it seems it can't flash the same bank it run from. I'm guessing that's the reason?

    I'd like to be able to just erase/write a few sectors below the bootloader code. Is that possible? 

  • Hi Mikkel,

    Our device doesn't have a separate small flash bank for bootloader only. The bootloader has to share the same bank with the application code. The flash API cannot erase/program the sectors in the same bank it is running at. This is why I copy the API and related code (bl_flash.obj) to SRAM.

    Yes, you can erase/write the following the sectors. As I said the API has to be at SRAM.

    Regards,

    QJ