Commit Graph

920 Commits

Author SHA1 Message Date
Jintao Lin 53245bd06c [nrf528xx] add received ACK timestamp info to mRxInfo (#5417)
To enable CSL, it is necessary to get received Enh-ACK timestamp so
that the next sample time could be calculated with this timestamp and
CSL phase in CSL IE.
2020-08-20 14:48:04 -07:00
Bob MacDonald e1cc23ce48 [ncp] remove left over references to OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL (#5427) 2020-08-19 12:34:25 -07:00
Li Cao 7db8c6815c [low-power] add csl feature for Thread 1.2 (#4557)
This commit implements the CSL feature in Thread 1.2.

- Add macro definitions for low power to control the compiling of
  source code.

- Add data and methods for running CSL in Mac and SubMac. This mainly
  includes setting CSL parameters, starting/stopping CSL, and the
  timer handling process.

- Add otPlatTimeGetAPI and implementation.

- Add CSL transmission implementation. CSL transmission is a new kind
  of transmission, the related definition and implementaion for the
  whole transmitting process is added.

- Add calling of start/stop CSL in certain cases.

- Implement CSL synchronization maintainence. If a CSL cordinator
  didn't get a frame containing CSL IE for CSLTimeout, the CSL
  receiver is regarded as de-synchronized.

- Add Cli interface for using CSL.

- Implement enhanced Ack with IE. The original code can only generate
  auto ack for Imm-Ack. As CSL requires CSL IE included in enhanced
  ack. This PR implements it.

- Add basic functional test for CSL transmission. More tests
  corresponding to test plan would be added later.
2020-08-18 10:55:33 -07:00
Jintao Lin 3f38068a71 [mac] change address filter and seek function to accept frame without PAN ID (#5389)
In 802.15.4-2015 spec Table 7-2, it is possible to receive frame with
destination address but without destination PAN ID. This commit
changes the address filter function to avoid dropping such frames.
2020-08-17 22:34:38 -07:00
Michael Spang 5e34b5062d [efr32] switch to proper config #include style (#5409)
Use the config specified on the command line, so that overriding this
with a project specific config doesn't cause preprocessor macro
redefinition errors.
2020-08-16 20:48:21 -07:00
Yakun Xu 8370395c47 [cli] remove multiple servers support (#5387) 2020-08-14 22:15:32 -07:00
Simon Lin e4a9281054 [otns] fix otns status emission built by cmake (#5362)
Seems the strong otPlatOtnsStatus is not used, but the weak
otPlatOtnsStatus was used in the original code if built by cmake.

This commit fixes this issue. Now both cmake and make builds
correctly.
2020-08-10 09:12:38 -07:00
Jonathan Hui f8a6d52695 [cli] add '::' to end of mesh local prefix output (#5344) 2020-08-06 11:52:35 -07:00
Jonathan Hui 73afdadaa8 [cli] print channel mask with leading '0x' (#5344)
To be conssitent with intput format.
2020-08-06 11:52:35 -07:00
Krzysztof Bogucki 7183b24e65 [build] add SPINEL_ENCRYPTER_LIBS option to common switches (#5334)
This option allows to pass Spinel Encrypter library to predefined
Makefiles for different platforms.

Example usage:
make -f examples/Makefile-nrf52840 SPINEL_ENCRYPTER_LIBS=my_encrypter_lib.a
2020-08-05 12:59:28 -07:00
Simon Lin 00f3043a06 [mlr] send MLR.req for local multicast addresses (#5248)
This commit includes:

- Adding compile configurations necessary for MLR features
- Adding source/header files necessary for MLR features
- Send MLR.req for local MAs on ThreadNetif
  - At most one MLR.req is outstanding
  - Reregistration according to PBBR configuration
  - Renewing periods according to PBBR configuration
- BBRs receive MLR.req with minimal processing and send MLR.rsp
- Add a test to verify that MLR.req is sent for local MAs.
2020-07-22 08:38:05 -07:00
Rongli Sun 8d1060fb60 [logging] Add DUA region (#5262) 2020-07-20 23:26:12 -07:00
Simon Lin 434e6bbffc [logging] add MLR log region (#5250) 2020-07-17 08:53:40 -07:00
Bob MacDonald b6027f9e65 [efr32] fix build errors due to recent change of otUdp APIs (#5243)
The commit which resulted in the compilation issues is: dc1d47
2020-07-15 14:37:12 -07:00
Mason Tran 5ce29eb89c [efr32] fix otPlatRadioGetRssi() for MG1, MG12, MG13 (#5238)
This fixes an issue with Channel Monitoring for the EFR32 platform
(MG1, MG12, MG13), where in, turning the radio to a new channel and
immediately gathering background RSSI information was returning
invalid results.

A further investigation with the RAIL team indicated that this issue
was occurring because the usage of `RAIL_GetRssi()` is
incorrect. While the Rail_GetRssi API functions as documented, the
problem is that the current implementation of this API returns valid
results only in certain specified radio states and does not fit the
use case for the OpenThread Channel Monitoring feature. (i.e computing
RSSI value in the RxWarm radio state).

To fix the issue, I am switching the affected platforms to the
efr32mg21 implementation for `otPlatRadioGetRssi()`, which uses
`RAIL_StartAverageRssi()` instead of
`RAIL_GetRssi()`. `RAIL_StartAverageRssi()` uses hardware to trigger
an interrupt once the RSSI is valid and should provide valid results.

This approach was added by Marven when testing DMP support with
OpenThread (https://github.com/openthread/openthread/pull/4321)
2020-07-14 20:48:54 -07:00
Yakun Xu b9a7903f19 [github-action] check with cmake version 3.10 (#5229) 2020-07-13 08:22:00 -07:00
Jintao Lin 4806fa4d0d [platform] fix transmit security for RCP (#5223) 2020-07-10 15:05:54 -07:00
Mason Tran 71c16d9558 [efr32] fix broken radio.c in EFR32MG21 (#5217)
processNextRxPacket() on the EFR32MG21 platform takes a RAIL handle as
a second argument.
2020-07-09 09:15:40 -07:00
Mason Tran d964694d19 [efr32] process received packet immediately (#5197)
When analyzing the energy mode transitions for a sleepy node, running
the sleepy-demo-mtd app, it was observed that, the current
implementation of the platform radio driver (efr32RadioProcess())
although correct, can be optimized by processing the next received
packet (processNextRxPacket()) before other actions being carried out
in this routine. For example, in a situation where a 802.15.4 MAC Ack
needs to be processed in response to a sent packet, adding this call
towards the end of this routine then delays stack notification (that a
Tx was done) until the next call to efr32RadioProcess().
2020-07-08 18:05:36 -07:00
Jintao Lin f7e16fec24 [nrf528xx] add platform radio support for transmit security (#5184) 2020-07-07 13:12:50 -07:00
gabekassel 716e5f0726 [efr32] Silabs EFR32MG1 Platform Support (#5191)
This adds platform support for Silabs EFR32MG1 (series1 Mighty Gecko
with 32K RAM + 64K flash).

A few notes on this commit:

- MG1 cannot fit FTD builds with certain options enabled (like
  diagnostics). In testing, I simply removed FTD from build
  options. We may want to add this to README

- Most platform files are directly duplicated from MG12

- Only created BRD4151A reference. Suspect Silabs team will want to
  add other reference platforms like Thunderboard 1

- Should include latest crypto acceleration changes made by Silabs
  team

- This has been tested using RCP and CLI builds both on BRD4151A WSTK
  and a custom design based on MG1.
2020-07-06 20:08:09 -07:00
Bob MacDonald 2a05a4c5f2 [efr32] fix compilation issues efr32*/flash.c (#5189) 2020-07-03 09:22:35 -07:00
Mason Tran 53c3940c1a [efr32] remove unnecessary nvm3 calls (#5178)
This removes unnecessary open/close calls that were being made when
handling nvm operations.

In a normal mode of operation, the nvm open call should be made only
once during initialization.

The only way these changes could be verified was by building a binary,
flashing it on a node and making sure that the node's network operations
(like forming a network) were okay.
2020-07-02 15:43:43 -07:00
Simon Lin baa6523766 [otns] fix simulation to use strong otPlatOtnsStatus definition (#5171)
- fix otPlatOtnsStatus(weak) is not used
- use the current openthread rather than openthread master
2020-06-30 22:49:50 -07:00
Jonathan Hui 2ebdf874eb [utils] remove wrap_string.h (#5150) 2020-06-25 09:14:18 -07:00
Jintao Lin 5c722a770c [simulation] support transmit security at simulation radio (#5118)
This commit adds transmit security support for simulation radio so
that security Enh-ACK could be handled at radio layer. This commit
also fixes issue #5041.
2020-06-22 12:23:16 -07:00
Bob MacDonald a6116725c0 [efr32] remove extra parenthesis causing compilation problems (#5135)
Remove extra parenthesis introduced with commit b66ac5d causing
compilation error for all efr32mg builds.
2020-06-22 10:09:41 -07:00
Yakun Xu 8248c3d9df [posix] use real time signal for microsecond timer (#5122) 2020-06-19 16:12:55 -07:00
Yakun Xu b66ac5d907 [logging] remove NCP_SPINEL output (#5104)
This commit removes log output NCP_SPINEL and update the original log
output APP to use NCP_SPINEL behavior.
2020-06-19 10:02:53 -07:00
Abtin Keshavarzian c4fd7df086 [logging] add OPENTHREAD_CONFIG_LOG_MESHCOP (#5124)
This commit adds `OPENTHREAD_CONFIG_LOG_MESHCOP` which enable
MeshCoP modules logging. This replaces the use of MLE log config
`OPENTHREAD_CONFIG_LOG_MLE` for controlling MeshCop logging.

The makefiles are also updated to include the new config when
"FULL_LOGS" option is used.
2020-06-19 09:49:38 -07:00
Jiacheng Guo 8367f885ea [simulation] remove linux specific prctl (#5126)
These code is not used since we remove OPENTHREAD_TARGET_DEFINES in
examples/ in 2016.
2020-06-19 08:55:51 -07:00
Jonathan Hui 1326d64a64 [style] replace NULL with nullptr (#5109) 2020-06-17 22:44:54 -07:00
Yakun Xu 3b362071e5 [link-raw] set receive done callback when enabled (#5108) 2020-06-17 14:42:39 -07:00
Jintao Lin e653478c50 [posix] get time offset between host and rcp (#5089)
To support CSL on RCP mode, POSIX host needs to know current time on
RCP. This commit adds function to periodically calculate the time
offset between host and RCP so that host can get an estimated RCP time
by adding its current time with this offset.
2020-06-16 22:53:29 -07:00
Steven Cooreman 30f40fc0fa [efr32] turn off warnings which break certain configurations of mbed TLS (#5091)
Detected on EFR32MG21 with hardware acceleration turned on, all inside
mbedTLS' library/ecdsa.c:

* Turning on ECDSA signing acceleration (MBEDTLS_ECDSA_SIGN_ALT)
  triggers an unused parameter on rs_ctx in
  mbedtls_ecdsa_write_signature_restartable

* Turning on ECDSA verification acceleration
  (MBEDTLS_ECDSA_VERIFY_ALT) triggers an unused parameter on rs_ctx in
  mbedtls_ecdsa_read_signature_restartable

* Turning on both ECDSA signing & verification acceleration
  (MBEDTLS_ECDSA_SIGN_ALT + MBEDTLS_ECDSA_VERIFY_ALT) triggers an
  unused function error on static function derive_mpi

Looking at the latest mbed TLS development branch, it seems this issue
will not be resolved soon. Therefore, we're turning off warnings for
unused parameters and unused functions inside mbedTLS for the platform
which uses this configuration (EFR32MG21).
2020-06-12 10:32:35 -07:00
Steven Cooreman 29bcfee0df [efr32] update mbedTLS configuration to use more hardware acceleration (#5074)
Turns on the following:
* SHA256 acceleration on all EFR32 devices (used for SHA256,
  HMAC-SHA256, ECDSA and DRBG)
* ECDSA/ECDH acceleration on EFR32MG21 (used in DTLS and exposed to
  application through otCryptoEcdsaSign)
* AES-CCM acceleration on EFR32MG21 (in case OT is updated to take
  advantage of mbedTLS' AES-CCM API)
* AES-CMAC acceleration on EFR32MG21 (used for PBKDF2)

Awaiting new GSDK release:
* end-to-end EC-JPAKE acceleration on EFR32MG21 (used in DTLS)
2020-06-11 15:53:05 -07:00
Yakun Xu 55790fb960 [cmake] use ot-config to umbrella private includes (#5079)
- add include directories to ot-config
- remove unused OT_PRIVATE_INCLUDES
2020-06-10 17:03:49 -07:00
Yakun Xu 6a6cbe48f0 [posix] use os defined macros (#5048)
This helps the OT_ASSERT automatically adopt the posix provided assert.
2020-06-04 13:22:49 -07:00
Jintao Lin 201b7b1a3d [mac] move auxiliary frame counter from Mac to SubMac (#4976)
In Thread 1.2, it is possible to receive an IEEE 802.15.4-2015
packet. Per specification, receiver should acknowledge this packet
with an IEEE 802.15.4-2015 ACK(Enh-ACK). This Enh-ACK can include
header IE with it and requires security enabled bit in FCF be set to
true. It is impractical for the host to generate the Enh-ACK and send
to RCP for transmission within AIFS time(192us). So RCP should prepare
the Enh-ACK by itself, which requires it to fill in the frame counter
and do the encryption/authentication.

This commit tries to address the need of filling auxiliary frame
counter in RCP by including the following changes:

- Move frame counter related functions from MAC layer to SubMac layer,
  which is mirrored in RCP.

- Set mMacFrameCounter to RCP using newly added spinel properties.

- RCP reports last used frame counter to host in TxDone and RxDone.

- Add a simulation test for reset verification.
2020-06-03 22:09:16 -07:00
Yakun Xu f302796bd2 [simulation] send enh-ack for 802.15.4-2015 frames (#5039)
This commit changes the simulation radio to send secured enh-ack for
secured frames. This improves code coverage for testing.
2020-06-03 10:59:19 -07:00
Li Cao b9d348c328 [simulation] use ACK frame generation utils (#5033) 2020-06-01 17:06:02 -07:00
Yakun Xu 23ed067d68 [cmake] make ot-config private (#5014) 2020-05-28 10:36:59 -07:00
Yakun Xu 9a3c2dc3b3 [cmake] add ot-config (#5003)
This commit adds an interface target ot-config for collecting compile definitions.
2020-05-26 10:24:22 -07:00
Piotr Koziar d281be6aef [build] change underscore to dash in libmbedcrypto name (#5002) 2020-05-25 17:17:18 -07:00
Simon Lin c2126a392f [cmake] add long routes options (#4859) 2020-05-20 21:02:25 -07:00
Simon Lin fa96bcd10f [otns] allow virtual time UART (#4818) 2020-05-20 17:52:36 -07:00
Yakun Xu 31e600f227 [cmake] allow just build NCP/CLI/RCP (#4953) 2020-05-20 11:30:23 -07:00
Jonathan Hui 132ba9d3fb [continuous-integration] add build checks for jn5189 and k32w061 (#4968) 2020-05-18 09:36:00 -07:00
Łukasz Duda 72109da6f1 [nrf52833] use 2 flash pages for non-volatile memory by default (#4972) 2020-05-15 10:18:49 -07:00
doru91 3122132af8 [examples] add k32w061 platform (#4930) 2020-05-14 14:19:25 -07:00