• Resolved

[FAQ] How does semihosting work with TI-RTOS (SYS/BIOS) and GCC?

Guru 96280 points

Replies: 1

Views: 50

All of my System_printf and printf calls work when I'm connected to CCS, but the application does not work when disconnected from CCS. Is this related to semihosting? 

  • Running Stand-alone TI-RTOS examples without an IDE

    Both IAR and GCC support the concept of semi-hosting. Semi-hosting is convenient during early development because printf and System_printf output can be directed to the IDE console. However, when semi-hosting is enabled, most of the TI-RTOS examples will not run when not connected to the IDE. This is because the System_flush() call never returns since it is waiting for the IDE to release it. Please note: the TI Codegen and CCS handshake mechanism is different. The examples built with TI codegen can be used with or without the IDE with no ill effects.

    GCC Specifics

    The TI-RTOS examples are built semi-hosting disabled as of TI-RTOS 2.20(i.e. the rdimon.a library is included). There are two different approaches to allow the examples to be run in a stand-alone environment.

    1. Use the nosys library. Please refer to the following FAQ for more details: https://e2e.ti.com/support/processors/f/791/p/947277/3499788#3499788 

    2. Use the SysCallbackSystem Provider instead of SysMin or SysStd. The UARTConsole example use SysCallBack. Instead of using the RTS functions, the SysCallbackmodule allows the user to specify a putchFxn function. The putchFxn can do nothing or do something with the character. The UARTConsole example sends the character out a UART.

    The TI-RTOS Kernel also has a SemiHostSupport module to enable the use of functions like fwrite, etc. by the application. Refer to the following site for more details: https://e2e.ti.com/support/processors/f/791/p/947278/3499789#3499789 

    IAR Specifics

    The TI-RTOS driver examples include the following linker option: --semihosting=iar_breakpoint. There are two different approaches to allow the examples to be run in a stand-alone environment.

    1. Remove the –semihosting option. This can be done in the makedefs of the generated examples or via the IDE on an imported example.

    2. Use the SysCallbackSystem Provider instead of SysMin or SysStd. The UARTConsole example use SysCallBack. Instead of using the RTS functions, the SysCallbackmodule allows the user to specify a putchFxn function. The putchFxn can do nothing or do something with the character. The UARTConsole example sends the character out a UART.