Page 1 of 1

How to properly increase FLASH_FS on pyboardv11?

Posted: Fri May 22, 2020 10:17 am
by ltmerlin
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.

Re: How to properly increase FLASH_FS on pyboardv11?

Posted: Fri May 22, 2020 5:18 pm
by dhylands
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.

Re: How to properly increase FLASH_FS on pyboardv11?

Posted: Sun May 24, 2020 8:55 pm
by ltmerlin
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...