Closed kairoswater-jason closed 4 weeks ago
After some digging, it looks like whatever estimates size of the flash section of target/memory.x
possibly might assume optimization level "z" not optimization level 1 (estimated size used to set length of FLASH section is shorter than the size of .text)
it looks like it was user error (or rather absence of familiarity/knowledge)
[kernel]
requires = {flash = XXX ....
was the culprit (XXX was too small)
The generated linker error did not immediately clue me in that it was this particular setting. I assumed that kernel sizing issues would produce warnings similar to what is emitted for tasks.
Reproducible example: In
/hubris/Cargo.toml
set[profile.release] opt-level = 1
Increase/hubris/app/demo-stm32g0-nucleo/app-g070-mini.toml
flash and stack sizes as needed Runcargo xtask dist app/demo-stm32g0-nucleo/app-g070-mini.toml
it appears the
.fill
section oftarget/link.X
does not play well with optimzation level 1 but works fine with optimization level "z" ?(context: this issue was discovered when trying to debug a system, and the optimizations were making following the program execution path in gdb difficult, this prompted changing the optimization level)
Is modifying the optimization setting for release in the toplevel
Cargo.toml
the proper way to change the optimization level? (my goal is to ship with less aggressive size optimization in release)Side-note: this same .fill section build issue occurs on larger chips with significantly more flash memory.