← index #5163PR #6377
Related · high · value 3.068
QUERY · ISSUE

[nRF port] Unable to Activate the FAT File System

openby sebi5361opened 2019-09-30updated 2019-12-06
port-nrf

I noticed that FAT file system couldn't be enabled on a nRF board as open("code.py", "wb") would fail making it impossible to create files onto the board.

Indeed, after building and flashing the firmware with the FAT file system enabled
(#define MICROPY_VFS (1) in mpconfigport.h and make SD=s132 MICROPY_FATFS=1 sd) the following error occurs:

>>> open("code.py", "wb")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 1] EPERM
CANDIDATE · PULL REQUEST

nrf/os: Fix building with MICROPY_VFS enabled.

closedby andrewleechopened 2020-08-26updated 2021-08-08
port-nrf

Building the nrf/actinius_icarus board has recently been broken due to changes in the VFS configuration. I've seen this in my ci builds as such:

micropython/ports/nrf/modules/uos/moduos.c:90: undefined reference to `disk_ioctl'
ld: /tmp/firmware.elf.GCE5h4.ltrans1.ltrans.o:(.rodata+0xdc0): undefined reference to `mp_fat_vfs_type'

#define MICROPY_VFS is disabled by default for the nrf port, however this board has it enabled explicitly.
@alextsam can you provide some more information about whether this was enabled intentionally?

The first commit here is the simplest one which #defines out fatfs dependencies from ports/nrf/modules/uos/moduos.c if MICROPY_VFS_FAT is not enabled.

Secondly, I've enabled MICROPY_VFS_FAT in mpconfigboard.h and MICROPY_FATFS in mpconfigboard.mk for actinius_icarus. @alextsam let me know if this was not desired on this board (I don't have one) and I can remove that commit again.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied