CAN Bus interrupt on Reception S32k144

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

CAN Bus interrupt on Reception S32k144

跳至解决方案
6,744 次查看
manuelmoreno-eg
Contributor II

Hi,

I am trying to enable interrupts on CAN reception (S32k144 EVB) with the folowing code:

void NVIC_init_IRQs (void) {
  S32_NVIC->ICPR[1] = 1 << (CAN0_ORed_0_15_MB_IRQn % 32);  /* IRQ81 CAN0 channel: clear any pending IRQ */
  S32_NVIC->ISER[1] = 1 << (CAN0_ORed_0_15_MB_IRQn % 32);  /* IRQ81 CAN0 channel: enable IRQ */
  S32_NVIC->IP[CAN0_ORed_0_15_MB_IRQn] = 0xA0;             /* IRQ81 CAN0 channel: priority 10 of 0-15 */
}

However, I cannot get any interrupt.

Where can I find documentation about the vectors S32_NVIC?

Thanks a lot,

Manuel

0 项奖励
回复
1 解答
3,060 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Manuel,

S32K1xx_DMA_Interrupt_mapping.xlsm

pastedImage_1.png

So please write to ICPR[2], ISER[2].

  S32_NVIC->ICPR[2] = 1 << (CAN0_ORed_0_15_MB_IRQn % 32);  /* IRQ81 CAN0 channel: clear any pending IRQ */
  S32_NVIC->ISER[2] = 1 << (CAN0_ORed_0_15_MB_IRQn % 32);  /* IRQ81 CAN0 channel: enable IRQ */

Regards,

Daniel

在原帖中查看解决方案

0 项奖励
回复
1 回复
3,061 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Manuel,

S32K1xx_DMA_Interrupt_mapping.xlsm

pastedImage_1.png

So please write to ICPR[2], ISER[2].

  S32_NVIC->ICPR[2] = 1 << (CAN0_ORed_0_15_MB_IRQn % 32);  /* IRQ81 CAN0 channel: clear any pending IRQ */
  S32_NVIC->ISER[2] = 1 << (CAN0_ORed_0_15_MB_IRQn % 32);  /* IRQ81 CAN0 channel: enable IRQ */

Regards,

Daniel

0 项奖励
回复