|
HomeCore 0.1.3 (07b5544)
Bare-metal personal computer firmware for Cortex-M
|
stm32vldiscovery target supports ST's STM32VLDISCOVERY board with an STM32F100RB. With 8 KB of RAM it is the smallest HomeCore target. It runs the shell and VFS over a USART1 console (interrupt-driven receive) with a 1 kHz SysTick. QEMU's stm32vldiscovery machine runs this port, so it is the STM32 code path covered by the CI regression. The physical-board build, which adds PLL clock setup, has not been validated on hardware.
At a glance
| SoC | ST STM32F100RB (st/stm32f100) |
|---|---|
| Core | Cortex-M3 |
| Flash | 128 KB at 0x08000000 |
| RAM | 8 KB at 0x20000000 |
| Clock | 24 MHz, PLL from HSI/2 × 6 |
| Console | USART1, PA9 TX / PA10 RX, 115200 8N1 |
| Presets | stm32vldiscovery, stm32vldiscovery-qemu |
| Preset | Configuration | Clock setup | Use |
|---|---|---|---|
stm32vldiscovery | configs/stm32vldiscovery_defconfig | PLL to 24 MHz | Physical board |
stm32vldiscovery-qemu | same defconfig + overlay src/board/stm32vldiscovery/qemu.yaml | Skipped | QEMU only |
QEMU maps its first serial port to USART1. Exit the interactive session with Ctrl-A, then X.
With clock_setup true (the default in board.yaml), board_init() runs the PLL from HSI/2 × 6 = 24 MHz, the STM32F100 maximum, with undivided AHB, APB1, and APB2 clocks. Each step waits with a bounded iteration budget; a failure halts before the console starts, so diagnose it with a debugger.
QEMU does not model the clock controller or GPIO: reads return 0 and writes are ignored. Its CPU and SysTick clock is fixed at 24 MHz, so the QEMU overlay (qemu.yaml, clock_setup: false) skips clock setup and the board reports 24 MHz in both configurations.
Both defconfigs change four defaults to fit 8 KB of RAM:
| Setting | Default | This board |
|---|---|---|
CONFIG_HOMECORE_KERNEL_MAIN_STACK_SIZE | 3072 | 2048 |
CONFIG_HOMECORE_SHELL_BASIC_MAX_NESTING | 8 | 4 |
CONFIG_HOMECORE_VFS_MAX_FILE_SIZE | 4096 | 1024 |
CONFIG_HOMECORE_KERNEL_STDIO_BUFFERED | y | n (saves about 2 KB of heap) |
VFS entries and descriptors use heap only while they exist, so the default caps of 16 files, 16 directories, and 16 open files are kept. In QEMU, about 450 bytes of heap are used after boot, and 16 directories plus 16 empty files add about 2 KB. File contents, BASIC programs, and variables share the remaining heap. When it runs out, creating an entry fails with "Not enough space" (ENOMEM), which differs from "No space left on device" at a cap.
BASIC lines may nest parentheses, unary signs, function calls, and IF ... THEN up to 4 levels. Measured stack peaks in QEMU are about 0.9 KB for file commands and 1.7 KB for BASIC at the nesting limit, leaving about 380 bytes of margin. mem reports heap use and the stack high-water mark.
| Board pin | Adapter pin |
|---|---|
| PA9 (USART1 TX) | RX |
| PA10 (USART1 RX) | TX |
| GND | GND |
Use a 3.3 V USB-to-UART adapter at 115200 baud, 8N1, no flow control. The on-board ST-LINK/V1 has no virtual COM port. OpenOCD provides board/stm32vldiscovery.cfg for it; on Linux the ST-LINK/V1 needs the usb-storage quirk 483:3744:i. These flashing steps have not been checked with this port:
| File | LED | Pin |
|---|---|---|
/dev/led0 | LD3 green | PC9 |
/dev/led1 | LD4 blue | PC8 |
Both are GPIO LEDs on port C, lit when the pin is high. QEMU models no GPIO, so the stm32vldiscovery-qemu build's overlay disables them and enables console LEDs with the same files, which print [led0] on and similar lines. See LEDs.
Confirm the banner, uptime against elapsed time (which checks the 24 MHz PLL), mem, the file commands, basic, the LEDs (write /dev/led0 on lights LD3), and reboot, as described in the porting guide.
The full board guide is docs/boards/stm32vldiscovery.md.