memorymap – Raw memory map access

The memorymap module allows you to read and write memory addresses in the address space seen from the processor running CircuitPython. It is usually the physical address space.

Available on these boards
  • ARAMCON Badge 2019
  • ARAMCON2 Badge
  • ATMegaZero ESP32-S2
  • Adafruit CLUE nRF52840 Express
  • Adafruit Circuit Playground Bluefruit
  • Adafruit Feather Bluefruit Sense
  • Adafruit Feather ESP32 V2
  • Adafruit Feather ESP32-S2 Reverse TFT
  • Adafruit Feather ESP32-S2 TFT
  • Adafruit Feather ESP32-S3 Reverse TFT
  • Adafruit Feather ESP32-S3 TFT
  • Adafruit Feather ESP32S2
  • Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM
  • Adafruit Feather ESP32S3 No PSRAM
  • Adafruit Feather HUZZAH32
  • Adafruit Feather nRF52840 Express
  • Adafruit FunHouse
  • Adafruit HUZZAH32 Breakout
  • Adafruit ItsyBitsy nRF52840 Express
  • Adafruit LED Glasses Driver nRF52840
  • Adafruit MagTag
  • Adafruit MatrixPortal S3
  • Adafruit Metro ESP32S2
  • Adafruit Metro ESP32S3
  • Adafruit Metro nRF52840 Express
  • Adafruit QT Py ESP32 PICO
  • Adafruit QT Py ESP32-S3 4MB Flash 2MB PSRAM
  • Adafruit QT Py ESP32-S3 no psram
  • Adafruit QT Py ESP32S2
  • Arduino Nano 33 BLE
  • Arduino Nano ESP32
  • Artisense Reference Design RD00
  • AtelierDuMaker nRF52840 Breakout
  • BLE-SS dev board Multi Sensor
  • BLING!
  • BPI-Bit-S2
  • BPI-Leaf-S3
  • BPI-PicoW-S3
  • BastBLE
  • BastWiFi
  • Bee-Data-Logger
  • Bee-Motion-S3
  • Bee-S3
  • BlizzardS3
  • BlueMicro840
  • CRCibernetica IdeaBoard
  • CrumpS2
  • Cytron Maker Feather AIoT S3
  • Deneyap Kart
  • Deneyap Kart 1A
  • Deneyap Kart 1A v2
  • Deneyap Mini
  • Deneyap Mini v2
  • ESP 12k NodeMCU
  • ESP32 Devkit V1
  • ESP32-S2-DevKitC-1-N4
  • ESP32-S2-DevKitC-1-N4R2
  • ESP32-S2-DevKitC-1-N8R2
  • ESP32-S3-Box-2.5
  • ESP32-S3-Box-Lite
  • ESP32-S3-DevKitC-1-N32R8
  • ESP32-S3-DevKitC-1-N8
  • ESP32-S3-DevKitC-1-N8R2
  • ESP32-S3-DevKitC-1-N8R8
  • ESP32-S3-DevKitM-1-N8
  • ESP32-S3-EYE
  • ESP32-S3-USB-OTG-N8
  • Electronut Labs Blip
  • Electronut Labs Papyr
  • Espressif ESP32-EYE
  • Espressif ESP32-LyraT
  • Espruino Bangle.js 2
  • FeatherS2
  • FeatherS2 Neo
  • FeatherS2 PreRelease
  • FeatherS3
  • Franzininho WIFI w/Wroom
  • Franzininho WIFI w/Wrover
  • Gravitech Cucumber M
  • Gravitech Cucumber MS
  • Gravitech Cucumber R
  • Gravitech Cucumber RS
  • HMI-DevKit-1.1
  • Hardkernel Odroid Go
  • HexKyS2
  • HiiBot BlueFi
  • IkigaiSense Vita nRF52840
  • IoTs2
  • Kaluga 1
  • LILYGO TEMBED ESP32S3
  • LILYGO TTGO T-DISPLAY v1.1
  • LILYGO TTGO T8 ESP32-S2
  • LILYGO TTGO T8 ESP32-S2 w/Display
  • LOLIN S3 16MB Flash 8MB PSRAM
  • LOLIN S3 MINI 4MB Flash 2MB PSRAM
  • Lilygo T-watch 2020 V3
  • M5Stack Atom Echo
  • M5Stack Atom Lite
  • M5Stack Atom Matrix
  • M5Stack Atom U
  • M5Stack AtomS3 Lite
  • M5Stack Core Basic
  • M5Stack Core Fire
  • M5Stack Core2
  • M5Stack Stick C
  • M5Stack Timer Camera X
  • MDBT50Q-DB-40
  • MDBT50Q-RX Dongle
  • MORPHEANS MorphESP-240
  • MagiClick S3 N4R2
  • Maker badge by Czech maker
  • MakerDiary nRF52840 MDK
  • MakerDiary nRF52840 MDK USB Dongle
  • Makerdiary M60 Keyboard
  • Makerdiary Pitaya Go
  • Makerdiary nRF52840 Connect Kit
  • Makerdiary nRF52840 M.2 Developer Kit
  • MicroDev microS2
  • MixGo CE
  • NanoS3
  • Neuron
  • Oak Dev Tech PixelWing ESP32S2
  • Open Hardware Summit 2020 Badge
  • PCA10056 nRF52840-DK
  • PCA10059 nRF52840 Dongle
  • Particle Argon
  • Particle Boron
  • Particle Xenon
  • PillBug
  • ProS3
  • S2Mini
  • S2Pico
  • SSCI ISP1807 Dev Board
  • SSCI ISP1807 Micro Board
  • Saola 1 w/Wroom
  • Saola 1 w/Wrover
  • Seeed XIAO nRF52840 Sense
  • SparkFun MicroMod nRF52840 Processor
  • SparkFun Pro nRF52840 Mini
  • TG-Watch
  • TTGO T8 ESP32-S2-WROOM
  • Targett Module Clip w/Wroom
  • Targett Module Clip w/Wrover
  • Teknikio Bluebird
  • TinkeringTech ScoutMakes Azul
  • TinyPICO
  • TinyPICO Nano
  • TinyS2
  • TinyS3
  • TinyWATCH S3
  • VCC-GND YD-ESP32-S3 (N16R8)
  • VCC-GND YD-ESP32-S3 (N8R8)
  • WarmBit BluePixel nRF52840
  • Waveshare ESP32-S2-Pico
  • Waveshare ESP32-S2-Pico-LCD
  • Waveshare ESP32-S3-Pico
  • iLabs Challenger 840
  • nanoESP32-S2 w/Wrover
  • nanoESP32-S2 w/Wroom
  • nice!nano

class memorymap.AddressRange(*, start, length)

Presents a range of addresses as a bytearray.

The addresses may access memory or memory mapped peripherals.

Some address ranges may be protected by CircuitPython to prevent errors. An exception will be raised when constructing an AddressRange for an invalid or protected address.

Multiple AddressRanges may overlap. There is no “claiming” of addresses.

Example usage on ESP32-S2:

import memorymap
rtc_slow_mem = memorymap.AddressRange(start=0x50000000, length=0x2000)
rtc_slow_mem[0:3] = b"\xcc\x10\x00"

Constructs an address range starting at start and ending at start + length. An exception will be raised if any of the addresses are invalid or protected.

__bool__() bool
__len__() int

Return the length. This is used by (len)

__getitem__(index: slice) bytearray
__getitem__(index: int) int

Returns the value(s) at the given index.

1, 2, 4 and 8 byte aligned reads will be done in one transaction. All others may use multiple transactions.

__setitem__(index: slice, value: circuitpython_typing.ReadableBuffer) None
__setitem__(index: int, value: int) None

Set the value(s) at the given index.

1, 2, 4 and 8 byte aligned writes will be done in one transaction. All others may use multiple transactions.