QSPI Flash file system problem 'Not a BS' with MicroPython on STM32F722IEK6 #15799
Replies: 2 comments 4 replies
-
The code expects the Flash to be formatted as FAT file sytem and complain, that it is not. It should then format it as FAT. Maybe that failed. Maybe you could try to create the file sytem from the REPL command line. See https://docs.micropython.org/en/latest/reference/filesystem.html#fat
|
Beta Was this translation helpful? Give feedback.
-
The fault "Not a BS" in the context of the check_fs() function from the MicroPython codebase refers to an issue with the Boot Sector (BS) of the filesystem. This fault usually occurs when the memory (in this case, the QSPI flash) does not contain a valid filesystem. It could mean that the flash is unformatted or corrupted. |
Beta Was this translation helpful? Give feedback.
-
Hello, i am trying to use MicroPython on a custom hardware board based on a STM32F722IEK6 chip.
The board contains 2 external QSPI flash chips (AT25SF641B) and is programmed using a Segger j-link using j-flash.
First mboot.hex is flashed, after that micropython.hex.
When connected using PuTTY to the REPL, the messages "MPY: can't create filesystem" and "MPY: can't mount flash" are printed.
Searching in the MicroPython codebase this error is caused by function 'check_fs()' called by 'find_volume()' in \lib\oofatfs\ff.c.
This function returns the value 3 (line 3091) which indicates 'Not a BS'.
This line:
if (ld_word(fs->win + BS_55AA) != 0xAA55) return 3; /* Check boot record signature (always here regardless of the sector size) */
What does this fault 'Not a BS' mean and what causes it? Anyone can help me with this?
Further investigation revealed that MicroPython tries to create the FAT partition (MBR is signed with special code 0xAA55) . No errors are returned in the process, but when an attempt is made by MicroPython to read the FAT partition the special code 0xAA55 could not be read and 0xCCCC is returned and hence "MPY: can't create filesystem" is printed. It seems like a timeout occurs while writing data to the QSPI but this error does not always bubble up. This timeout occurs in the mp_spiflash_wait_wip0() function in spiflash.c. In this function it waits for the QSPI to become idle, but times out.
Any help is appreciated, i am still trying to find the root cause...
Beta Was this translation helpful? Give feedback.
All reactions