STM32-Template
STM32-Template copied to clipboard
Error in make
when typed "make" ... ends to this:
/home/peyman/toolchain/Sourcery/bin/arm-none-eabi-gcc -T../stm32f100.ld -mthumb -mcpu=cortex-m3 -o BlinkingLights.elf startup_stm32f10x.o system_stm32f10x.o main.o
main.o: In function main': **# /home/peyman/toolchain/STM32-Template/BlinkingLights/main.c:12: undefined reference to
RCC_APB2PeriphClockCmd'**
collect2: error: ld returned 1 exit status
../Makefile.common:61: recipe for target 'BlinkingLights.elf' failed
I think marked text says that could not include "stm32f10x_gpio.c" & "stm32f10x_rcc.c" files in "/home/peyman/toolchain/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver" directory. How to fix??
looks like a path problem. Have you looked at the contents of /home/peyman/toolchain/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver ?? Did you download the standard peripheral libraries ?
Why don't you switch from the codesourcery tools to the arm launchpad tools here: https://launchpad.net/gcc-arm-embedded.
On Sat, Nov 26, 2016 at 11:29 AM, peymankhalili [email protected] wrote:
when typed "make" ... ends to this:
/home/peyman/toolchain/Sourcery/bin/arm-none-eabi-gcc -T../stm32f100.ld -mthumb -mcpu=cortex-m3 -o BlinkingLights.elf startup_stm32f10x.o system_stm32f10x.o main.o main.o: In function main': # /home/peyman/toolchain/STM32- Template/BlinkingLights/main.c:12: undefined reference to RCC_APB2PeriphClockCmd' collect2: error: ld returned 1 exit status ../Makefile.common:61: recipe for target 'BlinkingLights.elf' failed
I think marked text says that could not include "stm32f10x_gpio.c" & "stm32f10x_rcc.c" files in "/home/peyman/toolchain/ STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver" directory. How to fix??
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/geoffreymbrown/STM32-Template/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/ABq_UjGj-NtdJ_ORzImP9lhTyT3dwclAks5rCF5UgaJpZM4K87re .
of course.. I used arm launchpad tools instead of Sourcery. just for compatibility with your code changed folder name to Sourcery.
I downloaded standard peripheral libraries from here.
I just downloaded standard peripheral libraries from link you mentioned in book( from St.com ) but nothing changed. and I copied "stm32f10x_gpio.c" & "stm32f10x_rcc.c" to that folder(near makefile) but still same. I study GNU-make book by Richard M. Stallman to diagnoctic the error but everything looks true in makefile system.
At the end problem solved... from here. by studing edited makefile in that solutions I just found that this parts must added to makefile: OBJS += stm32f10x_gpio.o stm32f10x_rcc.o
I added and make completed successfully. final makefile is this: ////////////////////////////////////////////////////////////////////////////////////// TEMPLATEROOT = ..
compilation flags for gdb
CFLAGS = -O1 -g ASFLAGS = -g
object files
OBJS= $(STARTUP) main.o OBJS += stm32f10x_gpio.o stm32f10x_rcc.o
include common make file
include $(TEMPLATEROOT)/Makefile.common //////////////////////////////////////////////////////////////////////////////////////
That is curious. I'm glad you solved the problem. When I do the build on my system, there's no issue. But then it is always hard to know if there isn't something subtly different about how a machine is set up.
Geoffrey
On Sun, Nov 27, 2016 at 2:23 AM, peymankhalili [email protected] wrote:
At the end problem solved... from here https://github.com/StuartHa/DisoveringSTM32Solutions. by studing edited makefile in that solutions I just found that this parts must added to makefile: OBJS += stm32f10x_gpio.o stm32f10x_rcc.o
I added and make completed successfully. final makefile is this: //////////////////////////////////////////////////////////// ////////////////////////// TEMPLATEROOT = .. compilation flags for gdb
CFLAGS = -O1 -g ASFLAGS = -g object files
OBJS= $(STARTUP) main.o OBJS += stm32f10x_gpio.o stm32f10x_rcc.o include common make file
include $(TEMPLATEROOT)/Makefile.common //////////////////////////////////////////////////////////// //////////////////////////
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/geoffreymbrown/STM32-Template/issues/6#issuecomment-263106572, or mute the thread https://github.com/notifications/unsubscribe-auth/ABq_UnHSQBMv-P4LHUqq-yocNCjG77SIks5rCS_ngaJpZM4K87re .
I had the same problem, but due to peymankhalili is solved. Many thanks.