vindar / tgx

tgx - a tiny/teensy 3D graphics library
GNU Lesser General Public License v2.1
176 stars 31 forks source link

section .bss is not within region DTCM #23

Closed klaasdc closed 6 months ago

klaasdc commented 6 months ago

Hi,

I'm impressed with the ILI9341_t4 library speed and features and I'm trying to port my application to use TGX. So I made a few small-scale demos and now converted all the image data and drawing functions of the application over. I'm using a sort of scrolling menu system, where my UI draws "virtual" pages on 2 Image objects. These get blitted to the framebuffer to give the illusion of scrolling left or right.

When I try to compile, I get the following linker error:

Linking .pio\build\teensy41\firmware.elf
c:/users/klaasdc/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: address 0x20089d60 of .pio\build\teensy41\firmware.elf section `.bss' is not within region `DTCM'
c:/users/klaasdc/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: address 0x20089d60 of .pio\build\teensy41\firmware.elf section `.bss' is not within region `DTCM'

Before, in TeensyLoader, I never exceeded 7-8%, so I'm a little puzzled where all the memory is going. The compiled libTGX objects seems pretty big (libtgx.a is 1.1MB), but I'm also not sure how much of it is included by the linker, since I only use 1 font.

How can I reduced the size enough to make it link or identidy and cut out excess?

klaasdc commented 6 months ago

Ok, I found a description of the memory layout of the Teensy 4. I moved my two Image objects to DMAMEM and that solved it.

It works so smooth, even with non-CS DC pin. Incredible work!