Skip to content

Commit 22c694b

Browse files
Janne KiiskiläLiyouZhou
authored andcommitted
Mbed OS 5.11 and SD-Driver from within Mbed OS (ARMmbed#148)
* Basic Mbed OS 5.11 support * Take the Mbed OS SD-driver instead of ext. repo We should really start using the SD-driver INSIDE MbedOS, rather than the old legacy one we have in the external repo. Add in the "SD" component to all targets, as otherwise you can't overload it (previously the SD came in as it was directly pulled in to the repo via the sd-driver.lib). Now it is an Mbed OS component. * Add SD component from mbed-os * Update all config files with SD component addition and disabling mbed fault handler * Add KW24D pin mappings for SD-card These seem to be missing, adding them. They are listed (with slightly varying terms) in the Mbed OS board page, https://os.mbed.com/platforms/FRDM-KW24D512/ the 2nd board schema picture. https://os.mbed.com/media/uploads/Ting_Wang/frdm-kw24d512_arduino-header-pinout.jpg * Pin defines for NRF52_DK Block device config PinNames.h for NRF 52 DK says this: SPI_PSELMOSI0 = p25, SPI_PSELMISO0 = p28, SPI_PSELSS0 = p24, SPI_PSELSCK0 = p29, That's where you can hook SPI0. Board picture available in: https://os.mbed.com/platforms/Nordic-nRF52-DK/ -> https://os.mbed.com/media/uploads/andrzej_z_krakowa/nrf52_dk_pinout_armmbed_enabled_v2.png * .mbedignore -> put back FlashIAP As it is needed (ref: Russ Butler). * Nordic size reductions (drop fds.* -files) Seems we might be able to drop the fds* files from the binary to make them a lot smaller. Didn't test these (no board), so while waiting for a better solution - let's drop them off. * Get block devices back (.mbedignore) Too much stuff being removed, there will be need to have the storage things in. QSPI-driver itself then pulls in mbed_trace.h, which pulls in ns_types.h. * .mbedignore - put PSA & storage back It seems to compile now for me at least, push to CI so that runs more boards. This is just SO slow to compile on a laptop, especially on GCC_ARM. * .mbedignore update to fix nvm_ issues * Fix mbed_trace compile * Point to released tag mbed-os 5.11.0
1 parent c3498ea commit 22c694b

11 files changed

+75
-29
lines changed

.mbedignore

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,20 @@ mbed-os/rtos/*
33
mbed-os/events/*
44
mbed-os/features/FEATURE_LWIP/*
55
mbed-os/features/FEATURE_BLE/*
6-
mbed-os/features/FEATURE_COMMON_PAL/mbed-client-randlib/*
7-
mbed-os/features/FEATURE_COMMON_PAL/mbed-coap/*
8-
mbed-os/features/FEATURE_COMMON_PAL/nanostack-hal-mbed-cmsis-rtos/*
9-
mbed-os/features/FEATURE_COMMON_PAL/sal-stack-nanostack-eventloop/*
10-
mbed-os/features/FEATURE_COMMON_PAL/mbed-trace/source/*
11-
mbed-os/features/FEATURE_COMMON_PAL/mbed-trace/test/*
12-
mbed-os/features/FEATURE_COMMON_PAL/nanostack-libservice/source/*
13-
mbed-os/features/FEATURE_COMMON_PAL/nanostack-libservice/test/*
14-
mbed-os/features/FEATURE_UVISOR/*
156
mbed-os/features/unsupported/*
167
mbed-os/features/cellular/*
178
mbed-os/features/lorawan/*
189
mbed-os/features/nanostack/*
1910
mbed-os/features/netsocket/*
20-
mbed-os/features/filesystem/littlefs/*
21-
mbed-os/features/filesystem/fat/*
22-
mbed-os/features/device_key/*
11+
mbed-os/components/802.15.4_RF/*
12+
mbed-os/components/storage/blockdevice/COMPONENT_SD/util/*
2313
mbed-os/components/wifi/*
24-
mbed-os/components/storage/*
14+
mbed-os/features/frameworks/mbed-trace/*
2515
mbed-os/features/frameworks/mbed-client-cli/*
16+
mbed-os/features/frameworks/mbed-client-randlib/*
17+
mbed-os/features/frameworks/nanostack-libservice/source/*
18+
mbed-os/features/nanostack/nanostack-hal-mbed-cmsis-rtos/*
19+
mbed-os/features/frameworks/mbed-coap/*
2620
mbed-os/features/lwipstack/*
2721
mbed-os/features/nfc/*
2822
mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/onboard_modem_api.c
@@ -31,10 +25,8 @@ mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/m
3125
mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/min_battery_voltage.h
3226
mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/default_wifi_interface.cpp
3327
mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.cpp
34-
mbed-os/features/frameworks/mbed-client-randlib/*
35-
mbed-os/features/frameworks/mbed-coap/*
36-
mbed-os/features/frameworks/mbed-trace/*
37-
mbed-os/features/frameworks/nanostack-libservice/*
28+
mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_11/libraries/fds/*
29+
mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/libraries/fds/*
3830
update-client-hub/source/*
3931
update-client-hub/modules/atomic-queue/*
4032
update-client-hub/modules/control-center/*

configs/nrf52_block_device_fake_rot.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,18 @@
2626
},
2727
"target_overrides": {
2828
"*": {
29-
"target.features_remove": ["LWIP", "STORAGE"],
30-
"platform.stdio-baud-rate": 115200,
31-
"platform.stdio-flush-at-exit": false,
32-
"update-client.firmware-header-version": "2"
29+
"target.features_remove" : ["LWIP", "STORAGE"],
30+
"platform.stdio-baud-rate" : 115200,
31+
"platform.stdio-flush-at-exit" : false,
32+
"update-client.firmware-header-version": "2",
33+
"target.components_add" : ["SD"],
34+
"sd.CRC_ENABLED" : 0
3335
},
3436
"NRF52_DK": {
37+
"sd.SPI_CS" : "SPI_PSELSS0",
38+
"sd.SPI_MOSI" : "SPI_PSELMOSI0",
39+
"sd.SPI_MISO" : "SPI_PSELMISO0",
40+
"sd.SPI_CLK" : "SPI_PSELSCK0",
3541
"minimal-printf.console-output" : "SWO",
3642
"target.app_offset" : "0x74000",
3743
"update-client.application-details" : "(508*1024)",

configs/test_configs/fake_rot_sd_card.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
"update-client.storage-address" : "(1024*1024*64)",
4646
"update-client.storage-size" : "(1024*1024*2)",
4747
"update-client.storage-locations": 1,
48-
"update-client.firmware-header-version": "2"
48+
"update-client.firmware-header-version": "2",
49+
"target.components_add": ["SD"],
50+
"sd.CRC_ENABLED": 0
4951
},
5052
"K64F": {
5153
"flash-start-address" : "0x0",

configs/test_configs/header_separate_after_app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
"update-client.storage-address" : "(1024*1024*64)",
4646
"update-client.storage-size" : "(1024*1024*2)",
4747
"update-client.storage-locations": 1,
48-
"update-client.firmware-header-version": "2"
48+
"update-client.firmware-header-version": "2",
49+
"sd.CRC_ENABLED": 0
4950
},
5051
"K64F": {
5152
"flash-start-address" : "0x0",

configs/test_configs/header_separate_before_app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
"update-client.storage-address" : "(1024*1024*64)",
4646
"update-client.storage-size" : "(1024*1024*2)",
4747
"update-client.storage-locations": 1,
48-
"update-client.firmware-header-version": "2"
48+
"update-client.firmware-header-version": "2",
49+
"sd.CRC_ENABLED": 0
4950
},
5051
"K64F": {
5152
"flash-start-address" : "0x0",

configs/test_configs/power_cut_test.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"update-client.storage-address": "1024*1024*64",
3434
"update-client.storage-size": "1024*1024",
3535
"update-client.storage-locations": 1,
36-
"update-client.firmware-header-version": "2"
36+
"update-client.firmware-header-version": "2",
37+
"sd.CRC_ENABLED": 0
3738
},
3839
"K64F": {
3940
"update-client.application-details": "88*1024",

fix-mbed-os-compile/mbed_trace.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// ----------------------------------------------------------------------------
2+
// Copyright 2018 ARM Ltd.
3+
//
4+
// SPDX-License-Identifier: Apache-2.0
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
// ----------------------------------------------------------------------------
18+
19+
#ifndef MBED_TRACE_H
20+
#define MBED_TRACE_H
21+
22+
// bootloader common contains a redefinition of mbed_trace functions
23+
#include "bootloader_common.h"
24+
25+
#endif

mbed-os.lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/ARMmbed/mbed-os/#610e35ddc6d59f153173c1e7b2748cf96d6c9bcd
1+
https://github.com/ARMmbed/mbed-os/#6a0a86538c0b9b2bfcc4583b1e2b7fea8f4e71e9

mbed_app.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,15 @@
4141
"target_overrides": {
4242
"*": {
4343
"target.features_remove": ["LWIP", "STORAGE"],
44+
"platform.use-mpu" : false,
4445
"platform.stdio-baud-rate" : 115200,
4546
"platform.stdio-flush-at-exit": false,
4647
"update-client.storage-address" : "(1024*1024*64)",
4748
"update-client.storage-size" : "(1024*1024*2)",
4849
"update-client.storage-locations": 1,
49-
"update-client.firmware-header-version": "2"
50+
"update-client.firmware-header-version": "2",
51+
"target.components_add": ["SD"],
52+
"sd.CRC_ENABLED": 0
5053
},
5154
"K64F": {
5255
"flash-start-address" : "0x0",
@@ -79,7 +82,11 @@
7982
"nvstore.area_2_size" : "(2*1024)",
8083
"update-client.application-details": "(MBED_CONF_APP_FLASH_START_ADDRESS+36*1024)",
8184
"application-start-address" : "(MBED_CONF_APP_FLASH_START_ADDRESS+37*1024)",
82-
"max-application-size" : "DEFAULT_MAX_APPLICATION_SIZE"
85+
"max-application-size" : "DEFAULT_MAX_APPLICATION_SIZE",
86+
"sd.SPI_CS" : "PTC4",
87+
"sd.SPI_MOSI" : "PTC6",
88+
"sd.SPI_MISO" : "PTC7",
89+
"sd.SPI_CLK" : "PTC5"
8390
},
8491
"NUCLEO_L476RG": {
8592
"flash-start-address" : "0x08000000",
@@ -193,6 +200,10 @@
193200
"update-client.storage-size" : "(1024*1024*1)",
194201
"update-client.storage-locations" : 1,
195202
"update-client.storage-page" : 1,
203+
"sd.SPI_CS" : "A0",
204+
"sd.SPI_MOSI" : "A1",
205+
"sd.SPI_MISO" : "A2",
206+
"sd.SPI_CLK" : "A3",
196207
"target.features_remove": [
197208
"CRYPTOCELL310"
198209
],

mbed_lib.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "mbed-bootloader",
3+
"target_overrides": {
4+
"*": {
5+
"target.macros_add": ["MBED_FAULT_HANDLER_DISABLED"]
6+
}
7+
}
8+
}

sd-driver.lib

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)