SkillAgentSearch skills...

Circle

A C++ bare metal environment for Raspberry Pi with USB (32 and 64 bit)

Install / Use

/learn @rsta2/Circle
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Circle

Overview

Circle is a C++ bare metal programming environment for the Raspberry Pi. It should be usable on most existing models (tested on model A+, B, B+, on Raspberry Pi 2, 3, 4, 400, 5 and on Raspberry Pi Zero (2)), except on the Raspberry Pi Pico, which is not supported. It is not known, if it works on the Raspberry Pi 500 and on Compute Module 5. Circle provides several ready-tested C++ classes and add-on libraries, which can be used to control different hardware features of the Raspberry Pi. Together with Circle there are delivered several sample programs, which demonstrate the use of its classes. Circle can be used to create 32-bit or 64-bit bare metal applications.

Circle includes bigger (optional) third-party C-libraries for specific purposes in addon/ now. This is the reason why GitHub rates the project as a C-language-project. The main Circle libraries are written in C++ using classes instead. That's why it is called a C++ programming environment.

Release 50.1

New features:

  • An NVMe v1.4 SSD driver for the Raspberry Pi 5 has been added (see addon/nvme). v1.3 NVMe SSDs should work too. This support is currently experimental. Be sure that your SSD does not contain important data, if you want to test it. You should define the system option NO_BUSY_WAIT and your application should contain the scheduler for maximum performance.

  • The Kernel Address Sanitizer (Kasan) has been implemented for Circle. It can help to find invalid memory accesses while debugging. See doc/kasan.txt for details!

  • The KY-040 rotary encoder driver has been improved to support quarter-step and half-step rotary encoders. Full-step rotary encoders still are the default.

  • The class CI2SSoundBaseDevice can be used in DeviceModeTXRX mode on the Raspberry Pi 5 now with 2 channels.

  • The class CConsole provides a more comfortable line editor and a command history now.

  • Multi-core Circle programs can run in QEMU (AArch64) now. configure --qemu disables DMA usage for the frame buffer, because it does not work with QEMU.

  • A receive and/or send timeout on a socket can be set using CSocket::SetOption[Receive|Send]Timeout() now . The constructor of the class CHTTPDaemon got a new timeout parameter to close the HTTP connection, when the request does not complete in the given amount of time. The sample/21-webserver has been updated to use this feature.

  • The DNS resolver class CDNSClient resolves the host name "localhost" as the own IP address now.

Fixes:

  • There might have been a failed assertion in WLAN Mesh environments before, which has been fixed.
  • memcpy() did not check the destination alignment right in AArch64.
  • When an error occurred on a TCP connection, close was not executed properly and the connection was not shutdown.

More changes:

  • The LVGL support has been updated to v9.4.0.
  • The FatFs support has been updated to R0.16 w/patch1.

The 50th Step

This release comes with full (send and receive) network multicast support, including IGMPv2 support. A class CmDNSDaemon has been added, which determines and maintains our mDNS hostname on the local network. Name collisions with other hosts will be resolved by appending a numeric suffix to the hostname. The daemon is automatically started, when someone requests a pointer to it. This has been added to the CmDNSPublisher class, which works in conjunction with CmDNSDaemon now. The test/mdns-publisher uses the numeric suffix to generate an unique service name.

More news:

  • The function of the CTerminalDevice sequences ESC "[0m" and ESC "[27m" have been modified. The first one resets the color settings too, while the second one resets the reversed mode only.
  • The method CLogger::Read() returns 0 now, when the log buffer is empty. Before it returned -1.
  • The DHCP process has been improved and is quicker now under some circumstances.
  • A method GetUptime(sec, usec) has been added to the class CTimer.
  • The FatFs library in addon/fatfs/ has been updated to R0.16 with Unicode patch.
  • A display font Font12x22 has been added. The class CCharGenerator can handle fonts, with a width of up to 32 pixels.

Fixes:

  • The HDMI sound support with the class CHDMISoundBaseDevice did not work since Step 49.
  • The WLAN support in earlier versions was based on a port of wpa_supplicant v0.7.0, for which open security advisories exist. This has been fixed by porting wpa_supplicant v2.11 to Circle.
  • The Handling of "Enumeration done" in the USB gadget driver had issues, that made booting from the USB mass-storage device (MSD) gadget impossible.

The recommended toolchain for building Circle is based on GCC 14.3.1 now (see the Building section).

The recommended firmware, downloadable in boot/, has been updated. For the Raspberry Pi 5 it is required to use the new DTB file(s), because otherwise some functions will not work with this Circle version.

The WLAN firmware, downloadable in addon/wlan/firmware/, has been updated. It is absolutely recommended to use the new firmware, because older versions may have security vulnerabilities.

Features

Only the features with a "x" or other info are currently supported on the Raspberry Pi 5.

Circle supports the following features:

| Group | Features | Raspberry Pi 5 | |-----------------------|-----------------------------------------------------|----------------| | C++ build environment | AArch32 and AArch64 support | AArch64 only | | | Basic library functions (e.g. new and delete) | x | | | Enables all CPU caches using the MMU | x | | | Interrupt support (IRQ and FIQ) | IRQ only | | | Multi-core support (Raspberry Pi 2, 3 and 4) | x | | | Cooperative non-preemtive scheduler | x | | | CPU clock rate management | x | | | Clang/LLVM support (experimental) | x | | | | | | Debug support | Kernel logging to screen, UART and/or syslog server | x | | | C-assertions with stack trace | x | | | Hardware exception handler with stack trace | x | | | GDB support using rpi_stub (Raspberry Pi 2 and 3) | | | | Serial bootloader (by David Welch) included | x | | | Software profiling support (single-core) | x | | | QEMU support | | | | Kernel Address Sanitizer support | x | | | | | | SoC devices | GPIO pins (with interrupt, Act LED) and clocks | x | | | Frame buffer (screen driver with escape sequences) | limited | | | UART(s) (Polling and interrupt driver) | x | | | System timer (with kernel timers) | x | | | Platform DMA controller | DMA40 only | | | RP1 platform DMA controller (Raspberry Pi 5 only) | x | | | EMMC SD card interface driver | x | | | SDHOST SD card interface driver (Raspberry Pi 1-3) | | | | PWM output (2 channels) | 4 channels | | | PWM sound output (on headphone jack) | with adapter | | | I2C master(s) and slave | masters only | | | SPI0 master (Polling and DMA driver) | x | | | SPI1 auxiliary master (Polling) | | | | SPI3-6 masters of Raspberry Pi 4 (Polling) | SPI1-3 and 5 | | | SMI master | | | | I2S sound output and input | x | | | HDMI sound output (without VCHIQ) | x | | | Hardware random number generator | x | | | Watchdog device | x | | | Official Raspberry Pi touch screen (v1 only) | | | | VCHIQ interface and audio service drivers | | | | BCM54213PE Gigabit Ethernet NIC of Raspberry Pi 4 | | | | MACB / GEM Gigabit Ethernet NIC of Raspberry Pi 5 | x | | | Wireless LAN access | x | | | Driver for XPT2046-based touch screens | x | | | NVMe SSD driver for Raspberry Pi 5 (experimental) | x | | | | | | USB |

Related Skills

View on GitHub
GitHub Stars2.2k
CategoryDevelopment
Updated6h ago
Forks291

Languages

C

Security Score

100/100

Audited on Apr 1, 2026

No findings