Commit Graph

426 Commits

Author SHA1 Message Date
Yakun Xu 617f8958dd [mesh-forwarder] verify data request is ack with fp=1 (#3785) 2019-04-30 18:37:48 -07:00
Joseph Newman 988be2a7f6 [efr32] further UART driver refactoring (#3776)
- No  longer  queue  2x  32-byte  buffers  for   UART  receive.  Upon
  investigation, the  RAIL library switches these  buffers in software
  (within the  same ISR context as  `receiveDone`), so it  seems to be
  pointless  from  a   performance  perspective  in  queuing  multiple
  buffers. Instead, now work with 64-byte buffers.

- Refactored `updateReceiveProgress` so that extra variable
  `mLastCount` isn't required.

- Extensive testing at higher baud rates revealed race conditions and
  some issues with detecting buffer full conditions.

- Added comments to clarify the logic

- Removed asserts after returning from RAIL library
  functions. Contrary to my previous arguments, if the behaviour of
  the RAIL library functions changes in the future (with regards to
  the errors it returns), then somebody would have to remember to
  check these asserts were still appropriate.
2019-04-26 08:41:52 -07:00
Joseph Newman 02463bdda1 [efr32] improve USART driver error handling (#3745)
* efr32 uart dma changes
* correct handling of queue full
2019-04-16 09:40:01 -07:00
Kamil Sroka 9fa48b54a8 [nrf528xx] don't return OT_ERROR_FAILED from otPlatRadioTransmit (#3757) 2019-04-16 08:22:29 -07:00
Łukasz Duda 62b35b67c3 [nrf52840] update README.md after SDK release (#3759) 2019-04-15 08:38:18 -07:00
Łukasz Duda d3fdf84ee0 [platform] return error on incorrect otPlatRadioDisable usage (#3756) 2019-04-15 08:36:47 -07:00
Joseph Newman 5d2e6cd0d9 [efr32] take advantage of DMA for efr32 USART receive (#3730) 2019-04-08 10:39:45 -07:00
ozanoner 37a662197f [coap] remove otCoapMessage from CoapSecure::DefaultHandler() (#3737) 2019-04-06 21:54:07 -07:00
Yakun Xu 33b903bc62 [posix-app] fix conversion warnings (#3738)
This commit fixes conversion warnings and also adjusts one travis test to
check these kind of issues.
2019-04-06 21:40:54 -07:00
Yuzhuo Yang c02a985609 [diag] use OT_ARRAY_LENGTH to unify code and shrink image size (#3677) 2019-04-03 21:52:07 -07:00
Jiacheng Guo 88912d23ae [nrf52840] signal event in usb cdc (#3715) 2019-04-01 09:05:10 -07:00
dismirlian 81fd8a8b10 [examples] software implementation of source match table (#3717)
* [examples] add software implementation of source match table

* [efr32] modify radio driver to use generic implementation of source match table

* [efr32] configure soft source match table PAN ID
2019-04-01 08:52:47 -07:00
Łukasz Duda 0b6cd5b115 [nrf528xx] add otSysEventSignalPending call in spi-slave driver (#3716) 2019-03-27 08:47:13 -07:00
dismirlian 24d5d3db66 [efr32] minor enhancements to radio driver (#3713)
* Add static linkage to local functions

* Simplify clearing checksum of source match table entry
2019-03-26 08:53:10 -07:00
Jonathan Hui 8ed382207d [efr32] fix build issues when sub-GHz support is not configured (#3704) 2019-03-22 08:11:56 -07:00
Jonathan Hui aaaae937d3 [style] prefer OT_UNUSED_VARIABLE (#3696) 2019-03-19 21:17:33 -07:00
Zhanglong Xia 1af2933449 [efr32] enable BRD4170A to support 915MHz and 2.4GHz by default (#3664) 2019-03-14 09:44:35 -07:00
Kamil Sroka a99816a225 [nrf52811] add emulation on nRF52840 to README.md (#3682) 2019-03-12 23:27:42 -07:00
Łukasz Duda 039aab3fa0 [nrf52840] handle NRF_ERROR_BUSY from SD in flash driver (#3680) 2019-03-12 23:27:16 -07:00
RaKu 6453c9f033 [nrf52840] do not specify interface protocol in USB CDC (#3658)
bInterfaceProtocol descriptor previously indicated that AT V.250 commands
were supported by the device. This could cause issues with applications
managing modems.
2019-03-08 08:28:26 -08:00
Zhanglong Xia 96725a985e [phy] add support for OQPSK modulation in 915MHz band (#3378) 2019-03-08 08:09:55 -08:00
Jiacheng Guo ab12b47182 [posix] do not exit on EINTR in UART (#3643) 2019-03-04 08:38:28 -08:00
Stuart Longland 74ad300556 [cc2538] fix RSSI calibration when CC2592 is in use (#3636)
* Define parameter for RSSI offset.

This defines the RSSI offset as an overridable parameter in the CC2538
configuration for users that have installed a CC2592 on their board but
have hard-wired the HGM pin either to `VDD` or `GND`.

* Calibrate RSSI according to HGM state.

I had actually misread the datasheet a little bit, having gotten
sensitivity and RSSI offset confused.  The values I needed for the
sensitivity were actually in the table *above* where I got the original
figures here from.

This puts the *correct* figures in place, and also defines a function
that returns the RSSI offset based on the state of the HGM pin (or
returns a static value if we omit CC2592 support or disable HGM
control).

* Expose RSSI offset setting in Makefile

* Document RSSI offset parameter
2019-02-28 08:18:56 -08:00
Łukasz Duda db945a5278 [nrf528xx] update platforms README.md (#3633) 2019-02-28 08:17:00 -08:00
Piotr Szkotak 096632a475 [nrf528xx] add radio and random platform fixes (#3634)
* [nrf52811] add radio and random platform fixes

* [nrf528xx] handle all radio driver rx/tx errors
2019-02-27 12:41:41 -08:00
Joseph Newman f9884b8afc [efr32] implement otPlatRadioEnergyScan API (#3631)
* refactor for energy scan API

* rename enum, init status in init func, tidy up and fix issue in GetRssi

* add cast and fix start energy scan error return
2019-02-27 12:03:51 -08:00
Joseph Newman 02d33b9bb9 [efr32] fix cannot compile with log output OPENTHREAD_CONFIG_LOG_OUTPUT_APP (#3625) 2019-02-25 09:27:37 -08:00
Jonathan Hui 5cf3540f6e [efr32] unify flash config around SETTINGS_CONFIG_PAGE_NUM (#3620) 2019-02-25 09:26:26 -08:00
Stuart Longland fd2503e792 [cc2538] add support for CC2538-CC2592-EM (#3609)
* [cc2538] Define registers for control of CC2592.

In order to set up the signals needed to drive the CC2592 front-end, we
need to expose a few registers in the radio module that route internal
module signals to pins on Port C.

TI also recommend hooking the HGM pin of the CC2592 to a GPIO pin so
that the high-gain mode can be software-controlled.  It can be connected
to any GPIO pin, but they call out PD2 specifically for this, so we need
to configure GPIO port C & D.  Since we're here, we'll add B as well.

Some macros of convenience are also added for accessing the Nth element
in an array of 32-bit registers, as well as computing the bit mask of
the Nth GPIO pin.

* [cc2538] Define configuration settings for CC2592.

By default, we disable support for the CC2592 as we do not wish to break
existing OpenThread instances.  The configuration parameters allow
customisation of the locations for the `PA_EN`, `LNA_EN` and `HGM`
signals (within the constraints of the CC2538) for cases where people
have moved the signals around on custom boards.

The defaults work with designs derived off the CC2538-CC2592 EM
reference design.

* [cc2538] Define control interface for HGM pin.

Since the `HGM` signal is under software control, we need to be able to
allow the software to turn it on or off as required.  This exposes two
functions, one of which queries the current state (by looking at the
GPIO register bit-mask), and the other provides a means to change the
state.

* [cc2538] Implement control and calibration of the CC2592.

This implements the control functions defined earlier and adds the
necessary logic for initialising the CC2592.

The transmit and receive power levels are also calibrated.

* [cc2538] Define CC2592 options in Makefile.

This allows building of a CC2538-CC2592 EM image by specifying
`CC2592=1` on the command line.
2019-02-22 08:59:19 -08:00
Marven Gilhespie 18c496d915 [efr32] update to Silicon Labs Flex SDK v2.5 (#3596) 2019-02-19 12:09:49 -08:00
Piotr Szkotak 697aa0259c [nrf52811] fix uart hwfc define in the platform config (#3606) 2019-02-19 08:54:57 -08:00
Piotr Szkotak 80c98ac824 [nrf528xx] update radio driver to version 1.3.0 (#3603) 2019-02-19 08:44:49 -08:00
Łukasz Duda 968f9b6898 [nrf528xx] improve flash API (#3602) 2019-02-18 11:11:13 -08:00
Łukasz Duda 62d5be594d [nrf528xx] improve platform specific configs (#3595) 2019-02-15 09:34:28 -08:00
Abtin Keshavarzian 7a69ae36a1 [slaac] add config option to enable/disable SLAAC support (#3512)
This commit adds `OPENTHREAD_CONFIG_ENABLE_SLAAC` as a build
configuration option to enable/disable SLAAC support within
OpenThread. This feature is disabled by default. This commit also
adds `SLAAC` to `common-switches` list to allow builds to enable
this feature easily.
2019-02-13 18:17:18 -08:00
Łukasz Duda 070fd834e8 [nrf52811] add support for nRF52811 platform (#3566) 2019-02-08 08:41:22 -08:00
RaKu bfe0c492d9 [nrf52840] disable compilation of unused transports (#3561)
Add DISABLE_TRANSPORTS switch which disables build of all transports and examples using them.
Disable compilation of USB and UART transports if NCP_SPI switch is set. This also disables
the build of CLI example.
2019-02-07 08:42:27 -08:00
Abtin Keshavarzian 29d637683f [settings-flash] ensure SETTINGS_CONFIG_PAGE_NUM >=2 (#3416)
This commit adds code to ensure `SETTINGS_CONFIG_PAGE_NUM` is at
least two. This helps simplify the code and also address
Coverity warnings for unreachable code.
2019-02-04 20:46:23 -08:00
Oleksandr Grytsov c31ab99080 [samr21] Define SETTINGS_CONFIG_PAGE_NAME with const (#3491)
Currently SETTINGS_CONFIG_PAGE_NAME is defined indirectly by addresses of
__d_nv_mem_start and __d_nv_mem_end. But such definition doesn't allow to
perform compile time sanity check. Define this macro with const value 16.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov e7a6bde56d [samr21] Implement otPlatLog for SAMR21 XPLAINED PRO board (#3491)
Use EDBG DGI SPI interface to put log.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov 513b0f8b8d [samr21] Pass ack frame to otPlatRadioTxDone (#3491)
SAMR21 RF doesn't provide ACK frame payload. Create it manually and pass to
otPlatRadioTxDone.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov cf7b57a5cf [samr21] Set RF state to OT_RADIO_STATE_RECEIVE on tx finished (#3491)
OT doesn't always call otPlatRadioReceive to set rx state explicitly. It
causes RF is in wrong state in some cases. SAMR21 RF is switched to
rx state internally when tx is finished and OT platform radio state should
be updated accordingly. This fix is set sState to OT_RADIO_STATE_RECEIVE
when tx is done.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov f304177726 [samr21] Add hardware acceleration for the AES block cipher (#3491)
samr21 has HW aes-128 module. It couldn't be used before as mbedtls uses
256 bit random generator. Recently mbedtls introduces
MBEDTLS_CTR_DRBG_USE_128_BIT_KEY flag which makes mbedtls to use 128 bit
random generator. It limits the security of generated keys but allows
to use HW aes-128 module for encrypt/decrypt 802.15.4 frames.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov 0073a49dbd [samr21] Update README.md to latest ASF 3.45.0 (#3491)
* update reference to ASF 3.45.0 and gcc 7.3.1
* update other links

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov c4a7e8570d [samr21] Add possibility to define board with command line (#3491)
By default Makefile-samr21 builds for SAM R21 Xplained Pro board. Another
board can be specified with BOARD variable through command line:

    make -f examples/Makefile-samr21 BOARD=<TARGET_BOARD>

Currently supported following boards: SAMR21_XPLAINED_PRO,
SAMR21G18_MODULE, SAMR21B18_MODULE.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov 9fee87c071 [samr21] Remove memcpy from otPlatRadioTransmit (#3491)
samr21 rf driver requires that first byte of transmit buffer should be
psdu length. The psdu was copied to a local buffer with one byte shift then
the local buffer was passed to rf driver. This copying is removed by
extending length of sTransmitPsdu by 1 byte and use &sTransmitPsdu[1] as
transmit frame psdu.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Oleksandr Grytsov 68d527a530 [samr21] Fix compilation issue with gcc 7.3.1 (#3491)
Internal compiler.h defines __always_inline macro and includes cdefs.h
indirectly. cdefs.h also defines this macro. As result we have redefined
macro error which can't be suppressed. The fix is to use custom compiler.h
which is copy of ASF compiler.h bu defines __always_inline only if it is
not yet defined.

Signed-off-by: Oleksandr Grytsov <al1img@gmail.com>
2019-02-04 18:24:37 -08:00
Jeffrey Hayes 2c866feb48 [efr32] random number generation fix (#3367) 2019-02-04 15:59:18 -08:00
erja-gp 392cfecff8 [qpg6095] add Qorvo QPG6095 platform (#3525) 2019-02-04 10:50:27 -08:00
Yakun Xu e68e86317e [ci] test with time sync and header ie (#3514)
This commit adds the missing test with ie present by enabling TIME_SYNC
feature, so that IE code are covered.
2019-02-01 16:08:43 -08:00