Skip to content

Commit

Permalink
Adding QSPIF to blockdevice examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Offir Kochalsky committed Nov 8, 2018
1 parent b33c72a commit eefcb24
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ example by changing the class declared in main.cpp.
**Note:** Most block devices require pin assignments. Double check that the
pins in `<driver>/mbed_lib.json` are correct. For example, to change the pins for the SD driver, open `sd-driver/config/mbed_lib.json`, and change your target platform to the correct pin-out in the `target_overrides` configuration.

Starting mbed-os 5.10 the SD, SPIF and DATAFLASH block devices are components under mbed-os. In order to add a component to the application use the "components_add" `target_overrides` configuration:
Starting mbed-os 5.10 the SD, SPIF, DATAFLASH and QSPIF block devices are components under mbed-os. In order to add a component to the application use the "components_add" `target_overrides` configuration:

```
"target_overrides": {
Expand All @@ -189,7 +189,7 @@ Starting mbed-os 5.10 the SD, SPIF and DATAFLASH block devices are components un
}
```

The components_add param can be "SPIF", "SD" or "DATAFLASH" depends on the block devices you need.
The components_add param can be "SPIF", "SD" , "DATAFLASH" or "QSPIF" depends on the block devices you need.

Mbed OS has several options for the block device:

Expand All @@ -206,6 +206,21 @@ Mbed OS has several options for the block device:
MBED_CONF_SPIF_DRIVER_SPI_CS);
```
- **QSPIFBlockDevice** - Block device driver for NOR-based Quad SPI flash devices that
support SFDP, with QUAD SPI bus support for 4 bits per cycle (4 times the speed of standard SPI)
``` cpp
QSPIFBlockDevice bd(
QSPI_FLASH1_IO0,
QSPI_FLASH1_IO1,
QSPI_FLASH1_IO2,
QSPI_FLASH1_IO3,
QSPI_FLASH1_SCK,
QSPI_FLASH1_CSN,
QSPIF_POLARITY_MODE_0,
MBED_CONF_QSPIF_QSPI_FREQ);
```

- **DataFlashBlockDevice** - Block device driver for NOR-based SPI flash devices
that support the DataFlash protocol, such as the Adesto AT45DB series of
devices. DataFlash is a memory protocol that combines flash with SRAM buffers
Expand Down Expand Up @@ -294,6 +309,10 @@ control over the allocation of storage.
- NUCLEO_F429ZI + SD (requires shield)
- NUCLEO_F429ZI + SPIF (requires shield)
- NUCLEO_F429ZI + DataFlash (requires shield)
- DISCO_L475VG_IOT01A + QSPIF
- DISCO_L476VG + QSPIF
- DISCO_F413ZH + QSPIF
- DISCO_F469NI + QSPIF
\[1\]: Note: The UBLOX_EVK_ODIN_W2 SPI pins conflict with the default serial
pins. A different set of serial pins must be selected to use SPI flash with
Expand Down
6 changes: 5 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 ARM Limited
* Copyright (c) 2018 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,10 @@
#include <algorithm>

// Block devices
#if COMPONENT_QSPIF
#include "QSPIFBlockDevice.h"
#endif

#if COMPONENT_SPIF
#include "SPIFBlockDevice.h"
#endif
Expand Down
2 changes: 1 addition & 1 deletion mbed-os.lib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/ARMmbed/mbed-os/#610e35ddc6d59f153173c1e7b2748cf96d6c9bcd
https://github.com/ARMmbed/mbed-os/#5eabfabc51e10eec9a523e749ce207b74a8a5f64

0 comments on commit eefcb24

Please sign in to comment.