semihostingDemo

The semihosting facilitates communication between the host machine and the targeted embedded system through a debugger. This feature is useful during the development and debugging phases, as it allows you to print debug messages without needing a UART peripheral enabled. Also, this is practically advantageous when you want to omit the UART peripheral in resource-constrained designs.

The semihostingDemo example design clearly illustrates how to leverage semihosting in the Sapphire High-Performance SoC. To activate semihosting, ensure that the ENABLE_SEMIHOSTING_PRINT define is set to 1 in the bsp.h header file. This enables the seamless output of debug messages. All UART printing calls, e.g., bsp_print, bsp_printf, and other printing APIs, that are available in the bsp.h file is directed to the Efinity RISC-V Embedded Software IDE console. No modifications are required for your embedded software design.

This demonstration showcases the capability of the Efinity RISC-V Embedded Software IDE in printing debug messages and reading them from the console itself.

Note: While running the application, you may observe a warning in the console indicating keep_alive() is not invoked. This warning arises from the blocking nature of the semihosting reading, which can potentially delay the debugger from sending the keep_alive() signal on time. This warning does not impact the functionality of the application. It is simply a notification related to the timing of the keep_alive() signal. Therefore, it should not be a cause of alarm regarding the overall performance or expected behavior of the system.