[nRF port] Unable to Activate the FAT File System
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
nrf/os: Fix building with MICROPY_VFS enabled.
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.