This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP-MSPM0L1306: sysctl_shutdown example from SDK doesn't work with PA0 configured to wake on high level

Part Number: LP-MSPM0L1306
Other Parts Discussed in Thread: MSPM0L1304, MSPM0L1306

Hi,

we are working on an application for the MSPM0L1304 (using an LP-MSPM0L1306 for development) that would ideally use all available wakeup pins. However, I have noticed that when I set up PA0 to wake up when high, the MCU wakes up even when the pin is low.

For verification, I have reproduced the same issue by modifying the sysctl_shutdown example from the SDK.

I will list the steps I have used to reproduce the issue:

  1. Install the following: Ubuntu 22.04, Code Composer Studio 12.5.0.00007, ARM GCC 10.3-2021.10, MSPM0 SDK 1.20.00.05
  2. Import the example sysctl_shutdown_LP_MSPM0L1306_nortos_gcc from the SDK
  3. Click Flash, and observe the normal behaviour of this example. The red LED blinks once, then pressing the button on PA18 wakes up the MCU and produces an increasing number of blinks on the red LED.
  4. Modify the syscfg file to use PA1 as USER_SWITCH_1
  5. Add a jumper between PA1 and GND, leaving J9 in place as a pullup resistor
  6. Flash the updated firmware
  7. The expected behaviour is observed once more, where the MCU goes into shutdown mode, but removing the additional jumper causes a wakeup.
  8. Modify the syscfg file to use PA0 as USER_SWITCH_1
  9. Move the jumper to connect GND and PA0 instead, remove J2, but leave J10 in place once again
  10. Flash the updated firmware
  11. The MCU no longer appears to enter shutdown mode, blinking indefinitely. This happens regardless whether the jumper is in place or not. I think it is indeed entering shutdown mode, but it is waking up immediately.

From what I understand from the datasheet, both PA1 and PA0 should have wakeup support, as they are both 5V tolerant open drain IO pins. I have checked the errata sheet, as revised in April 2023, but I can't find anything relevant.

Interestingly, it does work when the pin is configured to wake on low, it works in our application code as well as the example.

We do have workarounds, but it would increase the BOM cost of the finished product.

Please find attached an archive of the modified example code, as well as the compiled binary.

How can we use the wake on high level function on the PA0 pin?

Thank you for your help!

Balint

sysctl_shutdown.zip

  • Hi Balint,

    Let me take a look.

  • HI Balint,

    I apologize for the delay in responding.  I believe I found the issue.

    The original code uses PA18 (SW1) which is pulled low through R11.  The wake logic is assigned a 1 on line 97, meaning wake when pin goes high.

    If you use PA0 or PA1, you will notice both are pulled high through two external resistors.  Unless you change the wakeup to 0 on line 97, the device will continuous wake.

    I changed wakeup to 0 and now both PA0 and PA1 work like PA18.

  • Hi Dennis, thank you for looking into this. Unfortunately, that's not quite what I am looking for. We would prefer both polarities to work, as we would like to implement a "wake on pin change" feature.

    To be able to test WAKEUP_ON_1, I jumpered the pins to GND (see steps 5 and 9) and expected the MCU to wake up when the jumper is removed (step 7 and 11). This behaviour worked on PA1, but not on PA0.

  • Hi, 

    I didn't see this wake up feature in L1306's datasheet 6.2:

    There is only PA17 and PA18 support wake from shutdown mode.

    Document: https://www.ti.com/lit/ds/slasex0d  REVISED JANUARY 2024

    Regards,

    Helic

  • Hi Helic,

    Yes, the I/O structure for those pins is listed as 5V tolerant open drain. However, 5V tolerant open drain pins are documented to support wakeup, according to Table 6-2:

    I have updated my documents.

    Thank you,

    Balint

  • Hi,

    any updates on this? I'm still convinced that I was doing my testing correctly and that these pins should support wakeup according to the datasheet. (In fact, PA1 works correctly with either polarity)

    Thank you,

    Balint

  • Hi Balint,

    Ok, I'm in the lab today working on similar issue so I'll see if I can get it to work.

  • Hi Balint,

    Here is the demo code you can refer to:

    https://tidrive.ext.ti.com/u/2JJU4JKSVPjKklT3/f24d2678-51eb-4c25-aa07-2eb710741779?l

    password:3BX8{nZQ

  • Hi Zoey,

    Thank you, that helped me figure it out.

    Your example has the wakeup enabled in the .syscfg file as well as in the source code. This causes an extra line to be emitted in SYSCFG_DL_GPIO_init:

    Fullscreen
    1
    2
    3
    DL_GPIO_initDigitalInputFeatures(GPIO_SWITCH_USER_SWITCH_1_IOMUX,
    DL_GPIO_INVERSION_DISABLE, DL_GPIO_RESISTOR_NONE,
    DL_GPIO_HYSTERESIS_DISABLE, DL_GPIO_WAKEUP_ON_1);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    This fixes my issue.

    In short the following sequence seems to be needed:

    Fullscreen
    1
    2
    3
    4
    DL_GPIO_initDigitalInputFeatures(GPIO_SWITCH_USER_SWITCH_1_IOMUX, ..., DL_GPIO_WAKEUP_ON_1); // What I was missing
    DL_SYSCTL_releaseShutdownIO();
    DL_GPIO_disableWakeUp(GPIO_SWITCH_USER_SWITCH_1_IOMUX);
    DL_GPIO_initDigitalInputFeatures(GPIO_SWITCH_USER_SWITCH_1_IOMUX, ..., DL_GPIO_WAKEUP_ON_1);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I will look into integrating this into our firmware as soon as I can.

    Thank you,

    Balint

  • Some final notes:

    Our firmware was using the following sequence, which worked with PA1, and PA17:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ENABLE);
    DL_SYSCTL_releaseShutdownIO();
    DL_GPIO_initDigitalInput(IOMUX_PINCM1);
    // bulk of the firmware
    DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1);
    DL_SYSCTL_setPowerPolicySHUTDOWN();
    __WFI();
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    This didn't work.

    The following also didn't work:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1);
    DL_SYSCTL_releaseShutdownIO();
    DL_GPIO_initDigitalInput(IOMUX_PINCM1);
    // bulk of the firmware
    DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1);
    DL_SYSCTL_setPowerPolicySHUTDOWN();
    __WFI();
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    However, the following two options did:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1);
    DL_SYSCTL_releaseShutdownIO();
    DL_GPIO_disableWakeUp(GPIO_SWITCH_USER_SWITCH_1_IOMUX);
    // bulk of the firmware
    DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1);
    DL_SYSCTL_setPowerPolicySHUTDOWN();
    __WFI();
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    To eliminate a couple of instructions:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1);
    DL_SYSCTL_releaseShutdownIO();
    DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1 & ~DL_GPIO_WAKEUP_ENABLE);
    // bulk of the firmware
    DL_GPIO_initDigitalInputFeatures(IOMUX_PINCM1, 0, 0, 0, DL_GPIO_WAKEUP_ON_1);
    DL_SYSCTL_setPowerPolicySHUTDOWN();
    __WFI();
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    This last version seems to work on PA0, PA1 and PA17.

    I'm glad that I finally have a working firmware build!

    Thank you, Balint