Commit Graph

243 Commits (5bb3ede8904d2488c60b1d7539dff2edcce87062)

Author SHA1 Message Date
Marcus Chang 0b40ddc530 Initial mbed HAL implementation for NRF5x family
Copied from previous location in targets/TARGET_NORDIC/TARGET_NRF5

Core functionality is working but some peripherals do not.
2018-04-19 09:40:41 -07:00
Marcus Chang d861bda214 Pin configurations for NRF52840 based boards 2018-04-19 09:40:41 -07:00
Marcus Chang 56cf0921ad Pin configurations for NRF52832 based boards 2018-04-19 09:40:41 -07:00
Marcus Chang ad1b986913 Linker scripts and startup files for NRF52840
Flash and RAM offsets have been modified to fit new SoftDevice
2018-04-19 09:40:41 -07:00
Marcus Chang bff552de6c Linker scripts and startup files for NRF52832
Flash and RAM offsets have been modified to fit new SoftDevice
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
Martin Kojtal cf4c7a5d35
Merge pull request #6164 from ashok-rao/br-BL652
Adding Laird BL652 as new target
2018-03-08 17:45:01 +01:00
Marcus Chang 812b9be6d3 NRF5: Customize STDIO pins from config system 2018-03-05 10:12:18 -08:00
paul-szczepanek-arm 8e41de2e25 Merge branch 'master' of https://github.com/paul-szczepanek-arm/mbed-os 2018-02-27 17:23:25 +00:00
Cruz Monrreal 3d37d819e9
Merge pull request #5046 from fkjagodzinski/timerevent_tests
TimerEvent tests
2018-02-26 15:02:52 -06:00
Cruz Monrreal c9cefccbdc
Merge pull request #6116 from marcuschangarm/fix_trng_nrf52
Add TRNG for NRF52832
2018-02-26 12:09:43 -06:00
Maciej Bocianski cd539e3e38 us_ticker_irq_handler call optimization 2018-02-23 09:21:37 +01:00
Martin Kojtal 2661f6fe40 us ticker: fix fire interrupt handling
Few targets need more than just pending IRQ set. They include some flags to be
set that are checked in IRQ handler. This is the case for targets in this
commit.
2018-02-23 09:13:40 +01:00
Cruz Monrreal ee64c9cf0b
Merge pull request #6021 from andrewleech/gpiote_uninit
nrf5x: fix array overflow in gpio configuration code
2018-02-22 21:21:35 -06:00
Ashok Rao 65f210288c Adding Laird BL652 as new target 2018-02-22 11:49:58 +00:00
Marcus Chang 9439c191de Add TRNG for NRF52832
Use SoftDevice API to get random numbers when present and active,
otherwise read random numbers directly from TRNG peripheral.
2018-02-21 12:06:12 -08:00
Cruz Monrreal 80082278b8
Merge pull request #6124 from marcuschangarm/nrf52_flash_fix
Make NRF52 flash work with SoftDevice
2018-02-20 13:31:45 -06:00
Marcus Chang 0a1cae9352 Make NRF52 flash work with SoftDevice
How you write and ersae the flash on the NRF52 changes depending on
whether the SoftDevice is enabled or not.

This change does a runtime check before erasing and writing, and
then chooses the correct function to perform the action.
2018-02-16 13:54:27 -08:00
Marcus Chang 6aa0975d71 itm_api.c implementation for Nordic NRF52 series
SWO frequency: 4000 kHz
2018-02-16 08:24:42 -08:00
Cruz Monrreal ee52f9044a
Merge pull request #5892 from OSHChip/master
add OSHChip as an mbed target
2018-02-14 15:19:26 -06:00
Ashok Rao 6c8b9b5005 Added MTB aliases & default SPI 2018-02-06 13:44:24 +00:00
Andrew Leech f639777dce nrf5x: gpiote uninit only needs to be run if input pin is configured for irq (or output) 2018-02-06 12:51:03 +11:00
Ashok Rao 2e9c3340de Adding LAIRD_BL600 MTB 2018-02-01 17:21:37 +00:00
Cruz Monrreal b08e1b3078
Merge pull request #5837 from ashok-rao/br-ublox-NINA
Adding MTB ublox NINA-B1 as a new target
2018-01-30 14:55:43 -06:00
Ashok Rao e1d901204b Add license info 2018-01-29 12:20:00 +00:00
drewcassidy 5547a09f20
fix typo 😖 2018-01-25 08:24:39 -08:00
drewcassidy e06d1db8ac
Add pinout diagram 2018-01-25 08:24:39 -08:00
drewcassidy a6c69567ee
add board header files 2018-01-25 08:24:38 -08:00
Cruz Monrreal 671c2d7e90
Merge pull request #5346 from scartmell-arm/feature-hal-spec-critical-section
Add Critical Section HAL API specification
2018-01-16 12:49:38 -06:00
Ashok Rao ec719bc2d9 Adding MTB ublox NINA-B1 as a new target 2018-01-12 13:08:27 +00:00
Cruz Monrreal b32828bc37
Merge pull request #5739 from pan-/nordic-new-client
BLE: Nordic pal client implementation
2018-01-11 10:26:47 -06:00
Vincent Coubard 31053273c2 Nordic BLE: Fix stack event size
Read By group type response can return 4 descriptor discovered when the remote server have 4 descriptors with a 16 bit UUID. The handle, UUID pair get stored in a ble_gattc_desc_t that is 20 bytes long.

This PR increase buffer size to handle this use case.
2018-01-10 17:04:35 +00:00
Steven Cartmell 643c8926d5 Remove counter from nordic critical HAL implementation
hal_critical_section_enter() is safe to call multiple times, however
hal_critical_section_exit() is only called on the last exit from a
critical section. This will cause a mismatch in the counter and the
interrupt state will never be restored if the critical section is
nested. Change this to a bool so that the interrupt save state is
tracked for hal_in_critical_section() to work correctly.
2018-01-09 15:35:12 +00:00
Steven Cartmell 061795c489 Move in_critical_section implementation into the HAL
- Add function to HAL hal_in_critical_section()
- Wrap assert in FEATURE_UVISOR macro
2018-01-09 10:41:29 +00:00
Steven Cartmell e14bee5209 Fix potential race condition in critical section HAL API
Call underlying HAL implementation to enter critical section/disable interrupts
before incrementing the global critical section counter.

Modify HAL implementations to track first entrances to the critical section and
only update the saved state on first enter.
2018-01-05 14:55:58 +00:00
Steven Cartmell 3c9ae7bf1c NRF51_DK: Add Critical Section HAL implementation 2018-01-05 14:55:57 +00:00
Jimmy Brisson b2495c7a8d
Merge pull request #5595 from nvlsianpu/bugfix/nordic_critical_section
fix nordic critical section
2018-01-04 09:52:32 -06:00
Andrzej Puzdrowski ae41c7db17 Implementation of critical section primitives
which can be called from diferent contexts.

Orginal nordic critical primitives must been called in pairs
from exacly the same function. As mbed hal call it in separate
methods, so they are not suitable here.
2018-01-03 11:39:15 +01:00
Dexter Fryar 30e1e0a349 Add app_start config system support for NRF52840 for bootloader 2017-12-20 08:25:14 -06:00
Andrzej Puzdrowski b084812eff current critical section implementation makes possible that interrupt
signals are lost. It was observed at last for tests-api-spi ci-test-shield's
test.

This patch introduce usage of sdk5 origin implementation in which
sd_nvic_critical_region_enter/exit is calling each time critical region
is enter/exit. This fixes the issue.
2017-11-28 09:44:28 +01:00
Martin Kojtal 1fa09fa43d
Merge pull request #5487 from nvlsianpu/bugfix_5462_initial_pin_value
Fix bug for issue:  initial pin value not retained
2017-11-16 16:13:13 +00:00
Andrzej Puzdrowski edb86500b5 Fix bug for issue 5462, initial pin value not retained
For api usage like DigitalOut led(LED1, 1) the hal function gpio_write()
sets the output before f. gpio_mode() is called. gpio_mode() clears the
output as it take never writen parameters (gpio_cfg_t.init_hight).

This patch use internal hardware register of GPIO output instedad of above paramiter latch
for retaining proper writen state.
2017-11-13 16:44:56 +01:00
johnny a2c78e104a Add support for RedBear's BLE Nano 2
Cribbed from 4bf42f2e20

I'm not sure if if there are any copyright issues here with what is
effectively a set of config files. A few folks have been bugging me (and
the redbear folks) for these changes, so I wanted them somewhere
centralized.
2017-11-02 17:43:12 -04:00
Jimmy Brisson 0b796cdbb9 Merge pull request #5187 from nvlsianpu/fix_i2c_timeout
nRFx: Use us ticker for I2C timeout
2017-10-13 09:20:14 -05:00
Jimmy Brisson 5c3ce0a84c Merge pull request #5200 from nvlsianpu/nrf51_adcIn_range_extend
Extend nRF51 AnalogIn voltage range to 3.6 V
2017-10-09 11:14:41 -05:00
Andrzej Puzdrowski 2a0d38eaf6 fix bug: I2C timeout due the clos strething by slave on nRFx SoC
Change implementation of timeout to one that is using us_ticker hal.
Timeout is now configurable by I2C_TIMEOUT_VALUE_US macro and this
value will be imported if will be defined externaly.
2017-10-09 14:14:54 +02:00
Andrzej Puzdrowski 93fb667b6d Fix: DigitalIn of nRF5x was allocating GPIOTE channel
The allocation of GPIOTE channels for DigitalIn is unwanted behavior.
This caused early run-out of channels for InterruptPin.
This patch replacing input configuration that is using gpiote driver by configuration that is
using gpio hal.
2017-09-27 09:49:48 +02:00
Andrzej Puzdrowski f861b37196 Extend nRF51 AnalogIn voltage range to 3.6 V
Previous the voltage range was set to 1.2 from SoC internal reference source.
This caused problem with testing. It is unexpected that range is much
shorter than vdd as well.

The voltage range was extended using SoC build in analog prescaler (set to 1/3).
2017-09-26 11:31:50 +02:00
Jimmy Brisson ca41a0f59d Correct uninit region for nordic targets 2017-09-13 14:51:27 -05:00
Jimmy Brisson d3b33d75a4 Correct NRF SDK11 assembly 2017-09-11 13:20:33 -05:00
Jimmy Brisson 4da4c1f5ce Correct compiler switching in Nordic code 2017-09-11 13:20:32 -05:00
Jimmy Brisson 15a9a0382b Enable Compiling with ARMC6 across all targets
remove duplicate sys.cpp
2017-09-11 13:20:32 -05:00
Russ Butler c3eae587eb Add tickless support for devices without SysTick
Some Cortex-M0 devices, such as the nrf51, don't have the SysTick.
Instead, these targets use a software interrupt to simulate SysTick.
Add the hooks in the tickless code to support these devices. Targets
which do not have SysTick should now define NO_SYSTICK in targets.json
and implement mbed_get_m0_tick_irqn to add os suport.

This patch also removes os tick handling from the existing devices
(nrf51) since this is now handled in common code.
2017-09-07 21:35:04 -05:00
Jimmy Brisson 74387f8c78 Merge pull request #4765 from iotvietmember/add_vbluno52
Add support for the VBLUno52 board
2017-07-27 09:45:53 -05:00
Jimmy Brisson 1f94ede86c Merge pull request #4744 from deepikabhavnani/spi_issue_4743
Allow user to set default transfer byte for block read
2017-07-24 14:45:30 -05:00
iotvietmember bd49f4303e Add support for the VBLUno52 board
Fix ERROR_PATTERN in VBLUNO52 config

Signed-off-by: iotvietmember <robotden@gmail.com>
2017-07-22 11:23:51 +07:00
Deepika 1b797e9081 Closed review comments
1. Doxygen and Grammar related
2. Change dummy to spi_fill
3. Remove NXP driver and add default loop in spi block read (same as all
other drivers)
2017-07-21 09:46:22 -05:00
Jimmy Brisson adfed0f9de Merge pull request #4644 from 0xc0170/fix_ticker_delta_negative
Ticker: add fire interrupt now function
2017-07-17 11:05:46 -05:00
Martin Kojtal c295187750 Merge pull request #4634 from nvlsianpu/bugfix/issue_4357_I2C_SPI_simultaneously
Fix the issue #4357: NRF52 doesn't support simultaneous use of I2C and SPI.
2017-07-13 16:53:33 +02:00
Martin Kojtal 06ff4f8bf2 Merge pull request #4693 from pan-/fix#4658
Nordic: Fix multiple defined symbol.
2017-07-13 16:43:09 +02:00
Martin Kojtal 08dfc8458e Merge pull request #4736 from pan-/fix_nrf52_idle_stack
NRF52832: Extend idle thread stack size to 512 bytes.
2017-07-13 16:36:38 +02:00
Martin Kojtal 10ea63b8e7 Ticker: add fire interrupt now function
fire_interrupt function should be used for events in the past. As we have now
64bit timestamp, we can figure out what is in the past, and ask a target to invoke
an interrupt immediately. The previous attemps in the target HAL tickers were not ideal, as it can wrap around easily (16 or 32 bit counters). This new
functionality should solve this problem.

set_interrupt for tickers in HAL code should not handle anything but the next match interrupt. If it was in the past is handled by the upper layer.

It is possible that we are setting next event to the close future, so once it is set it is already in the past. Therefore we add a check after set interrupt to verify it is in future.
If it is not, we fire interrupt immediately. This results in
two events - first one immediate, correct one. The second one might be scheduled in far future (almost entire ticker range),
that should be discarded.

The specification for the fire_interrupts are:
- should set pending bit for the ticker interrupt (as soon as possible),
the event we are scheduling is already in the past, and we do not want to skip
any events
- no arguments are provided, neither return value, not needed
- ticker should be initialized prior calling this function (no need to check if it is already initialized)

All our targets provide this new functionality, removing old misleading if (timestamp is in the past) checks.
2017-07-13 12:23:25 +01:00
Vincent Coubard 3f4e839957 NRF52832: Extend idle thread stack size to 512 bytes.
Fix a crash where the idle thread stack size overflows. This crash
was depending on the compiler and standard library used.
2017-07-11 11:55:47 +01:00
Vincent Coubard 17b68d7c50 Nordic: Fix multiple defined symbol.
The symbol Systick_Handler was defined as a weak symbol in us_ticker.c and
startup_nRF51822.s. While it work as expected when an application is compiled
from mbed OS source code it creates a duplicate symbol issue when mbed OS is
bundled as a library.
2017-07-03 15:07:06 +01:00
andreas.larsson 461c1b8492 Set LED4 the same as LED3 to get tests-mbedmicro-rtos-mbed-timer to pass. If set to NC the test will assert. 2017-06-30 12:29:38 +02:00
Jimmy Brisson 916bc4d953 Merge pull request #4629 from iotvietmember/add_target_vbluno51
Add support for VBLUno51 board
2017-06-29 11:08:19 -05:00
iotvietmember 96e932525b Remove comment in sdk_config.h
Signed-off-by: iotvietmember <robotden@gmail.com>
2017-06-27 21:27:40 +07:00
Andrzej Puzdrowski 080c5af88b remove hardcode uart pins definition for nRF52 SoCs
Each boards define its own pins.
2017-06-27 16:00:52 +02:00
Andrzej Puzdrowski 323633611c nrf5 spi_api - coding style enhancement 2017-06-27 10:44:21 +02:00
Andrzej Puzdrowski c1870afa86 Bugfix: #4357 simultaneous using of I2C and SPI.
Use serial-box of Nordic nRF5 SDK to share resource between
SPI and I2C.
SPI is allocated from highest hw instance number resource in order
to allocate as many I2C instances as possible.
2017-06-27 10:44:20 +02:00
iotvietmember 5c0c964291 Add support for VBLUno51 board [TARGET_VBLUNO51]
+ VBLUno51 board:
Nordic nRF51822
Bluetooth Low Energy
DAPLink interface
Arduino UNO pinout compatible
4 Power

+ Wiki: https://vngiotlab.github.io/vbluno/

+ Pass all test case in mbed test suite

Signed-off-by: iotvietmember <robotden@gmail.com>
2017-06-25 20:16:58 +07:00
Martin Kojtal d121a43e37 Merge pull request #4597 from theotherjimmy/travis-upcase-asm
Assert that all assembly files are named correctly in travis
2017-06-21 09:50:47 +02:00
Jimmy Brisson c7d6bbe295 Upcase all assembler file extensions 2017-06-20 14:50:08 -05:00
Vincent Coubard 970ee38079 NRF52840: Adjust idle thread stack size.
A stack size of 256 bytes is not enough on the NRF52840, this patch
changes it to a size of 512 bytes.
2017-06-16 10:15:03 +01:00
Martin Kojtal e850355a16 Merge pull request #4509 from kegilbert/17q2-spi_sdcard-rebase2
NRF52840: enabled SdBlockDevice capability
2017-06-09 15:07:03 +01:00
Russ Butler 805374ed89 Restore cmsis_nvic for Cortex-M0 targets
Restore cmsis_nvic (cmsis_nvic.c and cmsis_nvic.h) files for the
implementations which use a mechanism other than the VTOR to set
interrupts. These are vendor specific and were done for M0 devices
which do not have a VTOR.

Note - There were two cmsis_nvic files which did not use the VTOR that
which not restored in this patch. This is because these targets were
not M0 devices and could use the new unified implementation instead.
These files are:
targets\TARGET_ARM_SSG\TARGET_MPS2\TARGET_MPS2_M0P\device\cmsis_nvic.c
targets\TARGET_ONSEMI\TARGET_NCS36510\device\cmsis_nvic.c

Note - cmsis_nvic.c and cmsis_nvic.h were initial removed in
(and restored from) the commit:
b97ffe8fdc -
"CMSIS5: Replace target defined NVIC_Set/GetVector with CMSIS implementation"
2017-06-08 22:50:23 -05:00
Kevin Gilbert f324647aae Original pull request had added these checks to a deleted file. Replicating that change to allow builds on the NRF52840_DK (see original PR #4088 to see the explanation for the removal of spi async) 2017-06-08 17:31:24 -05:00
Andrzej Puzdrowski baf45b6596 [NRF52840]: disbale SPIM which fix block device 2017-06-08 17:31:24 -05:00
Andrzej Puzdrowski 3dc3329d13 [NRF5840] change: trng_get_bytes returns at last one random byte. 2017-06-07 15:32:57 -05:00
Andrzej Puzdrowski 8edac29db8 [NRF52840]: fix non-blocking mode of TRNG driver
improve coding style.
2017-06-07 15:32:40 -05:00
kl-cruz 8698756c63 [nRF52840] Fixed length in trng in every mode 2017-06-07 15:32:12 -05:00
kl-cruz c32e2c262a [nRF52840] added trng implementation for nrf52840 2017-06-07 15:31:39 -05:00
Sam Grove 5f138810a9 Merge pull request #4294 from ARMmbed/feature_cmsis5
Update CMSIS-Core and RTX to version 5
2017-06-02 23:44:32 -05:00
Martin Kojtal e229a49182 Merge pull request #4207 from geky/spi-remove-byte-locking
spi: Add SPI block-write to C++ and HAL for performance
2017-06-01 14:03:36 +02:00
Bartek Szatkowski 85cc9c8381 Remove deprecated RTX4 config options 2017-05-30 18:55:55 +01:00
Bartek Szatkowski b793a3fb89 Update codebase for CMSIS5/RTX5
Update all of mbed-os to use RTX5.
2017-05-30 18:55:52 +01:00
Bartek Szatkowski b97ffe8fdc CMSIS5: Replace target defined NVIC_Set/GetVector with CMSIS implementation 2017-05-30 18:55:51 +01:00
Sam Grove 58e88813a9 Merge pull request #4282 from kl-cruz/FlashAPI_nRF52840
Flash api nRF52840
2017-05-26 10:31:05 -05:00
Christopher Haster c1de19e49e spi: Added default spi_master_block_write implementation to all targets
There is an easy default implementation of spi_master_block_write that
just calls spi_master_write in a loop, so the default implementation
of spi_master_block_write has been added to all targets.
2017-05-25 12:04:58 -05:00
Jimmy Brisson da9b8f3dee Move duplicated NRF52 + MCU_NRF51822 files into NRF52 2017-05-22 11:26:43 -05:00
Jimmy Brisson e4739835ce Add static to NRF5 SDK11 macro definition 2017-05-19 15:06:41 -05:00
Martin Kojtal 8f295177ce Merge pull request #4317 from c1728p9/reduce_test_overhead
Reduce test overhead in preperation for CMSIS 5
2017-05-17 10:13:25 +01:00
kl-cruz 5cac624a2d nRF52840: Align sources after rebase 2017-05-17 09:21:51 +02:00
kl-cruz 4bb818cd97 nRF52840: Fixed flashapi test and casting issue 2017-05-17 09:21:39 +02:00
kl-cruz 98d4a13959 nRF52840: Aligned sources to coding standard 2017-05-17 09:21:27 +02:00
kl-cruz 7761af2b8d nRF52840: Removed unused, commented code 2017-05-17 09:21:17 +02:00
kl-cruz bd25d3bbda nRF52840: Added checking if sd is enabled in flashapi 2017-05-17 09:21:05 +02:00
kl-cruz 5e057a685d nRF52840: Cleaned up code 2017-05-17 09:20:54 +02:00
kl-cruz 39b0ef5394 nRF52840: Added flash_api implementation 2017-05-17 09:20:29 +02:00
Bartek Szatkowski c82c40f378 Temporarily increase max number of tasks for small boards
Affected boards: NRF51_DK, NRF52_DK, Beetle. This change is temporary and
will be overwritten by RTX update. It's necessary for the boards to pass
updated tests.
2017-05-15 13:23:08 +01:00