-
Notifications
You must be signed in to change notification settings - Fork 39
[Observation] Need to manually re-enable the Serial TX and RX pins after SLEEP_DEEP with v2.1 #411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi Check the post on Fri Feb 26, 2021 1:27 pm in https://forum.sparkfun.com/viewtopic.php?f=169&t=55163. In the Sketch we turn off the power as well as disable the UART0 pins. In wakeup() it will call Serial.begin(), which will lead to an MBED call in unbufferdserial.cpp, which in turn call MBED Serialbase.cpp and from there Serial_api.c. In serial.init() function in Serial_api.c it will ONLY turn on power and set the pins if this was NOT done previous ( e.g. there is no valid handle yet.). BUT as the handle is still valid because as was never de-initialized, power and pins will not be set correctly again. example was included. regards, |
Nice one Paul - thank you - I'd missed that discussion. |
Hi Paul (@paulvha ), |
with respect to serial. Calling Serial.end(); will lead to Hardwareserial.cpp. However, this function is currently empty and does nothing. I wrote the feedback based on V 2.0 , now looking at the code (V2.10), it seems the RX and TX pins are set, whether there is a handle or not, but it will not restore the power, reset buffer pointers etc etc. Need to look to Wire/IOM.. regards, |
Another observation...
With v2.1 of the core, we need to manually re-enable the Serial TX and RX pins after disabling them to reduce power consumption during SLEEP_DEEP.
With v1.2 of the core, we didn't need to do this.
Steps to reproduce:
RedBoard Artemis ATP
v2.1 of the core
Run the following example:
Here is the Serial output:
Note that
micros
does not behave well after waking from SLEEP_DEEP.The reverse question marks probably are expected - caused by turning the pin off and on again, generating a spurious start bit.
If you comment the four lines which re-enable the TX and RX pins, the code stops working on v2.1:
But if you switch to v1.2.1 of the core, the code does work with those same four lines commented. I guess Serial.begin must be re-initializing the pins for us? Note micros is better behaved too...
Cheers,
Paul
The text was updated successfully, but these errors were encountered: