Skip to content

Commit f070037

Browse files
committed
Add C HAL/LL source files wrapper library
Allow to not archive HAL/LL object files to core.a. This avoid the linker to select weak definitions instead of non-weak ones when 'whole-archive' option is not used. See: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15833.html Signed-off-by: Frederic Pillon <[email protected]>
1 parent 964576b commit f070037

File tree

140 files changed

+44
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+44
-4
lines changed

libraries/HAL_LL_Wrapper/keywords.txt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#######################################
2+
# Syntax Coloring Map For HAL_LL_Wrapper
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
#######################################
10+
# Methods and Functions (KEYWORD2)
11+
#######################################
12+
13+
#######################################
14+
# Constants (LITERAL1)
15+
#######################################
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=HAL LL Wrapper
2+
version=1.0.0
3+
author=Frederic Pillon
4+
maintainer=stm32duino
5+
sentence=C HAL/LL source files wrapper
6+
paragraph=Allow to not archive HAL/LL object files to core.a. This avoid the linker to select weak definitions instead of non-weak ones when 'whole-archive' option is not used.
7+
category=Other
8+
url=
9+
architectures=stm32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#ifndef __HAL_LL_WRAPPER_H__
2+
#define __HAL_LL_WRAPPER_H__
3+
4+
#endif /* __HAL_LL_WRAPPER_H__ */

platform.txt

+16-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ version=1.0.0
99

1010
# STM compile variables
1111
# ----------------------
12-
compiler.stm.extra_include="-I{build.source.path}" "-I{build.core.path}/avr" "-I{build.core.path}/stm32" "-I{build.core.path}/stm32/LL" "-I{build.core.path}/stm32/usb" "-I{build.core.path}/stm32/usb/hid" "-I{build.core.path}/stm32/usb/cdc" "-I{build.system.path}/Drivers/{build.series}_HAL_Driver/Inc/" "-I{build.system.path}/Drivers/{build.series}_HAL_Driver/Src/" "-I{build.system.path}/{build.series}/" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Src"
12+
compiler.stm.extra_include="-I{build.source.path}" "-I{build.core.path}/avr" "-I{build.core.path}/stm32" "-I{build.core.path}/stm32/LL" "-I{build.core.path}/stm32/usb" "-I{build.core.path}/stm32/usb/hid" "-I{build.core.path}/stm32/usb/cdc" "-I{build.system.path}/Drivers/{build.series}_HAL_Driver/Inc" "-I{build.system.path}/Drivers/{build.series}_HAL_Driver/Src" "-I{build.system.path}/{build.series}" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Src"
1313

1414
compiler.warning_flags=-w
1515
compiler.warning_flags.none=-w
@@ -92,10 +92,22 @@ build.opt.name=build_opt.h
9292
build.opt.sourcepath={build.source.path}/{build.opt.name}
9393
build.opt.path={build.path}/sketch/{build.opt.name}
9494

95+
build.hallldriver.path={build.path}/sketch/HAL_LL_Drivers.cpp
96+
97+
# Create sketch dir if not exists
98+
recipe.hooks.prebuild.1.pattern.windows=cmd /c if not exist "{build.path}\sketch" mkdir "{build.path}\sketch"
99+
recipe.hooks.prebuild.1.pattern.linux=bash -c "[ -f {build.path}/sketch ] || mkdir -p {build.path}/sketch"
100+
recipe.hooks.prebuild.1.pattern.macosx=bash -c "[ -f {build.path}/sketch ] || mkdir -p {build.path}/sketch"
101+
95102
# Create empty {build.opt} if not exists in the sketch dir
96-
recipe.hooks.prebuild.1.pattern.windows=cmd /c if not exist "{build.opt.sourcepath}" mkdir "{build.path}\sketch" & type NUL > "{build.opt.path}"
97-
recipe.hooks.prebuild.1.pattern.linux=bash -c "[ -f {build.opt.sourcepath} ] || (mkdir -p {build.path}/sketch && touch {build.opt.path})"
98-
recipe.hooks.prebuild.1.pattern.macosx=bash -c "[ -f {build.opt.sourcepath} ] || (mkdir -p {build.path}/sketch && touch {build.opt.path})"
103+
recipe.hooks.prebuild.2.pattern.windows=cmd /c if not exist "{build.opt.sourcepath}" type NUL > "{build.opt.path}"
104+
recipe.hooks.prebuild.2.pattern.linux=bash -c "[ -f {build.opt.sourcepath} ] || touch {build.opt.path}"
105+
recipe.hooks.prebuild.2.pattern.macosx=bash -c "[ -f {build.opt.sourcepath} ] || touch {build.opt.path}"
106+
107+
# Force include of HAL_LL_Wrapper library
108+
recipe.hooks.prebuild.3.pattern.windows=cmd /c echo #include ^<HAL_LL_Wrapper.h^> > "{build.hallldriver.path}"
109+
recipe.hooks.prebuild.3.pattern.linux=bash -c "echo $0 > {build.hallldriver.path}" "#include <HAL_LL_Wrapper.h>"
110+
recipe.hooks.prebuild.3.pattern.macosx=bash -c "echo $0 > {build.hallldriver.path}" "#include <HAL_LL_Wrapper.h>"
99111

100112
# compile patterns
101113
# ---------------------

0 commit comments

Comments
 (0)