energia / cc3200-core

6 stars 10 forks source link

Not Enough RAM for Variables on CC3200 #24

Closed rei-vilo closed 6 years ago

rei-vilo commented 6 years ago

I've found an interesting solution for my latest project Pervasive Reporting on the CC3200.

The e-paper display requires to have two frame buffers on RAM, but using two arrays of 9472 bytes raised an error while compiling.

~/Library/Energia15/packages/energia/tools/arm-none-eabi-gcc/4.8.4-20140725/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: ~/Library/Developer/Xcode/DerivedData/eX-Check-Display-dkzssdmfeebnduggodwhukhifkst/Build/Products/Debug/embeddedcomputing.elf section '.heap' will not fit in region 'SRAM' ~/Library/Energia15/packages/energia/tools/arm-none-eabi-gcc/4.8.4-20140725/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: region 'SRAM' overflowed by 12376 bytes

I was surprised, since the CC3200 features ~512 kB~ 256 kB of RAM, but Energia is mum about how they are allocated.

According to this E2E post, editing the cc3200.ld link script solved the issue.

I just changed HEAP_SIZE = 0x00010000; for HEAP_SIZE = 0x0000C000; as suggested, and everything built and ran fine now.

Is there something similar to the solution we're using for FRAM (https://github.com/energia/msp430-lg-core/issues/31)?

#define PLACE_IN_FRAM __attribute__((section(".text")))
robertinant commented 6 years ago

Minor correction on the RAM size. It is Up to 256KB. For the first versions of the CC3200 (< ES 1.33) only 192k was usable. Hence the SRAM SIZE is set to 0x00030000. I am going to keep it that way since there are plenty of boards out there with this limitation.

As for the heap size, 64k might indeed be a bit large but there are applications out there that might need this much.

Because of the above, I am going to keep the linker file as is.