You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/11/23 18:51:54 UTC

[31/70] [abbrv] [partial] incubator-mynewt-core git commit: Remove non-Apache-compatible Nordic SDK files.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/dfu_transport_serial.c
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/dfu_transport_serial.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/dfu_transport_serial.c
deleted file mode 100644
index b2ab3cc..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/dfu_transport_serial.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-#include "dfu_transport.h"
-#include <stddef.h>
-#include "dfu.h"
-#include <dfu_types.h>
-#include "app_error.h"
-#include "app_util.h"
-#include "hci_transport.h"
-#include "app_timer.h"
-#include "app_scheduler.h"
-
-#define MAX_BUFFERS          4u                                                      /**< Maximum number of buffers that can be received queued without being consumed. */
-
-/**
- * defgroup Data Packet Queue Access Operation Macros
- * @{
- */
-
-/** Provides status showing if the queue is full or not. */
-#define DATA_QUEUE_FULL()                                                                         \
-        (((MAX_BUFFERS -1) == m_data_queue.count) ? true : false)
-
-/** Provides status showing if the queue is empty or not */
-#define DATA_QUEUE_EMPTY()                                                                        \
-        ((0 == m_data_queue.count) ? true : false)
-
-/** Initializes an element of the data queue. */
-#define DATA_QUEUE_ELEMENT_INIT(i)                                                                \
-        m_data_queue.data_packet[(i)].packet_type = INVALID_PACKET
-
-/** Sets the packet type of an element of the data queue. */
-#define DATA_QUEUE_ELEMENT_SET_PTYPE(i, t)                                                         \
-        m_data_queue.data_packet[(i)].packet_type = (t)
-
-/** Copies a data packet pointer of an element of the data queue. */
-#define DATA_QUEUE_ELEMENT_COPY_PDATA(i, dp)                                                       \
-        m_data_queue.data_packet[(i)].params.data_packet.p_data_packet = (uint32_t *)(dp)
-
-/** Sets the packet length of an element in the data queue. */
-#define DATA_QUEUE_ELEMENT_SET_PLEN(i, l)                                                          \
-        m_data_queue.data_packet[(i)].params.data_packet.packet_length = (l)
-
-/** Gets a data packet pointer of an element in the data queue. */
-#define DATA_QUEUE_ELEMENT_GET_PDATA(i)                                                           \
-        (m_data_queue.data_packet[(i)].params.data_packet.p_data_packet)
-
-/** Gets the packet type of an element in the data queue. */
-#define DATA_QUEUE_ELEMENT_GET_PTYPE(i)                                                           \
-        m_data_queue.data_packet[(i)].packet_type
-
-/* @} */
-
-/** Abstracts data packet queue */
-typedef struct
-{
-    dfu_update_packet_t   data_packet[MAX_BUFFERS];                                  /**< Bootloader data packets used when processing data from the UART. */
-    volatile uint8_t      count;                                                     /**< Counter to maintain number of elements in the queue. */
-} dfu_data_queue_t;
-
-static dfu_data_queue_t      m_data_queue;                                           /**< Received-data packet queue. */
-
-/**@brief Initializes an element of the data buffer queue.
- *
- * @param[in] element_index index of the element.
- */
-static void data_queue_element_init (uint8_t element_index)
-{
-    DATA_QUEUE_ELEMENT_INIT(element_index);
-    DATA_QUEUE_ELEMENT_SET_PTYPE(element_index, INVALID_PACKET);
-    DATA_QUEUE_ELEMENT_COPY_PDATA(element_index, NULL);
-    DATA_QUEUE_ELEMENT_SET_PLEN(element_index, 0);
-}
-
-/** Initializes data buffer queue */
-static void data_queue_init(void)
-{
-    uint32_t index;
-
-    m_data_queue.count = 0;
-
-    for (index = 0; index < MAX_BUFFERS; index++)
-    {
-        data_queue_element_init(index);
-    }
-}
-
-/**@brief Function for freeing an element.
- *
- * @param[in] element_index index of the element.
- */
-static uint32_t data_queue_element_free(uint8_t element_index)
-{
-    uint8_t * p_data;
-    uint32_t  retval;
-
-    retval = NRF_ERROR_INVALID_PARAM;
-    
-    if (MAX_BUFFERS > element_index)
-    {
-        p_data = (uint8_t *)DATA_QUEUE_ELEMENT_GET_PDATA(element_index);
-        if (INVALID_PACKET != DATA_QUEUE_ELEMENT_GET_PTYPE(element_index))
-        {
-            m_data_queue.count--;
-            data_queue_element_init (element_index);
-            retval = hci_transport_rx_pkt_consume((p_data - 4));
-            APP_ERROR_CHECK(retval);
-        }
-    }
-    else
-    {
-        return NRF_ERROR_INVALID_PARAM;
-    }
-
-    return NRF_SUCCESS;
-}
-
-/**@brief Function for Allocating element.
- *
- * @param[in]   packet_type      packet type.
- * @param[out]  p_element_index  index of the element.
- */
-static uint32_t data_queue_element_alloc(uint8_t * p_element_index, uint8_t packet_type)
-{
-    uint32_t retval;
-    uint32_t index;
-
-    retval = NRF_ERROR_NO_MEM;
-    
-    if (INVALID_PACKET == packet_type)
-    {
-        retval = NRF_ERROR_INVALID_PARAM;
-    }
-    else if (true == DATA_QUEUE_FULL())
-    {
-        retval = NRF_ERROR_NO_MEM;
-    }
-    else
-    {
-        for (index = 0; index < MAX_BUFFERS; index++)
-        {
-            if (INVALID_PACKET == DATA_QUEUE_ELEMENT_GET_PTYPE(index))
-            {
-                // Found a free element: allocate, and end search.
-                *p_element_index = index;
-                DATA_QUEUE_ELEMENT_SET_PTYPE(index, packet_type);
-                retval = NRF_SUCCESS;
-                m_data_queue.count++;
-                break;
-            }
-        }
-    }
-
-    return retval;
-}
-
-// Flush everything on disconnect or stop.
-static void data_queue_flush(void)
-{
-    uint32_t index;
-
-    for (index = 0; index < MAX_BUFFERS; index++)
-    {
-         // In this case it does not matter if free succeeded or not as data packets are being flushed because DFU Trnsport was closed
-        (void)data_queue_element_free(index);
-    }
-}
-
-
-/**@brief       Function for handling the callback events from the dfu module.
- *              Callbacks are expected when \ref dfu_data_pkt_handle has been executed.
- *
- * @param[in]   packet  Packet type for which this callback is related. START_PACKET, DATA_PACKET.
- * @param[in]   result  Operation result code. NRF_SUCCESS when a queued operation was successful.
- * @param[in]   p_data  Pointer to the data to which the operation is related.
- */
-static void dfu_cb_handler(uint32_t packet, uint32_t result, uint8_t * p_data)
-{
-    APP_ERROR_CHECK(result);
-}
-
-
-static void process_dfu_packet(void * p_event_data, uint16_t event_size)
-{
-    uint32_t              retval;
-    uint32_t              index;
-    dfu_update_packet_t * packet;
-
-        while (false == DATA_QUEUE_EMPTY())
-        {
-            // Fetch the element to be processed.
-            for (index = 0; index < MAX_BUFFERS ; index++)
-            {
-                packet = &m_data_queue.data_packet[index];
-                if (INVALID_PACKET != packet->packet_type)
-                {
-
-                    switch (DATA_QUEUE_ELEMENT_GET_PTYPE(index))
-                    {
-                        case DATA_PACKET:
-                            (void)dfu_data_pkt_handle(packet);
-                            break;
-
-                        case START_PACKET:
-                            packet->params.start_packet = 
-                                (dfu_start_packet_t*)packet->params.data_packet.p_data_packet;
-                            retval = dfu_start_pkt_handle(packet);
-                            APP_ERROR_CHECK(retval);
-                            break;
-
-                        case INIT_PACKET:
-                            (void)dfu_init_pkt_handle(packet);
-                            retval = dfu_init_pkt_complete();
-                            APP_ERROR_CHECK(retval);
-                            break;
-
-                        case STOP_DATA_PACKET:
-                            (void)dfu_image_validate();
-                            (void)dfu_image_activate();
-
-                            // Break the loop by returning.
-                            return;
-
-                        default:
-                            // No implementation needed.
-                            break;
-                    }
-
-                    // Free the processed element.
-                    retval = data_queue_element_free(index);
-                    APP_ERROR_CHECK(retval);
-                }
-            }
-        }
-}
-
-
-void rpc_transport_event_handler(hci_transport_evt_t event)
-{
-    uint32_t  retval;
-    uint16_t  rpc_cmd_length_read = 0;
-    uint8_t * p_rpc_cmd_buffer = NULL;
-    uint8_t   element_index;
-
-    retval = hci_transport_rx_pkt_extract(&p_rpc_cmd_buffer, &rpc_cmd_length_read);
-    if (NRF_SUCCESS == retval)
-    {
-        // Verify if the data queue can buffer the packet.
-        retval = data_queue_element_alloc(&element_index, p_rpc_cmd_buffer[0]);
-        if (NRF_SUCCESS == retval)
-        {
-            //subtract 1 since we are interested in payload length and not the type field.
-            DATA_QUEUE_ELEMENT_SET_PLEN(element_index,(rpc_cmd_length_read / sizeof(uint32_t)) - 1);
-            DATA_QUEUE_ELEMENT_COPY_PDATA(element_index, &p_rpc_cmd_buffer[4]);
-            retval = app_sched_event_put(NULL, 0, process_dfu_packet);
-        }
-    }
-    
-    if (p_rpc_cmd_buffer != NULL && NRF_SUCCESS != retval)
-    {
-        // Free the packet that could not be processed.
-        retval = hci_transport_rx_pkt_consume(p_rpc_cmd_buffer);
-        APP_ERROR_CHECK(retval);
-    }
-}
-
-
-uint32_t dfu_transport_update_start(void)
-{
-    uint32_t err_code;
-
-    // Initialize data buffer queue.
-    data_queue_init();
-
-    dfu_register_callback(dfu_cb_handler);
-
-    // Open transport layer.
-    err_code = hci_transport_open();
-    APP_ERROR_CHECK(err_code);
-
-    // Register callback to be run when commands have been received by the transport layer.
-    err_code = hci_transport_evt_handler_reg(rpc_transport_event_handler);
-    APP_ERROR_CHECK(err_code);
-
-    return NRF_SUCCESS;
-}
-
-
-uint32_t dfu_transport_close(void)
-{
-    // Remove all buffered packets.
-    data_queue_flush();
-    
-    return hci_transport_close();
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/dfu_types.h
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/dfu_types.h b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/dfu_types.h
deleted file mode 100644
index 1415ee1..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/dfu_types.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-/**@file
- *
- * @defgroup nrf_dfu_types Types and definitions.
- * @{
- *
- * @ingroup nrf_dfu
- *
- * @brief Device Firmware Update module type and definitions.
- */
-
-#ifndef DFU_TYPES_H__
-#define DFU_TYPES_H__
-
-#include <stdint.h>
-#include "nrf_sdm.h"
-#include "nrf_mbr.h"
-#include "nrf.h"
-#include "app_util.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define NRF_UICR_BOOT_START_ADDRESS         (NRF_UICR_BASE + 0x14)      /**< Register where the bootloader start address is stored in the UICR register. */
-
-#if defined(NRF52)                                                  
-#define NRF_UICR_MBR_PARAMS_PAGE_ADDRESS    (NRF_UICR_BASE + 0x18)      /**< Register where the mbr params page is stored in the UICR register. (Only in use in nRF52 MBR).*/
-#endif                                                              
-
-#define CODE_REGION_1_START                 SD_SIZE_GET(MBR_SIZE)       /**< This field should correspond to the size of Code Region 0, (which is identical to Start of Code Region 1), found in UICR.CLEN0 register. This value is used for compile safety, as the linker will fail if application expands into bootloader. Runtime, the bootloader will use the value found in UICR.CLEN0. */
-#define SOFTDEVICE_REGION_START             MBR_SIZE                    /**< This field should correspond to start address of the bootloader, found in UICR.RESERVED, 0x10001014, register. This value is used for sanity check, so the bootloader will fail immediately if this value differs from runtime value. The value is used to determine max application size for updating. */
-
-#ifdef NRF51        
-
-#define CODE_PAGE_SIZE                      0x0400                      /**< Size of a flash codepage. Used for size of the reserved flash space in the bootloader region. Will be runtime checked against NRF_UICR->CODEPAGESIZE to ensure the region is correct. */
-
-#ifdef SIGNING      
-
-#define BOOTLOADER_REGION_START             0x00039C00                  /**< This field should correspond to start address of the bootloader, found in UICR.RESERVED, 0x10001014, register. This value is used for sanity check, so the bootloader will fail immediately if this value differs from runtime value. The value is used to determine max application size for updating. */
-#define BOOTLOADER_SETTINGS_ADDRESS         0x0003D800                  /**< The field specifies the page location of the bootloader settings address. */
-
-#else       
-
-#define BOOTLOADER_REGION_START             0x0003C000                  /**< This field should correspond to start address of the bootloader, found in UICR.RESERVED, 0x10001014, register. This value is used for sanity check, so the bootloader will fail immediately if this value differs from runtime value. The value is used to determine max application size for updating. */
-#define BOOTLOADER_SETTINGS_ADDRESS         0x0003FC00                  /**< The field specifies the page location of the bootloader settings address. */
-
-#endif      
-
-
-        
-#elif NRF52     
-        
-#define BOOTLOADER_REGION_START             0x0007A000                  /**< This field should correspond to start address of the bootloader, found in UICR.RESERVED, 0x10001014, register. This value is used for sanity check, so the bootloader will fail immediately if this value differs from runtime value. The value is used to determine max application size for updating. */
-#define BOOTLOADER_SETTINGS_ADDRESS         0x0007F000                  /**< The field specifies the page location of the bootloader settings address. */
-#define BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS  0x0007E000                  /**< The field specifies the page location of the mbr params page address. */
-        
-#define CODE_PAGE_SIZE                      0x1000                      /**< Size of a flash codepage. Used for size of the reserved flash space in the bootloader region. Will be runtime checked against NRF_UICR->CODEPAGESIZE to ensure the region is correct. */
-
-#else
-
-#error No target defined
-
-#endif
-
-#define DFU_REGION_TOTAL_SIZE           (BOOTLOADER_REGION_START - CODE_REGION_1_START)                 /**< Total size of the region between SD and Bootloader. */
-
-#ifndef DFU_APP_DATA_RESERVED
-#define DFU_APP_DATA_RESERVED           CODE_PAGE_SIZE * 0                                              /**< Size of Application Data that must be preserved between application updates. This value must be a multiple of page size. Page size is 0x400 (1024d) bytes, thus this value must be 0x0000, 0x0400, 0x0800, 0x0C00, 0x1000, etc. */
-#endif
-
-#define DFU_IMAGE_MAX_SIZE_FULL         (DFU_REGION_TOTAL_SIZE - DFU_APP_DATA_RESERVED)                 /**< Maximum size of an application, excluding save data from the application. */
-                                          
-#define DFU_IMAGE_MAX_SIZE_BANKED       (((DFU_IMAGE_MAX_SIZE_FULL) - \
-                                        (DFU_IMAGE_MAX_SIZE_FULL % (2 * CODE_PAGE_SIZE)))/2)            /**< Maximum size of an application, excluding save data from the application. */
-
-#define DFU_BL_IMAGE_MAX_SIZE           (BOOTLOADER_SETTINGS_ADDRESS - BOOTLOADER_REGION_START)         /**< Maximum size of a bootloader, excluding save data from the current bootloader. */
-
-#define DFU_BANK_0_REGION_START         CODE_REGION_1_START                                             /**< Bank 0 region start. */
-#define DFU_BANK_1_REGION_START         (DFU_BANK_0_REGION_START + DFU_IMAGE_MAX_SIZE_BANKED)           /**< Bank 1 region start. */
-
-#define EMPTY_FLASH_MASK                0xFFFFFFFF                                                      /**< Bit mask that defines an empty address in flash. */
-
-#define INVALID_PACKET                  0x00                                                            /**< Invalid packet identifies. */
-#define INIT_PACKET                     0x01                                                            /**< Packet identifies for initialization packet. */
-#define STOP_INIT_PACKET                0x02                                                            /**< Packet identifies for stop initialization packet. Used when complete init packet has been received so that the init packet can be used for pre validaiton. */
-#define START_PACKET                    0x03                                                            /**< Packet identifies for the Data Start Packet. */
-#define DATA_PACKET                     0x04                                                            /**< Packet identifies for a Data Packet. */
-#define STOP_DATA_PACKET                0x05                                                            /**< Packet identifies for the Data Stop Packet. */
-
-#define DFU_UPDATE_SD                   0x01                                                            /**< Bit field indicating update of SoftDevice is ongoing. */
-#define DFU_UPDATE_BL                   0x02                                                            /**< Bit field indicating update of bootloader is ongoing. */
-#define DFU_UPDATE_APP                  0x04                                                            /**< Bit field indicating update of application is ongoing. */
-
-#define DFU_INIT_RX                     0x00                                                            /**< Op Code identifies for receiving init packet. */
-#define DFU_INIT_COMPLETE               0x01                                                            /**< Op Code identifies for transmission complete of init packet. */
-
-// Safe guard to ensure during compile time that the DFU_APP_DATA_RESERVED is a multiple of page size.
-STATIC_ASSERT((((DFU_APP_DATA_RESERVED) & (CODE_PAGE_SIZE - 1)) == 0x00));
-
-/**@brief Structure holding a start packet containing update mode and image sizes.
- */
-typedef struct
-{
-    uint8_t  dfu_update_mode;                                                                           /**< Packet type, used to identify the content of the received packet referenced by data packet. */
-    uint32_t sd_image_size;                                                                             /**< Size of the SoftDevice image to be transferred. Zero if no SoftDevice image will be transfered. */
-    uint32_t bl_image_size;                                                                             /**< Size of the Bootloader image to be transferred. Zero if no Bootloader image will be transfered. */
-    uint32_t app_image_size;                                                                            /**< Size of the application image to be transmitted. Zero if no Bootloader image will be transfered. */
-} dfu_start_packet_t;
-
-/**@brief Structure holding a bootloader init/data packet received.
- */
-typedef struct
-{
-    uint32_t   packet_length;                                                                           /**< Packet length of the data packet. Each data is word size, meaning length of 4 is 4 words, not bytes. */
-    uint32_t * p_data_packet;                                                                           /**< Data Packet received. Each data is a word size entry. */
-} dfu_data_packet_t;
-
-/**@brief Structure for holding dfu update packet. Packet type indicate the type of packet.
- */
-typedef struct
-{
-    uint32_t   packet_type;                                                                             /**< Packet type, used to identify the content of the received packet referenced by data packet. */
-    union
-    {
-        dfu_data_packet_t    data_packet;                                                               /**< Used when packet type is INIT_PACKET or DATA_PACKET. Packet contains data received for init or data. */
-        dfu_start_packet_t * start_packet;                                                              /**< Used when packet type is START_DATA_PACKET. Will contain information on software to be updtaed, i.e. SoftDevice, Bootloader and/or Application along with image sizes. */
-    } params;
-} dfu_update_packet_t;
-
-/**@brief DFU status error codes.
-*/
-typedef enum
-{
-    DFU_UPDATE_APP_COMPLETE,                                                                            /**< Status update of application complete.*/
-    DFU_UPDATE_SD_COMPLETE,                                                                             /**< Status update of SoftDevice update complete. Note that this solely indicates that a new SoftDevice has been received and stored in bank 0 and 1. */
-    DFU_UPDATE_SD_SWAPPED,                                                                              /**< Status update of SoftDevice update complete. Note that this solely indicates that a new SoftDevice has been received and stored in bank 0 and 1. */
-    DFU_UPDATE_BOOT_COMPLETE,                                                                           /**< Status update complete.*/
-    DFU_BANK_0_ERASED,                                                                                  /**< Status bank 0 erased.*/
-    DFU_TIMEOUT,                                                                                        /**< Status timeout.*/
-    DFU_RESET                                                                                           /**< Status Reset to indicate current update procedure has been aborted and system should reset. */
-} dfu_update_status_code_t;
-
-/**@brief Structure holding DFU complete event.
-*/
-typedef struct
-{
-    dfu_update_status_code_t status_code;                                                               /**< Device Firmware Update status. */
-    uint16_t                 app_crc;                                                                   /**< CRC of the recieved application. */
-    uint32_t                 sd_size;                                                                   /**< Size of the recieved SoftDevice. */
-    uint32_t                 bl_size;                                                                   /**< Size of the recieved BootLoader. */
-    uint32_t                 app_size;                                                                  /**< Size of the recieved Application. */
-    uint32_t                 sd_image_start;                                                            /**< Location in flash where the received SoftDevice image is stored. */
-} dfu_update_status_t;
-
-/**@brief Update complete handler type. */
-typedef void (*dfu_complete_handler_t)(dfu_update_status_t dfu_update_status);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // DFU_TYPES_H__
-
-/**@} */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/experimental/dfu_init_template_signing.c
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/experimental/dfu_init_template_signing.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/experimental/dfu_init_template_signing.c
deleted file mode 100644
index abb52db..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/experimental/dfu_init_template_signing.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-/**@file
- *
- * @defgroup nrf_dfu_init_template Template file with an DFU init packet handling example.
- * @{
- *
- * @ingroup nrf_dfu
- *
- * @brief This file contains a template on how to implement DFU init packet handling.
- *
- * @details The template shows how device type and revision can be used for a safety check of the 
- *          received image. It shows how validation can be performed in two stages:
- *          - Stage 1: Pre-check of firmware image before transfer to ensure the firmware matches:
- *                     - Device Type.
- *                     - Device Revision.
- *                     Installed SoftDevice.
- *                     This template can be extended with additional checks according to needs.
- *                     For example, such a check could be the origin of the image (trusted source) 
- *                     based on a signature scheme.
- *          - Stage 2: Post-check of the image after image transfer but before installing firmware.
- *                     For example, such a check could be an integrity check in form of hashing or 
- *                     verification of a signature.
- *                     In this template, a simple CRC check is carried out.
- *                     The CRC check can be replaced with other mechanisms, like signing.
- *
- * @note This module does not support security features such as image signing, but the 
- *       implementation allows for such extension.
- *       If the init packet is signed by a trusted source, it must be decrypted before it can be
- *       processed.
- */
-
-#include "dfu_init.h"
-#include <stdint.h>
-#include <string.h>
-#include <dfu_types.h>
-#include "nrf_sec.h"
-#include "nrf_error.h"
-#include "crc16.h"
-
-// The following is the layout of the extended init packet if using image length and sha256 to validate image
-// and NIST P-256 + SHA256 to sign the init_package including the extended part
-#define DFU_INIT_PACKET_POS_EXT_IDENTIFIER                  0       //< Position of the identifier for the ext package
-#define DFU_INIT_PACKET_POS_EXT_IMAGE_LENGTH                4       //< Position of the image length    
-#define DFU_INIT_PACKET_POS_EXT_IMAGE_HASH256               8       //< Position of the 256
-#define DFU_INIT_PACKET_POS_EXT_INIT_SIGNATURE_R            40      //< Position of the Signature R
-#define DFU_INIT_PACKET_POS_EXT_INIT_SIGNATURE_S            72      //< Position of the Signature S
-#define DFU_INIT_PACKET_EXT_LENGTH_SIGNED                   40      //< Length of the extended init packet that is part of the signed data
-#define DFU_INIT_PACKET_EXT_BEGIN
-
-#define DFU_INIT_PACKET_EXT_LENGTH_MIN          6                   //< Minimum length of the extended init packet. Init packet and CRC16
-#define DFU_INIT_PACKET_EXT_LENGTH_MAX          104                 //< Identifier (4 bytes) + Image length (4 bytes) + SHA-256 digest (32 bytes) + NIST P-256 using SHA-256 (64 bytes)
-
-#define DFU_SHA256_DIGEST_LENGTH                32                  //< Length of SHA-256 digest
-#define DFU_SIGNATURE_R_LENGTH                  32                  //< Length of the signature part r
-#define DFU_SIGNATURE_S_LENGTH                  32                  //< Length of the signature part s
-
-static uint8_t m_extended_packet[DFU_INIT_PACKET_EXT_LENGTH_MAX];   //< Data array for storage of the extended data received. The extended data follows the normal init data of type \ref dfu_init_packet_t. Extended data can be used for a CRC, hash, signature, or other data. */
-static uint8_t m_extended_packet_length;                            //< Length of the extended data received with init packet. */
- 
- #define DFU_INIT_PACKET_USES_CRC16 (0)
- #define DFU_INIT_PACKET_USES_HASH  (1)
- #define DFU_INIT_PACKET_USES_ECDS  (2)
- 
-
-/** @snippet [DFU BLE Signing public key curve points] */
-static uint8_t Qx[] = { 0x39, 0xb0, 0x58, 0x3d, 0x27, 0x07, 0x91, 0x38, 0x6a, 0xa3, 0x36, 0x0f, 0xa2, 0xb5, 0x86, 0x7e, 0xae, 0xba, 0xf7, 0xa3, 0xf4, 0x81, 0x5f, 0x78, 0x02, 0xf2, 0xa1, 0x21, 0xd5, 0x21, 0x84, 0x12 };
-static uint8_t Qy[] = { 0x4a, 0x0d, 0xfe, 0xa4, 0x77, 0x50, 0xb1, 0xb5, 0x26, 0xc0, 0x9d, 0xdd, 0xf0, 0x24, 0x90, 0x57, 0x6c, 0x64, 0x3b, 0xd3, 0xdf, 0x92, 0x3b, 0xb3, 0x47, 0x97, 0x83, 0xd4, 0xfc, 0x76, 0xf5, 0x9d };
-/** @snippet [DFU BLE Signing public key curve points] */
-
-static nrf_sec_ecc_point_t Q = {.p_x   = Qx, 
-                                .x_len = sizeof(Qx),
-                                .p_y   = Qy, 
-                                .y_len = sizeof(Qy)};
-
-uint32_t dfu_init_prevalidate(uint8_t * p_init_data, uint32_t init_data_len)
-{
-    uint32_t                i = 0;
-    static uint32_t         err_code;
-    nrf_sec_data_t          init_data;
-    nrf_sec_ecc_signature_t signature;
-        
-    // In order to support encryption then any init packet decryption function / library
-    // should be called from here or implemented at this location.
-
-    // Length check to ensure valid data are parsed.
-    if (init_data_len < sizeof(dfu_init_packet_t))
-    {
-        return NRF_ERROR_INVALID_LENGTH;
-    }
-
-    // Current template uses clear text data so they can be casted for pre-check.
-    dfu_init_packet_t * p_init_packet = (dfu_init_packet_t *)p_init_data;
-    
-    
-    m_extended_packet_length = ((uint32_t)p_init_data + init_data_len) -
-                                (uint32_t)&p_init_packet->softdevice[p_init_packet->softdevice_len];
-    
-    if (m_extended_packet_length < DFU_INIT_PACKET_EXT_LENGTH_MIN)
-    {
-        return NRF_ERROR_INVALID_LENGTH;
-    }
-
-    if (((uint32_t)p_init_data + init_data_len) < 
-         (uint32_t)&p_init_packet->softdevice[p_init_packet->softdevice_len])
-    {
-        return NRF_ERROR_INVALID_LENGTH;
-    }
-    
-    memcpy(&m_extended_packet,
-           &p_init_packet->softdevice[p_init_packet->softdevice_len],
-           m_extended_packet_length);
-
-/** [DFU init application version] */
-    // To support application versioning, this check should be updated.
-    // This template allows for any application to be installed. However, 
-    // customers can place a revision number at the bottom of the application 
-    // to be verified by the bootloader. This can be done at a location 
-    // relative to the application, for example the application start 
-    // address + 0x0100.
-/** [DFU init application version] */
-    
-    // First check to verify the image to be transfered matches the device type.
-    // If no Device type is present in DFU_DEVICE_INFO then any image will be accepted.
-    if ((DFU_DEVICE_INFO->device_type != DFU_DEVICE_TYPE_EMPTY) &&
-        (p_init_packet->device_type != DFU_DEVICE_INFO->device_type))
-    {
-        return NRF_ERROR_INVALID_DATA;
-    }
-    
-    // Second check to verify the image to be transfered matches the device revision.
-    // If no Device revision is present in DFU_DEVICE_INFO then any image will be accepted.
-    if ((DFU_DEVICE_INFO->device_rev != DFU_DEVICE_REVISION_EMPTY) &&
-        (p_init_packet->device_rev != DFU_DEVICE_INFO->device_rev))
-    {
-        return NRF_ERROR_INVALID_DATA;
-    }
-
-    // Third check: Check the array of supported SoftDevices by this application.
-    //              If the installed SoftDevice does not match any SoftDevice in the list then an
-    //              error is returned.
-    while (i < p_init_packet->softdevice_len)
-    {
-        if (p_init_packet->softdevice[i]   == DFU_SOFTDEVICE_ANY ||
-            p_init_packet->softdevice[i++] == SD_FWID_GET(MBR_SIZE))
-        {
-            // Found a match. Break the loop.
-            break;
-        }
-        // No matching SoftDevice found - Return NRF_ERROR_INVALID_DATA.
-        return NRF_ERROR_INVALID_DATA;
-    }
-    
-    // Check that we have the correct identifier indicating that ECDS is used
-    if(*(uint32_t*)&m_extended_packet[DFU_INIT_PACKET_POS_EXT_IDENTIFIER] != DFU_INIT_PACKET_USES_ECDS)
-    {
-        return NRF_ERROR_INVALID_DATA;
-    }
-    
-    // init_data consists of the regular init-packet and all the extended packet data excluding the signing key
-    init_data.length = (init_data_len - m_extended_packet_length) + DFU_INIT_PACKET_EXT_LENGTH_SIGNED;
-    init_data.p_data = p_init_data;
-
-    signature.p_r   = &m_extended_packet[DFU_INIT_PACKET_POS_EXT_INIT_SIGNATURE_R];
-    signature.r_len = DFU_SIGNATURE_R_LENGTH;
-    signature.p_s   = &m_extended_packet[DFU_INIT_PACKET_POS_EXT_INIT_SIGNATURE_S];
-    signature.s_len = DFU_SIGNATURE_S_LENGTH;
-
-    err_code = nrf_sec_svc_verify(&init_data, &Q ,&signature, NRF_SEC_NIST256_SHA256);
-    return err_code;
-}
-
-uint32_t dfu_init_postvalidate(uint8_t * p_image, uint32_t image_len)
-{
-    uint8_t   image_digest[DFU_SHA256_DIGEST_LENGTH];
-    uint8_t * received_digest;
-    
-    nrf_sec_data_t data = {.p_data = p_image,
-                           .length = image_len};
-    
-    
-    // Compare image size received with signed init_packet data
-    if(image_len != *(uint32_t*)&m_extended_packet[DFU_INIT_PACKET_POS_EXT_IMAGE_LENGTH])
-    {
-        return NRF_ERROR_INVALID_DATA;
-    }
-                          
-    // Calculate digest from active block.
-    nrf_sec_svc_hash(&data, image_digest, NRF_SEC_SHA256);
-
-    received_digest = &m_extended_packet[DFU_INIT_PACKET_POS_EXT_IMAGE_HASH256];
-
-    // Compare the received and calculated digests.
-    if (memcmp(&image_digest[0], received_digest, DFU_SHA256_DIGEST_LENGTH) != 0)
-    {
-        return NRF_ERROR_INVALID_DATA;
-    }
-
-    return NRF_SUCCESS;
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/experimental/nrf_sec.h
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/experimental/nrf_sec.h b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/experimental/nrf_sec.h
deleted file mode 100644
index fce0ce9..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/experimental/nrf_sec.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-#ifndef NRF_SEC_H__
-#define NRF_SEC_H__
-
-#include "nrf_svc.h"
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define NRF_SEC_SVC_BASE 0x8 /**< The lowest SVC number reserved for the nRF Security library. */
-
-/**@brief The SVC numbers used by the SVC functions in the security library. */
-enum NRF_SEC_SVCS
-{
-    NRF_SEC_SVC_HASH = NRF_SEC_SVC_BASE,  /**< SVC number for generating a digest using a hash function over a dataset. */
-    NRF_SEC_SVC_VERIFY,                   /**< SVC number for veryfying a signature for a given dataset using provided keys and signature. */
-    NRF_SEC_SVC_LAST
-};
-
-/**@brief Enumeration containing list of supported ECC curve and hash functions in the nRF Security library.
- */
-typedef enum
-{
-    NRF_SEC_NIST256_SHA256 = 0x00, /**< Selection of NIST P-256 curve with SHA-256 digest for verification of signature. */
-    NRF_SEC_ALGO_LAST              /**< Last element in enumeration closing valid algorithm list. */
-}nrf_sec_algo_t;
-
-/**@brief Enumeration containing list of supported hash functions in the nRF Security library.
- */
-typedef enum
-{
-    NRF_SEC_SHA256 = 0x00, /**< Selection of SHA-256 hash function. */
-    NRF_SEC_HASH_FUNC_LAST /**< Last element in enumeration closing valid hash function list. */
-}nrf_sec_hash_func_t;
-
-/**@brief Structure with length of data and pointer to data for signing or verification.
- */
-typedef struct
-{
-    uint32_t   length;  /**< Length of data pointed to by @ref p_data. */
-    uint8_t  * p_data;  /**< Pointer to data to be used. */
-} nrf_sec_data_t;
-
-/**@brief Structure with pointers to X and Y coordinates of a point on the curve.
- */
-typedef struct
-{
-    uint8_t  * p_x;     /**< Pointer to X coordinate of point. */
-    uint32_t   x_len;   /**< Length of data pointed to by p_x. */
-    uint8_t  * p_y;     /**< Pointer to X coordinate of point. */
-    uint32_t   y_len;   /**< Length of data pointed to by p_x. */
-} nrf_sec_ecc_point_t;
-
-/**@brief Structure with pointers to r and s parts of the ecc signature.
- */
-typedef struct
-{
-    uint8_t  * p_r;     /**< Pointer to R part of signature    */
-    uint32_t   r_len;   /**< Length of data pointed to by p_r  */
-    uint8_t  * p_s;     /**< Pointer to S part of signature    */
-    uint32_t   s_len;   /**< Length to data pointed to by p_s  */
-} nrf_sec_ecc_signature_t;
-
-/**@brief   SVC Function for verifying a signature over a given dataset.
- *
- * @param[in] p_data       Pointer to the data which must be verified.
- * @param[in] p_Q          Pointer to the public key, Q.
- * @param[in] p_signature  Pointer to the signature (r and s).
- * @param[in] algorithm    Curve and hash algorithm to be used for verifying the signature, for
-                           example NIST P-256 with SHA-256.
- *
- * @retval NRF_ERROR_INVALID_DATA  If the signature does not match the dataset provided.
- * @retval NRF_ERROR_NOT_SUPPORTED If the selected algorithm is not supported in this version of 
-                                   the library.
- * @retval NRF_SUCCESS             If the signature matches the dataset provided.
- */
-SVCALL(NRF_SEC_SVC_VERIFY, uint32_t, nrf_sec_svc_verify (nrf_sec_data_t          * p_data,
-                                                         nrf_sec_ecc_point_t     * p_Q,
-                                                         nrf_sec_ecc_signature_t * p_signature,
-                                                         nrf_sec_algo_t            algorithm));
-
-/**@brief   SVC Function for generating a signature over a given dataset.
- *
- * @param[in]  p_data    Pointer to the data which must be verified.
- * @param[out] p_digest  Pointer to memory where generated digest shall be stored. Ensure 
- *                       sufficient memory is available, that is for a SHA-256 there must 
- *                       be at least 256 bits (8 words) available.
- * @param[in]  hash_func Type of fash function to use when generating the digest
- *
- * @retval NRF_ERROR_NULL          If a null pointer is provided as data or hash.
- * @retval NRF_ERROR_NOT_SUPPORTED If the selected hash functions is not supported in this version
- *                                 of the library.
- * @retval NRF_SUCCESS             If generation of a digest was successful.
- */
-SVCALL(NRF_SEC_SVC_HASH, uint32_t, nrf_sec_svc_hash(nrf_sec_data_t      * p_data, 
-                                                    uint8_t             * p_digest, 
-                                                    nrf_sec_hash_func_t   hash_func));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NRF_SEC_H__

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/hci_transport/hci_mem_pool_internal.h
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/hci_transport/hci_mem_pool_internal.h b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/hci_transport/hci_mem_pool_internal.h
deleted file mode 100644
index 596f1b9..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/hci_transport/hci_mem_pool_internal.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
- 
-/** @file
- *
- * @defgroup memory_pool_internal Memory Pool Internal
- * @{
- * @ingroup memory_pool
- *
- * @brief Memory pool internal definitions
- */
- 
-#ifndef MEM_POOL_INTERNAL_H__
-#define MEM_POOL_INTERNAL_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define TX_BUF_SIZE       32u    /**< TX buffer size in bytes. */
-#define RX_BUF_SIZE       600u   /**< RX buffer size in bytes. */
-
-#define RX_BUF_QUEUE_SIZE 2u     /**< RX buffer element size. */
- 
-#ifdef __cplusplus
-}
-#endif
-
-#endif // MEM_POOL_INTERNAL_H__
- 
-/** @} */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/hci_transport/hci_transport_config.h
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/hci_transport/hci_transport_config.h b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/hci_transport/hci_transport_config.h
deleted file mode 100644
index 5befce3..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/bootloader_dfu/hci_transport/hci_transport_config.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-/**@file
- *
- * @defgroup ble_sdk_bootloader_hci_congfig HCI Transport Layer Configuration
- * @{
- * @ingroup dfu_bootloader_api
- * @brief Definition of HCI Transport Layer configurable parameters
- */
-
-#ifndef HCI_TRANSPORT_CONFIG_H__
-#define HCI_TRANSPORT_CONFIG_H__
-
-#include "boards.h"                                                     /**< Default include for boards.h which means that default pin numbers will be used for RX, TX, CTS, and RTS on the UART. Other pin number can be used if desired. */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** This section covers configurable parameters for the HCI Transport SLIP layer. */
-#define HCI_SLIP_UART_RX_PIN_NUMBER  RX_PIN_NUMBER                      /**< Defines the UART RX pin number. The default pin for the board is chosen, but can be overwritten. */
-
-#define HCI_SLIP_UART_TX_PIN_NUMBER  TX_PIN_NUMBER                      /**< Defines the UART TX pin number. The default pin for the board is chosen, but can be overwritten. */
-
-#define HCI_SLIP_UART_RTS_PIN_NUMBER RTS_PIN_NUMBER                     /**< Defines the UART RTS pin number. The default pin for the board is chosen, but can be overwritten. */
-
-#define HCI_SLIP_UART_CTS_PIN_NUMBER CTS_PIN_NUMBER                     /**< Defines the UART CTS pin number. The default pin for the board is chosen, but can be overwritten. */
-
-#define HCI_SLIP_UART_MODE           APP_UART_FLOW_CONTROL_DISABLED     /**< Defines the UART mode to be used. Use UART Low Power with Flow Control - Valid values are defined in \ref app_uart_flow_control_t. For further information on the UART Low Power mode, please refer to: \ref app_uart . */
-
-#define HCI_SLIP_UART_BAUDRATE       UART_BAUDRATE_BAUDRATE_Baud38400   /**< Defines the UART Baud rate. Default is 38400 baud. */
-
-/** This section covers configurable parameters for the HCI Transport layer that are used for calculating correct value for the retransmission timer timeout. */
-#define MAX_PACKET_SIZE_IN_BITS      8000u                              /**< Maximum size of a single application packet in bits. */      
-#define USED_BAUD_RATE               38400u                             /**< The used uart baudrate. */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // HCI_TRANSPORT_CONFIG_H__
-
-/** @} */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/button/app_button.c
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/button/app_button.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/button/app_button.c
deleted file mode 100644
index f135eb6..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/button/app_button.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-#include "app_button.h"
-#include "app_timer.h"
-#include "app_error.h"
-#include "nrf_drv_gpiote.h"
-#include "nrf_assert.h"
-#include "sdk_common.h"
-
-static app_button_cfg_t *             mp_buttons = NULL;           /**< Button configuration. */
-static uint8_t                        m_button_count;              /**< Number of configured buttons. */
-static uint32_t                       m_detection_delay;           /**< Delay before a button is reported as pushed. */
-APP_TIMER_DEF(m_detection_delay_timer_id);  /**< Polling timer id. */
-
-
-static uint32_t m_pin_state;
-static uint32_t m_pin_transition;
-
-/**@brief Function for handling the timeout that delays reporting buttons as pushed.
- *
- * @details    The detection_delay_timeout_handler(...) is a call-back issued from the app_timer
- *             module. It is called with the p_context parameter. The p_context parameter is
- *             provided to the app_timer module when a timer is started, using the call
- *             @ref app_timer_start. On @ref app_timer_start the p_context will be holding the
- *             currently pressed buttons.
- *
- * @param[in]  p_context   Pointer used for passing information app_start_timer() was called.
- *                         In the app_button module the p_context holds information on pressed
- *                         buttons.
- */
-static void detection_delay_timeout_handler(void * p_context)
-{
-    uint8_t i;
-    
-    // Pushed button(s) detected, execute button handler(s).
-    for (i = 0; i < m_button_count; i++)
-    {
-        app_button_cfg_t * p_btn = &mp_buttons[i];
-        uint32_t btn_mask = 1 << p_btn->pin_no;
-        if (btn_mask & m_pin_transition)
-        {
-            m_pin_transition &= ~btn_mask;
-            bool pin_is_set = nrf_drv_gpiote_in_is_set(p_btn->pin_no);
-            if ((m_pin_state & (1 << p_btn->pin_no)) == (pin_is_set << p_btn->pin_no))
-            {
-                uint32_t transition = !(pin_is_set ^ (p_btn->active_state == APP_BUTTON_ACTIVE_HIGH));
-
-                if (p_btn->button_handler)
-                {
-                    p_btn->button_handler(p_btn->pin_no, transition);
-                }
-            }
-        }
-    }
-}
-
-static void gpiote_event_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
-{
-    uint32_t err_code;
-    uint32_t pin_mask = 1 << pin;
-
-    // Start detection timer. If timer is already running, the detection period is restarted.
-    // NOTE: Using the p_context parameter of app_timer_start() to transfer the pin states to the
-    //       timeout handler (by casting event_pins_mask into the equally sized void * p_context
-    //       parameter).
-    err_code = app_timer_stop(m_detection_delay_timer_id);
-    if (err_code != NRF_SUCCESS)
-    {
-        // The impact in app_button of the app_timer queue running full is losing a button press.
-        // The current implementation ensures that the system will continue working as normal.
-        return;
-    }
-
-    if (!(m_pin_transition & pin_mask))
-    {
-        if (nrf_drv_gpiote_in_is_set(pin))
-        {
-            m_pin_state |= pin_mask;
-        }
-        else
-        {
-            m_pin_state &= ~(pin_mask);
-        }
-        m_pin_transition |= (pin_mask);
-
-        err_code = app_timer_start(m_detection_delay_timer_id, m_detection_delay, NULL);
-        if (err_code != NRF_SUCCESS)
-        {
-            // The impact in app_button of the app_timer queue running full is losing a button press.
-            // The current implementation ensures that the system will continue working as normal.
-        }
-    }
-    else
-    {
-        m_pin_transition &= ~pin_mask;
-    }
-}
-
-uint32_t app_button_init(app_button_cfg_t *             p_buttons,
-                         uint8_t                        button_count,
-                         uint32_t                       detection_delay)
-{
-    uint32_t err_code;
-    
-    if (detection_delay < APP_TIMER_MIN_TIMEOUT_TICKS)
-    {
-        return NRF_ERROR_INVALID_PARAM;
-    }
-
-    if (!nrf_drv_gpiote_is_init())
-    {
-        err_code = nrf_drv_gpiote_init();
-        VERIFY_SUCCESS(err_code);
-    }
-
-    // Save configuration.
-    mp_buttons          = p_buttons;
-    m_button_count      = button_count;
-    m_detection_delay   = detection_delay;
-
-    m_pin_state      = 0;
-    m_pin_transition = 0;
-    
-    while (button_count--)
-    {
-        app_button_cfg_t * p_btn = &p_buttons[button_count];
-
-        nrf_drv_gpiote_in_config_t config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(false);
-        config.pull = p_btn->pull_cfg;
-        
-        err_code = nrf_drv_gpiote_in_init(p_btn->pin_no, &config, gpiote_event_handler);
-        VERIFY_SUCCESS(err_code);
-    }
-
-    // Create polling timer.
-    return app_timer_create(&m_detection_delay_timer_id,
-                            APP_TIMER_MODE_SINGLE_SHOT,
-                            detection_delay_timeout_handler);
-}
-
-uint32_t app_button_enable(void)
-{
-    ASSERT(mp_buttons);
-
-    uint32_t i;
-    for (i = 0; i < m_button_count; i++)
-    {
-        nrf_drv_gpiote_in_event_enable(mp_buttons[i].pin_no, true);
-    }
-
-    return NRF_SUCCESS;
-}
-
-
-uint32_t app_button_disable(void)
-{
-    ASSERT(mp_buttons);
-
-    uint32_t i;
-    for (i = 0; i < m_button_count; i++)
-    {
-       nrf_drv_gpiote_in_event_disable(mp_buttons[i].pin_no);
-    }
-
-    // Make sure polling timer is not running.
-    return app_timer_stop(m_detection_delay_timer_id);
-}
-
-
-uint32_t app_button_is_pushed(uint8_t button_id, bool * p_is_pushed)
-{
-    ASSERT(button_id <= m_button_count);
-    ASSERT(mp_buttons != NULL);
-
-    app_button_cfg_t * p_btn = &mp_buttons[button_id];
-    bool is_set = nrf_drv_gpiote_in_is_set(p_btn->pin_no);
-
-    *p_is_pushed = !(is_set^(p_btn->active_state == APP_BUTTON_ACTIVE_HIGH));
-    
-    return NRF_SUCCESS;
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/button/app_button.h
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/button/app_button.h b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/button/app_button.h
deleted file mode 100644
index a7b9697..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/button/app_button.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-/** @file
- *
- * @defgroup app_button Button Handler
- * @{
- * @ingroup app_common
- *
- * @brief Buttons handling module.
- *
- * @details The button handler uses the @ref app_gpiote to detect that a button has been
- *          pushed. To handle debouncing, it will start a timer in the GPIOTE event handler.
- *          The button will only be reported as pushed if the corresponding pin is still active when
- *          the timer expires. If there is a new GPIOTE event while the timer is running, the timer
- *          is restarted.
- *
- * @note    The app_button module uses the app_timer module. The user must ensure that the queue in
- *          app_timer is large enough to hold the app_timer_stop() / app_timer_start() operations
- *          which will be executed on each event from GPIOTE module (2 operations), as well as other
- *          app_timer operations queued simultaneously in the application.
- *
- * @note    Even if the scheduler is not used, app_button.h will include app_scheduler.h, so when
- *          compiling, app_scheduler.h must be available in one of the compiler include paths.
- */
-
-#ifndef APP_BUTTON_H__
-#define APP_BUTTON_H__
-
-#include <stdint.h>
-#include <stdbool.h>
-#include "nrf.h"
-#include "app_error.h"
-#include "nrf_gpio.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define APP_BUTTON_PUSH        1                               /**< Indicates that a button is pushed. */
-#define APP_BUTTON_RELEASE     0                               /**< Indicates that a button is released. */
-#define APP_BUTTON_ACTIVE_HIGH 1                               /**< Indicates that a button is active high. */
-#define APP_BUTTON_ACTIVE_LOW  0                               /**< Indicates that a button is active low. */
-
-/**@brief Button event handler type. */
-typedef void (*app_button_handler_t)(uint8_t pin_no, uint8_t button_action);
-
-/**@brief Button configuration structure. */
-typedef struct
-{
-    uint8_t              pin_no;           /**< Pin to be used as a button. */
-    uint8_t              active_state;     /**< APP_BUTTON_ACTIVE_HIGH or APP_BUTTON_ACTIVE_LOW. */
-    nrf_gpio_pin_pull_t  pull_cfg;         /**< Pull-up or -down configuration. */
-    app_button_handler_t button_handler;   /**< Handler to be called when button is pushed. */
-} app_button_cfg_t;
-
-/**@brief  Pin transition direction struct. */
-typedef struct
-{
-    uint32_t high_to_low;   /**Pin went from high to low */
-    uint32_t low_to_high;   /**Pin went from low to high */
-} pin_transition_t;
-    
-/**@brief Function for initializing the Buttons.
- *
- * @details This function will initialize the specified pins as buttons, and configure the Button
- *          Handler module as a GPIOTE user (but it will not enable button detection).
- *
- * @note Normally initialization should be done using the APP_BUTTON_INIT() macro
- *
- * @note app_button_enable() function must be called in order to enable the button detection.    
- *
- * @param[in]  p_buttons           Array of buttons to be used (NOTE: Must be static!).
- * @param[in]  button_count        Number of buttons.
- * @param[in]  detection_delay     Delay from a GPIOTE event until a button is reported as pushed.
- *
- * @return   NRF_SUCCESS on success, otherwise an error code.
- */
-uint32_t app_button_init(app_button_cfg_t *             p_buttons,
-                         uint8_t                        button_count,
-                         uint32_t                       detection_delay);
-
-/**@brief Function for enabling button detection.
- *
- * @retval NRF_SUCCESS Module successfully enabled.
- */
-uint32_t app_button_enable(void);
-
-/**@brief Function for disabling button detection.
- *
- * @retval  NRF_SUCCESS               Button detection successfully disabled. Error code otherwise.
- */
-uint32_t app_button_disable(void);
-
-/**@brief Function for checking if a button is currently being pushed.
- *
- * @param[in]  button_id     Button index (in the app_button_cfg_t array given to app_button_init) to be checked.
- * @param[out] p_is_pushed   Button state.
- *
- * @retval     NRF_SUCCESS               State successfully read.
- * @retval     NRF_ERROR_INVALID_PARAM   Invalid button index.
- */
-uint32_t app_button_is_pushed(uint8_t button_id, bool * p_is_pushed);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // APP_BUTTON_H__
-
-/** @} */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc16/crc16.c
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc16/crc16.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc16/crc16.c
deleted file mode 100644
index aa289af..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc16/crc16.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-#include "crc16.h"
-
-#include <stdlib.h>
-
-uint16_t crc16_compute(uint8_t const * p_data, uint32_t size, uint16_t const * p_crc)
-{
-    uint16_t crc = (p_crc == NULL) ? 0xFFFF : *p_crc;
-
-    for (uint32_t i = 0; i < size; i++)
-    {
-        crc  = (uint8_t)(crc >> 8) | (crc << 8);
-        crc ^= p_data[i];
-        crc ^= (uint8_t)(crc & 0xFF) >> 4;
-        crc ^= (crc << 8) << 4;
-        crc ^= ((crc & 0xFF) << 4) << 1;
-    }
-
-    return crc;
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc16/crc16.h
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc16/crc16.h b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc16/crc16.h
deleted file mode 100644
index e5bbe26..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc16/crc16.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
- 
-/** @file
- *
- * @defgroup crc_compute CRC compute
- * @{
- * @ingroup hci_transport
- *
- * @brief    This module implements CRC-16-CCITT (polynomial 0x1021) with 0xFFFF initial value.
- *           The data can be passed in multiple blocks.
- */
- 
-#ifndef CRC16_H__
-#define CRC16_H__
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Function for calculating CRC-16 in blocks.
- *
- * Feed each consecutive data block into this function, along with the current value of p_crc as
- * returned by the previous call of this function. The first call of this function should pass NULL
- * as the initial value of the crc in p_crc.
- *
- * @param[in] p_data The input data block for computation.
- * @param[in] size   The size of the input data block in bytes.
- * @param[in] p_crc  The previous calculated CRC-16 value or NULL if first call.
- *
- * @return The updated CRC-16 value, based on the input supplied.
- */
-uint16_t crc16_compute(uint8_t const * p_data, uint32_t size, uint16_t const * p_crc);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // CRC16_H__
- 
-/** @} */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc32/crc32.c
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc32/crc32.c b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc32/crc32.c
deleted file mode 100644
index ab8ee38..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc32/crc32.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-#include "crc32.h"
-
-#include <stdlib.h>
-
-uint32_t crc32_compute(uint8_t const * p_data, uint32_t size, uint32_t const * p_crc)
-{
-    uint32_t crc;
-
-    crc = (p_crc == NULL) ? 0xFFFFFFFF : ~(*p_crc);
-    for (uint32_t i = 0; i < size; i++)
-    {
-        crc = crc ^ p_data[i];
-        for (uint32_t j = 8; j > 0; j--)
-        {
-            crc = (crc >> 1) ^ (0xEDB88320 & -(crc & 1));
-        }
-    }
-    return ~crc;
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc32/crc32.h
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc32/crc32.h b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc32/crc32.h
deleted file mode 100644
index 4ec4e88..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/crc32/crc32.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
- 
-/** @file
- *
- * @defgroup crc_compute CRC compute
- * @{
- * @ingroup hci_transport
- *
- * @brief    This module implements the CRC-32 calculation in the blocks.
- */
- 
-#ifndef CRC32_H__
-#define CRC32_H__
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Function for calculating CRC-32 in blocks.
- *
- * Feed each consecutive data block into this function, along with the current value of p_crc as
- * returned by the previous call of this function. The first call of this function should pass NULL
- * as the initial value of the crc in p_crc.
- *
- * @param[in] p_data The input data block for computation.
- * @param[in] size   The size of the input data block in bytes.
- * @param[in] p_crc  The previous calculated CRC-32 value or NULL if first call.
- *
- * @return The updated CRC-32 value, based on the input supplied.
- */
-uint32_t crc32_compute(uint8_t const * p_data, uint32_t size, uint32_t const * p_crc);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // CRC32_H__
- 
-/** @} */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/experimental_section_vars/section_vars.h
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/experimental_section_vars/section_vars.h b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/experimental_section_vars/section_vars.h
deleted file mode 100644
index ac96a67..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/experimental_section_vars/section_vars.h
+++ /dev/null
@@ -1,271 +0,0 @@
-/* Copyright (c) 2016 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-#ifndef SECTION_VARS_H__
-#define SECTION_VARS_H__
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @defgroup section_vars Section variables
- * @ingroup app_common
- * @{
- *
- * @brief Section variables.
- */
-
-#if defined(__ICCARM__)
-// Enable IAR language extensions
-#pragma language=extended
-#endif
-
-
-// Macro to delay macro expansion.
-#define NRF_PRAGMA(x)       _Pragma(#x)
-
-
-/**@brief   Macro to register a named section.
- *
- * @param[in]   section_name    Name of the section to register.
- */
-#if defined(__CC_ARM)
-
-// Not required by this compiler.
-#define NRF_SECTION_VARS_REGISTER_SECTION(section_name)
-
-#elif defined(__GNUC__)
-
-// Not required by this compiler.
-#define NRF_SECTION_VARS_REGISTER_SECTION(section_name)
-
-#elif defined(__ICCARM__)
-
-#define NRF_SECTION_VARS_REGISTER_SECTION(section_name)     NRF_PRAGMA(section = #section_name)
-
-#endif
-
-
-/*lint -save -e27 */
-
-/**@brief   Macro to obtain the linker symbol for the beginning of a given section.
- *
- * @details The symbol that this macro resolves to is used to obtain a section start address.
- *
- * @param[in]   section_name    Name of the section.
- */
-#if defined(__CC_ARM)
-
-#define NRF_SECTION_VARS_START_SYMBOL(section_name)         section_name ## $$Base
-
-#elif defined(__GNUC__)
-
-#define NRF_SECTION_VARS_START_SYMBOL(section_name)         __start_ ## section_name
-
-#elif defined(__ICCARM__)
-
-#define NRF_SECTION_VARS_START_SYMBOL(section_name)         __section_begin(#section_name)
-
-#endif
-
-
-/**@brief   Macro to obtain the linker symbol for the end of a given section.
- *
- * @details The symbol that this macro resolves to is used to obtain a section end address.
- *
- * @param[in]   section_name    Name of the section.
- */
-#if defined(__CC_ARM)
-
-#define NRF_SECTION_VARS_END_SYMBOL(section_name)           section_name ## $$Limit
-
-#elif defined(__GNUC__)
-
-#define NRF_SECTION_VARS_END_SYMBOL(section_name)           __stop_ ## section_name
-
-#elif defined(__ICCARM__)
-
-#define NRF_SECTION_VARS_END_SYMBOL(section_name)           __section_end(#section_name)
-
-#endif
-
-/*lint -restore */
-
-
-/**@brief   Macro for retrieving the length of a given section, in bytes.
- *
- * @param[in]   section_name    Name of the section.
- */
-#if defined(__CC_ARM)
-
-#define NRF_SECTION_VARS_LENGTH(section_name) \
-    ((uint32_t)&NRF_SECTION_VARS_END_SYMBOL(section_name) - (uint32_t)&NRF_SECTION_VARS_START_SYMBOL(section_name))
-
-#elif defined(__GNUC__)
-
- #define NRF_SECTION_VARS_LENGTH(section_name) \
-    ((uint32_t)&NRF_SECTION_VARS_END_SYMBOL(section_name) - (uint32_t)&NRF_SECTION_VARS_START_SYMBOL(section_name))
-
-#elif defined(__ICCARM__)
-
- #define NRF_SECTION_VARS_LENGTH(section_name) \
-    ((uint32_t)NRF_SECTION_VARS_END_SYMBOL(section_name) - (uint32_t)NRF_SECTION_VARS_START_SYMBOL(section_name))
-
-#endif
-      
-
-/**@brief   Macro to obtain the start address of a named section.
- *
- * param[in]    section_name    Name of the section.
- */
-#if defined(__CC_ARM)
-
-#define NRF_SECTION_VARS_START_ADDR(section_name)       (uint32_t)&NRF_SECTION_VARS_START_SYMBOL(section_name)
-
-#elif defined(__GNUC__)
-
-#define NRF_SECTION_VARS_START_ADDR(section_name)       (uint32_t)&NRF_SECTION_VARS_START_SYMBOL(section_name)
-
-#elif defined(__ICCARM__)
-
-#define NRF_SECTION_VARS_START_ADDR(section_name)       (uint32_t)iar_ ## section_name ## _start
-
-#endif
-
-      
-/*@brief    Macro to obtain the end address of a named section.
- *
- * @param[in]   section_name    Name of the section.
- */
-#if defined(__CC_ARM)
-
-#define NRF_SECTION_VARS_END_ADDR(section_name)         (uint32_t)&NRF_SECTION_VARS_END_SYMBOL(section_name)
-
-#elif defined(__GNUC__)
-
-#define NRF_SECTION_VARS_END_ADDR(section_name)         (uint32_t)&NRF_SECTION_VARS_END_SYMBOL(section_name)
-
-#elif defined(__ICCARM__)
-
-#define NRF_SECTION_VARS_END_ADDR(section_name)         (uint32_t)iar_ ## section_name ## _end
-
-#endif
-
-
-/**@brief   Macro to extern a named section start and stop symbols.
- *
- * @note    These declarations are required for GCC and Keil linkers (but not for IAR's).
- *
- * @param[in]   type_name       Name of the type stored in the section.
- * @param[in]   section_name    Name of the section.
- */
-#if defined(__CC_ARM)
-
-#define NRF_SECTION_VARS_REGISTER_SYMBOLS(type_name, section_name)  \
-    extern type_name * NRF_SECTION_VARS_START_SYMBOL(section_name); \
-    extern void      * NRF_SECTION_VARS_END_SYMBOL(section_name)
-
-#elif defined(__GNUC__)
-
-#define NRF_SECTION_VARS_REGISTER_SYMBOLS(type_name, section_name)  \
-    extern type_name * NRF_SECTION_VARS_START_SYMBOL(section_name); \
-    extern void      * NRF_SECTION_VARS_END_SYMBOL(section_name)
-
-#elif defined(__ICCARM__)
-
-// No symbol registration required for IAR.
-#define NRF_SECTION_VARS_REGISTER_SYMBOLS(type_name, section_name)                  \
-    extern void * iar_ ## section_name ## _start = __section_begin(#section_name);  \
-    extern void * iar_ ## section_name ## _end   = __section_end(#section_name)
-
-#endif
-
-
-/**@brief   Macro to declare a variable to be placed in a named section.
- *
- * @details Declares a variable to be placed in a named section. This macro ensures that its symbol
- *          is not stripped by the linker because of optimizations.
- *
- * @warning The order with which variables are placed in a section is implementation dependant.
- *          Generally, variables are placed in a section depending on the order with which they
- *          are found by the linker.
- *
- * @warning The symbols added in the named section must be word aligned to prevent padding.
- *
- * @param[in]   section_name    Name of the section.
- * @param[in]   type_def        Datatype of the variable to place in the given section.
- */
-#if defined(__CC_ARM)
-    
-#define NRF_SECTION_VARS_ADD(section_name, type_def) \
-    static type_def __attribute__ ((section(#section_name))) __attribute__((used))
-
-#elif defined(__GNUC__)
-
-#define NRF_SECTION_VARS_ADD(section_name, type_def) \
-    static type_def __attribute__ ((section("."#section_name))) __attribute__((used))
-
-#elif defined(__ICCARM__)
-
-#define NRF_SECTION_VARS_ADD(section_name, type_def) \
-    __root type_def @ #section_name
-
-#endif
-
-
-/**@brief   Macro to get symbol from named section.
- *
- * @warning     The stored symbol can only be resolved using this macro if the 
- *              type of the data is word aligned. The operation of acquiring 
- *              the stored symbol relies on sizeof of the stored type, no 
- *              padding can exist in the named section in between individual 
- *              stored items or this macro will fail.
- *
- * @param[in]   i               Index of item in section.
- * @param[in]   type_name       Type name of item in section.
- * @param[in]   section_name    Name of the section.
- */
-#if defined(__CC_ARM)
-
-#define NRF_SECTION_VARS_GET(i, type_name, section_name) \
-    (type_name*)(NRF_SECTION_VARS_START_ADDR(section_name) + i * sizeof(type_name))
-      
-#elif defined(__GNUC__)
-
-#define NRF_SECTION_VARS_GET(i, type_name, section_name) \
-    (type_name*)(NRF_SECTION_VARS_START_ADDR(section_name) + i * sizeof(type_name))
-      
-#elif defined(__ICCARM__)
-
-#define NRF_SECTION_VARS_GET(i, type_name, section_name) \
-    (type_name*)(NRF_SECTION_VARS_START_ADDR(section_name) + i * sizeof(type_name))
-
-#endif
-
-
-/**@brief   Macro to get number of items in named section.
- *
- * @param[in]   type_name       Type name of item in section.
- * @param[in]   section_name    Name of the section.
- */
-#define NRF_SECTION_VARS_COUNT(type_name, section_name) \
-    NRF_SECTION_VARS_LENGTH(section_name) / sizeof(type_name)
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // SECTION_VARS_H__

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a1481cb2/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/fds/config/fds_config.h
----------------------------------------------------------------------
diff --git a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/fds/config/fds_config.h b/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/fds/config/fds_config.h
deleted file mode 100644
index b158f36..0000000
--- a/hw/mcu/nordic/src/ext/nRF5_SDK_11.0.0_89a8197/components/libraries/fds/config/fds_config.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-#ifndef FDS_CONFIG_H__
-#define FDS_CONFIG_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- /**
- * @file fds_config.h
- *
- * @defgroup flash_data_storage_config Configuration options
- * @ingroup flash_data_storage
- * @{
- * @brief   Configuration options for FDS.
- */
-
-/**@brief   Configures the size of the internal queue. */
-#define FDS_OP_QUEUE_SIZE           (4)
-
-/**@brief   Determines how many @ref fds_record_chunk_t structures can be buffered at any time. */
-#define FDS_CHUNK_QUEUE_SIZE        (8)
-
-/**@brief   Configures the maximum number of callbacks that can be registered. */
-#define FDS_MAX_USERS               (3)
-
-/**@brief   Configures the number of virtual flash pages to use.
- *
- * The total amount of flash memory that is used by FDS amounts to
- * @ref FDS_VIRTUAL_PAGES * @ref FDS_VIRTUAL_PAGE_SIZE * 4 bytes.
- * On nRF51 ICs, this defaults to 3 * 256 * 4 bytes = 3072 bytes.
- * On nRF52 ICs, it defaults to 3 * 1024 * 4 bytes = 12288 bytes.
- *
- * One of the virtual pages is reserved by the system for garbage collection. Therefore, the
- * minimum is two virtual pages: one page to store data and one page to be used by the system for
- * garbage collection.
- */
-#define FDS_VIRTUAL_PAGES           (3)
-
-/**@brief   Configures the size of a virtual page of flash memory, expressed in number of
- *          4-byte words.
- *
- * By default, a virtual page is the same size as a physical page. Therefore, the default size
- * is 1024 bytes for nRF51 ICs and 4096 bytes for nRF52 ICs.
- *
- * The size of a virtual page must be a multiple of the size of a physical page.
- */
-#if   defined(NRF51)
-    #define FDS_VIRTUAL_PAGE_SIZE   (256)
-#elif defined(NRF52)
-    #define FDS_VIRTUAL_PAGE_SIZE   (1024)
-#endif
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // FDS_CONFIG_H__