Commit Graph

195 Commits (837ba72cc1debabca1443977f6521f53a519f023)

Author SHA1 Message Date
Martin Kojtal 52aea31655
Merge pull request #8702 from SenRamakri/sen_CrashReportingImpl
Crash Reporting implementation
2018-11-23 20:24:53 +01:00
Martin Kojtal 7995e8beac
Merge pull request #8756 from ashok-rao/br-Murata-BL241
Add Murata WSM-BL241 as new target
2018-11-22 17:55:24 +01:00
Russ Butler 4acdf7012c Disable all NRF52 serial interrupts on init
When initializing serial disable all interrupts as some of these may
have been enabled by a bootloader. This ensures that the NRF52
serial driver remains compatible with any bootloader version.
2018-11-21 14:37:20 -06:00
Russ Butler 9ce3965ae2 Add flow control for RX FIFO filling
When the RX FIFO is nearly full use flow control to stop receiving
data.
2018-11-19 19:21:46 -06:00
Russ Butler 59bb79b05b NRF52 Serial overhaul
Make the following enhancement:
-Support serial port use without flow control
-Prevent dropped bytes by updating flow control handling
-Remove dead code

Serial port use without flow control:
In the prior implementation there was a window of time between
reloading DMA buffers after a timeout where bytes could be dropped.
This is because the uart needed to be turned off in order to flush the
bytes in the DMA buffer.

This change configures the DMA buffer to only receive one byte at a
time so there is no need to disable the uart to flush it. After each
byte is received the DMA transfer will be over so the transfer will
never be partially complete and need flushing. Since the uart is
always on it is safe to use it even without flow control.

Prevent dropped bytes by updating flow control handling:
To prevent dropped bytes due to high latency the flow control handling
of the RTS line was configured to be asserted automatically by
hardware after each byte. Once the CPU has read the byte and setup
the next receive buffer the RTS line is deasserted to the transfer can
continue. This ensure that when flow control is enabled data won't be
lost due to interrupt latency.

Remove dead code:
With the above changes there is a lot of dead code, such as the timer
handling code. This patch removes the code that is no longer used.
2018-11-19 19:21:45 -06:00
Russ Butler 21dd8e40ab Configure NRF52 uart on interrupt attach
When attaching an irq to serial call nordic_nrf5_serial_configure.
This ensures the serial is ready to receive data at the correct
baudrate.
2018-11-16 17:35:54 -06:00
Marcus Chang bb98ce082e Make serial_putc for NRF52 non-blocking
Busy-wait before sending a charecter instead of after. If
serial_writeable has been called first, the busy-wait loop will
be skipped.

Added initialization code to ensure NRF_UARTE_EVENT_TXDRDY is
armed correctly.
2018-11-16 17:32:53 -06:00
Russ Butler 4cda158e55 Fix uart race condition dropping bytes on NRF52
In nordic_nrf5_uart_event_handler if the events NRF_UARTE_EVENT_ENDRX
and NRF_UARTE_EVENT_RXSTARTED become pending after the check for
NRF_UARTE_EVENT_ENDRX but before the check for
NRF_UARTE_EVENT_RXSTARTED the RX DMA buffers will be setup incorrectly
by nordic_nrf5_uart_event_handler_rxstarted because active_bank hasn't
been updated. This cause dropped and incorrect data.

This patch fixes that problem by adding a second check for
NRF_UARTE_EVENT_ENDRX after checking for NRF_UARTE_EVENT_RXSTARTED
and skipping processing if NRF_UARTE_EVENT_ENDRX is set. The
subsequent interrupt will process both in the correct order. This
ensures that these events cannot be handled out of order and thus fixes
the corruption.
2018-11-16 17:30:31 -06:00
Senthil Ramakrishnan ef8c1c3cb6 Linker script modifications for crash data region 2018-11-16 13:59:59 -06:00
Ashok Rao ff55961c1f Changing license header 2018-11-16 15:38:11 +00:00
Ashok Rao fce42ae28e Incorporating review comments 2018-11-16 14:28:08 +00:00
Ashok Rao ec78ca937f Adding LED defines for CI 2018-11-16 09:51:32 +00:00
Ashok Rao 1bdfcba99b Removing unnecessary pin defines 2018-11-15 18:39:17 +00:00
Ashok Rao 8ef1378644 Adding Murata WSM-BL241 as new target 2018-11-15 18:28:24 +00:00
David Saada 542744d03c Support erase value in Flash HAL drivers, FlashIAP and block devices 2018-11-07 14:23:07 +02:00
Marcus Chang ab04ff1219 Remove debug flow control from NRF52_DK and NRF52840_DK
Currently flow control is not supported by the CI and enabling it
causes unwanted side effects.
2018-10-25 12:24:48 -07:00
Marcus Chang 1ad3b49599 Fix hardware flow control on NRF52 series
Due to buggy flow control logic in the UARTE, the stop signal
is not being set as it is supposed to when the the module is
not ready to receive data.

This commit signals the sender to halt transmitting when a DMA
buffer is full and only continue again when the atomic FIFO
buffer has been emptied. This allows platforms with hardware
flow control to minimize all buffers and rely on flow control
instead.
2018-10-24 13:11:12 -07:00
Naveen Kaje 7beb8d3f4b NRF52 : Fix UART RTS initialization
The preprocessor based macro check #if evaluates all
enums as 0 and hence the code does not get compiled.
Since move this to a runtime check where the pin variable
can be correctly evaluated.

Delete mbed_overrides.c as it has a target specific mbed_sdk_init() to
resolve linking problem.

This is a follow on patch to:
https://github.com/ARMmbed/mbed-os/pull/8046
2018-10-23 09:44:06 -05:00
Cruz Monrreal e942582045
Merge pull request #8454 from ashok-rao/br-BL654-new
Adding Laird BL654 as a new MTB target
2018-10-18 17:03:22 -05:00
Ashok Rao bee4429487 QSPI pins added 2018-10-18 11:30:11 +01:00
Ashok Rao 06a5b1e76a Addressing comments w.r.t alignments 2018-10-17 15:36:13 +01:00
Ashok Rao 6f720e86a1 Adding Laird BL654 as a new MTB target 2018-10-17 14:47:17 +01:00
Cruz Monrreal 50e6de7df2
Merge pull request #8046 from naveenkaje/UART_HWFC_Error_Fix_Upstream_Based
NRF52 serial: Fix UART console RX
2018-10-16 10:22:25 -05:00
Naveen Kaje fa480c4f15 NRF52: setup the UART_RTS pin during startup to enable console RX
While investigating the RX issue on NRF52_DK after SDK 14 updates,
it is observed that the RX FIFO doesn't get filled up, when the
flow control is disabled. Hence the readable never returns true.
If using Serial interface, the stdio file handles (0, 1, 2) get opened.
This results in configuring the flow control for STDIO, and it is observed
that the RX FIFO gets filled.

However, if RawSerial is used, the STDIO file handles
don't get opened. During the debug process it was observed that if the
flow control is configured once and then set to disabled, RX worked
as expected.

Alternative to this approach is that user application specifically
enables flow control as done in mbed's Greentea test suite. See https://goo.gl/r8nBYH

See https://goo.gl/8VB2qg step 14 for _initio's description.
See test code to reproduce the issue and test fix here: https://goo.gl/AQU1xG

Description
The change in behavior with NRF52's UART RX is documented here. #6891
This change is a fix for the above issue.
2018-10-12 14:43:35 -05:00
Deepika 61404e62d8 Nordic: Fix alignment of execute region to 8-byte boundary
--legacyalign, --no_legacyalign are deprecated from ARMC6 compiler, in order to
remove deprecated flags all linker files (GCC and IAR as well to have uniformity)
should strictly align to 8-byte boundary
2018-10-09 10:15:07 -05:00
Cruz Monrreal 2b3f5bd486
Merge pull request #8061 from naveenkaje/push_uart_flow_control_fix
NRF52: Ensure that we configure hardware after flow control changes
2018-10-08 10:08:03 -05:00
Cruz Monrreal ebb0d02fad
Merge pull request #7861 from ashok-rao/BL652_FlowControl_fix
Removing default flow control for MTB_LAIRD_BL652
2018-10-08 10:05:13 -05:00
Naveen Kaje 72abe51713 NRF52: setup the UART_RTS pin during startup to enable console RX
While investigating the RX issue on NRF52_DK after SDK 14 updates,
it is observed that the RX FIFO doesn't get filled up, when the
flow control is disabled. Hence the readable never returns true.
If using Serial interface, the stdio file handles (0, 1, 2) get opened.
This results in configuring the flow control for STDIO, and it is observed
that the RX FIFO gets filled.

However, if RawSerial is used, the STDIO file handles
don't get opened. During the debug process it was observed that if the
flow control is configured once and then set to disabled, RX worked
as expected.

Alternative to this approach is that user application specifically
enables flow control as done in mbed's Greentea test suite. See https://goo.gl/r8nBYH

See https://goo.gl/8VB2qg step 14 for _initio's description.
See test code to reproduce the issue and test fix here: https://goo.gl/AQU1xG

Description
The change in behavior with NRF52's UART RX is documented here. #6891
This change is a fix for the above issue.
2018-10-02 14:13:03 -05:00
Martin Kojtal 3b17888fe0
Merge pull request #8048 from naveenkaje/upstream_based_uart_fix_for_assert_test
NRF52: serial_api: Use polling for putc
2018-10-01 11:47:31 +02:00
Martin Kojtal 0ded1fa0d7
Merge pull request #7957 from andrewleech/nrf_override_ram_linker
nRF5x: pass ram linker start/length from config system
2018-10-01 11:45:55 +02:00
Martin Kojtal 6a34251b07
Merge pull request #7925 from maciejbocianski/qspi_hal_test_refactoring
Qspi hal test refactoring/update
2018-09-21 09:40:10 +02:00
Andrew Leech a0d7d4eef7 nrf: allow target.mbed_ram_start and target.mbed_ram_size to override settings in linker 2018-09-19 16:13:36 +10:00
Naveen Kaje 9e175db443 NRF52: Ensure that we configure hardware after flow control changes
Call the routines to program the hardware to reflect the updates made to
flow control so that the object and hardware are in synch.
2018-09-10 10:47:28 -05: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
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