Skip to content

Conversation

@henryrgithub
Copy link

Hello! I've got blinky working on the STM32F303 Nucleo board. I disabled some examples that weren't building for the STM32F1xx.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Lint Results

ℹ️ Additional issues on unchanged lines
The following 1 issue(s) exist but are not on lines changed in this PR:

examples/stmicro/stm32/build.zig:19: TODO style comments need to have a linked microzig issue on the same line.

@mattnite
Copy link
Contributor

mattnite commented Jan 7, 2026

@henryrgithub we compile these examples in CI, what compilation errors were you seeing?

@henryrgithub
Copy link
Author

Ah, looking closer, the errors are

error: ld.lld: section '.text' will not fit in region 'BANK_1': overflowed by 44176 bytes error: ld.lld: section '.ARM.extab' will not fit in region 'BANK_1': overflowed by 45064 bytes error: ld.lld: section '.ARM.exidx' will not fit in region 'BANK_1': overflowed by 45936 bytes error: ld.lld: section '.data' will not fit in region 'BANK_1': overflowed by 46128 bytes error: ld.lld: section '.flash_end' will not fit in region 'BANK_1': overflowed by 46128 bytes error: the following command failed with 5 compilation errors: /nix/store/jkfs8578bsdnaa0fm82k52kbm1j54i42-zig-0.15.2/bin/zig build-exe -fno-strip -fsingle-threaded -ODebug -target thumb-freestanding-eabi -mcpu cortex_m3 --dep microzig --dep app -Mroot=/home/no/proj/risc-V_FPGA/microzig/core/src/start.zig --dep config --dep drivers --dep cpu --dep chip --dep hal --dep app -Mmicrozig=/home/no/proj/risc-V_FPGA/microzig/core/src/microzig.zig -target thumb-freestanding-eabi -mcpu cortex_m3 --dep microzig -Mapp=/home/no/proj/risc-V_FPGA/microzig/examples/stmicro/stm32/src/stm32f1xx/advanced_adc.zig -Mconfig=.zig-cache/c/2e44dea0c90992b698c6f2eddfa68d8f/options.zig -ODebug -Mdrivers=/home/no/proj/risc-V_FPGA/microzig/drivers/framework.zig --dep rtt --dep microzig -Mcpu=/home/no/proj/risc-V_FPGA/microzig/core/src/cpus/cortex_m.zig --dep microzig -Mchip=.zig-cache/o/57469ebc81cb8ce9c2dcb7e94d99334f/chips/STM32F103C8.zig --dep ClockTree --dep microzig -Mhal=/home/no/proj/risc-V_FPGA/microzig/port/stmicro/stm32/src/hals/STM32F103.zig -ODebug -Mrtt=/home/no/proj/risc-V_FPGA/microzig/modules/rtt/src/rtt.zig -ODebug -MClockTree=/home/no/.cache/zig/p/ClockHelper-2.0.0-RcMaOSniGQHXH_qeoZbQDG64XThqpXTVPMfJ6P7LHpYY/src/lib.zig -ffunction-sections -fdata-sections --gc-sections --cache-dir .zig-cache --global-cache-dir /home/no/.cache/zig --name STM32F1xx_adv_adc -static -fcompiler-rt --script .zig-cache/o/4654645dc08c3d164634478f34f09e24/linker.ld --zig-lib-dir /nix/store/jkfs8578bsdnaa0fm82k52kbm1j54i42-zig-0.15.2/lib/zig/ --listen=-

and similar. The errors go away with -Doptimize=ReleaseFast or similar. I've uncommented the examples, though it might be nice to force strip of debug symbols on those.

Fair on the commented lines in board definition, I've deleted them and the unused RCC call.

@Grazfather
Copy link
Collaborator

Debug symbol are irrelevant to what actually gets written on flash.

I have a similar issue with ch32v, as they typically have very little storage.

What matters is not the size of the ELF, but rather what is written to flash, and debug symbols and such are not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants