Skip to content

mbed-nuvoton/NuMaker-mbed-ce-SPIF-FileSystem-example

 
 

Repository files navigation

Example for SPI NOR flash backed file system on Nuvoton's Mbed CE enabled boards

This is an example to demo file system backed by SPI NOR flash on Nuvoton's Mbed CE enabled boards.

Check out Mbed CE for details on Mbed OS community edition.

Support development tools

Use cmake-based build system. Check out hello world example for getting started.

⚠️ Warning

Legacy development tools below are not supported anymore.

For VS Code development or OpenOCD as upload method, install below additionally:

  • NuEclipse: Nuvoton's fork of Eclipse
  • Nuvoton forked OpenOCD: Shipped with NuEclipse installation package above. Checking openocd version openocd --version, it should fix to 0.10.022.

Developer guide

In the following, we take NuMaker-IoT-M467 board as an example for Mbed CE support.

Build the example

  1. Clone the example and navigate into it

    $ git clone https://github.com/mbed-nuvoton/NuMaker-mbed-ce-SPIF-FileSystem-example
    $ cd NuMaker-mbed-ce-SPIF-FileSystem-example
    $ git checkout -f master
    
  2. Deploy necessary libraries

    $ git submodule update --init
    

    Or for fast install:

    $ git submodule update --init --filter=blob:none
    
  3. Compile with cmake/ninja

    $ mkdir build; cd build
    $ cmake .. -GNinja -DCMAKE_BUILD_TYPE=Develop -DMBED_TARGET=NUMAKER_IOT_M467
    $ ninja
    $ cd ..
    

Flash the image

Flash by drag-n-drop built image NuMaker-mbed-ce-SPIF-FileSystem-example.bin or NuMaker-mbed-ce-SPIF-FileSystem-example.hex onto NuMaker-IoT-M467 board

Verify the result

Configure your terminal program with 115200/8-N-1, and you should see output similar to below:

--- Mbed OS filesystem example ---
Mounting the filesystem... lfs error:493: Corrupted dir pair at 0 1
lfs error:2222: Invalid superblock at 0 1
Fail :(
No filesystem found, formatting... OK
Opening "/fs/numbers.txt"... Fail :(
No file found, creating a new file... OK
Writing numbers (10/10)... OK
Seeking file... OK
Incrementing numbers (10/10)... OK
Closing "/fs/numbers.txt"... OK
Opening the root directory... OK
root directory:
    .
    ..
    numbers.txt
Closing the root directory... OK
Opening "/fs/numbers.txt"... OK
numbers:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
Closing "/fs/numbers.txt"... OK
Unmounting... OK
Mbed OS filesystem example done!

About

Example for SPI NOR flash backed file system on Nuvoton's Mbed CE enabled boards

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 86.1%
  • CMake 13.9%