lpcware

lpc4357-m0 ..each undeclared identifier is reported only once..

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by pgeloso on Mon May 25 01:59:17 MST 2015
Hi,
I'm using LPC4357 EA board and I have a the following compilation error in the m0 code (using LPCOpen):
..
error: 'TIMER1_IRQn' undeclared (first use in this function)
  NVIC_SetPriority(TIMER1_IRQn, 10);
                   ^
../src/my_m0_dc_talk_2.c:59:19: note: each undeclared identifier is reported only once for each function it appears in
...

I'm just adding a routine that works well in m4 core:

void my_timer1_setup(void){
// Enable timer 1 clock and reset it
Chip_TIMER_Init(LPC_TIMER1);
Chip_RGU_TriggerReset(RGU_TIMER1_RST);
while (Chip_RGU_InReset(RGU_TIMER1_RST)) {}

//  Get timer 1 peripheral clock rate
//timerFreq = Chip_Clock_GetRate(CLK_MX_TIMER1);
//timerFreq=timerFreq/TICKRATE_HZ;
//timerFreq=204000;//++ interrupt @ 1KHz

// Timer setup for match and interrupt at TICKRATE_HZ
Chip_TIMER_Reset(LPC_TIMER1);
Chip_TIMER_MatchEnableInt(LPC_TIMER1, 1);
Chip_TIMER_SetMatch(LPC_TIMER1, 1, 204000); //1KHz  N=204*10^6 / (10^3)=204000
Chip_TIMER_ResetOnMatchEnable(LPC_TIMER1, 1);
Chip_TIMER_Enable(LPC_TIMER1);

// Enable timer interrupt
NVIC_SetPriority(TIMER1_IRQn, 10);
NVIC_EnableIRQ(TIMER1_IRQn);
NVIC_ClearPendingIRQ(TIMER1_IRQn);

return;
}


I think to have correctly linked the libraries: 
Properties -> Settings -> Tool Settings -> MCU Compiler -> Includes -> lpc_chip_43xx_m0/inc
Properties -> Settings -> Tool Settings -> MCU Linker -> Libraries -> lpc_chip_43xx_m0/Debug

but the definition "TIMER1_IRQn" present in the file lpc_chip_43xx_m0/inc/cmisi_43xx.h seems so to be unknown to the code.

Do you know where's the mistake?

regards
Pietro

Original Attachment has been moved to: my_m0_dc_talk_2.zip

Outcomes