mirror of https://github.com/tinygo-org/tinygo.git
Browse Source
I found that .data is not correctly initialized with firmware images that use over 64kB of flash. The problem is that the data in .data (which is stored in flash, and copied to RAM at reset) is beyond the 64kB limit and must therefore be loaded using the elpm instruction instead of the lpm instruction. I encountered this issue while getting testdata/math.go to work for AVR. The following command mostly works with this patch, while it prints garbage withtout it: tinygo run -target=simavr -size=short -scheduler=none ./testdata/math.go (This also requires a patch to picolibc to work, see https://github.com/picolibc/picolibc/pull/371) It still doesn't work entirely with this patch: some of the math operations have an incorrect result. But at least it's an improvement as it won't print garbage anymore.pull/3291/head
Ayke van Laethem
2 years ago
committed by
Ron Evans
1 changed files with 13 additions and 0 deletions
Loading…
Reference in new issue