Closed ghost closed 2 years ago
Hi,
The default example used the generic "Serial" instance which by default is a HardwareSerial instance but when you enable the CDC then the 'Serial" instance is mapped to the USBSerial instance as stated in the error.
The library does not support wakeup for USB but form U(S)ART (when MCU has this capabilities).
So use a HardwareSerial instance as parameter of theenableWakeupFrom()
.
Then I have another question: How to organize wake-up on USB (UART) connection? If I specify the sleep mode SLEEP_MODE ( sleep ()), then when the USB is connected, the microcontroller "wakes up" and does not sleep while the USB is connected and the Port Monitor is open on the computer. If I specify the sleep mode DEEP_SLEEP_MODE ( deepSleep () ), then the microcontroller does not react to the USB connection. The microcontroller goes to sleep even if the Port Monitor is open on the computer. How to make the microcontroller wake up from USB from DEEP_SLEEP_MODE (_as with SLEEPMODE)? Will this work with RTC and LSE? Since I needed the clock source for the RTC it was LSE.
P.S. this method throws errors:
LowPower.enableWakeupFrom(&**HardwareSerial**, SerialWakeup);
D:\TEMP\arduino_modified_sketch_100407\SerialDeepSleep.ino: In function 'void setup()':
SerialDeepSleep:25:44: error: expected primary-expression before ',' token
25 | LowPower.enableWakeupFrom(&HardwareSerial, SerialWakeup);
| ^
exit status 1
expected primary-expression before ',' token
GH issue is not to request support. Use the forum instead. About your error this is normal as HardwareSerial is a class name not an object. Wake up from USB is not managed by this library, maybe you can try to use the HAL/LL to achieve this but I never tried this.
Hey! I am trying to compile the standard SerialDeepSleep example from the library and I am getting tons of errors:
What could be the problem? I am using the core: https://github.com/stm32duino/Arduino_Core_STM32 Microcontroller: STM32L152CBT6