8000 oofats: Check on block size during mkfs is done on block numbers, rather than bytes. · Issue #4305 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content
oofats: Check on block size during mkfs is done on block numbers, rather than bytes. #4305
Closed
@hoihu

Description

@hoihu

During development of support for the FAT FS for nRF52832 I stumbled across this line
https://github.com/micropython/micropython/blob/master/lib/oofatfs/ff.c#L5144

where it indicates (in my opinion) that the minimum requirement for mkfs to work is to have at least 50 blocks (independant of the block size!).

Since the nRF52 has a flash block size of 4kB, this check always resulted in OSError 5 since the maximum allowed FS space on this system is about 100kB. I guess the check for 50 makes sense for a block size of 512 Bytes.

Settings this check to be lower worked on my system and the flash FS was then working ok. I guess I could have added a SW layer where the flash page size is independant of the FS block size ( I guess that this must have been done on the STM32 device too?) but it was the most obvious and simple solution for me.

I wonder if this a bug or if I misinterpreted something.

Thanks for any feedback

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0