← index #18839Issue #8753
Related · high · value 2.045
QUERY · ISSUE

SEEED_XIAO_RP2350: Flash size configured as 4MB, board only has 2MB

openby mimi89999opened 2026-02-18updated 2026-02-18
bugport-rp2

Port, board and/or hardware

SEEED_XIAO_RP2350

MicroPython version

MicroPython v1.28.0-preview.175.ge154b6a8bf on 2026-02-17; Seeed XIAO RP2350 with RP2350

Reproduction

The SEEED_XIAO_RP2350 board definition appears to configure 4MB of flash, but the board only has 2MB. This causes the filesystem partition to extend beyond the physical flash boundary, risking silent data corruption due to address wrap-around.

MicroPython reports 3MB filesystem:

import rp2
f = rp2.Flash()
size = f.ioctl(4, 0) * f.ioctl(5, 0)
print(f"Flash: {size / 1024:.0f} KB")
# Flash: 3072 KB

import os
s = os.statvfs('/')
total = s[0] * s[2] / 1024
free = s[0] * s[3] / 1024
print(f"Total: {total:.1f} KB, Free: {free:.1f} KB")
# Total: 3072.0 KB, Free: 3064.0 KB

picotool info -a (in BOOTSEL mode) reports 2MB flash:

 flash size:             2048K

Seeed's product page and wiki also confirm 2MB of flash:

  • https://www.seeedstudio.com/Seeed-XIAO-RP2350-p-5944.html
  • https://wiki.seeedstudio.com/getting-started-xiao-rp2350/#specification

Expected behaviour

rp2.Flash() and os.statvfs('/') should report sizes consistent with the 2MB physical flash. The filesystem partition should not extend beyond the flash boundary.

Expected usable filesystem: ~1MB (2MB flash minus ~320KB firmware, minus alignment/overhead), not 3MB.

Observed behaviour

rp2.Flash() reports 3072 KB (3MB) of flash available for the filesystem. os.statvfs('/') confirms a 3072 KB filesystem. Both exceed the physical 2MB flash size reported by picotool and the board specifications.

Writing files that fill more than ~700KB of the filesystem would likely cause address wrap-around, silently overwriting firmware or earlier filesystem data.

Additional Information

Full picotool info -a device Information:

Device Information
 type:                   RP2350
 revision:               A2
 package:                QFN60
 chipid:                 0x20a0aaf2555c6673
 flash devinfo:          0x0c00
 current cpu:            ARM
 available cpus:         ARM, RISC-V
 default cpu:            ARM
 secure boot:            0
 debug enable:           1
 secure debug enable:    1
 boot_random:            a3fcac58:e68fafed:c6f6277e:2353da1d
 boot type:              bootsel
 last booted partition:  none
 diagnostic source:      slot 0
 last boot diagnostics:  0x00000000
 reboot param 0:         0x00000000
 reboot param 1:         0x00000000
 rom gitrev:             0x312e22fa
 flash size:             2048K

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

docs: alternative build options required for `port/rp2`

closedby r00t1900opened 2022-06-11updated 2025-11-06

description

Currently I bought an official raspberry pi pico board and a third-party pico board. One of the difference between them is the size of flash: the third-party board use an 4MB Flash instead of 2MB Flash in pi pico.

However, after I download the precompiled .u2f firmware file for pi pico and flash it to both of them, I got the same available space of filesystem:

os.statvfs('/')

Both of them output is about 1.38MB in total(calculated by blocks*bsize), as the firmware has already took about 500-600KB size for storage so the total flash size should be 2MB.

some thoughts

I guess that may be something define in the make steps. I lookup in port/rp2 and found a marco in rp2_flash.c:

#ifndef MICROPY_HW_FLASH_STORAGE_BYTES
#define MICROPY_HW_FLASH_STORAGE_BYTES (1408*1024)
#endif

And 1408KB is exactly almost equal to 1.37MB.
Is this the main reason why either W25Q16 or W25Q32 perform the same available filesystem size? I've also notice that the include part of rp2_flash.c:

...
#include "hardware/flash.h`
...

But I can not find the corresponding file hardware/flash.h.

questions

  • how to reconfigure for other flash size
    What should I do if I would like to build an alternative micropython firmware for a pico-like board? Maybe different in flash,crystal and pin layout. Where should I reconfigure before building?(mainly is the flash size)

  • how to operate more flash components
    The official pi pico is designed with flash connected to XIP via a single QSPI interface. But what should I do if I want to operate one more flash via the normal/common spi interface?(the speed is not a problem).
    I would like to storage data into different flash components, like 8 flash chips and switch them by CS signal. Can they be use as an another standalone filesystem with littlefs?
    If no, is there any spi-flash api for micropython to read/write/erase external flash component? If no, then I have to implement all basic spi-flash functions.

Thanks for reading and looking forward to your replies :)

In this case we can assume that the flash is W25QXX for getting started, while XX is range from 16 to 128.

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