How to properly increase FLASH_FS on pyboardv11?

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
ltmerlin
Posts: 27
Joined: Fri Jun 28, 2019 12:34 pm

How to properly increase FLASH_FS on pyboardv11?

Post by ltmerlin » Fri May 22, 2020 10:17 am

Can someone point me in the right direction to increase the FLASH_FS of the pyboardv11?

If have changed the origin of the FLASH_TEXT and the corresponding LENGTHs in stm32f405.ld file:

Code: Select all

/* Specify the memory areas */
MEMORY
{
    FLASH (rx)      : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */
    FLASH_ISR (rx)  : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
    FLASH_FS (rx)   : ORIGIN = 0x08004000, LENGTH = 496K
    FLASH_TEXT (rx) : ORIGIN = 0x080A0000, LENGTH = 384K
    CCMRAM (xrw)    : ORIGIN = 0x10000000, LENGTH = 64K
    RAM (xrw)       : ORIGIN = 0x20000000, LENGTH = 128K
}
What do I have to change in the flashbdev.c file since I don't know what sector size I need to use... The original file has:

Code: Select all

#define FLASH_MEM_SEG1_NUM_BLOCKS (224) // sectors 1,2,3,4: 16k+16k+16k+64k=112k
I changed it to:

Code: Select all

#define FLASH_MEM_SEG1_NUM_BLOCKS (1248) // sectors 1,2,3,4,5,6,7,8: 16k+16k+16k+64k+128k+128k+128k+128k=624
and built it but the PYFLASH storage volume, as it appears when resetting the device after flash, still states the standard available pyboard size.

User avatar
dhylands
Posts: 3351
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: How to properly increase FLASH_FS on pyboardv11?

Post by dhylands » Fri May 22, 2020 5:18 pm

See: viewtopic.php?f=3&t=3702&p=22627&p22627#p22627

You can't just increase the filesystem size i the flash blocks aren't the right sizes.

ltmerlin
Posts: 27
Joined: Fri Jun 28, 2019 12:34 pm

Re: How to properly increase FLASH_FS on pyboardv11?

Post by ltmerlin » Sun May 24, 2020 8:55 pm

thanks, I indeed had to look at the sector sizes.

I also had to change this in the flashbdev.c:

Code: Select all

#define FLASH_MEM_SEG1_NUM_BLOCKS (992) // sectors 1,2,3,4,5,6,7: 16k+16k+16k+64k+128k+128k+128k=496k
I'm not sure why I had to double the value (here 496k) to 992 to get the right number of blocks...

Post Reply