Power.Shutdown() fails with System.NotSupportedException on PICO

When calling Power.Shutdown(true, rtc.Now + TimeSpan.FromSeconds(10)); on a PICO, Shutdown always fails with System.NotSupportedException.

Seems to be related to use of the WKUP pin. If Power.Shutdown() is called with wkupPIN=false, then Shutdown works.

Here’s some example code to demonstrate the problem.
Not using PA0 (WKUP) anywhere in example code.
Using Firmware on a PICO.

namespace Pico_Shutdown_Fails
    internal class Program
        static GpioPin _Button;
        static GpioPin _Blue_LED;
        static RtcController rtc;

        static void Main()

            rtc = RtcController.GetDefault();
            rtc.Now = new DateTime(2023, 4, 12);

            _Button = GpioController.GetDefault().OpenPin(SC13048.GpioPin.PC13);
            _Blue_LED = GpioController.GetDefault().OpenPin(SC13048.GpioPin.PA8);

            while (_Button.Read() != GpioPinValue.Low)

            // ALWAYS fails with System.NotSupportedException when wkupPin=true
            Power.Shutdown(true, rtc.Now + TimeSpan.FromSeconds(10));

You need to set Wakeup edge.

SC13xxx does support Rising only. You need to add the code as below:

Power.WakeupEdge = WakeupEdge.Rising;

Power.Shutdown(true, rtc.Now + TimeSpan.FromSeconds(10));

Ah ha ! Thanks for the quick response.

I guess I missed that SC13048 needed that option set in the documentation.

Works perfect now.

1 Like