Commit Graph

404 Commits (f29c5b22a1bf2f285dad6ebd1b0a6991a2e68d00)

Author SHA1 Message Date
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
Cruz Monrreal 76827c3704
Merge pull request #7971 from JammuKekkonen/fix_softdevice_memory_reservation_for_nrf52dk
Fix memory reservation for Softdevice in NRF52_DK
2018-09-07 11:46:58 -05:00
Cruz Monrreal ff1a0ede1f
Merge pull request #7995 from yossi2le/revert-pinnames-files
Reverting PinNames.h after PR #7774 changes
2018-09-06 13:20:43 -05:00
Cruz Monrreal 201ec14d45
Merge pull request #7779 from MateuszMaz/fix_for_NRF52_pwm_issues
Fix for nrf52 pwm issues
2018-09-05 20:05:35 -05:00
Yossi Levy acfda5895e Changes in PR #7774 of PinNames.h should be reverted. This commit reverts those files excpet for K82F and K64F which are left as an example 2018-09-05 14:13:05 +03:00
Jammu Kekkonen 1a9999708e Fix memory reservation for Softdevice in NRF52_DK 2018-08-31 14:13:55 +03:00
Maciej Bocianski 3a64383de5 fix qspi address sending for nrf52
fix address sending in qspi_command_transfer
now address is send MSB first
2018-08-31 10:48:37 +02:00
Yossi Levy ed8e170d15 Moving SD, SPIF and FLASHIAP into mbedos and refactoring features storage directory structure. 2018-08-29 12:01:11 +03:00
Martin Kojtal 31a6fb49bd
Merge pull request #7817 from maciejbocianski/qspi_pinnames
standardise QSPI pin names
2018-08-24 21:12:25 +02:00
Martin Kojtal 2d330533a4
Merge pull request #7652 from andrewleech/nrf5x_config_lfclk
NRF5x: Fix config of LFCLK source / settings.
2018-08-24 13:05:24 +02:00
Maciej Bocianski 5195c820e6 standardise QSPI pin names 2018-08-24 12:09:51 +02:00
Ashok Rao 19a571c911 Removing default flow control for BL652 2018-08-22 16:50:22 +01:00
Maciej Bocianski 8b36d6b39a NRF5: fix qspi R/W opcodes mapping 2018-08-22 15:02:05 +02:00
Maciej Bocianski c2cc559aa7 NRF5: fix qspi custom command sending 2018-08-22 15:02:05 +02:00
Maciej Bocianski 1f4cc95f25 fix qspi command transfer for NORDIC
Add address unpacking support.
Only used in erase commands
2018-08-22 15:02:03 +02:00
Martin Kojtal ae7bb17eaf QSPI: add flash pins for nrf52480_dk board 2018-08-22 15:00:16 +02:00
Senthil Ramakrishnan cb4308ad64 Remove changes to Nordic SDK and modify HAL to track qspi init 2018-08-22 15:00:03 +02:00
Senthil Ramakrishnan 10a6fd6549 Add support for 1_1_2 and 1_2_2 modes in HAL 2018-08-22 15:00:01 +02:00
Senthil Ramakrishnan 16d121c5d2 Review fixes and doxygen changes 2018-08-22 15:00:00 +02:00
Senthil Ramakrishnan 009cc8b474 Enabling QSPI headers in Nordic HAL implementation and fix for UART STDIO definitions 2018-08-22 14:59:59 +02:00
Senthil Ramakrishnan 2df58e2d25 Modify QSPI HAL API to include an API for command-transfer operations 2018-08-22 14:59:59 +02:00
Martin Kojtal d1b51b6328 QSPI: initial HAL nrf52840 version
This commit adds QSPI HAL implementation for nrf52840 MCU targets
2018-08-22 14:59:58 +02:00
Andrew Leech 629357270e NRF5x: Fix config of LFCLK source / settings. 2018-08-22 13:55:28 +10:00
Cruz Monrreal 8e25d2d905
Merge pull request #7669 from SigmaDeltaTechnologiesInc/master
SDT64, 8195, 32620, 32625, 51822, 52832B added to targets
2018-08-17 11:10:12 -05:00
Cruz Monrreal b4e88392dd
Merge pull request #7645 from naveenkaje/fix_nrf
nrf_drv_twi: remove redundant nrf_drv_disable call in nrf_drv_twi_uninit
2018-08-15 15:51:21 -05:00
MateuszM 2aa67b8c16 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-08-13 17:39:27 +02:00
MateuszM e1d50193b0 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-08-13 17:29:49 +02:00
Jiwon Yune 04fc7aa36f Generic pin names added 2018-08-06 14:50:19 +01:00
Przemyslaw Stekiel ace821017f Add implementation of ticker_free() function to CI boards.
This PR provides implementation of ticker_free() function for the following boards:
ARCH_PRO
EV_COG_AD3029LZ
EV_COG_AD4050LZ
K22F
K64F
K82F
KW24D
KW41Z
LPC546XX
NRF51_DK
NRF52_DK
NUCLEO_F207ZG
NUCLEO_F401RE
NUCLEO_F429ZI
NUCLEO_F746ZG
REALTEK_RTL8195AM
2018-08-02 09:48:10 +02:00
Jiwon Yune 209a9dcc94 SDT52832B added 2018-08-01 18:21:45 +09:00
Jiwon Yune 784d17f68b SDT51822B added 2018-08-01 18:20:22 +09: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
Przemyslaw Stekiel c0ee843d63 Add lp/us ticker_free() functions stub.
This patch adds only empty stubs of `us_ticker_free()` and `lp_ticker_free()` for all boards where these functions are not implemented.
2018-07-25 08:58:38 +02:00
Cruz Monrreal dd6482b955
Merge pull request #7504 from TacoGrandeTX/feature_itm_fix
Feature itm fix
2018-07-18 09:01:13 -05:00
Marcus Chang 9a073c0ae4 Fix linker script for NRF52832/IAR
IAR linker script was using memory settings from the NRF52840 and
not the NRF52832.
2018-07-17 12:43:23 -07:00
Naveen Kaje ed251020b6 NRF52832 linker script: formatting fix 2018-07-12 15:19:13 -05:00
Naveen Kaje 192eb28814 Fix linker script for NRF52840/ARM 2018-07-12 15:19:13 -05:00
RFulchiero 0198481f8f Improved formatting for preprocessor conditionals. 2018-07-12 13:30:36 -05:00
Marcus Chang 10b90edea3 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-12 13:29:24 -05:00
Cruz Monrreal f4c936f455
Merge pull request #7486 from marcuschangarm/fix-nrf52-iar
Fix linker script for NRF52840/IAR
2018-07-12 10:09:12 -05:00
Marcus Chang fd088d2c4e Allow STDIO pins to be NC in NRF52 series
Prevent ASSERT from triggering when one of the STDIO pins is not
connected.
2018-07-11 17:19:18 -07:00
Marcus Chang 6f0bb757f4 Fix linker script for NRF52840/IAR
Add missing noinit section.
2018-07-11 15:48:51 -07:00
Marcus Chang 4bb84fdb71 Change NRF52 series UART to only use one SWI channel
This fixes conflicts with the SoftDevice.
2018-07-09 12:54:09 -07: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
Marcus Chang 01135e30ce Remove white space in config files for NRF52 series 2018-07-09 12:54:08 -07:00
Marcus Chang a0224ed794 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-02 11:13:50 -07:00
Martin Kojtal 44acaf587b
Merge pull request #7369 from marcuschangarm/fix-nrf52-serial
Fix race condition in serial_api.c for NRF52 series
2018-07-02 17:24:16 +02:00
Martin Kojtal 58fa28b9b2
Merge pull request #7313 from mprse/NRF52840_ticker_width_fix
NRF_52840: Fix us ticker counter size
2018-06-29 10:10:40 +02:00
Marcus Chang 2d71866028 Fix typo in NRF52 series README.md
UART configuration parameters mispelled.
2018-06-28 16:38:29 -07:00
Marcus Chang fc087ab32c 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-06-28 16:36:16 -07:00
Przemyslaw Stekiel 9966110dd9 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-27 15:33:07 +02:00
Marcus Chang 6346ba87c0 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-25 17:15:40 -07:00
Marcus Chang ddc709acec 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-25 13:19:15 -07:00
Marcus Chang a42f1d7a81 Remove whitespace from NRF52 serial_api.c 2018-06-25 13:16:11 -07:00
Cruz Monrreal 446de6947a
Merge pull request #7145 from drahnr/master
NRF52: add a separate .nvictable section and allow .noinit to be used…
2018-06-21 23:32:22 -05:00
Cruz Monrreal 0b8f46763a
Merge pull request #7220 from melvinvdb/fix_nrf5x_interrupt_pull_mode
Fix mbed::InterruptIn.mode() in NRF5x targets
2018-06-21 10:31:48 -05:00
Bernhard Schuster 124e15f196 NRF52: attempt to complete 86ce955d96 for ARMCC and IAR 2018-06-21 13:24:49 +02:00
Marcus Chang 6cec180d0b 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-20 15:09:14 -07:00
Cruz Monrreal 84d6b79dec
Merge pull request #7172 from mprse/NRF5x_updates
Unify RTC, lp ticker, and us ticker for NRF51 and NRF52 series
2018-06-20 16:08:05 -05:00
Melvin van den berg 4986daaa7d - Fixed coding style
- Set default pull mode to PullNone in gpio_irq_init
2018-06-19 13:11:31 +02:00
Przemyslaw Stekiel 02d7d25850 us_ticker_set_interrupt: fix bit-shift operation 2018-06-19 08:55:35 +02:00
Przemyslaw Stekiel 80fabcb125 Use lp_ticker.c for NRF51 and NRF52 boards 2018-06-19 08:47:06 +02:00
Przemyslaw Stekiel 4a8de084b9 Use common_rtc.h for NRF51 and NRF52 boards 2018-06-19 08:47:05 +02:00
Przemyslaw Stekiel b073720d62 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-19 08:47:05 +02:00
Przemyslaw Stekiel 7e222f2994 NRF5x: Add bug fix for the first timer read.
It has been noticed that first read value can not be trusted.
2018-06-19 08:47:04 +02:00
Przemyslaw Stekiel 1583cbc78e Use common us_ticker.c for NRF51 and NRF52 boards 2018-06-19 08:47:04 +02:00
Przemyslaw Stekiel cca4090bf6 NRF51, NRF52: Implement us_ticker_free() function. 2018-06-19 08:46:44 +02:00
Melvin van den berg 5fadb26f14 Fixed broken InterruptIn.mode() in NRF5x target which didn't do anything: interruptIn always remained with pullup resistor enabled. 2018-06-14 16:54:03 +02:00
Cruz Monrreal b989afaf79
Merge pull request #6178 from andrewleech/nrf51_16k_s130_linker
Add target definition: nrf51 16k on MCU_NRF51_UNIFIED platform
2018-06-11 09:05:16 -05: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
Cruz Monrreal bacf6a9dec
Merge pull request #6860 from andrewleech/nordic_ble_config
Nordic BLE: Allow configuration of softdevice parameters
2018-06-07 10:10:23 -05:00
Przemyslaw Stekiel 4d56b006d1 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-07 16:06:08 +02:00
Przemyslaw Stekiel ccba52b45b NRF5x: Remove duplicate lp ticker initialization from I2C, flash, trng. 2018-06-07 16:05:56 +02:00
Przemyslaw Stekiel e5e53e5e48 NRF52_DK: Use 32 bit counter for us ticker (instead 16 bit counter) 2018-06-07 16:00:55 +02: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
Bernhard Schuster 86ce955d96 NRF52: add a separate .nvictable section and allow .noinit to be used by the application 2018-06-06 14:04:15 +02:00
Cruz Monrreal 20a4412082
Merge pull request #7089 from paul-szczepanek-arm/fix-master
BLE fixes (SM whitelist creation, Nordic scatter file fix, missing TLS initialisation)
2018-06-04 10:44:54 -05:00
Anna Bridge 2d0e5f04b1
Merge pull request #6022 from andrewleech/nrf_asserts_error
nrf5x: Enable asserts -> mbed_error
2018-06-04 12:24:58 +01:00
Vincent Coubard dfcdbbfb14 Nordic FIX: place observers sequentially in flash. 2018-06-01 16:59:09 +01:00
Andrew Leech bf313aa1db 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-01 13:37:16 +10:00
Andrew Leech c1c425af08 Expose softdevice configurations via new nordic-ble library definition file 2018-06-01 13:37:15 +10:00
Cruz Monrreal cb3f8a5ad3
Merge pull request #7022 from marcuschangarm/fix-gpio
Fix array overflow in gpio configuration code for NRF5x
2018-05-29 10:43:23 -05: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
Przemyslaw Stekiel 77f738baac Move common_rtc.c and us_ticker.h files to the valid directory.
I decided to move these files to the targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51 since us_ticker.h is for sure specific for NRF51_DK and common_rtc.c might be valid also for NRF52, but this needs to be checked while porting NRF52_DK board.
2018-05-25 12:29:55 -05:00
Przemyslaw Stekiel bdfbad8422 Rename DEVICE_LOWPOWERTIMER to DEVICE_LPTICKER. 2018-05-25 12:29:55 -05:00
Przemyslaw Stekiel af2863a9e5 Update lp ticker to be consistent with the new standards.
Provide the following modifications for lp ticker driver:
- According to NRF51_DK reference manual rtc interrupt cannot be controlled by rtc event. In the previous implementation interrupts were enabled permanently and specific interrupt was enabled/disabled by enabling/disabling the specific event. If event is enabled, then event signal is provided to Programmable Peripheral Interconnect (PPI). If interrupt is enabled, then interrupt signal is provided to Nested Vector Interrupt Controller (NVIC). Disable all events permanently. Enable lp ticker overflow interrupt permanently(needed for RTC), disable lp ticker capture/compare interrupt on init (lp_ticker_init) , enable lp ticker interrupt when lp ticker interrupt is set (lp_ticker_set_interrupt), disable lp ticker interrupt on disable request(lp_ticker_disable_interrupt).
- Provide lp ticker data for higher level (freq: 32kHz / len: 24 bits),
- Add the following features to init routine: disable lp ticker interrupt.
- Make ticker driver to operate on ticks instead of us.
- Simplify lp ticker read and set interrupt routines (upper layers handle conversion to us and interrupt scheduling).
2018-05-25 12:29:54 -05:00
Przemyslaw Stekiel 533ad59669 NRF5 - make us ticker to be driven by high speed 1MHz timer
According to new ticker standards the following requirements for us ticker are not met on RRF5 boards:
- has a frequency between 250KHz and 8MHz (currently is driven by 32kHz clock)
- ticker increments by 1 each tick (currently is scaled to 1 MHz by incrementing counter by ~31)

Since BLE softdevice uses TIMER0 the proposition is to use high speed TIMER1 for us ticker configured as follows:
- TIMER counter width: 16 bits (max)
- TIMER frequency: 1MHz
This solution also uses Timer's capture/compare register 0 to specify interrupt time and Timer's capture/compare register 1 to read current timer value.
2018-05-25 12:29:54 -05:00
Bartek Szatkowski 2d19ac1d60 Make sure LPTICKER symbols are not used for builds without it for Nordic 2018-05-25 12:20:09 -05:00
Bartek Szatkowski 6e9f04bf2f Rename DEVICE_LOWPOWERTIMER to DEVICE_LPTICKER
That's to match DEVICE_USTICKER.
2018-05-25 12:20:09 -05:00
Steven Cartmell 18943a9693 Add lp/us ticker free() function implementation for NRF5 2018-05-25 12:17:49 -05:00
Marcus Chang 86f6054ea4 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-05-25 08:25:58 -07:00
Cruz Monrreal 791620c428
Merge pull request #6932 from paul-szczepanek-arm/security-manager-dev
BLE privacy, signing, persistent security database
2018-05-24 10:07:06 -05:00
Cruz Monrreal 2f86c152f0
Merge pull request #6794 from RonEld/cc310_porting
Cryptocell 310 support
2018-05-24 10:05:46 -05:00
paul-szczepanek-arm 80137be991 Merge https://github.com/ARMmbed/mbed-os into security-manager-dev 2018-05-23 09:47:06 +01:00
Andrew Leech 78d31cff5c Fix the flash length to use all of 256K part. 2018-05-23 09:50:52 +10:00
Martin Kojtal 585504f723
Merge pull request #6959 from marcuschangarm/remove-itm
Remove unused ITM implementation from NRF51 series
2018-05-22 14:40:57 +02:00
Andrew Leech 3300d2898b nrf51_16k_s130 Fix flash origin for APP_CODE_BASE
For details see: http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s130.sds%2Fdita%2Fsoftdevices%2Fs130%2Fmem_usage%2Fmem_resource_reqs.html

Set the ram start to 0x20002ef8 to be consistent with ATM_STD and IAR linker scripts
2018-05-22 11:40:10 +10:00