Commit Graph

54055 Commits

Author SHA1 Message Date
Jonathan Hahn 7346ba0106 drivers: sensor: add const qualifier to conversion
sensor_value_to_double should never alter the given value of val.
Therefore adding a const qualifier makes sense.

Signed-off-by: Jonathan Hahn <Jonathan.Hahn@t-online.de>
2021-07-19 18:16:52 +03:00
Jedrzej Ciupis 25ebb42bd9 net: pkt: remove ieee802154_frame_retry flag
Flag that indicates if a given packet is being retransmitted has become
obsolete since more detailed flags were added. This commit removes the
flag and references to it altogether.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2021-07-19 18:15:56 +03:00
Jedrzej Ciupis a55c0b0531 drivers: ieee802154: align with API changes
This commit aligns the nRF5 ieee802154 driver with the latest
API changes necessary to handle security-related flags properly.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2021-07-19 18:15:56 +03:00
Jedrzej Ciupis 6b4dd56579 manifest: update hal_nordic revision
This commit updates hal_nordic revision to bring the latest changes in
the nRF IEEE 802.15.4 radio driver.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2021-07-19 18:15:56 +03:00
Jedrzej Ciupis b66da81d18 net: pkt: add IEEE 802.15.4 security-related flags
This commit extends the struct net_pkt structure to contain flags
related to IEEE 802.15.4 security processing. Added flags:
 * ieee802154_frame_secured - indicates if a frame is authenticated and
encrypted according to the configuration stored in Auxiliary Security
Header
 * ieee802154_mac_hdr_rdy - indicates if MAC header is ready to be
transmitted or if it requires further modifications

These flags can be used by the upper layer to correctly configure
retransmissions of frames.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2021-07-19 18:15:56 +03:00
Vinayak Kariappa Chettimada c1792c002d Bluetooth: Controller: Fix HCI reset assert initiating on coded PHY
Fix HCI Reset Command from asserting when there is pending
connection creation requested on coded PHY.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:19:25 +02:00
Vinayak Kariappa Chettimada a5ac9c65f1 Bluetooth: Controller: Fix SID for legacy advertising reported
SID value for legacy advertising reported shall be 255.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:19:15 +02:00
Vinayak Kariappa Chettimada f9d693b93d Bluetooth: Add define for invalid Extended Advertising SID value
Add a define for invalid Extended Advertising SID value of
255 required when generating legacy advertising report.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:19:15 +02:00
Vinayak Kariappa Chettimada 8818c51cec Bluetooth: Controller: Use sizeof(uint8_t) for Tx Power field size
Use sizeof(uint8_t) for Tx Power field size instead of
auto-increment ++.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:19:00 +02:00
Vinayak Kariappa Chettimada 1922a0e982 Bluetooth: Controller: Add target address into common extended header
Add and retain in subsequent updates the target address
in the auxiliary PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:19:00 +02:00
Vinayak Kariappa Chettimada 6e0692fc4c Bluetooth: Controller: Fix legacy advertising PDU length initialization
Fix missing initialization of legacy advertising PDU length
when advertising sets are reused between extended and legacy
advertising modes.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:18:40 +02:00
Vinayak Kariappa Chettimada e34ec9fc25 Bluetooth: Controller: Use BT_CTLR_BROADCAST_ISO Kconfig option
Use CONFIG_BT_CTLR_BROADCAST_ISO when CONFIG_BT_CTLR_ADV_ISO
or CONFIG_BT_CTLR_SYNC_ISO Kconfig option is supported.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:18:31 +02:00
Vinayak Kariappa Chettimada ba6be70129 Bluetooth: Controller: Added comments for CSA #2 implementation
Added Bluetooth Specification references to the
implementation of Channel Selection algorithm #2 in the
Controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:18:31 +02:00
Vinayak Kariappa Chettimada 7b12723aad Bluetooth: Controller: Replace test vector inputs with auto variable
Replace hard coded channel map count and channel identifier
with an auto variables.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:18:31 +02:00
Vinayak Kariappa Chettimada 0cb3d31e54 tests: Bluetooth: Controller: Cover in-system tests in CI
Include the in-system tests Kconfig option in build-only and
babblesim tests.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:18:31 +02:00
Vinayak Kariappa Chettimada b329d198a7 Bluetooth: controller: Implement CSA #2 for SubEvents
Implement the functions required to calculate the SubEvent 1
and SubEvent n mapped channel indices.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:18:31 +02:00
Vinayak Kariappa Chettimada 3501148922 Bluetooth: Controller: Legacy vs Extended check for Periodic Adv HCI
Add the check for mixed use of Legacy vs Extended HCI
commands for Periodic Advertising related HCI commands.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 12:28:55 +02:00
Vinayak Kariappa Chettimada 591007206d Bluetooth: Controller: Fix directed advertising report
Fix extended advertising report to set the directed bit in
the event type when receiving directed non-connectable
advertising.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 12:05:10 +02:00
Vinayak Kariappa Chettimada 449d0b29b7 Bluetooth: Controller: Fix extended advertising timeout
Fix extended advertising PDUs seen after the advertising
duration has elapsed, by considering the events skipped
due to overlap with other events which is provided by
the ticker lazy parameter.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 12:04:56 +02:00
Vinayak Kariappa Chettimada 5659b005f1 Bluetooth: Controller: Add checks for invalid PHYs
Add checks for invalid PHYs supplied to HCI LE Extended Scan
Parameters and LE Extended Create Connection commands.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 12:04:36 +02:00
Vinayak Kariappa Chettimada 027835fea6 Bluetooth: Controller: Disallow anonymous legacy advertising
Check and disallow legacy advertising from being anonymous.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 12:03:35 +02:00
Marcin Niestroj 577315c4ff fs: littlefs: drop newline character in log messages
Newline character is automatically appended in log backends such as
UART, so there is no need to add it explicitly.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-07-19 12:03:15 +02:00
Marcin Niestroj c314557f2a fs: shell: fix incorrect message format when mount fails
There is '%u' and '%d' in format message, while there is only one
argument (besides format string). Remove ununsed '%u' to stop printing
garbage.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-07-19 12:02:58 +02:00
Marcin Niestroj 8e1a071725 logging: allow timestamp formatting for FS backend
FS backend is no different when it comes to producing human readable
timestamp. Allow to select it when FS is the only enabled logging
backend.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-07-19 12:02:43 +02:00
Krzysztof Chruscinski 482fae74a8 drivers: timer: nrf_rtc_timer: Fix race condition
RTC interrupt was reading CC value and passing it to the handler.
However, higher priority interrupt could preempt RTC interrupt
and set new CC value. In that case CC value read in the RTC
interrupt context was not the one that triggered the interrupt.
Added fallback to COUNTER value if that case is detected.

Using COUNTER is not as precise as CC because it returns time
when event was handled and not when event occured but it is the
only option since CC value is overwritten.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-07-19 12:02:27 +02:00
Johann Fischer 8cbef2da24 drivers: console: update USB_UART_CONSOLE description
Remove outdate text and add note what the option in
the console driver does.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-07-19 04:02:07 -04:00
Johann Fischer 8b37c62b35 usb: remove useless len argument from usb_data_to_host()
The len argument always has the same value as
usb_dev.setup.wLength, which is also the last received
USB device request.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-07-19 04:01:22 -04:00
Piotr Pryga 378a1e082a Bluetooth: controller: remove unnecessary ull_adv_ext_hdr_data struct
After extracting from ull_adv_sync_pdu_set_clear functions:
ull_adv_sync_pdu_alloc, ull_adv_sync_extra_data_set_clear
Use of ull_adv_ext_hrd_data structure became unnecessary.
The extra_data member of the structure was never used
due to separate function responsible for setting extra_data
content.
In all cases content for extended advertising header fields
may be passed to the ull_adv_sync_pdu_set_clear directly
as void * pointer, instead of pointer to ull_adv_ext_hdr_data.

This simplifies use of ull_adv_sync_pdu_set_clear as well
as removes unneccesary code to handle special structure type.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-07-17 16:43:08 -04:00
Piotr Pryga 4c3d76bf8b Bluetooth: controller: remove extra_data use in BIG create and terminate
extra_data is not used by ll_big_create and ll_big_terminate.
extra_data_prev and extra_data_new are optional arguments for
ull_adv_sync_pdu_alloc.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-07-17 16:43:08 -04:00
Piotr Pryga bef9d14f7f Bluetooth: controller: simplify arg list of ull_adv_sync_pdu_alloc
ull_adv_sync_pdu_alloc function was extracted from ull_adv_sync_pdu_-
-set_clear function. The arguments list of ull_adv_sync_pdu_alloc
was derived from source function but the acutal functionality is
only part of what it was before.

The ull_adv_sync_pdu_alloc does not change extended advertising
PDU header fileds. The hdr_add_fields and hdr_rem_fields arguments
were used to allocate or not allocate memory for extra_data related
with new periodic advertising PDU. Also hrd_data pointer was
not used by the function.

The function arguments list was simplified.
New enum ull_adv_pdu_extra_data_flag was introduced to provide
named flags for extra_data memory management.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-07-17 16:43:08 -04:00
Henrik Brix Andersen 946ad14073 drivers: can: mark the CAN API as unstable
Mark the Controller Area Network (CAN) driver API as unstable. The CAN
API was introduced in Zephyr v1.14 and has since gained support for many
different hardware platforms.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-17 10:47:53 -04:00
Piotr Mienkowski cdb6bfff1e soc: same70, samv71: free TRACESWO pin when unused
Pin PB5 is part of ARM Cortex-M debug interface and by default
configured to output TDO/TRACESWO signal. Disable TDO/TRACESWO
function on PB5 pin when LOG_BACKEND_SWO is not enabled. This
ultimately frees the pin to be used by standard SoC peripherals.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2021-07-17 08:09:08 -04:00
Robert Lubos 8a4e489739 net: sockets: dtls: Fix handshake with socket offloading
Fix `poll()` handling for DTLS clients when the underlying socket is an
offloaded socket. As in this case no `k_poll()` is used underneath, it's
not possible to monitor the handhshake status with `tls_established`
semaphore. Instead, do the following:

1. If no handhshake is in progress yet, just drop the incoming data -
   it's the client who should initiate the handshake, any data incoming
   before that should not be processed.
2. If handshake is currently in progress, lift the `POLLIN` flag and add
   small delay to allow the other thread to proceed with the handshake.
3. Otherwise, just proceed as usual.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-07-16 22:09:58 -04:00
Robert Lubos b4366a8732 net: sockets: tls: Fix handshake on non blocking sockets
The TLS/DTLS handshake in most cases is a blocking process, therefore
the underlying socket should be in a blocking mode to prevent busy
looping in the handshake thread. Fix this by clearing the O_NONBLOCK
flag on the underlying socket before the handshake, and restoring it
afterards.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-07-16 22:09:04 -04:00
Elliot Revell-Nash 15318634b7 logging: count file with index 0 as log file too
Fixes #36667

If you had a single log file with index 0 created and you reboot
the log backend wasn't counting it and was overwiting it.
If you filled that file up before rebooting then it worked as
expected, creating a new file at the next index on each boot.

Signed-off-by: Elliot Revell-Nash <elliot.revell-nash@wdtl.com>
2021-07-16 21:55:55 -04:00
Marcin Jeliński 70393b3c44 samples: subsys: ipc: Add a sample for using IPC Service
Demonstating usage of IPC Service. Multi-instance RPMsg
was ued as a backed for IPC Service.

Signed-off-by: Marcin Jeliński <marcin.jelinski@nordicsemi.no>
2021-07-16 21:43:39 -04:00
Marcin Jeliński 20d63b078c ipc: ipc_service: RPMsg multi-instance as backend for IPC Service
Implementation of the backend for IPC Service.
Multi-instance RPMsg was used as a backend.

Signed-off-by: Marcin Jeliński <marcin.jelinski@nordicsemi.no>
2021-07-16 21:43:39 -04:00
Marcin Jeliński 3fcd8d1003 ipc: Added IPC Service to support different transport backends
IPC Service allow plugging in different transport backends.
Specifies a generic API that is implemented by the backend.

Signed-off-by: Marcin Jeliński <marcin.jelinski@nordicsemi.no>
2021-07-16 21:43:39 -04:00
Marcin Jeliński 14272c2726 samples: subsys: ipc: Add a sample for using multi-instance RPMsg
Demonstating usage of multiple instance of RPMsg

Signed-off-by: Marcin Jeliński <marcin.jelinski@nordicsemi.no>
2021-07-16 21:43:39 -04:00
Marcin Jeliński 54d2eb45a1 ipc: Add multiple instances RPMsg
This patch implements a service that adds multiple instances
capabilities to RPMsg.
Each instance is allocated a separate piece of shared memory.
Multiple instances provide independent message processing.
Each instance has its own work_q.

Signed-off-by: Marcin Jeliński <marcin.jelinski@nordicsemi.no>
2021-07-16 21:43:39 -04:00
Gerson Fernando Budke 3771b968f0 drivers: eth: sam: Replace constants by devicetree values
The zephyr sam gmac driver don't get register address and, in some
cases, peripheral id from devicetree.  This replace headers constants
in favor of devicetree values.

This fix wrong Atmel SAME7x/SAMV7x gmac register address and add
missing peripheral id property for SAM family.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-07-16 21:34:43 -04:00
Gerson Fernando Budke 49eb184ea4 dts: eth: sam: Split generic GMAC compatible
The current GMAC compatible not allow especialize properties by SoC
family.  Split current generic Atmel GMAC compatible into two new
compatibles which are defined by SoC families.  This increase the
freedom and avoid odd situations.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-07-16 21:34:43 -04:00
Gerson Fernando Budke a9180f1b2c drivers: eth: sam: Fix style and documentation
This fixes properties documentation and two devicetree styles:

 - properties with wrong code identation and
 - property description tag style

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-07-16 21:34:43 -04:00
Elliot Revell-Nash 78498933f1 scripts: colorize parsed dictionary logging
Print parsed dictionary based logging with color

Signed-off-by: Elliot Revell-Nash <elliot.revell-nash@wdtl.com>
2021-07-16 21:34:06 -04:00
Carlo Caione b4803a0eff dts: npcx: Remove misused syscon compatible
Now that there is a syscon driver, remove the misused compatible.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-07-16 21:31:38 -04:00
Carlo Caione bc30598456 drivers: syscon: Add generic syscon API
A syscon device is a device managing a memory region containing a set of
registers that are not cohesive enough to represent as any specific type
of device. We need a driver for that because several other drivers could
use the same region at the same time and we need to io-map the region at
boot for MMU enabled platforms.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-07-16 21:31:38 -04:00
Gerard Marull-Paretas 5b939ea731 ci: doc: fix build target for doc publish
The build target was not updated on the doc publish workflow (htmldocs
-> html).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-16 21:15:43 -04:00
Gerard Marull-Paretas ac1b9d9654 doc: guides: move doc README to the guides folder
The location of the documentation guide is inconsistent with other
documentation guides, so move it to the `guides` folder.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-16 21:11:41 -04:00
Sylvio Alves c203dec140 west.yml: update hal to fix esp timer stack
Fix esp timer task stack definition.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-07-16 18:59:57 -04:00
Sylvio Alves 4d37aa828a driver: wifi: add esp event task name
When enabling shell and retrieving thread information,
esp wifi event task name was empty.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-07-16 18:59:57 -04:00