Standard C Library File, I/O and OS Retargeting
All Data Structures Functions Variables Typedefs Modules Pages
I/O Retarget example project

This project prints "Hello World" and a counter value via the UART output. It is configured for Arm Virtual Hardware, but other target hardware that provides a CMSIS Driver:USART can be easily added.

Prerequisites

Tools

Packs

  • Required packs are listed in the file retarget.csolution.yml

Project Structure

The project is generated using the CMSIS-Toolbox and is defined in csolution format:

  • retarget.csolution.yml lists the required packs and defines the hardware target and build-types (along with the compiler).
  • retarget.cproject.yml defines the source files and the software components.

Build Project

Use the cbuild command to build the Debug configuration for VHT target defined in .csolution.yml solution file.

cbuild retarget.csolution.yml -v --update-rte -p --configuration .Debug+VHT

Note: During the build process required packs may be downloaded (-p flag).

By default the project is compiled using Arm Compiler. One can change the compiler selection in .cdefault.yml file to GCC.

Execute Project

The project is configured for execution on Arm Virtual Hardware which removes the requirement for a physical hardware board.

VHT_MPS2_Cortex-M3 -f vht-cm3-config.txt out/retarget/VHT/Debug/retarget.axf

Note: The application image file has extension .elf when using GCC Compiler.