From 5fb5a4a4143f70749823981bbd574b8866d6703b Mon Sep 17 00:00:00 2001 From: RFulchiero Date: Tue, 19 Feb 2019 15:20:36 -0600 Subject: [PATCH] Remove ITM from NRF52_DK and DELTA_DFBM_NQ620 targets The NRF52_DK and DELTA_DFBM_NQ620 have the SWO pin (p0_18) mapped to LED2. This means that on startup LED2 turns on after the ITM is initialized which is confusing. Since most users want LED2 usage instead of SWO we remove the ITM for these targets. The nRF52 readme is updated to instruct users how to get SWO support if they need it. --- targets/TARGET_NORDIC/TARGET_NRF5x/README.md | 10 ++++++++++ targets/targets.json | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/README.md b/targets/TARGET_NORDIC/TARGET_NRF5x/README.md index bea26442f8..7e093ea90e 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/README.md +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/README.md @@ -153,6 +153,16 @@ The assert handler is defined in mbed-os/features/FEATURE_BLE/targets/TARGET_NOR * It is not possible to do an asynchronous write from flash and receive non-asynchronously at the same time since the non-asynchronous receive buffer is being used as the temporary transmission buffer. * The driver will flush the DMA buffer after a configurable timeout. During this process the UART will be halted and therefor unable to receive data. Hardware flow control should be enabled to avoid missing any data during this window. +#### Serial Wire Output (SWO) + +On the nRF52832 pin 18 (p18 or p0_18) is the SWO pin and a GPIO pin. On the nRF52_DK and DELTA_DFBM_NQ620 targets p18 is also mapped to LED2, so the ITM has been removed from these targets to avoid contention. If you need SWO capability instead of LED2, add the ITM through ```mbed_app.json```: +``` + "target_overrides": { + "*": { + "target.device_has_add": ["ITM"] + } + } +``` ## SoftDevice diff --git a/targets/targets.json b/targets/targets.json index d2db79b197..3af6147878 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -6791,7 +6791,8 @@ "device_name": "nRF52832_xxAA", "macros_add": [ "WSF_MAX_HANDLERS=10" - ] + ], + "device_has_remove": ["ITM"] }, "SDT52832B": { "inherits": ["MCU_NRF52832"], @@ -6835,7 +6836,8 @@ "supported_form_factors": ["ARDUINO"], "inherits": ["MCU_NRF52832"], "release_versions": ["5"], - "device_name": "nRF52832_xxAA" + "device_name": "nRF52832_xxAA", + "device_has_remove": ["ITM"] }, "MCU_NRF52840": { "inherits": ["Target"],