STM32F767 partition too small

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
User avatar
untitled
Posts: 24
Joined: Sat Nov 02, 2019 1:44 pm

STM32F767 partition too small

Post by untitled » Fri Aug 14, 2020 4:26 pm

I am using NUCLEO-F767ZI board which I was able to flash with Micropython successfully.
This board has 2 USB ports: one on st-link side and one on the opposite side.
When I connect USB on st-link side, partition named NODE_F767ZI gets mounted on my computer and it contains DETAILS.TXT and MBED.HTML files.
When I connect USB on the other side, PYBFLASH partition is mounted and it contains my .py files.

The problem is that PYBFLASH is only 81 KB size and I can not fit my code here. NODE_F767ZI partition is 2.1 MB.

Is it possible to resize those partitions or delete NODE_F767ZI partition and use free space for PYBFLASH?

I saw that it's possible to create partitions.csv file but I have no clue what should I put here.

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

Re: STM32F767 partition too small

Post by dhylands » Fri Aug 14, 2020 5:14 pm

The usb connector on the stlink side goes to the stlink processor and NODE_F767ZI partition also comes from the stlink processor (and isn't accessible in any way from the 767.

The other usb connector goes directly to the 767. It looks like the 767 has 2 Mbytes of flash, so I think it should be possible to increase the storage. I don't know the exact details, but I'm pretty sure this has been discussed previously in the forum.

You can also use frozen modules to get your .py files compiled into the firmware rather than requiring the filesystem.

User avatar
untitled
Posts: 24
Joined: Sat Nov 02, 2019 1:44 pm

Re: STM32F767 partition too small

Post by untitled » Fri Aug 14, 2020 5:19 pm

Thanks for an answer!

What is the purpose of NODE_F767ZI partition? Can it be used for flashing?

Any hints on search keywords to increase storage? I already tried searching forum but without success.

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

Re: STM32F767 partition too small

Post by dhylands » Fri Aug 14, 2020 5:33 pm

Yeah - the NODE_F767ZI is for flashing. You copy a file (probablu .hex format but I don't recall) and it flashes the 767.

Search for flashbdev

User avatar
untitled
Posts: 24
Joined: Sat Nov 02, 2019 1:44 pm

Re: STM32F767 partition too small

Post by untitled » Fri Aug 14, 2020 5:53 pm

I guess I should modify this file:
https://github.com/micropython/micropyt ... m32f767.ld

Probably I should increase FLASH_FS but I need to lower some other value before.
Could someone help me with that?

chrismas9
Posts: 152
Joined: Wed Jun 25, 2014 10:07 am

Re: STM32F767 partition too small

Post by chrismas9 » Sat Aug 15, 2020 1:24 pm

The F4 and F7 have irregular sector sizes, starting small then going to 128 KB. Most ports only allocate 64KB cache for erase write. If you want to use all the sectors you have to find contiguous RAM for a 128KB cache which will reduce your heap.

There is provision to use the first half of the first two 128KB sectors with a 64KB cache. Have a look at the F413 port which uses this method to get 240KB filesystem.

User avatar
untitled
Posts: 24
Joined: Sat Nov 02, 2019 1:44 pm

Re: STM32F767 partition too small

Post by untitled » Sun Aug 16, 2020 9:32 pm

I tried to use the same numbers as in this post viewtopic.php?f=3&t=3702&p=22627&p22627#p22612
followed by additional lines in other files but that didn't help.

I even tried to enter lower values but i'm still getting the same partition size.

Before uploading new firmware I tried to erase with

Code: Select all

st-flash --serial /dev/tty.usbmodem14103 erase
Tried to clean build with

Code: Select all

make BOARD=NUCLEO_F767ZI clean
I did filesystem reset as per http://docs.micropython.org/en/latest/p ... boot-modes

Nothing helps so i'm still looking for help.

Post Reply