GNU C/C++ Helloworld

Project HelloWorld example using GNU C/C++ compiler on QEMU

This chapter covers the basics of C/C++ embedded projects including creating, building, running, and debugging baremetal applications. The project referred to in this chapter is called “Hello World.” This application prints “Hello World” text and runs a simple for-loop as a simple demonstration. The application can also be built and run on QEMU emulator.

Components Prerequisites

  • baremetal-virt-qemu-helloworld-example: Hello World C Baremetal Project for running on QEMU
  • baremetal-virt-qemu-helloworld-cpp-example: Hello World C++ Baremetal Project for running on QEMU
  • xplor-studio-baremetal-debug-plugin: ELF XploR Studio Plugin using for creating baremetal examples
  • rv-xplor-elf-linux64/rv-xplor-elf-win64: XploR Embedded Toolchain for RISC-V (supported both 32 and 64-bit)
  • rv-qemu-linux64/rv-qemu-win64: QEMU for running and debugging RISC-V applications (Baremetal, Embedded, Embedded Linux)

To build, run and debug GNU Helloworld applications, please make sure that all above components are installed. Please refer to Component management for more information about installing component.

Working flow

  1. To create a new project, select File > New > C Project choose RISC-V Embedded Project > Hello World

example image

  1. Other steps are same as the quick-start project. Please refer to Quick start with FreeRTOS project for general working flow.

Notes