[ADAFRUIT_F405_EXPRESS] enable (more) flash

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
CarlFK
Posts: 11
Joined: Sun Aug 16, 2020 6:18 am

[ADAFRUIT_F405_EXPRESS] enable (more) flash

Post by CarlFK » Sun Sep 13, 2020 8:54 pm

summary: how do I enable the 2mb spi?
I suspect the follow up question: will someone port CPs implementation?

I have https://learn.adafruit.com/adafruit-stm ... er-express
which says:
2 MB SPI Flash chip

if I understand my history, 2mb was added after this:
https://github.com/micropython/micropyt ... board.h#L5
#define MICROPY_HW_HAS_FLASH (1)

which I guess is relevant to why I only have 95K fs, but CP has ~2m.

I went splunking around, all I have to offer is:

https://github.com/adafruit/circuitpyth ... oard.h#L32
#define FLASH_SIZE (0x100000)

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: [ADAFRUIT_F405_EXPRESS] enable (more) flash

Post by jimmo » Mon Sep 14, 2020 11:59 pm

CarlFK wrote:
Sun Sep 13, 2020 8:54 pm
summary: how do I enable the 2mb spi?
Have a look at the STM32L476DISC board config https://github.com/micropython/micropyt ... figboard.h

In summary:
- Disable MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE
- Define MICROPY_HW_SPIFLASH_{SIZE_BITS,CS,SCK,MISO,MOSI} (looks like the pins are defined later in the file f405_express file)
- Add the block device config for SPI flash (pretty much just copy that whole block)
- Add bdev.c and board_init.c

User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: [ADAFRUIT_F405_EXPRESS] enable (more) flash

Post by mattyt » Tue Sep 15, 2020 1:40 am

...and then it'd be great if you could submit a PR to add support for this board to MicroPython! :)

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: [ADAFRUIT_F405_EXPRESS] enable (more) flash

Post by mcauser » Tue Sep 15, 2020 2:18 am

Here's how I did it on my F407ZG board:
https://github.com/mcauser/BLACK_F407ZG ... 10d08ca81e

Post Reply