microcontroller.py:162 returns 1024 from __len__: false on the ATtiny85 (512 B) and the ATmega2560 (4096 B). CHANGELOG.md:6-9 promises nvm[0:4] works while microcontroller.py:152-154 says slice access is not available.
What to do
Expose the EEPROM size in pymcu.chips and read it: about 10 lines plus one entry per chip. storage and os are not addressable, there is no filesystem; document that rather than leave them silently absent.
From the read-only audit of the layer against CircuitPython (2026-09-14), Uno-class boards first.
Fixed (nvm size); storage and os are not done
nvm
len(nvm) was a 1024 literal in the layer, reported on every chip. It asks the HAL now,
which knows the part: PyMCU dbe25747 adds EEPROM.size() as a compile-time constant.
| part |
before |
after |
| ATmega328P |
1024 |
1024 |
| ATtiny85 |
1024 |
512 |
| ATtiny13 |
1024 |
64 |
| ATmega2560 |
1024 |
4096 |
A program that trusted the old number wrote past the end of an ATtiny85's EEPROM and used a
quarter of an ATmega2560's. Measured on an Arduino Uno in pymcu-avr e923c80; the other
sizes are the parts' datasheets.
pymcu-circuitpython c45b70e, with a test that patches the HAL's answer and checks the layer
reports it rather than its own number.
Still open
storage and os have no filesystem to stand on, which is the other half of this issue and
is untouched. A filesystem needs a block device and a directory structure, and there is
neither; the honest shapes are either a refusal that names nvm and the EEPROM, or a real
read-only image in flash. That is a design decision, not a fix.
microcontroller.py:162returns 1024 from__len__: false on the ATtiny85 (512 B) and the ATmega2560 (4096 B).CHANGELOG.md:6-9promisesnvm[0:4]works whilemicrocontroller.py:152-154says slice access is not available.What to do
Expose the EEPROM size in
pymcu.chipsand read it: about 10 lines plus one entry per chip.storageandosare not addressable, there is no filesystem; document that rather than leave them silently absent.From the read-only audit of the layer against CircuitPython (2026-09-14), Uno-class boards first.
Fixed (nvm size); storage and os are not done
nvm
len(nvm)was a1024literal in the layer, reported on every chip. It asks the HAL now,which knows the part: PyMCU
dbe25747addsEEPROM.size()as a compile-time constant.A program that trusted the old number wrote past the end of an ATtiny85's EEPROM and used a
quarter of an ATmega2560's. Measured on an Arduino Uno in pymcu-avr
e923c80; the othersizes are the parts' datasheets.
pymcu-circuitpython
c45b70e, with a test that patches the HAL's answer and checks the layerreports it rather than its own number.
Still open
storageandoshave no filesystem to stand on, which is the other half of this issue andis untouched. A filesystem needs a block device and a directory structure, and there is
neither; the honest shapes are either a refusal that names
nvmand the EEPROM, or a realread-only image in flash. That is a design decision, not a fix.