QUERY · ISSUE
OpenMV Feature: RTC.memory()
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.
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