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.

RTOS/DSPBIOS: Restart SYSBIOS program

Part Number: DSPBIOS

Tool/software: TI-RTOS

Hi

I have a simple SYSBIOS program (for A15 core on idk5718) which creates a task dynamically in the main() function.
So far this works.
At some point I try to restart the program. The program halts again at main() but then creating the task fails with a "out of memory" error.
Probably the reset function from the debugger only jumps to main() without setting up everything before main().
Thats why then I tried to jump directly to _c_int00 (by using the disassembly window), to make sure SYSBIOS is setup from the very beginning.
Running the program from _c_int00 works but I still get the "out of memory" error message when creating the task.
How is this possible when running from _c_int00?
Is there an other way to restart a SYSBIOS program from CCS GUI without terminating the debug session?

Im using CCS V7.1.0 and SYSBIOS V6.46.4.53.

Regards,
Markus

  • Which compiler are you using?

    Some linkers have an option to initialize variables at "load time" vs "run time". Load time initialization, the global variables are initialized by CCS when it loads the target. Run time init is done by some auto init code called from c_int00.

    I think you should review your linker options. You might want run time variable initialization.

  • Markus Mueller said:
    At some point I try to restart the program.

    Are you using the Run->Restart menu option?

    Markus Mueller said:
    Probably the reset function from the debugger only jumps to main() without setting up everything before main().

    You mention "reset" here but also "restart" above, so I'm wondering specifically which one you're using.

    Regardless, neither of those will cause a jump directly to main().  A "restart" should just put the PC at _c_int00, and you probably have the CCS option "Run to main" checked, in which case a BP will be placed at main() and the CPU will run (to main(), as long as you haven't put a BP at any other location before main()).  If you uncheck that, when you "restart" or "reset" the PC should be placed at _c_int00 with the CPU in a stopped state.

    To change this behavior, select (left click) the CPU in the "Debug" window, then choose menu item "Tools->Debugger Options->Auto Run and Launch Options.  This will bring up a window with "Auto Run Options", with a "Run to symbol" field set to "main".  Just below that, uncheck "On a program load or restart".  The "Run to symbol" field will no longer be relevant, so you can leave it set to "main".

    Markus Mueller said:
    Is there an other way to restart a SYSBIOS program from CCS GUI without terminating the debug session?

    You can do a "Run->Load->Reload Program", and if Karl is correct in his previous reply then reloading will allow load-time cinit to happen correctly.

    Regards,

    - Rob

  • Hi Robert, hi Karl

    I wanted to say "restart" not "reset".
    With "Run->Load->Reload Program" it works.
    I'm using Compiler Version "GNU V4.9.3 (Linaro)" for A15 Core of AM571x and "TI V8.1.3" for C66 Core of AM571x.
    For TI V8.1.3 I could find the linker option to choose RAM or ROM initalisation. But I could not find this option for the GNU compiler.

    Regards,
    Markus
  • Markus Mueller said:
    For TI V8.1.3 I could find the linker option to choose RAM or ROM initalisation. But I could not find this option for the GNU compiler.

    I don't believe that GCC supports the notion of run-time initialization, at least not directly.

    In GCC, initialized data goes into the .data section and uninitialized data goes into the .bss section.  The .data section is written with the initializer values by the linker, and is directly loaded by CCS.  The .bss section doesn't get loaded, and instead gets 0-initialized by GCC startup code.

    With TI compilers, they all go to .bss (and yes, that even means initialized global variables), and global variables that have an initializer get a cinit record generated for them.  It is this TI cinit record that gets processed either at load-time by the CCS loader, or at runtime by a special function that runs early (e.g., before main()) and processes the cinit records.

    So, I believe that with GCC-compiled programs you will need to always reload them to have their initialized values be present.

    Regards,

    - Rob

  • Hi Rob,

    Thank you for these explanations.

    Regards,
    Markus