- Why do we need this FS_Nano33BLE library
- Changelog
- Prerequisites
- Installation
- Examples
- Example FS_Test
- Debug Terminal Output Samples
- Debug
- Troubleshooting
- Issues
- TO DO
- DONE
- Contributions and Thanks
- Contributing
- License
- Copyright
Why do we need this FS_Nano33BLE library
Avoid using FATFS because the somehow (issue with the core ???) it's OK to use only with 512KB. Please use the better LittleFS, where you can select the size anywhere from 64KB to 512KB.
This library is just a simple LittleFS wrapper to facilitate your usage of LittleFS for the onboard flash on MBED nRF52840-based boards such as Nano_33_BLE, Nano_33_BLE_Sense, using Arduino-mbed mbed_nano core
The filesystem access uses normal POSIX APIs or mbed FileSystem APIs
- MBED nRF52840-based boards such as Nano_33_BLE, Nano_33_BLE_Sense, etc. using Arduino-mbed mbed_nano core
- Seeeduino nRF52840-based boards such as SEEED_XIAO_NRF52840 and SEEED_XIAO_NRF52840_SENSE, etc. using Seeeduino
mbedcore
Arduino IDE 1.8.19+for Arduino.Arduino mbed_nano core 3.4.1+for Arduino (Use Arduino Board Manager) MBED nRF52840-based boards such as Nano_33_BLE, Nano_33_BLE_Sense.Seeeduino mbed core 2.7.2+for Seeeduino nRF52840-based boards such as SEEED_XIAO_NRF52840 and SEEED_XIAO_NRF52840_SENSE
The best and easiest way is to use Arduino Library Manager. Search for FS_Nano33BLE, then select / install the latest version.
You can also use this link for more detailed instructions.
Another way to install is to:
- Navigate to FS_Nano33BLE page.
- Download the latest release
FS_Nano33BLE-main.zip. - Extract the zip file to
FS_Nano33BLE-maindirectory - Copy whole
FS_Nano33BLE-mainfolder to Arduino libraries' directory such as~/Arduino/libraries/.
- Install VS Code
- Install PlatformIO
- Install FS_Nano33BLE library by using Library Manager. Search for FS_Nano33BLE in Platform.io Author's Libraries
- Use included platformio.ini file from examples to ensure that all dependent libraries will installed automatically. Please visit documentation for the other options and examples at Project Configuration File
Example FS_Test
FS_Nano33BLE/examples/FS_Test/FS_Test.ino
Lines 11 to 371 in ac168d3
The following is the sample terminal output when running example FS_Counting on MBED Nano_33_BLE using 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 OKThe following is the sample terminal output when running example FS_Test on MBED Nano_33_BLE using 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 completeThe following is the sample terminal output when running example FS_Test on MBED Nano_33_BLE using 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 completeDebug is enabled by default on Serial.
You can also change the debugging level (FS_LOGLEVEL) from 0 to 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_ 0If you get compilation errors, more often than not, you may need to install a newer version of the core for Arduino boards.
Sometimes, the library will only work if you update the board core to the latest version because I am using newly added functions.
Submit issues to: FS_Nano33BLE issues
- Search for bug and improvement.
- Basic LittleFS wrapper for MBED nRF52840-based boards such as Nano_33_BLE, Nano_33_BLE_Sense, using Arduino-mbed mbed_nano core
- Add Version String
- Add Table of Contents
- Fix
multiple-definitionslinker error - Use correct
NANO33BLE_FS_STARTaddress forLittleFSwithout wasting flash space. Check Half size of flash #2 - Add support to Seeeduino nRF52840-based boards such as SEEED_XIAO_NRF52840 and SEEED_XIAO_NRF52840_SENSE, etc. using Seeeduino
mbedcore - Add astyle using
allmanstyle. Restyle the library - Display compile warning only when
_FS_LOGLEVEL_ > 3
Many thanks for everyone for bug reporting, new feature suggesting, testing and contributing to the development of this library.
- Thanks to Rob Probin to report issue Half size of flash #2 leading to v1.2.0
![]() Rob Probin |
If you want to contribute to this project:
- Report bugs and errors
- Ask for enhancements
- Create issues and pull requests
- Tell other people about this library
- The library is licensed under GPLv3
Copyright (c) 2021- Khoi Hoang

