From a720305437aa941a33a3327ca003c1c2c570f298 Mon Sep 17 00:00:00 2001 From: Yossi Levy Date: Thu, 6 Sep 2018 17:02:59 +0300 Subject: [PATCH 1/4] Adjustments of blockdevice example to 5.10, Removing driver libs and updating main to use SD for K64. --- dataflash-driver.lib | 1 - main.cpp | 19 ++++++++++++++----- mbed-os.lib | 2 +- sd-driver.lib | 1 - spif-driver.lib | 1 - 5 files changed, 15 insertions(+), 9 deletions(-) delete mode 100644 dataflash-driver.lib delete mode 100644 sd-driver.lib delete mode 100644 spif-driver.lib diff --git a/dataflash-driver.lib b/dataflash-driver.lib deleted file mode 100644 index e0af9eb..0000000 --- a/dataflash-driver.lib +++ /dev/null @@ -1 +0,0 @@ -https://github.com/ARMmbed/dataflash-driver/#efcb8a1a5c11225028b175b64af4149532e3ef97 diff --git a/main.cpp b/main.cpp index 6f705f5..62988a6 100644 --- a/main.cpp +++ b/main.cpp @@ -18,18 +18,27 @@ #include // 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 diff --git a/mbed-os.lib b/mbed-os.lib index f4fee62..c172d47 100644 --- a/mbed-os.lib +++ b/mbed-os.lib @@ -1 +1 @@ -https://github.com/ARMmbed/mbed-os/#0fdfcf7350896a9c0b57c4a18237677abfe25f1a +https://github.com/ARMmbed/mbed-os/#3fb5781af180c32a6062f050d59cdf93654b3e9f diff --git a/sd-driver.lib b/sd-driver.lib deleted file mode 100644 index de9855c..0000000 --- a/sd-driver.lib +++ /dev/null @@ -1 +0,0 @@ -https://github.com/ARMmbed/sd-driver/#c16fa2bf36b87e862f81e0b30dbddca1460e1084 diff --git a/spif-driver.lib b/spif-driver.lib deleted file mode 100644 index 8229592..0000000 --- a/spif-driver.lib +++ /dev/null @@ -1 +0,0 @@ -https://github.com/ARMmbed/spif-driver/#8de1c754973c2bddf4b8e858330cff8592b552e4 From 1a6bf2de3346e92510c8becdce439975041e5378 Mon Sep 17 00:00:00 2001 From: Yossi Levy Date: Thu, 6 Sep 2018 18:16:14 +0300 Subject: [PATCH 2/4] Updating the README to explain how to switch block devices --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2aa6ce8..2e99d65 100644 --- a/README.md +++ b/README.md @@ -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 `/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 `/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", @@ -186,6 +189,8 @@ pins in `/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 From 269d27d644a5ba4f99f1f9c0268021e096b272f0 Mon Sep 17 00:00:00 2001 From: Yossi Levy Date: Wed, 26 Sep 2018 15:36:28 +0300 Subject: [PATCH 3/4] updating to mbed-os 5.10.0 --- mbed-os.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mbed-os.lib b/mbed-os.lib index c172d47..9f474a3 100644 --- a/mbed-os.lib +++ b/mbed-os.lib @@ -1 +1 @@ -https://github.com/ARMmbed/mbed-os/#3fb5781af180c32a6062f050d59cdf93654b3e9f +https://github.com/ARMmbed/mbed-os/#610e35ddc6d59f153173c1e7b2748cf96d6c9bcd From c3738f630a5a48b5a77e00e5344294546a49e695 Mon Sep 17 00:00:00 2001 From: Yossi Levy Date: Wed, 26 Sep 2018 15:42:52 +0300 Subject: [PATCH 4/4] fixing travis build --- .travis.yml | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index f6b44a0..dcc3509 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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