Update FlexCAN_t4
Thank you for this!!
Update FlexCAN_t4
If we use the elf, we can replace the normal size tool.. do you have a link to the code?
Here is the elf parsing code.
https://github.com/PaulStoffregen/teensy_size
Want the final result to be compact in the non-verbose mode, probably 1 line per memory region shown on the product page (so 3 lines for Teensy 4.0, 4 lines for Teensy 4.1). Exact format to be determined....
As said a few posts later, I don't think we can simply replace the size-tool. The builder prints a defined text and gets its data by using the regexs on the output.
FLASH: code:59452, data:6152, headers:7212 free for files:8053648
RAM1: code:65536, variables:21184 free for local variables:437568
RAM2: variables:15520 free for malloc/new:508768
Der Sketch verwendet 0 Bytes (0%) des Programmspeicherplatzes. Das Maximum sind 8126464 Bytes.
Globale Variablen verwenden 0 Bytes (0%) des dynamischen Speichers, 524288 Bytes für lokale Variablen verbleiben. Das Maximum sind 524288 Bytes.
I removed "-A" from the commandline.
recipe.hooks.postbuild.4.pattern="{compiler.path}teensy_size" "{build.path}/{build.project_name}.elf"
Not sure what 'text_csf' / headers is telling me?
FLASH: code:86092, data:10160, headers:7212 free for files:8023000
RAM1: code:98304, variables:21312 free for local variables:404672
RAM2: variables:16576 free for malloc/new:507712
[B]EXTRAM: variables:8388608[/B]
FLASH: code:85916, data:10160, headers:7212 free for files:8023176
RAM1: code:98304, variables:21312 free for local variables:404672
RAM2: variables:16576 free for malloc/new:507712
RAM1: 22.81% of 512 kB used.
Code (ITCM, 32 kB Blocks): 76.48 kB
Variables (DTCM): 20.81 kB
Available for Variables: 395.19 kB
RAM2: 3.16% of 512 kB used.
Variables (DMAMEM): 16.19 kB
Available for Heap: 495.81 kB
EXTMEM: not used.
FLASH: 1.27% of 7936 kB used.
Code and Constants: 100.87 kB
Memory region Used Size Region Size %age Used
ITCM: 96 KB 512 KB 18.75%
DTCM: 21312 B 512 KB 4.06%
RAM: 16576 B 512 KB 3.16%
FLASH: 103292 B 7936 KB 1.27%
ERAM: 0 GB 16 MB 0.00%
The first 4140 bytes are headers needed by NXP's ROM, and the last 3072 bytes are a placeholder for a digital signature and public key to someday be used when/if we support encryption & authentication.
Minor problem... looks like arduino builder discards all the stdout printing in non-verbose mode.
teensy_size.c:54:43: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=]
if (!filedata) die("unable to allocate %ld bytes\n", filesize);
~~^ ~~~~~~~~
%I64d
teensy_size: Memory Usage on Teensy 4.1:
teensy_size: FLASH: code:85344, data:10904, headers:7212 free for files:8023004
teensy_size: RAM1: code:98304, variables:21312 free for local variables:404672
teensy_size: RAM2: variables:16576 free for malloc/new:507712
teensy_size: EXTRAM: variables:8388608
teensy_size: Memory Usage on Teensy 4.1:
teensy_size: FLASH: code:140560, data:13176, headers:7212 free for files:7965516
teensy_size: RAM1: code:163840, variables:37696 free for local variables:322752
teensy_size: RAM2: variables:16576 free for malloc/new:507712
Memory region Used Size Region Size %age Used
ITCM: 132812 B 512 KB 25.33%
DTCM: 37696 B 512 KB 7.19%
RAM: 16576 B 512 KB 3.16%
FLASH: 160956 B 7936 KB 1.98%
Wondering, In my size program I put check in for in your case free for local variables if it <=0 the program returns an error status
don't see it in this code base. I found it helped when people for example have large tables or the like and use up all of the ram1