RESETb/PTA20 on KL15 as "GPIO"?

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

RESETb/PTA20 on KL15 as "GPIO"?

711 Views
WolfgangW
Contributor I

Hi,

I am trying to get a workaround for the following problem:
- KL15Z128 MCU
- bootloader uses SRCM_SRS1 & RCM_SRS1_SW_MASK as criterion to stay in bootloader/update mode
- watchdog is unused/disabled

- I need to reset the MCU from the application while restarting (not staying in bootloader/update mode), so
  SW reset can not be used for this.

As I have a rather large capacitor and pull-up connected to RESETb/PTA20
I thought about setting PTA20 low as a GPIO and then switch it back to
RESETb function to let the MCU reset itself, but this does not work. This
is my code:

PORT_PCR_REG(PORTA_BASE_PTR, 20) = PORT_PCR_MUX(1);
GPIOA_PDDR |= (1 << 20);
GPIOA_PCOR = 1 << 20;
delay_ticks(2);
PORT_PCR_REG(PORTA_BASE_PTR, 20) = PORT_PCR_MUX(0);

There is no low pulse on PTA20 and when single-stepping through the
code, I can see PORTA_PCR20, GPIOA_PDDR and GPIOA_PDOR

being correctly set, but GPIOA_PDIR always reads '1' in bit 20.

From the data sheet I see no limitation in PTA20 GPIO functionality,
but to me it seems that this pin is input-only in hardware.
Did anybody else try this yet and can share their experience?

Best regards,
Wolfgang

Labels (1)
Tags (3)
0 Kudos
1 Reply

461 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Wolfgang Wegner:

The reset pin is a special case and the Reference Manual is missing a little explanation on this. This is already reported and it should be included in later manual revisions.

The behavior is as next:

By default the RESET_b function is not selected by the PORTx_PCRn[MUX] value but is controlled by the FOPT[RESET_PIN_CFG] bit. The PORTx_PCRn[MUX] value has no effect when the RESET_B pin is configured as the reset  pin function. If the reset pin function is disabled then the pin is configured in its DISABLED state. The pin can then be configured to its GPIO function by setting the PORTx_PCRn[MUX] value to "1"


The RESET_PIN_CFG bit is loaded from flash non-volatile register NVM_FOPT at address 0x040D. Because of this it is not possible to change the pin from [Reset -> GPIO] or [GPIO -> Reset] during code execution. The attached guide explains the procedure to use Reset_b pin as GPIO, using CW, GCC toolchain or Processor Expert.



Regards!,
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos