Current:
- compiling the static library (after clean) takes 11 seconds, 57 .o files (45 from stm32f1xx_hal, 12 from system/libstm)
- compiling arduino sketch for the first time takes 6 seconds, 23 .o core/arduino files + sketch
- compiling arduino sketch again takes 3 seconds, only recompiles the sketch
If I move all the files from system/libstm32f103c/source and system/libstm32f103c/include to cores/arduino/libstm (with the exception of stm32f1xx_hal_conf.h) (also note: no need to change the makefiles/platform.txt):
- compiling the static library (after clean) takes 9 seconds, 45 .o stm32f1xx_hal files
- compiling arduino sketch for the first time takes 8 seconds, 35 .o files (23 core/arduino + 12 libstm files) + sketch
- compiling arduino sketch again takes 3 seconds, only recompiles the sketch
Advantage:
- Working on the libstm files, no need to set up a gcc make environment (in windows/linux), execute the makefile+compile every time. Just compile as always.
- The static library needs to be created only once, as the stm32f1xx_hal files rarely change.
- VECT_TAB_OFFSET will just work, as it will be used arduino-compile time, not static library compile time.
Disadvantage:
- Slightly slower first sketch compilation.
- Only one libstm. Although I see this as an advantage.
In both versions the staticlib makefile has to support it(currently “CFLAGS += -DSTM32F103xB” etc…); move SystemClock_Config from hw_config.c to variant.cpp; (and move the peripheral variables to variant, if they greatly differ between chips).
Did you compile a large (complex) sketch or just a simple blink sketch ?
Did you compile a large (complex) sketch or just a simple blink sketch ?
Ironically I had to put part of it into static lib, as usbd_conf.h is included from Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_def.h .
Also because the example STM32F100 does not have USB, it fails to compile for that board. BluePill works.
before: first time 13 seconds, subsequent 6 seconds.
after: first time 16 seconds, subsequent 6 seconds.
before: first time 13 seconds, subsequent 6 seconds.
after: first time 16 seconds, subsequent 6 seconds.
Our preliminary tests are conclusive in spit of some regression for the Nucleo variant.
We will now work on this new architecture for the STM32F103RB Nucleo board.
Our tests will be limited to the Nucleo variant. Thank you for your understanding.
BR
Some cleanup:
- Cleanup, move chip.h to cores/arduino
- Cleanup, remove old libstm32f1 folder
- Cleanup, rename libstm32f103c to staticlibstm32f1, This is important! Fixes platform.txt include.
Some cleanup:
- Cleanup, move chip.h to cores/arduino
- Cleanup, remove old libstm32f1 folder
- Cleanup, rename libstm32f103c to staticlibstm32f1, This is important! Fixes platform.txt include.


