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.

  • Resolved

[FAQ] RTOS: How do I make my custom SYS/BIOS library more debug friendly?

Intellectual 1060 points

Replies: 1

Views: 383

Tool/software: TI-RTOS

I have a customized SYS/BIOS project that I want to step through but the debug experience is not ideal. How can I make my library more debug friendly?

  • By default, the following setting is in your .cfg script:

    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    BIOS.libType = BIOS.LibType_Custom;

    ... will generate a highly optimized, minimally debug-able custom SYS/BIOS library that your application will link with.

    The optimizations are achieved by including the "-o3" compiler option during the compilation phase. This aggressive optimization setting results in very efficient code at the expense of debug-ability.

    The easiest way to produce a more debug friendly library is to switch the BIOS libtype as such:

    BIOS.libType = BIOS.LibType_Debug;

    This will keep all the same configurations as the custom library except that no optimization is done and the debug symbols will be present. Note that this will produce a much larger and slower binary.

    You can also opt to keep the libType 'custom' and modify the optimization setting by adding the following line to your config script:

    BIOS.customCCOpts = BIOS.customCCOpts.replace("-o3", "-o0");

    This will change the optimization level from "-o3" to "-o0". (You can replace "-o0" with whatever setting you want).

    For ARM targets (ie 'M3', 'A8Fnv', 'Arm9'), you should also add the following line to your config script to remove the "--opt_for_speed=2" compiler option:

    BIOS.customCCOpts = BIOS.customCCOpts.replace("--opt_for_speed=2", "");

    Note: This modification will result in much slower SYS/BIOS performance as well as a larger code footprint.

    To view the set of compiler options used to create the custom SYS/BIOS library, add the following to your config script:

    print(BIOS.customCCOpts);

    Note: Whatever you do, DO NOT REMOVE the "--program_level_compile" compiler option from BIOS.customCCOpts.

    Note: The 'BIOS.libType' option was added in 6.32.01

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.