Tool/software: Code Composer Studio
I am not able to flash my code in the launchpad board. I am attaching the screen shot of the problem that I am getting while debugging the code. Please help.
Thanks and Regards,
Saurabh Shah,
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.
Tool/software: Code Composer Studio
I am not able to flash my code in the launchpad board. I am attaching the screen shot of the problem that I am getting while debugging the code. Please help.
Thanks and Regards,
Saurabh Shah,
Hello Saurabh,
1. add section in link.cmd file
define a section for flasg API related objects: bl_flash.obj, Fapi_userDefinedFunction.obj, and API Library
2. Write a function to copy the flashAPI function to SRAM
; 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
3. Call the function defined in step 2 in main()
Hello Saurabh,
The spi_size, api_load and api_run should be defined in link.cmd file. For example:
flashAPI :
{
Fapi_UserDefinedFunctions.obj (.text)
bl_flash.obj (.text)
--library= ..\..\..\lib\F021_API_CortexR4_BE.lib (.text)
} load = FLASH_API, run = SRAM, LOAD_START(api_load), RUN_START(api_run), SIZE(api_size)
api_size is size of the API related code (Fapi_UserDefinedFunctions.obj, bl_flash.obj, the lib).
api_run is the address of the API related code in SRAM (copied)
api_load is the address of the API related code in flash
Please use those three variable in your code copy function.
Hello QJ Wang,
Thanks for your reply. I have tried everything as per your instruction. But the problem is not resolved. I have purchased a new board to continue my work. One last thing I want to ask is what may be the reason for this error (The first screenshot). So far I have read many TI forums and I have come to conclusion that the bootloader may get corrupted. Am I right? Or is there any other reason?
Thanks and Regards,
Saurabh Shah,
CoEP