Code Monkey home page Code Monkey logo

mbed-os-example-blockdevice-qspif's Introduction

Deprecation note

This repository has been deprecated and is no longer maintained.

Getting Started With The mbed-os Example for the QSPI Flash Block Device

This is the mbed-os example for the QSPIFBlockDevice driver. See the qspif-blockdevice repository for more information.

This guide outlines the steps to get a QSPI NOR SFDP flash device working on an mbed OS platform.

Please install mbed CLI.

Hardware Requirements

This example can be used on an mbed-os platform with a QSPI NOR flash device connected to the QSPI pins.

This document uses DISCO_L476VG board as an example. Simply change the relevant target option (e.g. -m DISCO_L476VG) to the target matching your own.

Create the Example Application

From the command-line, import the example:

mbed import mbed-os-example-blockdevice-qspif

You should see:

[mbed] Importing program "mbed-os-example-blockdevice-qspif" from "https://github.com/ARMmbed/mbed-os-example-blockdevice-qspif" at latest revision in the current branch
[mbed] Adding library "mbed-os" from "https://github.com/ARMmbed/mbed-os" at rev #revision

Move into the newly created directory:

cd mbed-os-example-blockdevice-qspif

If the mbed-os library was not automatically added (see trace above), do the following to import mbed-os:

mbed new .

Build the Example

Invoke mbed compile, and specify the name of your platform and your favorite toolchain (GCC_ARM, ARM, IAR). For example, for the GCC_ARM toolchain:

mbed compile -m DISCO_L476VG -t GCC_ARM

Your PC may take a few minutes to compile your code. At the end, you see the following result:

[snip]
+--------------------------+-------+-------+-------+
| Module                   | .text | .data |  .bss |
+--------------------------+-------+-------+-------+
| Fill                     |   149 |     4 |    21 |
| misc                     |   208 |    12 |    28 |
| drivers                  |  1234 |     4 |   144 |
| features                 |    14 |     4 |     0 |
| hal                      |  1707 |     4 |    68 |
| platform                 |  2654 |   256 |   133 |
| rtos                     |  9495 |   168 |  6073 |
| QSPIFBlockDevice.o       |  3117 |     0 |    40 |
| targets                  | 13124 |     8 |   848 |
| Subtotals                | 54840 |  2256 | 10320 |
+--------------------------+-------+-------+-------+
Total Static RAM memory (data + bss): 10704 bytes
Total Flash memory (text + data): 63246 bytes

Image: ./BUILD/DISCO_L476VG/GCC_ARM/mbed-os-example-blockdevice-qspif.bin

Run the Example Binary on the DISCO_L476VG

Copy the binary from <root_dir>/mbed-os-example-blockdevice-qspif/BUILD/DISCO_L476VG/GCC_ARM/mbed-os-example-blockdevice-qspif.bin to the DISCO_L476VG:

  1. Connect your mbed device to the computer over USB.
  2. Copy the binary file to the mbed device.
  3. Press the reset button to start the program.
  4. Open the UART of the board in your favorite UART viewing program. For example, screen /dev/ttyACM0.

After connecting a serial console and resetting the target, the following trace should be seen:

QSPI SFDP Flash Block Device example
QSPIF BD size: 16777216
QSPIF BD read size: 1
QSPIF BD program size: 1
QSPIF BD erase size (at address 0): 4096
Hello World!

Troubleshooting

  1. Make sure mbed-cli is working correctly and its version is newer than 1.0.0.
mbed --version

If not, update it:

pip install mbed-cli --upgrade

mbed-os-example-blockdevice-qspif's People

Contributors

0xc0170 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ldong-arm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.