Commit Graph

414 Commits (266d4c43a2e382d7013a98ca6a1cc14a5ffb83b5)

Author SHA1 Message Date
Martin Kojtal e75794ec6e
Merge pull request #9888 from ARMmbed/feature-armc6
ARM Toolchain update to ARM Compiler 6.11(ARMC6)
2019-03-04 12:23:38 +01:00
Senthil Ramakrishnan 84785ae086 Check for __ARMCC_VERSION only 2019-02-28 11:53:00 -06:00
Senthil Ramakrishnan 988aba4fc4 ARMc6 build fixed for Nordic targets 2019-02-28 11:53:00 -06:00
j3hill 5d79ba82e7 QSPI write alignment fix for nRF52x
If the data buffer for a write is not 4-byte aligned, use an aligned 16 byte buffer on the stack
2019-02-27 09:58:32 -06:00
Cruz Monrreal e1736cd06f
Merge pull request #9571 from mprse/fix_9523_rtos_less_issue
Update to 2-region model for HEAP and Stack Memory
2019-02-26 22:50:19 -06:00
Cruz Monrreal 01aeb48d0f
Merge pull request #9767 from TacoGrandeTX/fix_nrf_swo_led2_clash
Remove ITM from NRF52_DK and DELTA_DFBM_NQ620 targets
2019-02-21 11:01:46 -06:00
Cruz Monrreal 59549b8eb4
Merge pull request #9616 from kjbracey-arm/nrf52_atomics
nRF52 serial: Tighten/simplify atomics
2019-02-20 11:58:34 -06:00
deepikabhavnani 2a1211a82a Add heaplimit to NRF52 devices 2019-02-19 15:49:49 -06:00
RFulchiero 5fb5a4a414 Remove ITM from NRF52_DK and DELTA_DFBM_NQ620 targets
The NRF52_DK and DELTA_DFBM_NQ620 have the SWO pin (p0_18) mapped to
LED2. This means that on startup LED2 turns on after the ITM is
initialized which is confusing. Since most users want LED2 usage
instead of SWO we remove the ITM for these targets.

The nRF52 readme is updated to instruct users how to get SWO support
if they need it.
2019-02-19 15:20:36 -06:00
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
Kevin Bracey 5ed7e372db nRF52 serial: Tighten/simplify atomics
Use new atomics (exchange, load, store and bool types) to simplify
and improve the atomics in the nRF52 serial HAL.

* Ensure mutexes are released last and atomically when done
  done inside a critical section.
* Compare-and-swap is not required for the spinlock - exchange is
  sufficient. (Not clear a spinlock is needed anyway, but left in).
* Remove unneeded volatile, and make mutexes bool.
2019-02-05 15:44:04 +02: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