Evite usar FATFS porque de alguna manera (¿problemas con el núcleo?) Está bien usar solo con 512KB . Utilice el mejor LittleFS , donde puede seleccionar el tamaño de 64 kb a 512kb.
Esta biblioteca es solo un simple envoltorio LittleFS para facilitar su uso de LittleFS para el flash a bordo en las tablas basadas en MBed NRF52840 como Nano_33_BLE, Nano_33_BLE_Sense , usando Arduino-Mbed MBed_nano Core
El acceso del sistema de archivos utiliza API POSIX normales o API del sistema de archivos MBed
mbed Seeeduino Arduino IDE 1.8.19+ para Arduino.Arduino mbed_nano core 3.4.1+ para Arduino (use el Administrador de tableros de Arduino) MBed Boards basados en NRF52840 como Nano_33_BLE, Nano_33_BLE_Sense .Seeeduino mbed core 2.7.2+ para los tableros basados en Seeeduino NRF52840 como Seeed_Xiao_Nrf52840 y Seeed_Xiao_Nrf52840_Sense La mejor y más fácil forma es usar Arduino Library Manager . Busque fs_nano33ble , luego seleccione / instale la última versión. También puede usar este enlace para instrucciones más detalladas.
Otra forma de instalar es:
FS_Nano33BLE-main.zip .FS_Nano33BLE-mainFS_Nano33BLE-main al directorio de las bibliotecas de Arduino, como ~/Arduino/libraries/ .Fs_nano33ble/ejemplos/fs_test/fs_test.ino
Líneas 11 a 371 en AC168D3
La siguiente es la salida del terminal de muestra cuando se ejecuta el ejemplo FS_COUNTING en MBED nano_33_ble usando LittleFS
Start FS_Test on Nano 33 BLE
LittleFS_Nano33BLE v1 .2.1
FS_size (KB) = 256
FS_ Start Address = 0xC0000
[FS] LittleFS size (KB) = 256
[LFS] LittleFS Mount OK
Deleting file: /littlefs/counts.txt => OK
Times have been run = 1
=> Open to write OK
Start FS_Test on Nano 33 BLE
LittleFS_Nano33BLE v1.2.1
[LFS] LittleFS size (KB) = 256
[LFS] LittleFS Mount OK
=> Open to read OK
Times have been run = 2
=> Open to write OK
Start FS_Test on Nano 33 BLE
LittleFS_Nano33BLE v1.2.1
[LFS] LittleFS size (KB) = 256
[LFS] LittleFS Mount OK
=> Open to read OK
Times have been run = 3
=> Open to write OKLa siguiente es la salida del terminal de muestra cuando se ejecuta el ejemplo FS_TEST en mBed nano_33_ble usando littlefs
Start FS_Test on Nano 33 BLE
LittleFS_Nano33BLE v1 .2.1
FS_size (KB) = 256
FS_ Start Address = 0xC0000
[FS] LittleFS size (KB) = 256
[LFS] LittleFS Mount Fail
[LFS] Formatting...
[LFS]
FS Format OK. Mounting
====================================================
Writing file: /fs/hello1.txt => Open OK
* Writing OK
====================================================
Reading file: /fs/hello1.txt => Open OK
Hello from Nano_33_BLE
====================================================
Appending file: /fs/hello1.txt => Open OK
* Appending OK
====================================================
Reading file: /fs/hello1.txt => Open OK
Hello from Nano_33_BLE
Hello from Nano_33_BLE
====================================================
Renaming file: /fs/hello1.txt to: /fs/hello2.txt => OK
====================================================
readCharsFromFile: /fs/hello2.txt => Open OK
Hello from Nano_33_BLE
Hello from Nano_33_BLE
====================================================
Deleting file: /fs/hello2.txt => OK
====================================================
Reading file: /fs/hello2.txt => Open Failed
====================================================
Testing file I/O with: /fs/hello1.txt => Open OK
- writing
64 Kbytes written in (ms) 2461
====================================================
- reading
64 Kbytes read in (ms) 7
====================================================
Testing file I/O with: /fs/hello2.txt => Open OK
- writing
64 Kbytes written in (ms) 2460
====================================================
- reading
64 Kbytes read in (ms) 7
====================================================
Deleting file: /fs/hello1.txt => OK
====================================================
Deleting file: /fs/hello2.txt => OK
====================================================
Test completeLa siguiente es la salida del terminal de muestra cuando se ejecuta el ejemplo FS_TEST en mBed nano_33_ble usando FATFS
Start FS_Test on Nano 33 BLE
FATFS_Nano33BLE v1 .2.1
FS_size (KB) = 512
FS_ Start Address = 0x80000
[FS] LittleFS size (KB) = 512
[LFS] FATFS Mount OK
====================================================
Writing file: /fs/hello1.txt => Open OK
* Writing OK
====================================================
Reading file: /fs/hello1.txt => Open OK
Hello from Nano_33_BLE
====================================================
Appending file: /fs/hello1.txt => Open OK
* Appending OK
====================================================
Reading file: /fs/hello1.txt => Open OK
Hello from Nano_33_BLE
Hello from Nano_33_BLE
====================================================
Renaming file: /fs/hello1.txt to: /fs/hello2.txt => OK
====================================================
readCharsFromFile: /fs/hello2.txt => Open OK
Hello from Nano_33_BLE
Hello from Nano_33_BLE
====================================================
Deleting file: /fs/hello2.txt => OK
====================================================
Reading file: /fs/hello2.txt => Open Failed
====================================================
Testing file I/O with: /fs/hello1.txt => Open OK
- writing
64 Kbytes written in (ms) 4374
====================================================
- reading
64 Kbytes read in (ms) 15
====================================================
Testing file I/O with: /fs/hello2.txt => Open OK
- writing
64 Kbytes written in (ms) 4374
====================================================
- reading
64 Kbytes read in (ms) 15
====================================================
Deleting file: /fs/hello1.txt => OK
====================================================
Deleting file: /fs/hello2.txt => OK
====================================================
Test completeLa depuración está habilitada de forma predeterminada en Serial.
También puede cambiar el nivel de depuración ( FS_Loglevel ) de 0 a 4
# define FS_DEBUG_OUTPUT Serial
// These define's must be placed at the beginning before #include "FS_Nano33BLE.h"
// _FS_LOGLEVEL_ from 0 to 4
# define _FS_LOGLEVEL_ 0Si recibe errores de compilación, la mayoría de las veces, es posible que deba instalar una versión más nueva del núcleo para las tablas Arduino.
A veces, la biblioteca solo funcionará si actualiza el núcleo del tablero a la última versión porque estoy usando funciones recientemente agregadas.
Enviar problemas a: fs_nano33ble temas
multiple-definitionsNANO33BLE_FS_START para LittleFS sin desperdiciar espacio flash. Verifique la mitad del tamaño de Flash #2mbed de Seeeduinoallman Style. Restile la biblioteca_FS_LOGLEVEL_ > 3Muchas gracias por todos por los informes de errores, una nueva función que sugieren, pruebas y contribuyen al desarrollo de esta biblioteca.
![]() Rob Probin |
Si desea contribuir a este proyecto:
Copyright (c) 2021- Khoi Hoang