-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
ports/mimxrt: Add support for RTC Alarm/Wakeup and Deepsleep. #12287
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
Conversation
ad85470
to
465ce5d
Compare
465ce5d
to
cb8a347
Compare
Deepsleep works. That's fine. There is some strange effect: Before deepsleep, the current consumption at a Teensy 4.1 is 71 mA. After waking up from deepsleep, it is 102 mA. Similar to the state after firmware update, where the board boots into a 102mA state as well. Calling machine.reset() at a 71mA state does not change the current consumption. |
I have no idea, it doesn't seem like we're enabling anything after wakeup. Any suggested fixes ? |
I do not know what causes this power consumption increase. It is not affected by machine.reset(). Clearing it requires a power cycle. And it does not happen always, as I noticed just now! So it maybe a hardware issue, like a latch-up. |
cb8a347
to
49b46a9
Compare
@robert-hh - Not sure why the current would have increased. We don't have that issue on our boards. I don't see any major differences between us and the Teensy power system. |
I raised a issue about that #10578 and made a PR #10607, which is held for further consideration about a common API. So a RTC alarm can fit into these plans, but hopefully be merged before. |
@robert-hh Speaking of |
There is a machine.LED class at mimxrt boards, and machine.Signal. Or do you think of something different. |
Yes I was thinking if something like that can be moved to extmod and shared with other ports, right now I extend class LED:
def __init__(self, pin_name):
self.pin = Pin(pin_name, Pin.OUT)
board = self.boardname()
if board in []: # All boards have inverted LEDs, add ones that don't here.
self.inverted = False
else:
self.inverted = True
def on(self):
self.pin(int(not self.inverted))
# And so on...
..... Then lets me support boards with/without inverted LEDs, and it will have to do until there's an upstream |
I never actually tested it before, I used machine.Pin and they worked fine on our board. |
But what is the difference then to the Signal class, which as well allows to declare it as inverted. |
You don't know if the pins are inverted or not unless you know which board the code is running on by checking os.uname or platform etc.. which makes writing a simple blinky that works on all boards more complex than it needs to be, and then this code has to be in every example that uses an LED. |
For machine.LED the pins are defined in a way, that led.on() and led.off() work as expected. But there is only one definition for all pins of a board. So maybe that could be improved. |
Yes that's why it's better than |
0991940
to
046b66c
Compare
Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
Following the documented Python machine.RTC API. Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
046b66c
to
e784714
Compare
Thanks for updating. Now merged. |
These changes still build on all MCUs, but was only tested on 1060.