Commit Graph

404 Commits (f29c5b22a1bf2f285dad6ebd1b0a6991a2e68d00)

Author SHA1 Message Date
Russ Butler 8d205ab430 Add testing pinmaps to NRF5X devices
Add pinmap tables to the NRF5X families to allow testing.
2019-02-08 09:10:46 -06:00
Russ Butler 8669417e7b Add HAL API for spi pinmap
Add the functions to get spi pinmaps to all targets.
2019-02-08 09:10:37 -06:00
Russ Butler 34c176654d Add HAL API for serial pinmap
Add the functions serial_tx_pinmap, serial_rx_pinmap, serial_cts_pinmap
and serial_rts_pinmap to all targets.
2019-02-08 09:10:28 -06:00
Russ Butler 2ed1dc2bfa Add HAL API for qspi pinmap
Add the functions qspi_master_sclk_pinmap, qspi_master_ssel_pinmap and
qspi_master_data0_pinmap-qspi_master_data3_pinmap to all targets with
qspi support.
2019-02-08 09:10:25 -06:00
Russ Butler be492fe07a Add HAL API for pwmout pinmap
Add the function pwm_pinmap to all targets.
2019-02-08 09:10:19 -06:00
Russ Butler 22a89773fa Add HAL API for i2c pinmap
Add the functions i2c_master_sda_pinmap, i2c_master_scl_pinmap,
i2c_slave_sda_pinmap and i2c_slave_scl_pinmap to all targets.
2019-02-08 09:10:12 -06:00
Russ Butler 4818f88d73 Add HAL API for analog in pinmap
Add the function analogin_pinmap to all targets.
2019-02-08 09:09:51 -06:00
j3hill 2a72bb67a3 NRF5x: QSPI SFDP read implementation 2019-01-23 10:24:02 -06:00
Przemyslaw Stekiel 888f49dade [NORDIC] Support boot stack size configuration option 2019-01-08 15:32:07 +01:00
Martin Kojtal 63eca294a1
Merge pull request #9163 from InfernoEmbedded/fix-8913-partner
Don't use define checks on DEVICE_FOO macros (partner code)
2019-01-07 16:37:24 +00:00
Alastair D'Silva aa80b7c70a Don't use define checks on DEVICE_FOO macros (partner code)
The DEVICE_FOO macros are always defined (either 0 or 1).

This patch replaces any instances of a define check on a DEVICE_FOO
macro with value test instead.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
2018-12-20 20:02:29 +11:00
j3hill 2c4a3d5980 NRF52840_DK: QSPI check Read/Write WORD alignment, and properly set
clock frequency divider

These changes are to enable QSPI functioanlity
for the NRF52840DK.
2018-12-18 13:55:10 -06:00
Martin Kojtal 1c201b4628
Merge pull request #8910 from c1728p9/nrf52_tx_fix
Fix rare NRF52 serial TX lockup
2018-12-05 13:40:03 +01:00
Wilfried Chauveau fd6aa1b568
fix according to @ashok-rao's review 2018-12-03 16:30:46 +00:00
Wilfried Chauveau 1ba5861930
fix copyrights 2018-12-03 16:30:45 +00:00
Wilfried Chauveau 9f8d96a1a3
Add the port for the ACONNO ACN52832 module on MTB's form factor 2018-12-03 16:30:41 +00:00
Russ Butler 131eed9b4f Fix rare NRF52 serial TX lockup
When using UARTSerial sending data over the uart follows the sequence
below:
<-TX done ISR runs and sets a software interrupt to pending
<-Software interrupt fires:
    -disables TX done interrupt
    -calls UARTSerial TX handler which sends bytes until the uart
     buffer filled (writeable returns false). Sending a byte
     re-enables the TX done interrupt continuing the cycle

Due to this sequence, if the UARTSerial TX handler does not send a byte
then the transmit state machine mentioned above will get stuck with
the TX done interrupt disabled. The events causing this failure:
<-TX done ISR runs and sets a software interrupt to pending
<-Software interrupt fires:
    -disables TX done interrupt
    -calls UARTSerial TX handler:
        -checks writeable which is true and sends a byte
            <- interrupted by a higher priority interrrupt
            <- TX done ISR runs, setting software interrupt to
               pending again
        -checks writeable which is true and sends a second byte
    -Software interrupt finishes
<-Software interrupt fires:
    -disables TX done interrupt
    -calls UARTSerial TX handler:
        -checks writeable which is false and DOES NOT SEND A BYTE
    -Software interrupt finishes, the TX interrupt is still disabled
*-Byte gets sent but TX done ISR does not fire

This patch prevents the TX lockup by removing the code in the
software interrupt which disables the TX done interrupt. Disabling the
TX done interrupt at this point is not necessary so this code is safe
to remove.
2018-11-29 19:09:04 -06:00
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