AnsweredAssumed Answered

Why would the S32 lock up after reading a GPIO PCR?

Question asked by gearhead1107 on Oct 27, 2017
Latest reply on Aug 19, 2018 by Martijn de Milliano

I'm currently trying to debug the interaction of a boot-loader and firmware load, and having some issues that seem to be GPIO related. In both programs I'm using the NXP drivers for GPIO initialization, and in PINS_Init() there's a line that tries to read the PCR values:

uint32_t regValue = config->base->PCR[config->pinPortIdx];

In assembly, there's a LDR.W instruction which is trying to pull values from the 0x4004D040 address:

ldr.w   r3, [r3, r2, lsl #2] ;Note that R3=0x4004D000 and R2=0x10 here

Immediately after this instruction, the processor hangs/ goes to the reset handler at 0x450

Some interesting notes are that:

  • Both the Bootloader and Firmware are trying to reference the same 0x4004D040 address, which seems to correspond to Multiplexing Control for PORT-E. 
  • The first program is able to run this code fine, however the second code that tries to run through its same code fails

 

I've been digging through the GPIO muxing documentation in the RM, but can't find why just *reading* this register would fail after GPIO has been initialized. Any ideas here?

Outcomes