File tree Expand file tree Collapse file tree
docs/building-and-flashing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,9 +28,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_FLAGS}")
2828set (CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS } -x assembler-with-cpp -MMD -MP" )
2929set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS } -Wall -Wextra -Wpedantic -fdata-sections -ffunction-sections" )
3030
31- set (CMAKE_C_FLAGS_DEBUG "-O0 -g3" )
31+ set (CMAKE_C_FLAGS_DEBUG "-Og -g3" ) # Optimize for debugging on constrained 32KB flash
3232set (CMAKE_C_FLAGS_RELEASE "-Os -g0" )
33- set (CMAKE_CXX_FLAGS_DEBUG "-O0 -g3" )
33+ set (CMAKE_CXX_FLAGS_DEBUG "-Og -g3" )
3434set (CMAKE_CXX_FLAGS_RELEASE "-Os -g0" )
3535
3636set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS } -fno-rtti -fno-exceptions -fno-threadsafe-statics" )
Original file line number Diff line number Diff line change 11---
2- title : Build
2+ title : Development Guide
33page_id : build
44---
55
6- ## Prerequisites
6+ ## Building
7+
8+ ### Prerequisites
9+
10+ - CMake
11+ - ARM GCC toolchain
12+
13+ ### Build Commands
14+
15+ ``` bash
16+ cmake --preset Release
17+ cmake --build build/Release
18+ ```
19+
20+ This will generate the firmware binary at ` build/Release/color-led.elf ` .
21+
22+ ## Flashing
23+
24+ Once built, flash the firmware to the board using probe-rs:
25+
26+ ``` bash
27+ probe-rs download --chip stm32c011f6ux build/Release/color-led.elf
28+ ```
29+
30+ ## Debugging
31+
32+ For a more advanced development workflow with debugging capabilities:
33+
34+ ### Prerequisites
735
836- ** VSCode** with the STM32Cube extension (see [ .vscode/extensions.json] ( ../../.vscode/extensions.json ) )
937
1038The STM32Cube VSCode extension will automatically install and configure dependencies.
1139
12- ## Setup
40+ ### Setup
1341
14421 . Clone the repository
15432 . Open the project in VSCode
16443 . Install the recommended extensions when prompted
17454 . The STM32Cube extension will set up the build environment automatically
1846
19- ## Building
20-
21- - Press ` Ctrl+Shift+B ` to build
22- - Or click the build button in the CMake extension toolbar
23-
24- ## Debugging
47+ ### Debug Session
2548
26- To flash and debug:
27- - Press ` F5 ` to build, flash, and start debugging
28- - Or click the debug button in the VSCode debug panel
49+ To build, flash, and debug in one step :
50+ - Press ` F5 ` to start a debug session
51+ - Or click the debug button in the VSCode debug panel
You can’t perform that action at this time.
0 commit comments