I have revisited the problem with two custom SCM20260N boards and one SCM20260D Dev board with the latest firmware 2.1.0.6500. I measured the following power consumption after shutdown:
#1 SCM20260N custom board:
With enabled Extend heap: irregularly alternated value of 1 mA and 4 mA sometimes 8 mA , 16 mA
Without enabled Extend heap: always 1 mA
#2 SCM20260N custom board:
With enabled Extend heap: irregularly alternated value of 1 mA and 19 mA
Without enabled Extend heap: always 1 mA
SCM20260D Dev board with display disconnected:
With enabled Extend heap: irregularly alternated value of 34 mA and 38 mA
Without enabled Extend heap: always 34 mA
We just test again with your code, not modified. The result is always 25.5mA (powered by 3.3v) and 26.4mA (powered 5.0v) on Dev board, on two different SITCore modules, no matter enabled extend heap or not.
Actually, enabled heap or not, external / internal ram are always initialized same way and ready to use.
Problem could be voltmeter :d. We had few problems with our old voltmeter.
Also, make sure wakeup pin is not floating. With only 4 seconds timeout and this pin floating, cause system up, down, up, down …a lot and value didn’t make sense to me.
I tried again with the new FW on six custom boards with 20260N. I logged the consumption, every single one of about 1400 shutdowns ended up with 1mA consumption (without extend heap). I did the same with extend heap enabled, about half of the shutdowns ended up consuming 20mA. I tried the test with multiple meters. I added the following code to fill the whole RAM, I test anything anymore, I don’t know how the memory block startup/shutdown works. After this change, the 20mA shutdown repeated significantly more often. We have a pull-up resistor on the wake-up pin.
RtcController.GetDefault().Now = new DateTime(2021, 1, 1, 0, 0, 0);
GpioPin ledDBG = GpioController.GetDefault().OpenPin(SC20260.GpioPin.PH10);
ledDBG.SetDriveMode(GpioPinDriveMode.Output);
ledDBG.Write(GpioPinValue.High);
Thread.Sleep(1000);
Random rand = new Random();
ArrayList arrayList = new ArrayList();
while (Memory.ManagedMemory.FreeBytes > 70)
{
arrayList.Add(new byte[(int)Math.Min(Memory.ManagedMemory.FreeBytes - 70, rand.Next(1024))]);
}
Power.WakeupEdge = WakeupEdge.Falling;
DateTime wakeupTime = RtcController.GetDefault().Now.AddSeconds(4);
Power.Shutdown(true, wakeupTime);