Skip to content

Commit a1e85ff

Browse files
committed
Link STM32Cube HAL files as objects // Resolve #468
This fixes an issue when weak symbols in a static library get linked in the final firmware even when proper symbols are present.
1 parent 0e159cc commit a1e85ff

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

builder/frameworks/stm32cube.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,16 +319,14 @@ def build_usb_libs(usb_libs_root):
319319
if board.get("build.stm32cube.custom_config_header", "no") == "no":
320320
generate_hal_config_file()
321321

322-
libs.append(
323-
env.BuildLibrary(
324-
os.path.join("$BUILD_DIR", "FrameworkHALDriver"),
325-
os.path.join(
326-
FRAMEWORK_DIR,
327-
"Drivers",
328-
MCU_FAMILY.upper() + "xx_HAL_Driver",
329-
),
330-
src_filter="+<*> -<Src/*_template.c> -<Src/Legacy>",
331-
)
322+
env.BuildSources(
323+
os.path.join("$BUILD_DIR", "FrameworkHALDriver"),
324+
os.path.join(
325+
FRAMEWORK_DIR,
326+
"Drivers",
327+
MCU_FAMILY.upper() + "xx_HAL_Driver",
328+
),
329+
src_filter="+<*> -<Src/*_template.c> -<Src/Legacy>",
332330
)
333331

334332
#

0 commit comments

Comments
 (0)