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:
Hello,
I have a question related to the codestart section. Specifically, I am looking at the example code flashapi_ex2_sci_kernel under C:\ti\c2000\C2000Ware_5_00_00_00\driverlib\f28004x\examples\flash, but more generally I am interested in how the code execution flows after device startup and after exiting the Boot ROM.
The comments in file "flashapi_ex2_codestartbranch.asm" state that "code_start is the first code that is executed after exiting the boot ROM code."
However, upon inspecting the linker flag set (Properties --> C2000 linker --> Summary of flags set), I see the flag "--entry_point=_bankSelect".
This is consistent with the
#pragma CODE_SECTION(bankSelect, "codestart");
code in the file flashapi_ex2_ldfu.c file.
So then if the entry_point is not code_start, but bankSelect, then when is code_start called, and when is the C runtime environment (_c_int00) initialized?
If the codestart section is defined in multiple places (both in flashapi_ex2_ldfu.c and also in flashapi_ex2_codestartbranch.asm), which one wins? It seems that bankSelect wins, because that is the entry point, but bankSelect is C code, and the C runtime environment is not initialized yet.
Could you explain the code execution flow?
Best,
Laszlo
Hi Laszlo,
Thanks for your question. I'll be able to provide a detailed answer early next week.
Regards,
Charles
Hi,
Codestart is called depending upon the current bank selection logic. _c_int00 is still initialized prior to main.
For more information, you can consult the flow stated in the Live Firwmare Update w/ Device Reset application note.
Thanks and regards,
Charles
Hi Charles,
Thank you. I am familiar with the document you linked. My question was about a topic not explained there, and your reply didn't address it either. Could you kindly take a look at the questions again?
Thank you.
Laszlo
Hi Laszlo,
>So then if the entry_point is not code_start, but bankSelect, then when is code_start called, and when is the C runtime environment (_c_int00) initialized?
The _c_int00 runtime environment is initialized for the bank manager first through the f28004x_codestart.asm file. Then it is not initialized for the LFU BankSelect logic function as there are no global variables present within the function.
>If the codestart section is defined in multiple places (both in flashapi_ex2_ldfu.c and also in flashapi_ex2_codestartbranch.asm), which one wins?
Codestart is assigned twice, first for the bank manager and then for the application code. First the codestart for the bank manager is considered, then the codestart for the application. You can also look at the generated project .map file for the LFU flash kernel to see the generated codestart addresses.
Thanks,
Charles