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.
I'm trying to load .text section to flash and then run it in RAM using BINIT Table. While doing so I'm facing this issue.
Hello Rishitha,
As you said instead of binit tables, I tried to move .text from FLASH to RAM using memcpy(). In linker command file, I've mapped this section to LOAD in FLASH and RUN in RAM. But still facing this issue. CCS is getting breakpoint at line 82 in codestart.asm and when I try to resume it's showing no source availiable for _system_post_cinit(). When I run code from flash it's working fine. I'm Facing this issue only when I try to move entire .text section from flash to RAM while runing.
Rishitha,
Could you show your linker command file? Also, if you place your init functions in .TI.ramfunc you should not need to manually do the memcpy - the code generation tools should handle that for you.
Thanks,
Ibukun
Also, when the error occurs, check the CPU_SYS_REGS.RESC and NMI_INTRUPT_REGS.NMISHDFLG registers to see what has caused the device to reset. Perhaps you have a clock setup issue.
Thank you for sharing Rishitha. Just a point of clarification: the LOAD=FLASH/RUN=RAM is only needed for functions that initialize the Flash. The rest of your code can just run from Flash simply.
But you need to have Flash_init_module() called from your code. If you have a custom function that initializes the flash, you must have #pragma CODE_SECTION(myFlashInitFunc, ".TI.ramfunc") declared so that the linker places it in the correct section. If you're calling Flash_initModule() from driverlib this pragma is already declared in the library source.
Yeah, I've tried runing rest of the code from Flash. It is working fine. Since flash has waitstates, I want to try moving my entire code to RAM
Ah, I see. You could just make sure that all of your performance-critical code functions are placed in .TI.ramfunc by using the #pragma I described above and that should take care of them.
For anything outside of .TI.ramfunc, you would likely need to create your own copy tables and use the copy_in() function to copy them from Flash into RAM. For more on this, take a look at www.ti.com/lit/spraa46, section 4 (Copy Tables).
I've created a section, included .text section of object files in it and moved this section from flash to RAM using boot time copy tables. But when I try to move codestart.asm object file and few others (attached below), it's showing error. What's the reason for that and how can I make sure that these run in RAM.
Hi Rishitha,
You shouldn't move codestart.asm into RAM. This is just the initial code that branches to _c_int00. It is the entry point that the boot ROM will branch to - so if it is not present in Flash then your code won't start at all.
Typically. you wouldn't move all your functions into RAM, just the ones running your control loop that you need to execute with 0-wait-state latency.
Best regards,
Ibukun