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

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

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

1,707件の閲覧回数
lpcware
NXP Employee
NXP Employee
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

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,593件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue May 26 00:32:36 MST 2015
If you look in cmsis_43xx_m0app.h, you'll not see TIMER1 listed. This is because TIMER1 is not accessible from the M0 cpu, only from the M4. You'll need to use TIMER0 or TIMER3 instead. Check the NVIC chapter of the LPC43xx User Guide for more details.

Regards,
LPCXpresso Support
0 件の賞賛
返信

1,593件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nerd herd on Mon May 25 19:55:19 MST 2015
Hi pgeloso,

Where are you calling this function? Is it in your main()? Also, can you tell me which software example project you are using? I would like to replicate the issue.
0 件の賞賛
返信