This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Building an STM32 CUBE project using Keil MDK

My customer is using Cube. I do not. I wrote some library and created a very simple project to test and validate it. U did use Keil and armcc v5.06. I had trouble adding this library to the same test project within Cube. My next step was to build the same library setting Keil MDK to use GNU toolchain.

Here ios my build output:

Build started: Project: main
*** Note: Rebuilding project, since 'Options->Output->Create Batch File' is selected.
Rebuild target 'mc_comm_lib_mk9p0'
compiling main.c...
compiling system_stm32g4xx.c...
assembling startup_stm32g431xx.asm...
linking...
c:\st\stm32cubeide_1.6.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: ./out/startup_stm32g431xx.o: in function `LoopForever':
B:/STM32/G4/Examples/mc_comm_lib GNU mk9p0/../../Nimbus/PAL/SRC/startup_stm32g431xx.asm:87: undefined reference to `_siccmram'
c:\st\stm32cubeide_1.6.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: B:/STM32/G4/Examples/mc_comm_lib GNU mk9p0/../../Nimbus/PAL/SRC/startup_stm32g431xx.asm:93: undefined reference to `_sccmram'
c:\st\stm32cubeide_1.6.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: B:/STM32/G4/Examples/mc_comm_lib GNU mk9p0/../../Nimbus/PAL/SRC/startup_stm32g431xx.asm:94: undefined reference to `_eccmram'
c:\st\stm32cubeide_1.6.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: c:/st/stm32cubeide_1.6.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924/tools/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard\libc.a(lib_a-exit.o): in function `exit':
exit.c:(.text.exit+0x16): undefined reference to `_exit'
collect2.exe: error: ld returned 1 exit status
".\OUT\main.elf" - 1 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed: 00:00:07

This is the startup file:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
******************************************************************************
* @file startup_stm32g431xx.s
* @author MCD Application Team
* @brief STM32G431xx devices vector table GCC toolchain.
* This module performs:
* - Set the initial SP
* - Set the initial PC == Reset_Handler,
* - Set the vector table entries with the exceptions ISR address,
* - Configure the clock system
* - Branches to main in the C library (which eventually
* calls main()).
* After Reset the Cortex-M4 processor is in Thread mode,
* priority is Privileged, and the Stack is set to Main.
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


Could you please let me know what I'm missing?

Thanks.

0