From 9a0fc98bdc8b4c900e4cd978b1c4132efbea289b Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 6 Sep 2018 21:49:06 +0200 Subject: [PATCH 1/3] Hotfix for PR #7778 TB_SENSE_12 would have been left behind by the changes in #7778. This commit implements the changes in mbed to allow targets to provide a default network interface for Silicon Labs targets. --- .../sal-stack-nanostack/mbed_lib.json | 3 +++ .../TARGET_SL_RAIL/NanostackRfPhyEfr32.cpp | 6 ++++++ features/netsocket/mbed_lib.json | 3 +++ targets/targets.json | 18 +++++++++++++++--- tools/test_configs/target_configs.json | 4 ++++ 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/features/nanostack/sal-stack-nanostack/mbed_lib.json b/features/nanostack/sal-stack-nanostack/mbed_lib.json index 56620466a1..b69dd1c4f1 100644 --- a/features/nanostack/sal-stack-nanostack/mbed_lib.json +++ b/features/nanostack/sal-stack-nanostack/mbed_lib.json @@ -13,6 +13,9 @@ }, "NCS36510": { "nanostack.configuration": "lowpan_router" + }, + "TB_SENSE_12": { + "nanostack.configuration": "lowpan_router" } } } diff --git a/features/nanostack/targets/TARGET_Silicon_Labs/TARGET_SL_RAIL/NanostackRfPhyEfr32.cpp b/features/nanostack/targets/TARGET_Silicon_Labs/TARGET_SL_RAIL/NanostackRfPhyEfr32.cpp index 7ada01adaa..329ccca021 100644 --- a/features/nanostack/targets/TARGET_Silicon_Labs/TARGET_SL_RAIL/NanostackRfPhyEfr32.cpp +++ b/features/nanostack/targets/TARGET_Silicon_Labs/TARGET_SL_RAIL/NanostackRfPhyEfr32.cpp @@ -1275,3 +1275,9 @@ static void radioEventHandler(RAIL_Handle_t railHandle, } while (events != 0); } + +NanostackRfPhy &NanostackRfPhy::get_default_instance() +{ + static NanostackRfPhyEfr32 rf_phy; + return rf_phy; +} diff --git a/features/netsocket/mbed_lib.json b/features/netsocket/mbed_lib.json index 5de5a8884a..3575b47ebc 100644 --- a/features/netsocket/mbed_lib.json +++ b/features/netsocket/mbed_lib.json @@ -36,6 +36,9 @@ }, "NCS36510": { "nsapi.default-mesh-type": "LOWPAN" + }, + "TB_SENSE_12": { + "nsapi.default-mesh-type": "LOWPAN" } } } diff --git a/targets/targets.json b/targets/targets.json index 30e5284fc4..1a24ac30e6 100755 --- a/targets/targets.json +++ b/targets/targets.json @@ -3443,7 +3443,7 @@ }, "EFR32MG1_BRD4150": { "inherits": ["EFR32MG1P132F256GM48"], - "device_has": ["ANALOGIN", "CRC", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LPTICKER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES", "USTICKER", "FLASH"], + "device_has": ["802_15_4_PHY", "ANALOGIN", "CRC", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LPTICKER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES", "USTICKER", "FLASH"], "forced_reset_timeout": 2, "config": { "hf_clock_src": { @@ -3482,11 +3482,14 @@ "macro_name": "EFM_BC_EN" } }, + "overrides": { + "network-default-interface-type": "MESH" + }, "public": false }, "TB_SENSE_1": { "inherits": ["EFR32MG1P233F256GM48"], - "device_has": ["ANALOGIN", "CRC", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LPTICKER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES", "USTICKER", "FLASH"], + "device_has": ["802_15_4_PHY", "ANALOGIN", "CRC", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LPTICKER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES", "USTICKER", "FLASH"], "forced_reset_timeout": 5, "config": { "hf_clock_src": { @@ -3519,6 +3522,9 @@ "value": "cmuHFRCOFreq_32M0Hz", "macro_name": "HFRCO_FREQUENCY_ENUM" } + }, + "overrides": { + "network-default-interface-type": "MESH" } }, "EFM32PG12B500F1024GL125": { @@ -3588,7 +3594,7 @@ "TB_SENSE_12": { "inherits": ["EFR32MG12P332F1024GL125"], "device_name": "EFR32MG12P332F1024GL125", - "device_has": ["ANALOGIN", "CRC", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LPTICKER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES", "USTICKER", "TRNG", "FLASH"], + "device_has": ["802_15_4_PHY", "ANALOGIN", "CRC", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LPTICKER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES", "USTICKER", "TRNG", "FLASH"], "forced_reset_timeout": 5, "config": { "hf_clock_src": { @@ -3621,6 +3627,9 @@ "value": "cmuHFRCOFreq_32M0Hz", "macro_name": "HFRCO_FREQUENCY_ENUM" } + }, + "overrides": { + "network-default-interface-type": "MESH" } }, "EFM32GG11B820F2048GL192": { @@ -3680,6 +3689,9 @@ "value": "PG13", "macro_name": "QSPI_FLASH_EN" } + }, + "overrides": { + "network-default-interface-type": "ETHERNET" } }, "WIZWIKI_W7500": { diff --git a/tools/test_configs/target_configs.json b/tools/test_configs/target_configs.json index ad294bda6f..09c22cb6e5 100644 --- a/tools/test_configs/target_configs.json +++ b/tools/test_configs/target_configs.json @@ -46,5 +46,9 @@ "KW24D": { "default_test_configuration": "NO_NETWORK", "test_configurations": ["6LOWPAN_HOST", "6LOWPAN_ROUTER", "THREAD_END_DEVICE", "THREAD_ROUTER"] + }, + "TB_SENSE_12": { + "default_test_configuration": "NO_NETWORK", + "test_configurations": ["6LOWPAN_HOST", "6LOWPAN_ROUTER", "THREAD_END_DEVICE", "THREAD_ROUTER"] } } From 736fc2a3635317f9c751262089494a04e43146b2 Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 7 Sep 2018 16:11:55 +0200 Subject: [PATCH 2/3] Supply default test config for TB_SENSE_1 as well --- tools/test_configs/target_configs.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/test_configs/target_configs.json b/tools/test_configs/target_configs.json index 09c22cb6e5..8750262cd5 100644 --- a/tools/test_configs/target_configs.json +++ b/tools/test_configs/target_configs.json @@ -50,5 +50,9 @@ "TB_SENSE_12": { "default_test_configuration": "NO_NETWORK", "test_configurations": ["6LOWPAN_HOST", "6LOWPAN_ROUTER", "THREAD_END_DEVICE", "THREAD_ROUTER"] + }, + "TB_SENSE_1": { + "default_test_configuration": "NO_NETWORK", + "test_configurations": ["6LOWPAN_HOST", "6LOWPAN_ROUTER", "THREAD_END_DEVICE", "THREAD_ROUTER"] } } From 0e7eda07492ad3cc27e3d6fc17a190898608d869 Mon Sep 17 00:00:00 2001 From: Kevin Bracey Date: Thu, 20 Sep 2018 13:19:24 +0300 Subject: [PATCH 3/3] Remove IAR assembler macros containing quotes IAR assembler 7.80 has some problems handling difficult macros, leading to immediate exit with return value -11. In particular, a URL string has been causing problems, presumably due to the "//" resembling a comment. A previous escaping workaround in 0d97803 seemed to work, but the crash has still been seen with a particular target. Previous creation of the extended command line file for the IAR assembler was stripping quotes from macros. This rendered the resulting definitions for string-containing macros incorrect, which means that we can assume no assembler code is currently relying on them. Therefore, as a precautionary measure to avoid the crash, simply remove all macros containing strings when creating them for IAR. This apparently clears the crashes seen during testing of https://github.com/ARMmbed/mbed-os/pull/8023 --- tools/toolchains/iar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/toolchains/iar.py b/tools/toolchains/iar.py index b54487869a..ecfd6c8de5 100644 --- a/tools/toolchains/iar.py +++ b/tools/toolchains/iar.py @@ -167,7 +167,7 @@ class IAR(mbedToolchain): opts = ['-D%s' % d for d in defines] if for_asm: config_macros = self.config.get_config_data_macros() - macros_cmd = ['"-D%s"' % d.replace('"', '').replace('//','/\/') for d in config_macros] + macros_cmd = ['"-D%s"' % d for d in config_macros if not '"' in d] if self.RESPONSE_FILES: via_file = self.make_option_file( macros_cmd, "asm_macros_{}.xcl")