micropython / micropython

MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems
https://micropython.org
Other
19.46k stars 7.77k forks source link

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

Open r00t1900 opened 2 years ago

r00t1900 commented 2 years ago

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

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.

peterhinch commented 2 years ago

This support query should be raised in the forum rather than in this bug tracker.

Re using a set of SPI flash chips to create a filesystem see this repo.

r00t1900 commented 2 years ago

This support query should be raised in the forum rather than in this bug tracker.

Re using a set of SPI flash chips to create a filesystem see this repo.