Commit Graph

311 Commits (mbed-os-5.9)

Author SHA1 Message Date
MateuszM 38652c8a61 Fix for issue #7707 PwmOut inverted
since obj->sequence = &obj->pulse
and most significant bit of sequence denotes the polarity, we should set it.
2018-09-07 17:28:57 +01:00
MateuszM e93472c2c3 Fix for issue #7743 NRF52 Cannot initialize PWM
Deleted lines that caused the problem. Note that, in nrf_drv_pwm_init there are lines that check if pwm instance is already running, so we don't even need to check it in nordic_pwm_init.
nrf_drv_uninit should be used in nordic_pwm_restart.
2018-09-07 17:28:57 +01:00
Andrew Leech 577cb8d8b1 NRF5x: Fix config of LFCLK source / settings. 2018-09-07 17:28:57 +01:00
Jiwon Yune ec47853b86 Generic pin names added 2018-09-07 17:28:57 +01:00
Jiwon Yune 0a3caa01ed SDT52832B added 2018-09-07 17:28:57 +01:00
Jiwon Yune b1558ec4e0 SDT51822B added 2018-09-07 17:28:57 +01:00
Naveen Kaje 3d5aed282e 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-08-23 16:58:05 -05:00
RFulchiero 48fa58ba38 Improved formatting for preprocessor conditionals. 2018-07-27 13:38:58 -05:00
Marcus Chang 71a2a39445 Fix ITM on NRF52 series
The ITM must be initialized before the SoftDevice, but due to the
lazy initialization in C++ on (at least) GCC the ITM init call
might happen too late.

This commit moves the initialization code into the NRF52 system
startup file.
2018-07-27 13:38:58 -05:00
Marcus Chang 87aa896e8a Fix linker script for NRF52832/IAR
IAR linker script was using memory settings from the NRF52840 and
not the NRF52832.
2018-07-27 13:38:55 -05:00
Naveen Kaje 9b224fe98f NRF52832 linker script: formatting fix 2018-07-15 22:54:26 -05:00
Naveen Kaje 31db58a6a4 Fix linker script for NRF52840/ARM 2018-07-15 22:54:26 -05:00
Marcus Chang 5b3f54f0ef Fix linker script for NRF52840/IAR
Add missing noinit section.
2018-07-15 22:53:58 -05:00
Marcus Chang c94bab0e6b Allow STDIO pins to be NC in NRF52 series
Prevent ASSERT from triggering when one of the STDIO pins is not
connected.
2018-07-15 22:53:45 -05:00
Marcus Chang e44efbb68e Change NRF52 series UART to only use one SWI channel
This fixes conflicts with the SoftDevice.
2018-07-15 22:53:45 -05:00
Marcus Chang 542d7841cb Fix inconsistent SWI configuration in NRF52 series
All SWI channels except SWI0 is being used by the SoftDevice and
not only SWI1.
2018-07-15 22:53:45 -05:00
Marcus Chang a2e7424063 Remove white space in config files for NRF52 series 2018-07-15 22:53:45 -05:00
Marcus Chang 7b7d9ccca6 Fix interrupt initialization for NRF52 series
In some cases the UARTE interrupt would be enabled with pending
interrupts. This commit ensures that interrupts are only enabled
from a known state.
2018-07-15 22:53:31 -05:00
Marcus Chang 6166005eaa Fix typo in NRF52 series README.md
UART configuration parameters mispelled.
2018-07-15 22:48:50 -05:00
Marcus Chang e409f48bba Fix race condition in serial_api.c for NRF52 series
* Elevate RTC2 interrupt priority to same level as UARTE to prevent
race condition on shared variables.
* Remove unused TXDRDY event code.
* Fix typo in macro.
2018-07-15 22:48:50 -05:00
Przemyslaw Stekiel 126bf17ff4 NRF_52840: Fix us ticker counter size
It has been noticed that there is a problem with us ticker on NRF_52840 board after 32 bit counter has been used for us ticker on NRF52 family boards.
Currently NRF52 symbol is defined only for MCU_NRF52832 (not for MCU_NRF52840) and based on this symbol 16 or 32 bit counter is selected (16 bit for NRF51 family and 32 for NRF52 family).
Since MCU_NRF52840 defines NRF52840_XXAA and provides 32 bit counters, 32 bit counter should be selected also when NRF52840_XXAA symbol is defined.
2018-06-29 17:11:50 +01:00
Marcus Chang 00a0c81217 Improve serial performance for NRF52 series
Time sensitive user callbacks are called through lowest priority
SWI handlers instead of the highest priority UART handler.
2018-06-29 17:10:17 +01:00
Marcus Chang f4aa4ff082 Make serial_putc non-blocking for the NRF52 series
Previous implementation would block until character had been
completely sent, which is not what the API specifies.
2018-06-29 17:10:17 +01:00
Marcus Chang e2ab561e3d Remove whitespace from NRF52 serial_api.c 2018-06-29 17:10:17 +01:00
Melvin van den berg 4d84c0329c - Fixed coding style - Set default pull mode to PullNone in gpio_irq_init 2018-06-29 17:10:17 +01:00
Melvin van den berg f59655629e Fixed broken InterruptIn.mode() in NRF5x target which didn't do anything: interruptIn always remained with pullup resistor enabled. 2018-06-29 17:10:17 +01:00
Marcus Chang 4a5e6a9d7d Fix SPI initialization for NRF52 series
New changes to Mbed error reporting in 5.9 exposed bug in SPI
driver where an instance was uninitialized twice which triggered
an ASSERT.

This fix keeps track of which instance has been initialized and
only calls uninit when it is safe.
2018-06-29 17:10:17 +01:00
Przemyslaw Stekiel 6048944f98 us_ticker_set_interrupt: fix bit-shift operation 2018-06-29 17:10:17 +01:00
Przemyslaw Stekiel 6b9f91a519 Use lp_ticker.c for NRF51 and NRF52 boards 2018-06-29 17:10:17 +01:00
Przemyslaw Stekiel b3de87b62e Use common_rtc.h for NRF51 and NRF52 boards 2018-06-29 17:10:17 +01:00
Przemyslaw Stekiel 1f0f9c2257 NRF5x: Increase lp us ticker interrupt priority
Set the second highest user level, leaving the highest for UART (we are having constant overflows) and two levels below for everything else.
This should increase the timer accuracy.
2018-06-29 17:10:17 +01:00
Przemyslaw Stekiel 1e49e4d45c NRF5x: Add bug fix for the first timer read.
It has been noticed that first read value can not be trusted.
2018-06-29 17:10:17 +01:00
Przemyslaw Stekiel d6b7367bac Use common us_ticker.c for NRF51 and NRF52 boards 2018-06-29 17:10:17 +01:00
Przemyslaw Stekiel 80b100eef5 NRF51, NRF52: Implement us_ticker_free() function. 2018-06-29 17:10:17 +01:00
Przemyslaw Stekiel 9ecbc5b02b common_rtc_set_interrupt: Wrap <ticks_count> before comparisons
RTC counter is 24-bit. Upper layer handles counter size and wraps ticks count when interrupt is to be fired before passing it to common_rtc_set_interrupt(), but for consistency and safety reasons we can wrap it again in the NRF driver.
2018-06-29 17:10:17 +01:00
Przemyslaw Stekiel 97b4f65216 NRF5x: Remove duplicate lp ticker initialization from I2C, flash, trng. 2018-06-29 17:10:17 +01:00
Przemyslaw Stekiel ae5848e29a NRF52_DK: Use 32 bit counter for us ticker (instead 16 bit counter) 2018-06-29 17:10:17 +01:00
Vincent Coubard b80471a005 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-15 13:30:56 +01:00
Andrew Leech 5d751dfb8f Move mbed_lib.json from targets folder to feature_ble folder The functionality added all affects BLE features in use so this location is a better fit. 2018-06-15 13:30:56 +01:00
Andrew Leech 4dc172b875 Expose softdevice configurations via new nordic-ble library definition file 2018-06-15 13:30:56 +01:00
Andrew Leech 2ba88ba8f6 Redirect NRF asserts to mbed error() in TARGET_NRF5x and SDK 14.2 Add related details to TARGET_NRF5x Readme's 2018-06-15 13:30:56 +01:00
Andrew Leech cee87d9cef Comment out the assert test that requires non-existent symbols from linker 2018-06-15 13:30:56 +01:00
Andrew Leech 5759e17a85 Only enable DEBUG_NRF_USER when NDEBUG is not set 2018-06-15 13:30:56 +01:00
Andrew Leech 2615631a4b Address known typo in nrf sdk 11
ref: https://devzone.nordicsemi.com/f/nordic-q-a/14000/nrf_drv_adc-c-doesn-t-compile-with--ddebug_nrf
2018-06-15 13:30:56 +01:00
Marcus Chang 28060c1b63 Fix array overflow in gpio configuration code for NRF5x
Reintroduce PR #6021

https://github.com/ARMmbed/mbed-os/pull/6021

which was accidentally removed by PR #6711

https://github.com/ARMmbed/mbed-os/pull/6711
2018-06-15 13:30:56 +01:00
Vincent Coubard 3fc2d33946 Nordic FIX: place observers sequentially in flash. 2018-06-05 15:05:18 +01:00
Przemyslaw Stekiel 3850c80b43 Make common_rtc.c compatible with SDK 14.2 and move it common dir 2018-05-25 12:33:43 -05:00
Przemyslaw Stekiel 1d1b6cd571 NRF52_DK: disable us ticker in deep-sleep mode
This functionality is required by new sleep standards.
2018-05-25 12:33:42 -05:00
Przemyslaw Stekiel 9ef0083f92 NRF52_DK: use new ticker driver designed for NRF51_DK 2018-05-25 12:33:41 -05:00
Przemyslaw Stekiel fac7d744d5 Disable us ticker in deep-sleep mode. 2018-05-25 12:30:52 -05:00