Triggering external interrupt on GPIO pin causes MCU reset

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

Triggering external interrupt on GPIO pin causes MCU reset

跳至解决方案
1,015 次查看
ntamias
Contributor II

HW setup:

  • NXP MPC5744P DEVKIT
  • PINS PA10 & PA11 connected via external cable. (PA11 configured as GPIO output)

SW setup:

  • S32 Design Studio for Power Architecture v2.1 with Processor Expert.
  • External interrupt on line 9 enabled for GPIO pin PA10.
  • External interrupt on line 30 enabled for user switch SW1 (pin PF12).
  • FreeRTOS running.

Relevant register contents

  • SIUL2.MSCR[10] = 0x00090000
  • SIUL2.MSCR[92] = 0x00090000
  • SIUL2.DIRER0 = 0x40000200
  • SIUL2.IREER0 = 0x40000000
  • SIUL2.IFEER0 = 0x00000200
  • SIUL2.IFER0 = 0x0
  • SIUL2.IMCR[182] = 0x00000001
  • SIUL2.IMCR[203] = 0x00000001
  • INTC_0.PSR[244] = 0x8005
  • INTC_0.PSR[246] = 0x8005

The user switch interrupt works as expected but when I toggle pin PA11 (output connected to input pin PA10) the MCU resets and I'm thrown in the IVOR1 exception handler.

The behaviour I'd like to implement is sensing the falling edge of an external signal connected to pin PA10.

 

0 项奖励
回复
1 解答
991 次查看
ntamias
Contributor II

So the cause of my problem is that a machine check exception happens because vPortISRHandler is called BEFORE the FreeRTOS scheduler has started. This is in turn because an external input interrupt happens before the scheduler has started.

A potential solution would be to disable interrupts until after the scheduler has started.

在原帖中查看解决方案

0 项奖励
回复
1 回复
992 次查看
ntamias
Contributor II

So the cause of my problem is that a machine check exception happens because vPortISRHandler is called BEFORE the FreeRTOS scheduler has started. This is in turn because an external input interrupt happens before the scheduler has started.

A potential solution would be to disable interrupts until after the scheduler has started.

0 项奖励
回复