Triggering external interrupt on GPIO pin causes MCU reset

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

Triggering external interrupt on GPIO pin causes MCU reset

Jump to solution
672 Views
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 Kudos
1 Solution
648 Views
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.

View solution in original post

0 Kudos
1 Reply
649 Views
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 Kudos