Commit graph

56101 commits

Author SHA1 Message Date
Robert Lubos
b6f69a6df1 net: lwm2m: Align float handling with specification
According to the specificaion, resources are not predefined to use 32 or
64 bit floating point numbers, but should rather accept any of them (as
indicated by the size of the TLV in the message). This lead to issues
for instance with Eclipse Leshan LWM2M server, where Leshan sent 64-bit
value, while Zephyr expected 32-bit, making it impossible to write
the resource.

Therefore, unify the float usage to 32-bit float representation and fix
the TLV parsing functions, to accept values sent as either 32 or 64 bit
float.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-16 19:04:52 -04:00
Robert Lubos
9cdc1bb944 net: sockets: tls: Fix TLS POLLHUP notification
The `poll()` function did not report POLLHUP if the peer ended the DTLS
session, making it impossible to detect such event on the application
side.

On the other hand, TLS erroneusely reported POLLHUP along with each
POLLIN event, as the 0 returned by the `recv()` socket call was
wrongly interpreted (it was expected to get 0 in return as 0 bytes were
requested).

Fix this by introducing a helper function to process the mbedtls context
and verify if new application data is pendingi or session has ended.
Use this new function in the poll handler, instead of a socket `recv()`
call, to remove any ambiguity in the usage, for both TLS and DTLS.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-16 18:14:33 -04:00
Robert Lubos
d0affeff69 net: sockets: tls: Return ENOTCONN when DTLS client session ends
Notify the application when DTLS client session ends by returning
ENOTCONN on such event. Additionally, reset the mbed TLS session
structures, allowing to reinstante the session on the next send() call.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-16 18:14:33 -04:00
Robert Lubos
b999c47424 net: sockets: tls: Fix incorrectly used errno codes
ECONNABORTED was returned in case tls_mbedtls_reset() function for
resetting session failed, which can be caused by memory shortage. Return
ENOMEM instead.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-16 18:14:33 -04:00
Andrzej Puzdrowski
031ed1859b manifest: mcuboot update
MCUboot fork was updated in order to bring bugfixes from its
upstream:
- introduce MCUBOOT_CPU_IDLE() for support low power single thread
(fixes single thread power consumption)
- Allow not working secondary image device and boot form primary
device if image available
- fixes memory alignment of the RAM buffer that is used to temporarily
store data during swap.
- update devicetree py package lib files include path in assembly
- serial recovery: cbor_encoder: fix str encoding macros
- zephyr: Kconfig: fix board references
- do not set defaults for LOG_IMMEDIATE Kconfig
- boot: Do not use `irq_lock()` if using arm cleanup
- Kconfig: fix deadlock on cryptolib selectors

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-09-16 17:39:36 -04:00
Lingao Meng
c4fbc5bb20 Bluetooth: host: Fix hci command done
When received hci command rsp which not for expected
hci command, we should ignore this.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-16 21:29:09 +03:00
Lingao Meng
61370f171c Bluetooth: host: Fix host send cmd complete to dis-conn
Fixes: #38054

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-16 21:29:09 +03:00
Ludvig Samuelsen Jordet
cf3f219441 Bluetooth: Mesh: Test reprovisioning
This adds tests for config client reset and reprovisioning of a node.

Signed-off-by: Ludvig Samuelsen Jordet <ludvig.jordet@nordicsemi.no>
2021-09-16 13:25:46 -04:00
Erwan Gouriou
eb31ffe852 tests/drivers/uart: async_api: Enable test on nucleo_f103rb
Add the few bits missing to run the test.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-09-16 13:19:19 -04:00
Vinayak Kariappa Chettimada
9e2b9c7a91 Bluetooth: Host: Fix Periodic Advertising Sync using Advertiser List
Fix Periodic Advertising Sync Establishment to accept
synchronization establishment to device listed in the
Periodic Advertisers List when filter policy was used.

Fixes #38520.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-16 16:35:45 +02:00
Daniel DeGrasse
b261d2b3e1 mxrt685: Disabled support for 1.8V USDHC negotiation on RT685 EVK
The IMXRT685 evaluation board uses a PMIC to reduce the signalling
voltage for a connected SD card to 1.8V, which Zephyr does not currently
support. This results in Zephyr failing to interface with any SD card
that supports 1.8V signalling when run on the RT685 eval board. This
commit disables support for 1.8V signalling for the RT685.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-09-16 09:34:02 -04:00
Xavier Chapron
f83bb02cbf drivers: modem: sara-r4: Replace snprintf calls by snprintk
Snprintf calls should be avoid when not necessary, instead snprintk
should be used as it offers the same functionnalities at a lower cost
in flash.

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
2021-09-16 09:33:28 -04:00
Chen Peng1
0774ce94ed tests: mem_map: limit memory below 0x10000000 on up_squared.
there is a memory hole from address 0x10000000-0x12150fff
in the ram on up_squared, we don't have access to read/write
this range, so limit the memory range below 0x10000000.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
2021-09-16 09:32:36 -04:00
Vinayak Kariappa Chettimada
380a800b88 Bluetooth: Controller: Fix incorrect common header length calc
Fix incorrect calculation of received common extended header
length. Due to this a zero length advertising data is
reported in Extended Advertising and Periodic Advertising
report as one byte AD data.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-16 15:20:12 +02:00
Anas Nashif
0f9533e3d5 actions: run get_maintainer.py to validate paths
Run script which would error on any missing paths or invalid syntax.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-09-16 09:13:01 -04:00
Anas Nashif
5fad40e7d3 MAINTAINERS: update few entries with maintainers/collaborators
Change X86 platform maintainer and add Peter in the kernel entry.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-09-16 09:13:01 -04:00
Anas Nashif
d9250b1c86 MAINTAINER: path and glob fixes
Lots of things have moved and fix a few globs

Fixes #32531

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-09-16 09:13:01 -04:00
Maciej Perkowski
efc3242140 bugfix: samples: display: Set ft800 sample to be build only
The sample from samples/drivers/misc/ft800/ causes twister to
timeout as it has no pass conditions defiend nor producess any
output that can be verified. What is more, it requires a shield
which is not reflected in the sample.yaml. This fix sets test harness
to display and adds an entry for the required fixture.

Fixes: #38536

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2021-09-16 06:59:27 -04:00
Asbjørn Sæbø
e8620a7416 Bluetooth: Object Transfer Service: Defines for allowed object ID values
Add #defines for the maximum and minimum allowed values for object
IDs.

Moves the #define for the directory listing object ID to the public
header file

Having these limits available is useful for applications wanting to
ensure they pass in (or handle) valid object ID values.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2021-09-16 10:32:19 +02:00
Asbjørn Sæbø
0e095c9817 Bluetooth: Object transfer service object ID mask define
Object IDs are 48 bits, but are often carried in uint64_t variables.
This commit defines a mask value that retains the least significant 48
bits.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2021-09-16 10:32:19 +02:00
Henrik Brix Andersen
2e242c51fb soc: riscv: ite: it8xxx2: guard SoC Kconfig options
Guard the IT8XXX2 SoC specific Kconfig options with 'if ... endif'.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-09-15 23:11:43 -04:00
Tom Owen
d63d828c8f stm32: Add FMAC support to Kconfig
This commit adds FMAC HAL and LL drivers to the Kconfig system
Required to enable Filter Math Accelerator (FMAC)
 on STM32G4/H7 devices

Signed-off-by: Tom Owen <tom.owen@zepler.net>
2021-09-15 22:36:49 -04:00
Yong Cong Sin
495f6b7ccc drivers: modem: bg9x: Fix unused configs
Fix Kconfig so that unused configs won't be compiled.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-15 11:30:03 -04:00
Erwan Gouriou
8a021b49db boards: nucleo_g071rb: Set openocd as default flash & debug i/f
Zephyr SDK now features an openocd version compatible
with stm32g0 targets.
Set openocd as the default zephyr runner for this target.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-09-15 11:12:23 -04:00
Erwan Gouriou
146d9a85ca boards: nucleo_g474re: Set openocd as default flash & debug i/f
Zephyr SDK now features an openocd version compatible
with stm32g4 targets.
Set openocd as the default zephyr runner for this target.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-09-15 11:12:23 -04:00
Szymon Janc
24007fb2ad tests: bluetooth: tester: Fix build with EATT disabled
For ECFC L2CAP test we user overlay with disabled EATT and
bt_eatt_disconnect_one() is available only with EATT enabled.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-09-15 16:58:06 +02:00
Daniel Leung
cd5357ca56 boards: qemu_x86: disable QEMU icount with shell and HPET timer
For some unknown reasons, using the new modified HPET timer would
render shell unresponsive under QEMU. So for now, disable QEMU
icount when shell is enabled.

Fixes #37672

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-09-15 08:07:35 -04:00
Carles Cufi
6de4747979 Bluetooth: Update terms in public API to spec v5.3
The Bluetooth Core Specification, version 5.3, has introduced multiple
changes to several widely-used terms in order to make them inclusive.
Update the public API to reflect this, excluding hci.h, which will be
done in a subsequent commit.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-15 14:02:50 +03:00
Ramiro Merello
324374d20c MAINTAINERS: Added myself as JSON collaborator
Added myself as collaborator for the JSON library, added files json.c/.h

Signed-off-by: Ramiro Merello <rmerello@itba.edu.ar>
2021-09-15 06:55:01 -04:00
Tomasz Bursztyka
d8484e2ea5 drivers/ivshmem: MSI API change was not applied in this drivers
commit id ec2b9d42af missed that ivshmem
uses pcie_msi_enable as well, thus fixing it now.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2021-09-15 13:42:22 +03:00
Henrik Brix Andersen
79952ad774 manifest: update hal_nxp
Update the NXP HAL to bring in fix for the FlexCAN driver on the NXP
Kinetis MKE1xF.

Fixes: #38442

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-09-14 15:47:18 -05:00
Trond Einar Snekvik
035d877967 Bluetooth: Mesh: Inclusive terminology
Implements the Bluetooth appropriate language mapping for the Bluetooth
mesh subsystem.

Changes the following terms:

- Master security credentials -> Flooding security credentials
- Whitelist filter -> Accept filter
- Blacklist filter -> Reject filter
- Removes CDB's NODE_BLACKLISTED, which was not in use.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-09-14 19:30:18 +02:00
Yong Cong Sin
54490e8fe3 subsys/mgmt/hawkbit: Check retval of mbedtls_md_update
Check the return value of mbedtls_md_update and break on error.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-14 12:28:40 -04:00
Yong Cong Sin
5cee596c9b subsys/mgmt/hawkbit: Cleanup connection if error after http_request
All errors that occured after http_request should clean up the
connection.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-14 12:28:40 -04:00
Yong Cong Sin
22b5a03321 subsys/mgmt/hawkbit: Break and return if error
There's no need to continue if there's an error, so just break and
return.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-14 12:28:40 -04:00
Yong Cong Sin
dfb55e5353 subsys/mgmt/hawkbit: Warning if image is unconfirmed
Add a warning if the image is unconfirmed. Add a delay before rebooting
so that the user knows what happened.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-14 12:28:40 -04:00
Yong Cong Sin
8363e805c0 subsys/mgmt/hawkbit: Handle multipacket response properly
The current HAWKBIT_PROBE & HAWKBIT_PROBE_DEPLOYMENT_BASE response
handlers aren't able to handle multipacket response from Hawkbit
server. This commit fixes it by using the implementation from
HAWKBIT_DOWNLOAD.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Signed-off-by: Joep Buruma <burumaj50@gmail.com>
2021-09-14 12:28:40 -04:00
Yong Cong Sin
793c0340d4 subsys/mgmt/hawkbit: Implement DDI API authentication
Implement Hawkbit DDI API authentication for the client.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-14 12:28:40 -04:00
Yong Cong Sin
8ffb5e2ff2 subsys/mgmt/hawkbit: Use log_strdup for string pointers
Use log_strdup for string pointers.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-14 12:28:40 -04:00
Yong Cong Sin
6e8b1d7c29 subsys/mgmt/hawkbit: Clean up log and print error codes
Clean up log messages and print error codes wherever possible.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-14 12:28:40 -04:00
Yong Cong Sin
dc27d25c4d samples/subsys/mgmt/hawkbit: Update README
Update sample's README for better clarity.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-14 12:28:40 -04:00
Yong Cong Sin
8c51d39c9f samples/subsys/mgmt/hawkbit: Print build time
Print build time on boot to differentiate between update.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-14 12:28:40 -04:00
Maciej Perkowski
2b78e8b961 bugfix: sample: test: Add pass conditions to audio/dmic sample
Twister was failing for samples/drivers/audio/dmic with timeout
because there were no pass conditions defined. This patch sets
harness to console and adds regex entries to be checked.

Fixes: #38532

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2021-09-14 11:43:42 -04:00
Henrik Brix Andersen
91a0372b5c soc: riscv: priv: call __reset during boot
Call __reset instead of directly calling __initialize from the common
RISC-V privileged SoC vectors __start. This allows injection of SoC
specific reset code just after setting up the machine trap vector.

RISC-V privilege SoCs without the need for custom reset code can set
CONFIG_INCLUDE_RESET_VECTOR=y to include a __reset stub which simply
calls __initialize.

Fixes: #38396

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-09-14 09:48:03 -04:00
Jani Hirsimäki
9de47d2b0b net: ip: packet_socket: fixing raw sckt IPPROTO_RAW usage
net_packet_socket_input() was changed to hardcode the return of
NET_CONTINUE and that caused a segmentation fault/crash in
net_core/process_data(), in cases when pkt was unreferred and
NET_OK was returned from net_conn_input()
This happened with socket combo of: AF_PACKET+SOCK_RAW+IPPROTO_RAW.

Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
2021-09-14 08:37:36 -04:00
Jani Hirsimäki
f7219e8a31 tests: net: socket: new tests for AF_PACKET&SOCK_RAW&IPPROTO_RAW
New test case for testing send/recv for
socket combo of: AF_PACKET&SOCK_RAW&IPPROTO_RAW.

Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
2021-09-14 08:37:36 -04:00
Gerard Marull-Paretas
994c77a927 soc: arm: st_stm32: do not enable PM_DEVICE by default
CONFIG_PM_DEVICE was a de-facto requirement when enabling CONFIG_PM=y
since some device, i.e. UART, used the PM device hooks to block
suspension process while the device was busy finishing transmission.
This has now been fixed using constraints, so CONFIG_PM=y can be enabled
without further requirements.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-09-14 08:36:33 -04:00
Kamil Gawor
50ff77fa91 bluetooth: Split configuration into separated Kconfigs
Extracted new Kconfig file for the Extended Advertising
and for the Bluetooth Isochronous Channel from the
Bluetooth subsystem Kconfig.

Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
2021-09-14 09:57:03 +02:00
Kamil Gawor
3f09f94bd2 bluetooth: Add missing choice names in Kconfig
This commit adds missing choice names in Bluetooth
subsystem Kconfig files.

Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
2021-09-14 09:57:03 +02:00
Kamil Gawor
c95ee1744f bluetooth: services: Use log template for BAS
The BAS serivce Kconfig uses now a log template instead of
defining logger configuration itself.

Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
2021-09-14 09:57:03 +02:00