Custom Variant Startup File - Error if defined in boards.txt

Post here first, or if you can't find a relevant section!
Post Reply
kjn
Posts: 9
Joined: Wed Apr 15, 2020 4:21 am

Custom Variant Startup File - Error if defined in boards.txt

Post by kjn »

Hi,

I've created a custom variant according to the guide: https://github.com/stm32duino/Arduino_C ... 28board%29

In this particular case, its an F042 board with a custom bootloader, I've been able to adjust the linker script in the variant successfully, however I also require some changes to the start-up file.

I followed this guide: https://github.com/stm32duino/Arduino_C ... efinitions

In boards.txt I added the following line to the board-def.

Code: Select all

GenF0.menu.pnum.CAN_F042K6TX.build.startup_file=-DCUSTOM_STARTUP_FILE
and added the required .S file to the variant folder (modified from the provided CMSIS template)

However, when this line is enabled I am getting an error - essentially it cannot find the file in the variant folder.

Code: Select all

In file included from C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.11.0\cores\arduino\stm32\startup_stm32yyxx.S:1:
C:\Users\user\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.11.0\cores\arduino\stm32\stm32_def_build.h:541:4: warning: #warning "No CMSIS startup file defined, custom one should be used" [-Wcpp]
  541 |   #warning "No CMSIS startup file defined, custom one should be used"
      |    ^~~~~~~
Sketch uses 11892 bytes (52%) of program storage space. Maximum is 22528 bytes.
Global variables use 1212 bytes (20%) of dynamic memory, leaving 4740 bytes for local variables. Maximum is 5952 bytes.
The variant folder is correctly defined, the variant definitions and header file are correctly found and build will work with the default .S file if this is commented out - am I missing something with respect to the startup_file definition?

Input appreciated.
Post Reply

Return to “General discussion”