← index #18960PR #7133
Related · high · value 3.369
QUERY · ISSUE

OpenMV Feature: RTC.memory()

openby kwagyemanopened 2026-03-21updated 2026-03-21
enhancement

Description

RTC.memory() working for the STM32, MIMXRT, and Alif on the machine module.

Also, standardize the RTC API on these ports. They all implement the machine API in somewhat different ways.

Code Size

No response

Implementation

I hope the MicroPython maintainers or community will implement this feature

Code of Conduct

Yes, I agree

CANDIDATE · PULL REQUEST

esp32/machine_rtc: ESP32 machine.RTC().usermem() returning a bytearray.

openby karfasopened 2021-04-19updated 2024-03-07
port-esp32

Returns a bytearray referencing the user memory area of an ESP32 RTC.

This somewhat overlaps with RTC().memory(), but allows to address the entire user memory (e.g. using the uctypes functions) without knowing the exact address of the user memory area.

I would have preferred to create an attribute/property (e.g. RTC().usermem) for this, but that is way too complicated in the C API.

Previous:

mem = uctypes.bytearray_at(0x50000200, 2048) # user needs to know address + size
uctypes.addressof(RTC().memory())                     # address completely unrelated to RTC memory

Afterwards:

mem = machine.RTC().usermem()     # no need to consult source and linker map
addr = uctypes.addressof(mem)         # REAL address of RTC memory

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied