Commit Graph

157 Commits (a5f1426a4480ba9f6e27c545072163336ad97c00)

Author SHA1 Message Date
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