Sleep wake-up by UART issue on electron

Hi

I have an issue with the SystemSleepMode::STOP and wake-up on usart and duration with an electron. When the electron is woken up by UART the second character when reading from UART is missing. So when sending ‘12345’ from a terminal to wake-up the electron, then my firmware on the electron receives ‘1345’!

SystemSleepConfiguration config;
config
   .mode(SystemSleepMode::STOP)
   .duration(10s)
   .usart(Serial1);
auto result = System.sleep(config);

This only happens when both are set as wake-up usart and duration. When only usart is used all characters are received.

SystemSleepConfiguration config;
config
   .mode(SystemSleepMode::STOP)
   .usart(Serial1);
auto result = System.sleep(config);

The GitHub - bittailor/Particle-UartWakeupIssue contains a full example that reproduces the issue. There is also a small node.js test script to send strings/commands to the electron and compare what it receives.

I tried it with DeviceOS versions 3.3.1, 3.30, 2.3.1, the issue is always the same.

Is this a known issue?
Or is it not possible to use usart and duration togther as wake-up trigger?
Or is there another issue with my code?

Thanks for any advice.

Regrads Franz

Example output of the test program that shows the issue.

$> npm test        

> uart-wakeup-issue-test@1.0.0 test
> node test.js

** Send first two commands
send> 12345
send> 98765
uart> 0000001648 [app] INFO: Uart cli handle command => '1345'
recv> 1345
uart> 0000001648 [app] INFO: Uart cli handle command => '98765'
recv> 98765
** Wait until asleep again
uart> 0000006648 [app] INFO: Go to sleep [2]
** Send second two commands
send> HelloWorld
send> GoodBye
uart> 0000006663 [app] INFO: Uart cli handle command => 'HlloWorld'
recv> HlloWorld
uart> 0000006666 [app] INFO: Uart cli handle command => 'GoodBye'
recv> GoodBye


Missmatch on 0:
  send:  12345
  recv:  1345
Missmatch on 2:
  send:  HelloWorld
  recv:  HlloWorld

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.