Commit 9835765
fix(stm32): #223 stm32f103c8 SPI auto-discovery — accept LTO-stable PinMap_SPI_* alongside the SPIClass mangled symbol
The orchestrator wiring is correct: `framework.get_framework_libraries()`
returns the bundled SPI lib, the resolver attributes `<SPI.h>` to it, and
SPI.cpp + utility/spi_com.c are compiled into the ELF. But the Release
profile's `-flto -Os -fno-rtti` inlines `SPIClass::begin()` into its caller
and strips the independent `_ZN8SPIClass*` symbols, so the original
`has_symbol_containing("SPIClass")` assertion fails on every Release build.
The probe now accepts either the mangled `SPIClass*` C++ symbol (visible in
non-LTO builds) or `PinMap_SPI_*` — a `const` global array from the SPI
library's `utility/spi_com.c` whose address is taken by the peripheral pin
tables and survives both LTO and `--gc-sections`. Either signal proves the
library was auto-discovered, compiled, and linked into the firmware.
Closes #223
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a04bb2a commit 9835765
1 file changed
Lines changed: 30 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
| |||
84 | 92 | | |
85 | 93 | | |
86 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
87 | 110 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
92 | 117 | | |
93 | 118 | | |
94 | 119 | | |
| |||
0 commit comments