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.
Hello,
I am using TI's F021 API for erasing and writing to both bank 0 and bank 1.
The entire F021 API runs in RAM as well as my code calling it. The rest of my code runs in bank 0.
Erasing/Writing bank 1 works perfectly but when erasing/writing bank 0 I quite consistently (about 9 / 10 times) get a very confusing prefetch abort.
For details see: https://community.arm.com/developer/ip-products/processors/f/cortex-r-forum/44736/atcm-ecc-error-causes-prefetch-abort-despite-ecc-check-being-disabled
Two questions:
Thank you,
I have already relocated the API code as well as the calling code into RAM and am executing from there as described in that thread. I would like to take a look at "the bootloader" mentioned by QJ Wang in their reply. Any idea how I can get my hands on "the bootloader"'s source code?
Regards,
Lukas
Lukas,
Please take a look at this E2E:
https://e2e.ti.com/support/microcontrollers/hercules/f/312/p/849928/3150652#3150652
To download the Hercules_examples including bootloaders:
Ubuntu user: with git, git clone git://git.ti.com/hercules_examples/hercules_examples.git
Windows user: download one of the compressed file formats under the commit page.
In your case, the example project which can be imported to CCS is here:
\hercules_examples\Bootloaders\SafetyMCU_Bootloaders\TMS570LS31x
Take a look at bl_link.cmd file, please note not to forget about the const section when you move Flash API from Flash to RAM:
flashAPI:
{
.\F021_Flash_API\02.01.01\source\Fapi_UserDefinedFunctions.obj (.text)
.\source\bl_flash.obj (.text)
//.\source\bl_dcan.obj (.text)
--library= ..\..\..\F021_Flash_API\02.01.01\F021_API_CortexR4_BE.lib (.text)
} palign=8 load = FLASH0, run = SRAM, LOAD_START(apiLoadStart), RUN_START(apiRunStart), SIZE(apiLoadSize)
.text : {} > FLASH0 /*Initialized executable code and constants*/
.const : {} load=FLASH0, run = SRAM, LOAD_START(constLoadStart), RUN_START(constRunStart), SIZE(constLoadSize)
Please note bl_flash.c which is under SafetyMCU_Bootloaders\source folder, that is calling Flash APIs. So in your case, make sure all source code calling Flash APIs be included in this load & run structure, i.e., within flashAPI{} in command file.
Also please take a look at :
\hercules_examples\Bootloaders\SafetyMCU_Bootloaders\source\bl_main.c. Make sure you copy both sections as well:
Hopefully this helps.
best regards,
David Zhou