From 7ad0af3265a163c37b9a8e36939383b2b21dc43a Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Fri, 17 Jun 2016 11:02:37 +0100 Subject: [PATCH] Enable BLE feature on NRF51 and nrf52. Update softdevice references. Add BLE and softdevice related macros. Add specific macros for NRF52_DK. --- hal/targets.json | 64 ++++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/hal/targets.json b/hal/targets.json index 4beaec92bc..e140916c4e 100644 --- a/hal/targets.json +++ b/hal/targets.json @@ -1100,7 +1100,14 @@ "inherits": ["Target"], "core": "Cortex-M0", "OVERRIDE_BOOTLOADER_FILENAME": "nrf51822_bootloader.hex", - "macros": ["NRF51", "TARGET_NRF51822"], + "macros": [ + "NRF51", + "TARGET_NRF51822", + "BLE_STACK_SUPPORT_REQD", + "SOFTDEVICE_PRESENT", + "S130", + "BLE_STACK_SUPPORT_REQD" + ], "MERGE_BOOTLOADER": false, "extra_labels": ["NORDIC", "MCU_NRF51", "MCU_NRF51822", "NRF5"], "OUTPUT_EXT": "hex", @@ -1110,29 +1117,9 @@ "MERGE_SOFT_DEVICE": true, "EXPECTED_SOFTDEVICES_WITH_OFFSETS": [ { - "boot": "s130_nrf51_1.0.0_bootloader.hex", - "name": "s130_nrf51_1.0.0_softdevice.hex", - "offset": 114688 - }, - { - "boot": "s110_nrf51822_8.0.0_bootloader.hex", - "name": "s110_nrf51822_8.0.0_softdevice.hex", - "offset": 98304 - }, - { - "boot": "s110_nrf51822_7.1.0_bootloader.hex", - "name": "s110_nrf51822_7.1.0_softdevice.hex", - "offset": 90112 - }, - { - "boot": "s110_nrf51822_7.0.0_bootloader.hex", - "name": "s110_nrf51822_7.0.0_softdevice.hex", - "offset": 90112 - }, - { - "boot": "s110_nrf51822_6.0.0_bootloader.hex", - "name": "s110_nrf51822_6.0.0_softdevice.hex", - "offset": 81920 + "boot": "", + "name": "s130_nrf51_2.0.0_softdevice.hex", + "offset": 110592 } ], "detect_code": ["1070"], @@ -1140,7 +1127,8 @@ "function": "MCU_NRF51Code.binary_hook", "toolchains": ["ARM_STD", "GCC_ARM"] }, - "program_cycle_s": 6 + "program_cycle_s": 6, + "features": ["BLE"] }, "MCU_NRF51_16K_BASE": { "inherits": ["MCU_NRF51"], @@ -1738,7 +1726,7 @@ "MCU_NRF52": { "inherits": ["Target"], "core": "Cortex-M4F", - "macros": ["NRF52", "TARGET_NRF52832"], + "macros": ["NRF52", "TARGET_NRF52832", "BLE_STACK_SUPPORT_REQD", "SOFTDEVICE_PRESENT"], "extra_labels": ["NORDIC", "MCU_NRF52", "MCU_NRF52832", "NRF5"], "OUTPUT_EXT": "hex", "is_disk_virtual": true, @@ -1758,12 +1746,34 @@ "function": "MCU_NRF51Code.binary_hook", "toolchains": ["ARM_STD", "GCC_ARM"] }, - "MERGE_BOOTLOADER": false + "MERGE_BOOTLOADER": false, + "features": ["BLE"] }, "NRF52_DK": { "supported_form_factors": ["ARDUINO"], "inherits": ["MCU_NRF52"], "progen": {"target": "nrf52-dk"}, + "macros_add": [ + "BOARD_PCA10040", + "NRF52_PAN_12", + "NRF52_PAN_15", + "NRF52_PAN_58", + "NRF52_PAN_55", + "NRF52_PAN_54", + "NRF52_PAN_31", + "NRF52_PAN_30", + "NRF52_PAN_51", + "NRF52_PAN_36", + "NRF52_PAN_53", + "S132", + "CONFIG_GPIO_AS_PINRESET", + "BLE_STACK_SUPPORT_REQD", + "SWI_DISABLE0", + "NRF52_PAN_20", + "NRF52_PAN_64", + "NRF52_PAN_62", + "NRF52_PAN_63" + ], "device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "SPI", "SPISLAVE"] } }