Hi all,
I am coding a little project for my model railway using some own code and some libraries (SPI, SD, NativeEthernet and Websocket).
Compiling the project with -Og results in the following teensy_size output:
Line 3 means that 13308 bytes are left for the stack and interrupt handling, right? To me, this seems a little low and doing debug work, strange effects happen (e.g. only small packets are sent via ethernet, large ones kill the socket). Compiling with -Os, the code size is reduced to the following teensy_size output:
Here, I have plenty of space left and the application works without hiccups. I am totally fine with 55k of variables, but the code size is still very heavy.
I already moved many strings to FLASHMEM but still struggle to reduce code size.
Is there a way to check the stack size at runtime? Or is there a way to put code into the RAM2 for debugging sessions? Or put the stack on RAM2 instead?
I also appreciate any other suggestion. With visual micro I have the option to compile my application, libraries and core with different optimization levels, but this is not the best idea, right?
Thanks
Daniel
I am coding a little project for my model railway using some own code and some libraries (SPI, SD, NativeEthernet and Websocket).
Compiling the project with -Og results in the following teensy_size output:
Code:
teensy_size*: Memory Usage on Teensy 4.1
teensy_size*: FLASH: code:443968, data:41008, headers:9060 free for files:7632428
teensy_size*: RAM1: variables:52228, code:441464, padding:17288 free for local variables:13308
teensy_size*: RAM2: variables:24768 free for malloc\new:499520
Code:
teensy_size*: Memory Usage on Teensy 4.1
teensy_size*: FLASH: code:277032, data:31788, headers:9100 free for files:7808544
teensy_size*: RAM1: variables:41892, code:274568, padding:20344 free for local variables:187484
teensy_size*: RAM2: variables:24768 free for malloc\new:499520
I already moved many strings to FLASHMEM but still struggle to reduce code size.
Is there a way to check the stack size at runtime? Or is there a way to put code into the RAM2 for debugging sessions? Or put the stack on RAM2 instead?
I also appreciate any other suggestion. With visual micro I have the option to compile my application, libraries and core with different optimization levels, but this is not the best idea, right?
Thanks
Daniel