Commit Graph

547 Commits (065a79e48ac826c28003fdecdcf383d0fb8257ff)

Author SHA1 Message Date
Martin Kojtal a8e87236de
Merge pull request #12368 from mprse/NRF_Serial_Fpga_fix
Fix NRF52840_DK UART driver and adapt FPGA test
2020-02-10 14:26:31 +00:00
Martin Kojtal d847f9f164
Merge pull request #12305 from kivaisan/remove_multi_athandler_support_v2
Cellular: Remove support for multiple ATHandlers
2020-02-07 11:00:41 +00:00
Przemyslaw Stekiel 6a9b4bb64f TARGET_NRF52/serial_api.c: Fix style 2020-02-05 08:47:09 +01:00
Przemyslaw Stekiel fbe8a8e327 NRF52 serial: Trigger TxIrq interrupt manually on enabling
It is required by Mbed HAL API to generate TxIrq interrupt when TXD register is empty (also after enabling TxIrq interrupt):
f73a62afbf/hal/serial_api.h (L144-L147)

The driver uses DMA to perform uart transfer and TxIrq is generated after the transfer is finished.
While enabling TxIrq we will check if TXD reg is empty and manually trigger the interrupt.
2020-02-05 08:47:09 +01:00
Przemyslaw Stekiel 575f9c2d64 Fix NRF51, NRF52 gpio_irq_init() function
Acording to the description in `gpio_irq_hal_api.h` file `gpio_irq_init()` should return 0 on success.
Currently, it returns 1 causing the FPGA test to fail.
2020-02-03 14:23:41 +01:00
Kevin Bracey ba5dd4d8c1
Merge pull request #12153 from mprse/spi_fpga_test_extend
Hackathon: Increase coverage of the SPI master FPGA test
2020-01-31 15:00:02 +02:00
Anna Bridge 0d48a26f82
Merge pull request #12154 from hugueskamba/hk-baremetal-nrf51822-fix
NRF51822: Fix baremetal linker error
2020-01-24 11:21:25 +00:00
Kimmo Vaisanen bd0f939277 Cellular: Remove support for multiple ATHandlers
Major changes:
- Dependency to FileHandle removed from base classes
- AT_CellularDevice owns the default FileHandle and shares it with AT -classes
- Hang-up -detection moved as CellularContext::configure_hup(). Cannot be configured via CellularDevice any more.

Result on NRF52840_DK + BG96:
GCC:
Total Static RAM memory (data + bss): 29360(+296) bytes
Total Flash memory (text + data): 130660(-832) bytes

ARM:
Total Static RAM memory (data + bss): 261554(+8) bytes
Total Flash memory (text + data): 127573(-1193) bytes

IAR:
Total Static RAM memory (data + bss): 25479(+296) bytes
Total Flash memory (text + data): 102418(-527) bytes

RAM increase is because now ATHandler is no longer created with new -operator but is now member of AT_CellularDevice,
so image tool is able to count it. Actually total RAM consumption has decreased due to removed variables.
2020-01-23 09:27:44 +02:00
Martin Kojtal b7c961c4ac
Merge pull request #12220 from hugueskamba/hk-replace-uartserial-nordic
NRF5x targets: Replace UARTSerial references with BufferedSerial
2020-01-17 09:59:56 +00:00
Martin Kojtal 4c4ed0ab78
Merge pull request #12258 from trowbridgec/disable-ep_agora-cell-aux-uart-by-default
Disable the cell AUX UART by default on EP_AGORA
2020-01-15 13:07:28 +01:00
Chris Trowbridge a21a0062af Disable the cell AUX UART by default on EP_AGORA 2020-01-14 12:55:16 -05:00
George Beckstein d8fbfbfeb4 Replace macro "UART1_ENABLED" with corresponding "NRFX_UARTE1_ENABLED". 2020-01-10 11:33:11 -05:00
George Beckstein dd98d0102f Update SDK config for nRF52840 to disable UART1 instance (Mbed serial port uses UARTE peripheral) 2020-01-10 11:32:47 -05:00
aglass0fmilk dc19460fa3 Remove use of deprecated UART driver (as opposed to UARTE). Disable unused TWIM peripheral (deprecated TWI peripheral is currently used for I2C master mode operation). 2020-01-09 16:35:06 -05:00
George Beckstein b6befee4cf Properly configure PRS API so it actually delegates the shared interrupt slot to the appropriate peripheral 2020-01-09 16:35:06 -05:00
Hugues Kamba efd3763467 NRF5x targets: Replace UARTSerial references with BufferedSerial
`BufferedSerial` is `UARTSerial` renamed to convey the original purpose
of the class. It is the recommended buffered I/O serial class.
2020-01-08 15:42:07 +00:00
Hugues Kamba e0c628cbb7 NRF51822: Fix baremetal linker error
Ensure the NRF51822 `us_ticker.c` module content is compiled in only if
the target supports USTICKER.
2020-01-08 15:33:01 +00:00
Martin Kojtal c42125f890
Merge pull request #12151 from hugueskamba/hk-nrf-fix-baremetal-build
NRF5x: Fix baremetal linker error
2020-01-08 14:41:26 +01:00
Hugues Kamba 6afca2460e NRF5x: Fix baremetal linker error
DEBUG_NRF_USER gets defined for build profiles (develop, debug)
which do not define NDEBUG (see nrf_assert.h). Therefore the definition
of the function should also be visible if DEBUG_NRF_USER is defined.
2020-01-03 15:14:09 +00:00
Martin Kojtal a387985c7c
Merge pull request #12144 from hugueskamba/hk-nrf52840-two-mem-region-model
NRF52840: Use 2 region memory model for the ARM toolchain
2020-01-02 10:08:58 +00:00
Antti Kauppila ca7848d854 Refactored away onboard_modem_api because it is not needed at all
All targets must implement soft_- and hard_power_on/off() functions which are practically same what onboard_modem_api offered.
These were seen as a duplicate features and therefore we removed this.
All targets involved have been updated to reflect the changes
2019-12-27 16:04:10 +01:00
Przemyslaw Stekiel 769b7c5256 NRF52x SPI capabilities: rx/tx buffers can have different sizes 2019-12-20 12:56:09 +01:00
Hugues Kamba c3c6cfa8d6 NRF52840: Use 2 region memory model for the ARM toolchain 2019-12-19 15:13:44 +00:00
Przemyslaw Stekiel b2dad08387 Change explicit pinmap to static pinmap 2019-11-28 08:32:12 +01:00
Przemyslaw Stekiel 0e0952fadc NRF52840_DK: Add explicit pinmap support 2019-11-28 08:32:06 +01:00
Martin Kojtal d0d3462781
Merge pull request #11846 from manchoz/manchoz_makerdiary-nrf52840-mdk
Add support for Makerdiary nRF52840-MDK
2019-11-21 10:54:21 +01:00
Martin Kojtal 699372421a
Merge pull request #11790 from 0xc0170/master-rob
nrf52: reset UARTE peripheral in serial_free
2019-11-14 10:42:08 +01:00
Giampaolo Mancini 1804b40fac Fix indentation 2019-11-12 14:48:54 +01:00
Giampaolo Mancini fd3088867e Add support for Makerdiary nRF52840-MDK 2019-11-12 09:56:04 +01:00
Przemyslaw Stekiel b24afed5ae SPI fpga test: use get_capabilities() function to skip test cases for unsupported features 2019-11-06 10:09:20 +01:00
Rob Vlaar 6f31229f48 Workaround to reset UARTE peripheral to be able to go into deep sleep 2019-10-31 15:29:30 +00:00
Przemyslaw Stekiel c83307e96c NRF52: Fix PWM driver
Fix pwm nrf
2019-10-30 14:37:30 +01:00
Martin Kojtal 4b21157085
Merge pull request #11739 from maciejbocianski/nrf52_i2c_byte_rw_fix
Nrf52 i2c byte rw fix
2019-10-28 13:16:49 +01:00
Maciej Bocianski 703348acc8 NRF52: fix i2c byte read/write implementation
i2c_byte_write implementation was broken.
Data sending was inside addressing block

Changed from:
i2c_byte_write
{
   if (start) {
      if (read_address)
         start read;
      esle
         start write;
      write byte;
   }
}

to:
i2c_byte_write
{
   if (start) {
      // if first call after start
      // address for reading or writing
      if (read_address)
         start read;
      esle
         start write;
      } else {
         // send data byte
         write byte;
   }
}
2019-10-28 08:41:12 +01:00
Martin Kojtal 8637069b36
Merge pull request #11698 from kjbracey-arm/armstack
Clean up ARM toolchain heap+stack setup in targets
2019-10-24 11:37:11 +02:00
Maciej Bocianski 7d5f6cf4a9 NRF52: fix i2c timeouts
add tick to us conversion
2019-10-23 15:00:11 +02:00
Kevin Bracey fb6aa3ef4f Clean up ARM toolchain heap+stack setup in targets
ARM Compiler 6.13 testing revealed linker errors pointing out
conflicting use of `__user_setup_stackheap` and
`__user_initial_stackheap` in some targets. Remove the unwanted
`__user_initial_stackheap` from the targets - the setup is
centralised in the common platform code.

Looking into this, a number of other issues were highlighted

* Almost all targets had `__initial_sp` hardcoded in assembler,
  rather than getting it from the scatter file. This was behind
  issue #11313. Fix this generally.
* A few targets' `__initial_sp` values did not match the scatter
  file layout, in some cases meaning they were overlapping heap
  space. They now all use the area reserved in the scatter file.
  If any problems are seen, then there is an error in the
  scatter file.
* A number of targets were reserving unneeded space for heap and
  stack in their startup assembler, on top of the space reserved in
  the scatter file, so wasting a few K. A couple were using that
  space for the stack, rather than the space in the scatter file.

To clarify expected behaviour:

* Each scatter file contains empty regions `ARM_LIB_HEAP` and
  `ARM_LIB_STACK` to reserve space. `ARM_LIB_STACK` is sized
  by the macro `MBED_BOOT_STACK_SIZE`, which is set by the tools.
  `ARM_LIB_HEAP` is generally the space left over after static
  RAM and stack.
* The address of the end of `ARM_LIB_STACK` is written into the
  vector table and on reset the CPU sets MSP to that address.
* The common platform code in Mbed OS provides `__user_setup_stackheap`
  for the ARM library. The ARM library calls this during startup, and
  it calls `__mbed_user_setup_stackheap`.
* The default weak definition of `__mbed_user_setup_stackheap` does not
  modify SP, so we remain on the boot stack, and the heap is set to
  the region described by `ARM_LIB_HEAP`. If `ARM_LIB_HEAP` doesn't
  exist, then the heap is the space from the end of the used data in
  `RW_IRAM1` to the start of `ARM_LIB_STACK`.
* Targets can override `__mbed_user_setup_stackheap` if they want.
  Currently only Renesas (ARMv7-A class) devices do.
* If microlib is in use, then it doesn't call `__user_setup_stackheap`.
  Instead it just finds and uses `ARM_LIB_STACK` and `ARM_LIB_HEAP`
  itself.
2019-10-23 14:53:49 +03:00
Giampaolo Mancini c30ca66e2b Add SPDX identifier 2019-10-21 15:41:41 +02:00
Giampaolo Mancini f9674adaad Fix overflow calculation for reload_value.
Please,  note that this patch fixes upstream bug. See:

https://devzone.nordicsemi.com/f/nordic-q-a/51674/maximum-reload-time-for-wdt
2019-10-21 15:41:41 +02:00
Giampaolo Mancini c79f54c67b Remove default conf macro because typo in nRF SDK 2019-10-21 15:41:41 +02:00
Giampaolo Mancini 92a316711e Fix timeout limits 2019-10-21 15:41:41 +02:00
Giampaolo Mancini 10c78f41e8 Add support for nRF52 Watchdog 2019-10-21 15:41:40 +02:00
Martin Kojtal c94ae909a8
Merge pull request #11622 from trowbridgec/increase-nrfx-gpiote-config-num-of-low-power-events
nRF52 SDK 15.0 - Enable more than 1 interrupt
2019-10-16 14:26:04 +08:00
Martin Kojtal ea3ead0349
Merge pull request #11676 from maciejbocianski/nrf5X_fix_i2c_twi_sdk
nrf52 - fix i2c/twi driver
2019-10-15 22:16:19 +08:00
Maciej Bocianski 7cc0b614bb nrf52 - fix i2c/twi driver
Sync TWI driver to sdk version 15.3.0 to get rid of data length limitation
2019-10-12 08:59:57 +02:00
Maciej Bocianski 98939e2749 nrf5x - add missing gpio_set implementation 2019-10-11 08:55:23 +02:00
Chris Trowbridge 26ebc997e0 Increase NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS from a default of 1 to 4 2019-10-03 08:56:39 -04:00
Martin Kojtal fda544a14c
Merge pull request #11566 from trowbridgec/add-default-connectivity-config-for-ep-agora
EP_AGORA: Add config logic to enable BLE, cell, and LoRa by default
2019-10-01 13:17:59 +02:00
Martin Kojtal 7e62cafc82
Merge pull request #11585 from marcemmers/nrf_port_api
NRF52: Fixed missing guard in port_api.c
2019-09-30 14:46:31 +02:00
Marc Emmers a02c50d768 Add newline at end of file 2019-09-30 11:20:56 +02:00