microzig icon indicating copy to clipboard operation
microzig copied to clipboard

AVR: runtime font/table lookups fail (works with inline for / compile-time unroll)

Open jlucaso1 opened this issue 5 months ago • 0 comments

Platform: AVR atmega328p Zig version: 0.15.1 Microzig version / commit: 039d2da63bf507c42a669e2233c52afa89ab1dcb (current main) Repo: https://github.com/jlucaso1/zig-duino/blob/eu-te-amo/src/firmware.zig#L60 Observed: Building with inline for produces a larger hex (e.g. 2304 bytes) and the firmware drives the LEDs correctly. The runtime-loop variant produces a smaller hex (e.g. 965 bytes) and LEDs remain off. Copy-to-RAM workaround did not fix it.

Notes / suspected root cause:

  • Likely interaction between microzig data placement / AVR program-memory access and generated loads (possible wrong lpm vs ld usage or pointer/addressing mismatch)

jlucaso1 avatar Sep 19 '25 00:09 jlucaso1