VF61 Suspend/Wakeup on WinCE6 MFC

Greetings,
using WinCE6 on VF61 with BSP version 1.5 I’m trying to implement a way to suspend my device until woken up by an hardware button on pin 45 and reset it when it wakes up.
I’m using the SetSystemPowerState( NULL, POWER_STATE_SUSPEND, 0 ) API to suspend it and right after that i call SetSystemPowerState( NULL, POWER_STATE_RESET, 0 ) to reset the device as soon as it wakes up from the suspended state.

I added to the registry the following:
[HKEY_LOCAL_MACHINE\System\PM\Suspend]
“WakeupSources” = “pin45t”

So now when i press a button connected on pin 45 my device should wake up.
Sometimes it works as expected:

  • Device goes in suspended state
  • Button on pin 45 is pressed
  • Device resumes, hits SetSystemPowerState( NULL, POWER_STATE_RESET, 0 ) line
  • Device resets

This is how I expect the device to behave everytime but sometimes it enters the suspended state and never wakes up. The button on pin 45 has no effect.

It’s really hard to debug what’s happening since suspend also cuts off communication with my PC.

How exactly button is connected to pin45? Do you have pull up or pull down resistor connected to pin 45? Have you tried to use “h” or “l” condition?

There is a pull-up resistor connected to pin 45.
I don’t know if it matters but this pin is also used and configured as an input gpio while the application is running. (with a long press of the button on pin 45 a prompt appears on display, the button is released and when confirmed with the touchscreen the device then goes into suspend mode)
I followed the documentation ( Suspend registry settings ) where ‘h’ and ‘l’ aren’t listed as available options for VF61 module.
Now I have tried testing with both ‘h’ and ‘l’ options but the device did not wake up at all.
I also tried with ‘r’ and the device failed to wake up 4 times out of 15, and with the ‘f’ options the device failed to wake up 5 times out of 15 (similar situations as with the ‘t’ option)

Hello @alex.tx,
any news or suggestion on how to solve this problem?

What happened with suspend/resume if you do not start your app? Does it work reliably in that case?

Can your share a schematic of your button connection?

Hello @alex.tx ,
On the colibri evaluation board 3.2 with the same button (connected the same as in our custom board) I managed to reproduce the same behaviour when pressing the button in the exact same moment as you click suspend. If done with a certain timing the system won’t wake up even if the app is not running (bare WinCE6 nk6.bin). If done, let’s say normally, the system always wakes up.
I also tried to debug via serial connection, I will attach the results and maybe this will give some insight.

Button schematics:

Debug log:
Debug wakeup on pin 45t NOT OK.txt (1.9 KB)
Debug wakeup on pin 45t OK.txt (2.8 KB)

I also tried with the Ethernet driver disabled as it’s recommended in the debug log but nothing changed.

Is it reproduceable om our latest BSP (v1.8) ?

@alex.tx I managed to upgrade to version 1.8 and I will try to test it in the next days and share the results with you, thanks

Hi @DeasLab ,

Was there something wrong with ColibriVybrid_Core_CE6.pbxml? Or anything else with BSP or Workspace 1.8?

Hi @germano.tx ,
the file wasn’t opening after extracting it from the .zip and I thought something was wrong with it. After various attempts to compile I tried to re-extract it and it worked fine. Now I managed to compile without errors

Hello @alex.tx,
I’ve been trying for some days to make our app work on BSP v1.8 but it doesn’t even work correctly, it’s just a blackscreen when I start it. I’m going back to v1.5 since it was working alright with that version and it would probably take me too much time to make it work on the new bsp.
Since this is an urgent matter, is there no way to make it work on BSP v1.5?

Unfortunately this is issue of suspend code. Between setting up suspend and turning off mmu and real suspend there are few instructions of code and if you press button exactly at that point it won’t wake up . There is no fix available for now. Could you change logic of your up to prevent double button tap?