Skip to content

Commit 182fdf4

Browse files
authored
Merge pull request #353 from fpistm/custom_startup
Allow use of a custom startup file
2 parents 891d9fb + c3d12c6 commit 182fdf4

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

Diff for: cores/arduino/stm32/startup_stm32yyxx.S

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "stm32_def_build.h"
22

3+
#if defined(CMSIS_STARTUP_FILE)
34
#include CMSIS_STARTUP_FILE
4-
5+
#endif

Diff for: cores/arduino/stm32/stm32_def_build.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef _STM32_DEF_BUILD_
22
#define _STM32_DEF_BUILD_
33

4+
#if !defined(CMSIS_STARTUP_FILE) && !defined(CUSTOM_STARTUP_FILE)
45
#if defined(STM32F030x6)
56
#define CMSIS_STARTUP_FILE "startup_stm32f030x6.s"
67
#elif defined(STM32F030x8)
@@ -296,4 +297,7 @@
296297
#else
297298
#error UNKNOWN CHIP
298299
#endif
299-
#endif //_STM32_DEF_BUILD_
300+
#else
301+
#warning "No CMSIS startup file defined, custom one should be used"
302+
#endif /* !CMSIS_STARTUP_FILE && !CUSTOM_STARTUP_FILE */
303+
#endif /* _STM32_DEF_BUILD_ */

Diff for: platform.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ compiler.c.extra_flags=
5959
compiler.c.elf.extra_flags=
6060
compiler.cpp.extra_flags=
6161
compiler.cpp.std=gnu++14
62-
compiler.S.extra_flags=
62+
compiler.S.extra_flags={build.startup_file}
6363
compiler.ar.extra_flags=
6464
compiler.elf2bin.extra_flags=
6565
compiler.elf2hex.extra_flags=
@@ -81,6 +81,7 @@ build.info.flags=-D{build.series} -DARDUINO={runtime.ide.version} -DARDUINO_{bui
8181
# Defaults config
8282
build.xSerial=-DHAL_UART_MODULE_ENABLED
8383
build.enable_usb=
84+
build.startup_file=
8485
build.flags.optimize=-Os
8586
build.flags.ldspecs=--specs=nano.specs
8687

0 commit comments

Comments
 (0)