|
ELEC-C7222
Libraries for ELEC C7222 Course Work
|
This guide walks through first-time setup for this repository in VS Code with CMake Tools and the Raspberry Pi Pico extension.
For full build details (toolchain assumptions, options, and build variants), see the Build Guide (building.md).
This project depends on Git submodules (for example external FreeRTOS-related sources and docs mirrors).
If you already cloned and need to refresh:
Install at minimum:
raspberry-pi.raspberry-pi-picoms-vscode.cmake-toolsmarus25.cortex-debugms-vscode.cpptoolsThe Pico extension is expected to provision Pico SDK/toolchain content under ~/.pico-sdk.
Useful optional extensions/tools:
ms-vscode.vscode-serial-monitor (Serial Monitor)Serial Port Monitor plugin (JetBrains)xRTOS (VS Code) and related xRTOS support/plugin in CLionThis project configures FreeRTOS runtime stats/trace support for detailed RTOS views (tasks/objects), including settings from libs/elec_c7222/config/FreeRTOSConfig.h and runtime hooks under libs/elec_c7222/utils/platform/*/freertos_hooks.c.
CMake presets are named, version-controlled configuration profiles stored in CMakePresets.json.
In this repository:
Debug: configures a debug build in build/DebugRelease: configures a release build in build/ReleaseWhy use presets:
Open the repository folder in VS Code, then use Command Palette (Ctrl/Cmd+Shift+P):
CMake: Select Configure PresetPico - Debug (or Pico - Release)CMake: ConfigureAfter configure completes, CMake Tools generates the selected build tree and target metadata.
Use Command Palette actions in this order:
CMake: Set Build Targetgetting-started-freertos-cpp).CMake: Set Launch/Debug Target (if shown in your CMake Tools version)Notes:
CMake: Build builds by default.CMake: Debug or Run actions execute.When you configure the project, the getting-started executables are configured together with the rest of the available targets.
The two getting-started targets are:
getting-started-freertos-cgetting-started-freertos-cppFor a first debug session, the natural starting point is getting-started-freertos-c, since it is the simpler FreeRTOS C setup.
Common actions from Command Palette:
CMake: BuildCMake: CleanCMake: Clean Rebuild (or run Clean then Build)Recommended first-time flow:
UART logging note:
921600 via PICO_DEFAULT_UART_BAUD_RATE.CMake: Select Configure Preset -> choose Pico - DebugCMake: ConfigureCMake: Set Build TargetCMake: BuildCMake: Debug, orPico Debug (Cortex-Debug)The Pico extension integrates SDK/toolchain and debug metadata into VS Code. In this repository, launch.json uses Pico extension command variables such as:
${command:raspberry-pi-pico.launchTargetPath}${command:raspberry-pi-pico.getGDBPath}${command:raspberry-pi-pico.getTarget}${command:raspberry-pi-pico.getChip}This allows launch configurations to resolve correct ELF path, GDB binary, target config, and SVD without hard-coding per-machine values.
For runtime debug logs, use a serial port monitor extension and connect to the active UART at 921600 baud.
Provided debug configurations include:
Pico Debug (Cortex-Debug) (extension-managed OpenOCD)Pico Debug (Cortex-Debug with external OpenOCD)config.openocd is provided primarily for CLion/OpenOCD workflows; VS Code generally uses .vscode/launch.json and Pico extension variables.
The included CLion project setup provides similar build and debug configurations. You can select them from CLion's Run/Debug Configurations menu, and they should work out of the box for the standard project workflow.
For daily use, this sequence is effective:
Debug for development).CMake: Debug or Run and Debug panel.building.md