WeActSTM32F411CEU6 filesystem corruption

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
davef
Posts: 93
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

WeActSTM32F411CEU6 filesystem corruption

Post by davef » Mon Jul 13, 2020 12:49 am

Thought I'd try pyboard.py and making a small filesystem:

Code: Select all

import os

p2 = pyb.Flash(start=1*1024)
os.VfsFat.mkfs(p2)
os.mount(p2, '/data')
os.chdir('/data')
When I plugged the board back in all I see is a small 60K filesystem with two odd file names in it, both containing the above script.

Doing:

Code: Select all

sudo make BOARD=WEACT_F411CEU6 deploy
to my surprise did not revert to my previously working system.

I think my mistake was to only use part of a script under Hybrid STM32 in the filesystem docs ... and incorrectly set the start position. I can get rid of the two files and the folder, but after another deploy there is now another empty directory and no expected folder called WEACT411CE

How do I re-claim my little dev board?

Thanks,
Dave
Last edited by davef on Mon Jul 13, 2020 2:52 am, edited 1 time in total.

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

Re: WeActSTM32F411CEU6 filesystem corruption

Post by jimmo » Mon Jul 13, 2020 2:47 am

davef wrote:
Mon Jul 13, 2020 12:49 am
How do I re-claim my little dev board?
I think the situation you're in is that you have two filesystems that overlap (the original one, and the new one that starts at a different location).

The firmware update only writes to the region of flash that contains the code, but you can do a full "mass erase" (pydfu.py -m) first. (Or whichever other tool you're using, e.g. st-flash).

The issue here is that for historical reasons, the pyb.Flash class is a bit surprising in the way that it fakes the partition table for USB MSC. See this note here: https://docs.micropython.org/en/latest/ ... 32-pyboard

If you follow the full "hybrid" instructions (especially after a mass-erase) then it should be possible to create two partitions (I assume that's what you're aiming to do?)

davef
Posts: 93
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: WeActSTM32F411CEU6 filesystem corruption

Post by davef » Mon Jul 13, 2020 4:01 am

Hi jimmo,

Thank you very much. When I tried the full Hybrid STM32 snippet I had an error. Now that I know how to re-claim the board I'll try again.

Cheers,
Dave

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

Re: WeActSTM32F411CEU6 filesystem corruption

Post by dhylands » Mon Jul 13, 2020 5:53 pm

Also keep in mind that the STM32F411CEU6 only has 512K of flash.

The default firmware and filesystem take up 376K

Due to the way the flash is laid out, this means that the only available flash block is a 128K one that starts at the 384K mark. Due to RAM memory constraints you can only use 64K of any flash block, and I'm not sure that you can create a FAT filesystem with only a single flash block (but I'm not sure).

davef
Posts: 93
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: WeActSTM32F411CEU6 filesystem corruption

Post by davef » Wed Jul 15, 2020 10:32 am

Hi Dave,

As I have some SPI flash coming I put the filesystem exercise "on-hold". Thanks for explaining some of the possible constraints.

Post Reply