Skip to content

Allow use of a custom startup file #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cores/arduino/stm32/startup_stm32yyxx.S
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "stm32_def_build.h"

#if defined(CMSIS_STARTUP_FILE)
#include CMSIS_STARTUP_FILE

#endif
6 changes: 5 additions & 1 deletion cores/arduino/stm32/stm32_def_build.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _STM32_DEF_BUILD_
#define _STM32_DEF_BUILD_

#if !defined(CMSIS_STARTUP_FILE) && !defined(CUSTOM_STARTUP_FILE)
#if defined(STM32F030x6)
#define CMSIS_STARTUP_FILE "startup_stm32f030x6.s"
#elif defined(STM32F030x8)
Expand Down Expand Up @@ -296,4 +297,7 @@
#else
#error UNKNOWN CHIP
#endif
#endif //_STM32_DEF_BUILD_
#else
#warning "No CMSIS startup file defined, custom one should be used"
#endif /* !CMSIS_STARTUP_FILE && !CUSTOM_STARTUP_FILE */
#endif /* _STM32_DEF_BUILD_ */
3 changes: 2 additions & 1 deletion platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.cpp.extra_flags=
compiler.cpp.std=gnu++14
compiler.S.extra_flags=
compiler.S.extra_flags={build.startup_file}
compiler.ar.extra_flags=
compiler.elf2bin.extra_flags=
compiler.elf2hex.extra_flags=
Expand All @@ -81,6 +81,7 @@ build.info.flags=-D{build.series} -DARDUINO={runtime.ide.version} -DARDUINO_{bui
# Defaults config
build.xSerial=-DHAL_UART_MODULE_ENABLED
build.enable_usb=
build.startup_file=
build.flags.optimize=-Os
build.flags.ldspecs=--specs=nano.specs

Expand Down