Commit Graph

26 Commits (266d4c43a2e382d7013a98ca6a1cc14a5ffb83b5)

Author SHA1 Message Date
Senthil Ramakrishnan 84785ae086 Check for __ARMCC_VERSION only 2019-02-28 11:53:00 -06:00
Senthil Ramakrishnan 988aba4fc4 ARMc6 build fixed for Nordic targets 2019-02-28 11:53:00 -06:00
j3hill 2a72bb67a3 NRF5x: QSPI SFDP read implementation 2019-01-23 10:24:02 -06:00
Naveen Kaje 28c63ec0f3 NRF52: serial_api: Use polling for putc
There are scenarios where putc is called within a critical section, e.g
to log ASSERTs in early initialization code. The interrupts being
disabled here prevents the handlers for the UARTE from executing.
This breaks the tx_in_progress flag based approach. The tx_in_progress
never gets reset. Poll on the TXDRDY instead.

It can be recreated with a simple program as shown here:

*************** Current Behavior ****************
++ MbedOS Error Info ++
Error Status: 0x80FF0100 Code: 256 Module: 255
Error Message: F

************** With Fix *************************

++ MbedOS Error Info ++
Error Status: 0x80FF0100 Code: 256 Module: 255
Error Message: Fatal Run-time error
Location: 0x2C0A9
Error Value: 0x0
Current Thread: Id: 0x20005520 Entry: 0x30EBF StackSize: 0x1000 StackMem: 0x20004520 SP: 0x20005490
For more info, visit: https://armmbed.github.io/mbedos-error/?error=0x80FF0100
-- MbedOS Error Info --
nrf failure at .\main.cpp:22
***************************************************
2018-09-09 16:33:30 -05:00
Andrew Leech 629357270e NRF5x: Fix config of LFCLK source / settings. 2018-08-22 13:55:28 +10:00
Naveen Kaje db91e7ed02 nrf_drv_twi: remove redundant nrf_drv_disable call in nrf_drv_twi_uninit
i2c_api implementation for NRF52 does a disable() followed by uninit().
The uniinit() implementation in NRF drivers layer makes another call to
disable. This throws off the state of the I2C instance leading to an
assert. Since the disable is only invoked from the I2C API layer for
Nordic, remove this redundant call.

Signed-off-by: Naveen Kaje <Naveen.Kaje@arm.com>
2018-07-30 09:18:43 -05:00
Marcus Chang cfb99d689a Fix inconsistent SWI configuration in NRF52 series
All SWI channels except SWI0 is being used by the SoftDevice and
not only SWI1.
2018-07-09 12:54:09 -07:00
Cruz Monrreal cbee41c6f7
Merge pull request #7150 from pan-/fix-armcc-nrf-sections
Nordic: Fix nrf sections on ARMCC
2018-06-11 08:52:10 -05:00
Vincent Coubard 16ece66f95 Nordic: Fix nrf sections on ARMCC
The nrf section features has different implementations for each compilers supported by mbed-os. The header guard was ruling out compiler other than GCC by checking if __GNUC__ is defined. This check is not applicable on mbed os as the ARM compiler compile sources with gnu compatibility.

This patch makes sure that the right implementation is selected for the right compiler . The previous patch has been reverted as it is not reliable.
2018-06-06 17:18:28 +01:00
Andrew Leech c1c425af08 Expose softdevice configurations via new nordic-ble library definition file 2018-06-01 13:37:15 +10:00
paul-szczepanek-arm 80137be991 Merge https://github.com/ARMmbed/mbed-os into security-manager-dev 2018-05-23 09:47:06 +01:00
Marcus Chang ef9bc9ccc9 Add NRF52 support for building bootloader and updateable firmware
New directory structure:

 * TARGET_SOFTDEVICE_COMMON
 * TARGET_SOFTDEVICE_S112
 * TARGET_SOFTDEVICE_S132_FULL (MBR + SoftDevice, default)
 * TARGET_SOFTDEVICE_S132_OTA (SoftDevice only, for firmware updates)
 * TARGET_SOFTDEVICE_S132_MBR (MBR only, for bootloader builds)
 * TARGET_SOFTDEVICE_S140_FULL (MBR + SoftDevice, default)
 * TARGET_SOFTDEVICE_S140_OTA (SoftDevice only, for firmware updates)
 * TARGET_SOFTDEVICE_S140_MBR (MBR only, for bootloader builds)
 * TARGET_SOFTDEVICE_NONE

The X_OTA and X_MBR binaries are obtained from the original x_FULL SoftDevice
by splitting it in an MBR part and a SoftDevice part. The MBR is needed for
the bootloader and the SoftDevice for firmware updates.

Build application without SoftDevice:

  "target_overrides": {
      "*": {
          "target.extra_labels_remove": ["SOFTDEVICE_COMMON", "SOFTDEVICE_X_FULL"],
          "target.extra_labels_add": ["SOFTDEVICE_NONE"]
      }
  }

Build application for firmware update using SoftDevice X:

  "target_overrides": {
      "*": {
          "target.extra_labels_remove": ["SOFTDEVICE_X_FULL"],
          "target.extra_labels_add": ["SOFTDEVICE_X_OTA"]
      }
  }

Build bootloader without SoftDevice X:

  "target_overrides": {
      "*": {
          "target.extra_labels_remove": ["SOFTDEVICE_COMMON", "SOFTDEVICE_X_FULL"],
          "target.extra_labels_add": ["SOFTDEVICE_X_MBR"]
      }
  }
2018-05-17 07:32:09 -07:00
Vincent Coubard ca5a9f359a Nordic BLE: remove unecessary nordic ble libraries. 2018-05-15 14:51:19 +01:00
Vincent Coubard a22b4e5d5e Nordic BLE: Remove nordic gap init.
This initialization is already done in GattServer.
2018-05-15 14:51:18 +01:00
Vincent Coubard ed20b17d29 Nordic BLE: Fix link count 2018-05-15 14:51:16 +01:00
Marcus Chang 6af843fceb Trim white space and clean up NRF52 configuration files
Removed unused and duplicate macros.
2018-05-13 22:31:17 -07:00
Marcus Chang bb14051588 Fix vector table relocation for NRF52
The vector table relocation sequence depends on:

1. Whether the SoftDevice is present.
2. The Application is a bootloader or not.

If the SoftDevice is present and the application is a bootloader
the MBR must be initialized to trap SoftDevice service calls
before setting the new vector table address.

The SCB->VTOR must be set to point at the MBR as well.

If the SoftDevice is not present the SCB->VTOR can point at the
new vector table directly.
2018-04-27 13:40:50 -07:00
Cruz Monrreal 487576972b
Merge pull request #6720 from marcuschangarm/fix-sdk-spi
Fix bug in Nordic SDK 14.2 SPI driver
2018-04-26 20:17:36 -05:00
Marcus Chang 3edfc77949 Fix bug in Nordic SDK 14.2 I2C driver
Interrupts were not enabled before transmitting data leading to
missed interrupts.
2018-04-23 16:38:31 -07:00
Marcus Chang cba7e0df06 Fix bug in Nordic SDK 14.2 SPI driver
Interrupts were not enabled before transmitting data leading to
missed interrupts.
2018-04-23 16:08:44 -07:00
Marcus Chang b964420bbc Reorganize targets.json for NRF52 based targets
* Consolidated device_has and macros to the main MCU targets.
* Moved errata configuration to mbed_lib.json for HAL implementation.
* Moved clock configuration to mbed_lib.json for HAL implementation.
* Moved UART configuration to mbed_lib.json for HAL implementation.
2018-04-19 09:41:05 -07:00
Donatien Garnier 64baf717e8 Upgrade NRF52 BLE API to version 5
* Add NRF_SD_BLE_API_VERSION=5 macro to MCU_NRF52832 target
* Added initial Softdevice v5 API support for nRF5XPalGattClient.cpp
* Added initial Softdevice v5 API support for nRF5xGap.h
* Added initial Softdevice v5 API support for nRF5xGattServer.cpp
* Make sure the ah() hash function used by the security manager is declared with C linkage
* Removed 'ARM porting pending' checks in Nordic SDK
* Added BLE configuration to mbed_lib.json for NRF52x targets
* Migrated APIs and events model for Nordic SDK14.2 & SD API v5 in btle.cpp; adopted polling dispatch model
* Migrated APIs and events model for Nordic SDK14.2 & SD API v5 in nRF5xn.cpp
* Migrated APIs and events model for Nordic SDK14.2 & SD API v5 in nRF5xGap.cpp
* Added const qualifier to hwCallbacks's p_ble_evt parameter in nRF5xGattServer
* Add workaround to enable Radio Notification module from Nordic SDK
  * Disabled SWI1 interrupt manually from SWI driver module
    * Added missing include directive for "nrf_nvic.h" in ble_radio_notification.c
* Set correct number of custom UUIDs
* Adjust Softdevice RAM requirements for NRF52832/S132
  * RAM settings for the application were adjusted as follow:
    * Start: 0x20003800
    * Size: 0xC800
* Adjust Softdevice RAM requirements for NRF52840/S140
  * RAM settings for the application were adjusted as follow:
    * Start: 0x20003700 (was 0x20003000)
    * Size: 0xC900
* Added 3dBm as a permitted TX Power value for NRF52832
* Fix address type recovery in GAP
* Return min non-connectable adv interval compatible with infrastrcture's expectations
* Moved BLE driver from TARGET_SDK_14_2/FEATURE_BLE to TARGET_SDK_14_2/TARGET_SOFTDEVICE_COMMON/ble
2018-04-19 09:40:41 -07:00
Marcus Chang 3b9ec4932c Flash storage for NRF52
Add fstorage and fds from Nordic SDK for SoftDevice compatible
flash storage. Mbed HAL flash API mapped to use fstorage API
to ensure write and erase doesn't conflict with BLE operation.
2018-04-19 09:40:41 -07:00
Marcus Chang 00713342b9 Switch to managed bootloader for SoftDevice merge on NRF52
SoftDevice can be swapped even easier now:

    "target_overrides": {
        "*": {
            "target.extra_labels_remove": ["SOFTDEVICE_COMMON", "SOFTDEVICE_S140"],
            "target.extra_labels_add": ["SOFTDEVICE_NONE"]
        }
    }
2018-04-19 09:40:41 -07:00
Marcus Chang 39c69f146c Optional SoftDevice for the NRF52 series
Ability to swap SoftDevices using the mbed configuration system.

For example, build NRF52840_DK without SoftDevice:

    "target_overrides": {
        "*": {
            "target.MERGE_SOFT_DEVICE": false,
            "target.extra_labels_remove": ["SOFTDEVICE_COMMON", "SOFTDEVICE_S140"],
            "target.extra_labels_add": ["SOFTDEVICE_NONE"]
        }
    }

Pinned down vector table to beginningn of RAM.
2018-04-19 09:40:41 -07:00
Marcus Chang fc2760ad04 NRF52832 and NRF52840 upgraded to Nordic SDK 14 and SoftDevice 5.0
Initial commit for separating NRF52 code from the NRF51 and for
combining the NRF52832 and NRF52840 SDK to version 14.

nRF5_SDK_14.2.0_17b948a.zip has been used as baseline.

The folders in SDK/components:
 * ble
 * boards
 * device
 * drivers_nrf
 * libraries
 * softdevice

have been copied to TARGET_NORDIC/TARGET_NRF52/TARGET_SDK14.

Each folder contains a README.md file describing any modifications
made to that particular folder. Most common operation is deletion
of files.

If the need arise in the future the missing files can be added again.

The SoftDevices have been moved to TARGET_SOFTDEVICE_x folders for
flexible selection.

ble.h has been renamed to nrf_ble.h to avoid namespace clash with
mbed OS BLE.
2018-04-19 09:40:41 -07:00