Sometimes when I run my TI-RTOS based application, I don't get to main(). Can you please explain what happens with a TI-RTOS based application before main() and how to debug the issue?
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.
Here is the standard boot sequence without TI-RTOS:
When the device is released from reset, the reset vector initiates C runtime initialization at the _c_int00() entry point. One of the first steps is to initialize the system stack pointer. This same stack is used during initial booting, as well as in and after main().
Once the .cinit and table of .pinit functions has been processed, the main() function is called. If there are arguments to pass to main() (depending upon the application build options), the args_main() function is used to call main(). At this point, the C runtime environment has been fully initialized, and the application can begin its intended purpose.
The kernel has several points where it adds items into the boot sequence.
The application can plug-in the “user” reset function as follows in the .cfg file.
var Startup = xdc.useModule('xdc.runtime.Startup'); Startup.resetFxn = "&foo";
Note: the application must supply the reset function in their code (e.g. “foo”).
You can look in ROV->Startup and see the user reset function.
Note: it’s best to assume nothing has happened before your reset function is called. So no cinit, heap, etc. For some devices, the stack may not have been setup either (so no local variables).
These are not used often, but for completeness here are examples of plugging the first and last functions in the .cfg file:
var Startup = xdc.useModule('xdc.runtime.Startup'); Startup.firstFxns.$add("&myFirst"); Startup.lastFxns.$add("&myLast");
You can see the new first and last functions in ROV also. Note: you may have to hover over the fields to see the full list.
If you are having problems getting to main here are some pointers
Please refer to http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/3_20_04_68/exports/docs/rtscpedia/Using_xdc.runtime_Startup/Using_xdc.runtime_Startup.html#Boot_Sequence_and_Control_Points for more details.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.