MicroPython & ULP/RTC Memory

MicroPython & ULP/RTC Memory

Big power advantages exist for using the ULP ( Ultra Low Power ) processor for regular tasks like recording a state change from a GPIO or ADC input, storing the information within the RTC memory, then waking the main CPU up when the information needs to be transmitted via Lora.

The programming of the ULP can now be done via a simple MicroPython wrapper:

github.com/ThomasWaldmann/py-esp32-ulp/

github.com/micropython/micropython/pull/3578

ULP examples
github.com/espressif/esp-iot-solution/tree/master/examples/ulp_examples

LoBo MicroPython for ESP32
github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki/rtc
github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki
adds RTC.read and RTC.write
NB: Still looking for an example of how the RTC memory can be accessed from the MicroPython code running on the main CPU.
I guess this example code is managing to access the RTC memory: github.com/ThomasWaldmann/py-esp32-ulp/blob/a19ae7b104a129fa0b3f7e228cebcf71bcebbf8c/examples/counter.py

while True:
    print(hex(mem32[ULP_MEM_BASE + load_addr] & ULP_DATA_MASK))

ULP Instructions
docs.espressif.com/projects/esp-idf/en/latest/api-guides/ulp.html
docs.espressif.com/projects/esp-idf/en/latest/api-guides/ulp_instruction_set.html

Leave a Reply

Your email address will not be published. Required fields are marked *