Page 1 of 1

WeActSTM32F411CEU6 filesystem corruption

Posted: Mon Jul 13, 2020 12:49 am
by davef
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

Re: WeActSTM32F411CEU6 filesystem corruption

Posted: Mon Jul 13, 2020 2:47 am
by jimmo
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?)

Re: WeActSTM32F411CEU6 filesystem corruption

Posted: Mon Jul 13, 2020 4:01 am
by davef
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

Re: WeActSTM32F411CEU6 filesystem corruption

Posted: Mon Jul 13, 2020 5:53 pm
by dhylands
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).

Re: WeActSTM32F411CEU6 filesystem corruption

Posted: Wed Jul 15, 2020 10:32 am
by davef
Hi Dave,

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