Skip to content

Commit

Permalink
Merge pull request #13 from ARMmbed/mbed-os-5.10.0-oob
Browse files Browse the repository at this point in the history
Mbed os 5.10.0
  • Loading branch information
Yossi Levy authored Sep 26, 2018
2 parents 98a01e1 + c3738f6 commit b33c72a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 30 deletions.
27 changes: 7 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@

env:
matrix:
- TARGET=K82F
- TARGET=NRF52840_DK
- TARGET=K64F
- TARGET=UBLOX_EVK_ODIN_W2
- TARGET=NUCLEO_F429ZI

global:
- >
STATUS=$'curl -so/dev/null --user $MBED_BOT --request POST
Expand Down Expand Up @@ -53,21 +49,12 @@ install:
- python --version

script:
# Check that example compiles with spif
- mbed compile -t GCC_ARM -m $TARGET -j0

# Check that example compiles with dataflash
- sed -i 's/SPIFBlockDevice bd/DataFlashBlockDevice bd/g' main.cpp
- sed -i 's/MBED_CONF_SPIF_DRIVER/MBED_CONF_DATAFLASH/g' main.cpp
- mbed compile -t GCC_ARM -m $TARGET -j0

# Check that example compiles with sd
- sed -i 's/DataFlashBlockDevice bd/SDBlockDevice bd/g' main.cpp
- sed -i 's/MBED_CONF_DATAFLASH/MBED_CONF_SD/g' main.cpp
- mbed compile -t GCC_ARM -m $TARGET -j0
- mbed compile -t GCC_ARM -m K64F -j0

# Check that example compiles with spif
- sed -i 's/SDBlockDevice bd/SPIFBlockDevice bd/g' main.cpp
- sed -i 's/MBED_CONF_SD/MBED_CONF_SPIF_DRIVER/g' main.cpp
- mbed compile -t GCC_ARM -m $K82F -j0

# Check that example compiles with heap
- sed -i 's/SDBlockDevice bd(/HeapBlockDevice bd(1024*512, 512);/g' main.cpp
- sed -i '/MBED_CONF_SD/d' main.cpp
- mbed compile -t GCC_ARM -m $TARGET -j0

7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,15 @@ 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:
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:

```
"target_overrides": {
...
"NUCLEO_F429ZI": {
"components_add": ["SPIF"],
"SPI_MOSI": "PC_12",
"SPI_MISO": "PC_11",
"SPI_CLK": "PC_10",
Expand All @@ -186,6 +189,8 @@ pins in `<driver>/mbed_lib.json` are correct. For example, to change the pins fo
}
```

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

Mbed OS has several options for the block device:

- **SPIFBlockDevice** - Block device driver for NOR-based SPI flash devices that
Expand Down
1 change: 0 additions & 1 deletion dataflash-driver.lib

This file was deleted.

19 changes: 14 additions & 5 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,27 @@
#include <algorithm>

// Block devices
#if COMPONENT_SPIF
#include "SPIFBlockDevice.h"
#endif

#if COMPONENT_DATAFLASH
#include "DataFlashBlockDevice.h"
#endif

#if COMPONENT_SD
#include "SDBlockDevice.h"
#endif

#include "HeapBlockDevice.h"


// Physical block device, can be any device that supports the BlockDevice API
SPIFBlockDevice bd(
MBED_CONF_SPIF_DRIVER_SPI_MOSI,
MBED_CONF_SPIF_DRIVER_SPI_MISO,
MBED_CONF_SPIF_DRIVER_SPI_CLK,
MBED_CONF_SPIF_DRIVER_SPI_CS);
SDBlockDevice bd(
MBED_CONF_SD_SPI_MOSI,
MBED_CONF_SD_SPI_MISO,
MBED_CONF_SD_SPI_CLK,
MBED_CONF_SD_SPI_CS);


// Entry point for the example
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/#0fdfcf7350896a9c0b57c4a18237677abfe25f1a
https://github.com/ARMmbed/mbed-os/#610e35ddc6d59f153173c1e7b2748cf96d6c9bcd
1 change: 0 additions & 1 deletion sd-driver.lib

This file was deleted.

1 change: 0 additions & 1 deletion spif-driver.lib

This file was deleted.

0 comments on commit b33c72a

Please sign in to comment.