Is there any benefit to uploading a config/flashing the board using any of the optimizations besides smallest code?

If so, how the heck would you benchmark something like that?

I can just barely squeeze in basic defines, Fetts prop file, and 4 blade styles using the “fastest” optimization. (97%)

Short answer: yes, sometimes

In particular, large, complicated styles can run very slowly in some cases. Especially if you have a blade with lots of pixels. (Like a zig-zag blade.) Turning on optimizations can make that much better.

The easy way to tell if optimizations are doing something is to use the top command in the serial monitor. It measures how much time is spent doing things, and it also shows blade FPS and number of idle loops per second. WIth optimizations, blade FPS and idle loops should go up.

Ultimately, if the blade FPS is high enough, optimizations won’t do anything that you will notice, and in that case there is no point.

2 Likes

Ah, thank you sir.

Any issue with these Arduino errors if the upload completes and the saber appears to function as desired?

c:/users/rt_br/appdata/local/arduino15/packages/proffieboard/tools/arm-none-eabi-gcc/9-2020-q2-update/bin/…/lib/gcc/arm-none-eabi/9.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe:C:\Users\rt_br\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\variants\STM32L433CC-ProffieboardV2/linker_scripts/STM32L433CC_FLASH.ld:224: warning: memory region `SRAM2’ not declared
In function ‘operator new’,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\fire.h:61:15,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\fire.h:115:68,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:105:30,
inlined from ‘RunLayer’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:111:61,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\remap.h:27:20,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:99:28,
inlined from ‘RunLayer’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:111:61,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\alpha.h:20:46,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\lockup.h:122:5:
C:\Users\rt_br\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4\new.cpp:22:16: warning: argument 1 value ‘4294967295’ exceeds maximum object size 2147483647 [-Walloc-size-larger-than=]
22 | return malloc(size);
| ^
C:\Users\rt_br\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4\new.cpp: In member function ‘run’:
c:\users\rt_br\appdata\local\arduino15\packages\proffieboard\tools\arm-none-eabi-gcc\9-2020-q2-update\arm-none-eabi\include\malloc.h:37:14: note: in a call to allocation function ‘malloc’ declared here
37 | extern void *malloc (size_t);
| ^
In function ‘operator new’,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\fire.h:61:15,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\fire.h:115:68,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:105:30,
inlined from ‘RunLayer’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:111:61,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\layers.h:24:46,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:99:28,
inlined from ‘RunLayer’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:111:61,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\layers.h:24:46,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:99:28,
inlined from ‘RunLayer’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:111:61,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\layers.h:24:46,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:99:28,
inlined from ‘RunLayer’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:111:61,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\layers.h:24:46,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:99:28,
inlined from ‘RunLayer’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:111:61,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\layers.h:24:46,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:99:28,
inlined from ‘RunLayer’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:111:61,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\layers.h:24:46,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:99:28,
inlined from ‘RunLayer’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:111:61,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\layers.h:24:46,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:99:28,
inlined from ‘RunLayer’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:111:61,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\layers.h:24:46,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:77:30,
inlined from ‘RunStyle’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\blade_style.h:87:61,
inlined from ‘run’ at C:\Users\rt_br\Desktop\Proffie\ProffieOS\styles\style_ptr.h:82:18:
C:\Users\rt_br\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4\new.cpp:22:16: warning: argument 1 value ‘4294967295’ exceeds maximum object size 2147483647 [-Walloc-size-larger-than=]
22 | return malloc(size);
| ^
C:\Users\rt_br\AppData\Local\Arduino15\packages\proffieboard\hardware\stm32l4\3.6.0\cores\stm32l4\new.cpp: In member function ‘run’:
c:\users\rt_br\appdata\local\arduino15\packages\proffieboard\tools\arm-none-eabi-gcc\9-2020-q2-update\arm-none-eabi\include\malloc.h:37:14: note: in a call to allocation function ‘malloc’ declared here
37 | extern void *malloc (size_t);
| ^
Sketch uses 256944 bytes (98%) of program storage space. Maximum is 262144 bytes.
dfu-util 0.9

These are all warnings that can be safely ignored.

Excellent. Thank you sir