2.8 KiB
2.8 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Context
University exercise (RTO, "UE u01") for an STM32F072VBTx (Cortex-M0) board. The git root is two levels up (rto1/); UE/ holds exercises, VO/ holds lecture slides (PDF). The exercise spec is doc/u01.pdf. Code comments are partly German.
Build
Keil µVision 5 project Apus.uvprojx, target Apus, ARM Compiler 6 (armclang V6.23). There is no Makefile, linter, or test suite. Command-line build:
"C:/Users/gaems/AppData/Local/Keil_v5/UV4/UV4.exe" -b Apus.uvprojx -j0 -o build_log.txt
(-r for rebuild, -f to flash.) Output goes to output/ (Apus.axf, Apus.build_log.htm), map file to listing/. These build artifacts and the .uvguix.* / .uvoptx IDE state files are committed to git, so they show up as modified after every build.
- Global defines:
STM32F072,USE_STDPERIPH_DRIVER. Include paths:src,stm32f0-stdperiph,src/Devices,src/Tasks— so BSP headers are included as"BSP/Led.h", task headers directly. - New
.cfiles must be added to the project's file groups inApus.uvprojx(or via the µVision IDE), otherwise they are not compiled.
Architecture
- Superloop, no RTOS (yet). src/main.c initializes the BSP, then calls each task function (
TaskCounter,TaskKey,TaskLed,TaskWatch,TaskPoti,TaskMandelbrot) once per loop iteration, clearing the TFT at the start of each iteration. Tasks are plainvoid TaskX(void)functions in src/Tasks/ (aggregated byTaskAll.h) that keep state instaticlocals and draw their own row on the TFT (Tft_DrawString(10, 18 + row*24, ...), 16x24 font). - Timing measurement via GPIO. src/Debug.c drives GPIOB pins as logic-analyzer probes;
debug_tmaps each task (and the SysTick ISR) to a pin.main.cwraps every task call inDebug_Set/Debug_Unset; the double toggle on themandelbrotpin at loop start measures the probe overhead. When adding a task, add an enum entry inDebug.hand its pin to the mask inDebug_Init. - SysTick (src/BSP/systick.c) fires every 1 ms and increments a private
msTickscounter (also toggles thesystickdebug pin). - BSP (src/BSP/):
Key,Led,Adc(potentiometer),TftDisplay— thin wrappers over the vendored ST Standard Peripheral Library in stm32f0-stdperiph/. Device/CMSIS/startup files live in src/Devices/. Don't modify vendored code. - src/StdDef.h provides
BOOL/TRUE/FALSE/NULL_PTR; use these instead of<stdbool.h>.assert()failures land in__aeabi_assertinmain.c(infinite loop for inspection in the debugger).