What values do i have to define in the makefile if i want to use the lpcopen chip files?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What values do i have to define in the makefile if i want to use the lpcopen chip files?

819 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kabirbansod on Mon Jun 22 01:37:36 MST 2015
Hi all,

I am trying to make a project for my custom lpc1347 board, the project requires me to use makefiles, i have added all the lpcopen's lpc_chip_13xx/inc and src files to the project directory and when i try to compile it using the following command in the makefile:

$(notdir $(wildcard $(CONTIKI_CPU)/*.c))


contiki-lpc1347-mote.a(clock_13xx.o): In function `Chip_Clock_GetMainOscRate':
../../cpu/arm/lpc1347/Makefile.lpc1347:138: recipe for target 'hello-world-nosyms.lpc1347-mote' failed
/home/darth-speedious/Documents/Project/Contiki-open/examples/lpc-carrier-board/../../cpu/arm//lpc1347/./clock_13xx.h:456: undefined reference to `OscRateIn'
collect2: error: ld returned 1 exit status
make: *** [hello-world-nosyms.lpc1347-mote] Error 1
rm hello-world.co


Do i have to define this value in the makefiles?
0 Kudos
7 Replies

717 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Jun 22 05:36:59 MST 2015

Quote: kabirbansod
...where i can learn more about these libraries?



Read datasheet and user manual, then analyze and debug an example...
0 Kudos

717 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kabirbansod on Mon Jun 22 05:19:25 MST 2015
Okay, "System Oscillator" made me think it was System's clock. Thanks... do you know where i can learn more about these libraries?


Quote:
http://docs.lpcware.com/lpcopen/v1.03/

seems a little outdated, i am stuck trying to use USART examples now, unable to understand how it works.
0 Kudos

717 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Jun 22 04:57:59 MST 2015

Quote: kabirbansod
Yes, that is the reason why i added
const uint32_t OscRateIn = 12000000;
const uint32_t ExtRateIn = 0;

To my board configuration file. Thanks :). But i also added SystemCoreClock as 72000000, since it was there in one of the projects, how are these different? Is this the rate of External Oscillator (then why is ExtRateIn=0)?.




:quest:

/* System oscillator rate and clock rate on the CLKIN pin */
const uint32_t OscRateIn = 12000000;


OscRateIn is your System oscillator rate = whatever you have connected to XTALIN (oscillator, crystal, cat...).

SystemCoreClock is used to store the actual System clock:

SystemCoreClock = Chip_Clock_GetSystemClockRate();


/* Return system clock rate */
uint32_t Chip_Clock_GetSystemClockRate(void)
{
/* No point in checking for divide by 0 */
return Chip_Clock_GetMainClockRate() / LPC_SYSCTL->SYSAHBCLKDIV;
}
0 Kudos

717 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kabirbansod on Mon Jun 22 04:19:38 MST 2015
Yes, that is the reason why i added
const uint32_t OscRateIn = 12000000;
const uint32_t ExtRateIn = 0;

To my board configuration file. Thanks :). But i also added SystemCoreClock as 72000000, since it was there in one of the projects, how are these different? Is this the rate of External Oscillator (then why is ExtRateIn=0)?.
0 Kudos

717 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Mon Jun 22 02:57:53 MST 2015
It is defined in the board library (board.c)
/*****************************************************************************
 * Private functions
 ****************************************************************************/

/* System oscillator rate and clock rate on the CLKIN pin */
const uint32_t OscRateIn = 12000000;
const uint32_t ExtRateIn = 0;
0 Kudos

717 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kabirbansod on Mon Jun 22 02:49:17 MST 2015
I have a linker script but for libraries i am using semihosting:
--specs=rdimon.specs -lc -lrdimon
as a CFLAG.

But now that i define this in one of the c files
const uint32_t OscRateIn = 12000000;
const uint32_t ExtRateIn = 0;


I get no error, Though i do not understand what OscRateIn is for, how is it different from SystemCoreClock? The value of SystemCoreClock i am using is 72000000.
0 Kudos

717 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Mon Jun 22 02:04:21 MST 2015
That is a linker error. Have you linked with the chip and board libraries?
0 Kudos