Skip to content
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

Error in make #6

Open
peymankhalili opened this issue Nov 26, 2016 · 7 comments
Open

Error in make #6

peymankhalili opened this issue Nov 26, 2016 · 7 comments

Comments

@peymankhalili
Copy link

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??

@geoffreymbrown
Copy link
Owner

geoffreymbrown commented Nov 26, 2016 via email

@peymankhalili
Copy link
Author

peymankhalili commented Nov 27, 2016

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.

@peymankhalili
Copy link
Author

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.

@peymankhalili
Copy link
Author

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
//////////////////////////////////////////////////////////////////////////////////////

@geoffreymbrown
Copy link
Owner

geoffreymbrown commented Nov 27, 2016 via email

@Matiasus
Copy link

I had the same problem, but due to peymankhalili is solved. Many thanks.

@QGB
Copy link

QGB commented Mar 29, 2023

RCC_APB2PeriphClockCmd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants