Undefined reference to 'SystemCoreClock' in uart.c

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Undefined reference to 'SystemCoreClock' in uart.c

3,853件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ALX34 on Tue May 29 09:24:15 MST 2012
Hello everybody,
I try to use uart.c from examples.LPC17xx.zip
But when I use UARTInit I got Undefined reference to 'SystemCoreClock' error and i don't know why .:mad:

Is there anyone can help me ??

Thanks.
0 件の賞賛
返信
6 返答(返信)

2,818件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Wed May 30 08:32:22 MST 2012
There is a much simpler solution than adding own linker scripts...

- Import CMSIS project into workspace.
- Choose new project -> "LPCXpresso C project".
- In the final step of the wizard point to the CMSIS project where it sais "CMSIS library to link project to".
- Copy uart.c, uart.h and type.h to the new project.
- Add location of uart.h and type.h to the search path.
- Build the project.

Or, even simpler, just edit the main.c of the UART example.

Regards,
0 件の賞賛
返信

2,818件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lyncas on Wed May 30 06:08:52 MST 2012

Quote: ALX34

Yes I made my own project and I included uart.c (+ uart.h) and the CMSIS project.

When I said "until I use UARTInit function" I mean when I call other function from uart.c like UARTSend I got no problem but when I call UARTInit I got this error.
However I use it like in main.c of uart project.



If you made your own project,  read this thread,  I posted a linker setting that you should check to fix the SystemCoreClock problem

http://knowledgebase.nxp.com/showthread.php?t=463
0 件の賞賛
返信

2,818件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ALX34 on Wed May 30 01:03:08 MST 2012
Thanks for your fast reply,

Yes I made my own project and I included uart.c (+ uart.h) and the CMSIS project.

When I said "until I use UARTInit function" I mean when I call other function from uart.c like UARTSend I got no problem but when I call UARTInit I got this error.
However I use it like in main.c of uart project.
0 件の賞賛
返信

2,818件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Wed May 30 00:19:27 MST 2012
Hi,

What do you mean by "until I use UARTInit function"?
The UART project is an example project, file "main.c" calls this function on startup. Do you mean you made your own project in which you want to use functions from uart.c?

SystemCoreClock is defined in files system_LPC17xx.c / system_LPC17xx.h (from the CMSIS project) which needs to be included when compiling. The UART example has all settings correct by default and should compile right away.

Regards,
0 件の賞賛
返信

2,818件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ALX34 on Wed May 30 00:00:50 MST 2012
Yes I linked the CMSISv1p30_LPC17xx library and the compilation worked well until I use UARTInit function.
0 件の賞賛
返信

2,818件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Tue May 29 11:47:55 MST 2012
Do you have the cmsis library linked in?
0 件の賞賛
返信