NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
StarterWare Semihosting
Contents
Background
[edit]
Semihosting is a mechanism that enables code running on the target to communicate with the host pc that is running a debugger, providing IO facilities. For more information on Semihosting refer semihosting. The below sections discuss semihosting support in StarterWare and steps to be followed to enable it. In StarterWare the semihosting has been validated with Linaro GCC and TMS470 tool chain. The standard I/O Functions which are tested and supported in StarterWare on a Debug Console are Printf, Scanf, Puts, fGets, Getchar, PutChar.
Code Update[edit]
In the StarterWare applications the default console is configured as uart. This can be changed to redirect to debugger console.
ConsoleUtilsSetType(CONSOLE_UART); ''Change to'' ConsoleUtilsSetType(CONSOLE_DEBUGGER);
For more information on Console utility API please refer Console Utils..
Please refer below sections on tool chains which explains how to compile the application to enable semihosting.
Tool chains
[edit]
Linaro GCC
[edit]
StarterWare supports linaro gcc tool chain. To enable semihosting follow the below steps.
- Compile the application using the command
make CONSOLE=SEMIHOSTING
- The linker command file (.lds) in StarterWare supports the necessary sections needed for semihosting. So no change is needed here.
- In CCS ensure the semihosting option is selected as shown below.
- After compilation load the elf (.out) file using CCS and IO functions can be handled via CCS console.
- A sample output from execution of RTC example on AM335x EVMSK is shown bleow.
TI ARM Tool chain
[edit]
Follow the below steps to enable semihosting,
- In addition to enabling semihosting as shown in above section, while building StarterWare example the "utils" project has to be complied with predefined symbol "SEMIHOSTING".
- Other steps for loading and executing are as usual and no change is required.
Emulators Supported[edit]
The following emulators are supported in CCS 5.4 for semihosting,
- xds 560
- xds 100v2
Known issues / Limitations[edit]
- SemiHosting is enabled with CCS 5.4 only and the previous versions do not support semihosting.
- xds 510 emulator will not work for semihosting in CCS 5.4
- Console works slowly while using XDS100V2 Emulator.
- SemiHosting with IAR toolchain is not tested with StarterWare
Additional Information
[edit]