Forum > Embedded - AVR

Out of memory on a ATtiny841

(1/2) > >>

pascalbythree:
Out of memory on a ATtiny841 when using the www.freepascal.org compiler!

Does anybody know a exe compressor to be used for HEX files for AVR ?

Or i am i stuck to compiler parameters ?

Greets, PascalByThree, Wouter van Wegen

Laksen:
Out of RAM or FLASH?

If RAM, reduce the amount of global variables you need
If FLASH, rewrite your code to make your generated code smaller. You might be using a lot of RTL functions that might be large (WriteLn, memory manager, etc)

You can investigate sizes of stuff with
--- Code: ---avr-embedded-nm -Sn MyProgram.elf
--- End code ---

TRon:

--- Quote from: pascalbythree on November 30, 2023, 03:42:00 pm ---Does anybody know a exe compressor to be used for HEX files for AVR ?

--- End quote ---
fwiw: solution likes that is actually making things worse because when compressed you require roughly twice the the amount of memory. First to load the compressed file into memory and the second time for the decompressed version (and the decompression code itself requires memory as well).

pascalbythree:
8K Bytes flash memory,

To load a UART and a I2C stack. With a small program loop. And some procedures to store a integer in the EEPROM.

Do you think it will be sufficiant ? Maybe it is possible to tell like that ?

ccrause:

--- Quote from: TRon on November 30, 2023, 06:13:52 pm ---
--- Quote from: pascalbythree on November 30, 2023, 03:42:00 pm ---Does anybody know a exe compressor to be used for HEX files for AVR ?

--- End quote ---
fwiw: solution likes that is actually making things worse because when compressed you require roughly twice the the amount of memory. First to load the compressed file into memory and the second time for the decompressed version (and the decompression code itself requires memory as well).

--- End quote ---
It is even worse on Harvard architecture, instructions are only loaded from flash, so the decompressor needs to decompress to flash.  The decompressor also needs to run from flash, so it requires quote a bit of juggling of already limited flash memory.  And the flash space is already too small for the original code.  So while this is an interesting academic challenge, it would be a lot easier to just buy a controller with more flash.

Navigation

[0] Message Index

[#] Next page

Go to full version