-
Notifications
You must be signed in to change notification settings - Fork 7.6k
GPIO driver support for RW61x PM3 #89355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…x devices. RW61x devices loses peripheral context when entering into PowerMode 3, so when exiting form this power mode, it is necesary to restore all context. This is a preliminary solution until who is responsible to restore this context and to know the zephyr's contract for Power Management. Signed-off-by: Missael Maciel <[email protected]>
…x devices RW61x devices loses peripheral context when entering into PowerMode 3, so when exiting from this power mode, it is necesary to restore all context. This is a preliminary solution until definition on the responsible to save the context for the GPIO peripheral. Signed-off-by: Missael Maciel <[email protected]>
… devices RW61x devices loses peripheral context when entering into PowerMode3, so when exiting from this power mode, it is necessary to restore all context. This is a preliminary solution until zephyr contract defines whis is responsible to save and restore context for GPIO peripheral. Signed-off-by: Missael Maciel <[email protected]>
Test conditions: |
I just gave this a go on my frdm board with a current meter inserted on JP9 (IDD_MCU) and I'm seeing it alternating between 5.9 and 6.6mA, shouldn't it be around 100-200uA? Also the LED is not behaving correctly, it is just briefly flashing not the expected 50% on 50% off like the non PM sample. |
Also tried turning off the LED and FLEXCOMM used for printf, currently only drops to ~5mA, something is seriously wrong with PM3 at the moment |
Hello @matt-wood-ct one question:
|
Hi @davidmissael, I do not think the MCU is falling over/crashing because I added a longer initial delay with busy wait (5 seconds) and I am not seeing that looping, so I believe it is retaining ram OK and resuming operation. I am using an overlay with standby status = okay and the delays are well over the 1000us required for standby (PM3) state. |
@matt-wood-ct FYI, by default, the RW61x SOC does not maintain the GPIO and pads state when the SOC enters PM3 mode. The state of these pads can be latched using the |
Hi @matt-wood-ct |
Hi David, The question remains though, if the current into Vbat is about right, then what is this extra 5mA going into the other power pins on the MCU? Is the radio on & leaking current? or is it going into Vio. So I took off R128 and measured across JP7. I can confirm that the current appears to be centred there as I measured 5.1-5.4mA on the connection. Any suggestions which IO might be consuming this current, its pretty substantial. |
Tested adding the snippet from the https://github.com/nxp-zephyr/hal_nxp/blob/5ed79a97220679f2fb862dceeb6484d88d9b49cc/mcux/mcux-sdk/boards/frdmrw612/board.c |
Best result I ended up getting on Vio was with this snippet in main: for (i = 0; i < 64; i++)
{
IO_MUX_SetPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
}
for (i = 0; i < 4; i++)
{
IO_MUX_SetRfPinOutLevelInSleep(i, IO_MUX_SleepPinLevelLow);
}
/* LEDS */
IO_MUX_SetPinOutLevelInSleep(0, IO_MUX_SleepPinLevelUnchanged);
IO_MUX_SetPinOutLevelInSleep(1, IO_MUX_SleepPinLevelUnchanged);
IO_MUX_SetPinOutLevelInSleep(12, IO_MUX_SleepPinLevelUnchanged);
/* MDIO */
IO_MUX_SetPinOutLevelInSleep(56, IO_MUX_SleepPinLevelHigh);
IO_MUX_SetPinOutLevelInSleep(57, IO_MUX_SleepPinLevelHigh);
/* I2C */
IO_MUX_SetPinOutLevelInSleep(16, IO_MUX_SleepPinLevelHigh);
IO_MUX_SetPinOutLevelInSleep(17, IO_MUX_SleepPinLevelHigh); But this is still reading about 520uA into the Vio pins, so something is still leaking, I did a simple for loop toggling each sleep level on each pin and was not able to find the cause, so maybe it isn't a pin directly. ps. when measured on the main IDD_MCU header (JP9) this now shows the overall current as 810uA. |
GPIO issue was implemented in: |
THIS IS A PRELIMINARY SOLUTION TO HELP CONTINUE THE DRIVER'S SUPPORT FOR POWER MANAGEMENT ON RW61x DEVICES
On RW61x devices, when entering in PM3, all peripheral lose their state/context. After exiting from this power mode, that context needs to be restored. This PR saves the GPIOs registers before entering to PM3 and restores the registers after exiting PM3, this helps the application recover all GPIOs configurations when returning from this power mode.