Commit Graph

94813 Commits

Author SHA1 Message Date
Andy Ross fc56050e05 kernel/spinlock: Fix SPIN_VALIDATE in ISRs
Spinlocks taken in ISRs were storing the _current thread pointer of
the interrupted thread as the owner, which was never strictly correct
but was benign as the thread would never run until the lock was
released.

But now k_thread_abort(_current) in an ISR has been fixed to eliminate
all references to the (now aborted) thread struct, and _current points
to a dummy thread.  Handle that edge case in the validation framework.

Signed-off-by: Andy Ross <andyross@google.com>
2024-05-02 13:55:03 -04:00
Andy Ross cef2ac5583 tests/kernel: Bump kobj thread bitmask size for a few tests
A scheduler fix for free memory usage on aborted threads is now using
a per-CPU dummy thread instead of a single stack-based one at startup.
These static thread objects need spots in the kobj bitmasks, and a few
tests are sitting right at the default limit (16 threads).

Signed-off-by: Andy Ross <andyross@google.com>
2024-05-02 13:55:03 -04:00
Bogdan Marinescu da708e232a ipc_rpmsg_static_vrings: use names for WQ threads
This patch adds names to the threads created by `mbox_init` via
`k_work_queue_start`. The name of the thread is the same as the name in
the device instance.

The main reason for this has to do with how `mcumgr` reports [thread
information](https://docs.zephyrproject.org/latest/services/device_mgmt/smp_groups/smp_group_0.html#task-statistics-command).
Specifically, data about threads is sent in a CBOR encoded map where the
map keys are the thread names (at least in the default configuration). If
there's more than one IPC channel defined (one example of this being
`samples/subsys/logging/multidomain`), both threads would be created
with an empty name and `mcumgr` will only return the data associated
with the thread created by the last call to `mbox_init`.

Signed-off-by: Bogdan Marinescu <bogdan.marinescu@gmail.com>
2024-05-02 20:47:38 +03:00
Alberto Escolar Piedras 82fa83048e release note/migration guide: Mention fuzzing changes
The fuzzing support only worked when targetting the
native_posix board, and in a way which was very coupled
with the fuzzing sample.
This has now been refactored, so those who may have
relied on hooking to the board in the same way as this
sample will need to adapt.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-02 20:46:03 +03:00
Alberto Escolar Piedras 320f23ef96 arch posix fuzzing: Move kconfig options to sample
Move the kconfig options used to configure the interrupt
and wait time to the sample which uses them instead of
having them in the architecture code.
This options are very particular for this sample and not
really an API.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-02 20:46:03 +03:00
Alberto Escolar Piedras df5440fc59 arch posix: Correct ARCH_POSIX_LIBFUZZER kconfig help message
This option can be used now also with native_sim
and seems to work fine with both 32 and 64 bit targets.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-02 20:46:03 +03:00
Alberto Escolar Piedras e51ab58f2b samples fuzzer: Update README as it works on native_sim too
Update the readme as the sample works on native_sim,
and native_posix will be deprecated soon.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-02 20:46:03 +03:00
Alberto Escolar Piedras f5553004b0 sample fuzzer: Move fuzzer specific code to sample and fix for native_sim
Move the LLVM fuzzing specific code out of the board main
file and into the sample.
That way we avoid needing to duplicate it for native_sim and
avoid having a very adhoc interface between the fuzzer test
and runner code.

Also ensure it works for native_sim and not just native_posix

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-02 20:46:03 +03:00
Alberto Escolar Piedras 09d554b769 native_simulator: Rework fuzzing support
The fuzzing support in the native_simulator had not got
to work yet. Let's remove it, and instead let the
test application handle it.

For this we make public the functions which initialize
the simulation and advance time, so the fuzzing tests
can use it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-02 20:46:03 +03:00
Andrzej Kaczmarek 2bff629d29 MAINTAINERS: Update Renesas maintainers
Update maintainers for Renesas code to Renesas employees.

Add @ioannis-karachalios as maintainer for Renesas SmartBond code.
Add @KhiemNguyenT as maintainer for Renesas HAL.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2024-05-02 20:41:13 +03:00
Tomi Fontanilles 43651979fc drivers: entropy: fix TF-M enabled build with MbedTLS 3.6.0
This fixes the compilation of entropy_psa_crypto.c that failed
when trying to include the MbedTLS configuration.

Inherit the needed include folders and definitions from tfm_api.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-02 09:42:34 -07:00
Tomi Fontanilles 8cd04a50e8 samples: tfm_secure_partition: fix build of the ARoT
With the update of MbedTLS to 3.6.0 the configuration files
(mbedtls/mbedtls_config.h, psa/crypto_config.h)
are not found anymore by default.

Make the ARoT's CMake target inherit from psa_crypto_config;
it defines what is needed to find the MbedTLS
configuration files.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-02 09:42:34 -07:00
Tomi Fontanilles e49033ac1e modules: tf-m: make CONFIG_BUILD_WITH_TFM imply CONFIG_MBEDTLS
This fixes NS compilation on certain app/board combinations
where TF-M is used but CONFIG_MBEDTLS was not set to y.

With the update to MbedTLS 3.6.0, the compilation failed in
(at least) interface/src/tfm_crypto_api.c when trying to
include MbedTLS configuration file because the MbedTLS Kconfigs
were not defined due to CONFIG_MBEDTLS being n (and the default
MbedTLS configuration file not being found).

TF-M's dependency on MbedTLS is pretty much a given.
This change ensures that the configuration for MbedTLS
is properly defined at all times when TF-M is in use.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-02 09:42:34 -07:00
Tomi Fontanilles 94404589d4 modules: tf-m: fix tfm_api's configuration of MbedTLS
The configuration file was not passed down to tfm_api, which
made the compilation of (at least) interface/src/tfm_crypto_api.c
fail when updating MbedTLS to 3.6.0.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-02 09:42:34 -07:00
Tomi Fontanilles 5416e76d3b modules: mbedtls: force NS-side config to client-only when using TF-M
When building with TF-M (CONFIG_BUILD_WITH_TFM),
force MBEDTLS_PSA_CRYPTO_CLIENT && !MBEDTLS_PSA_CRYPTO_C
so that no NS code tries to act like the MbedTLS core
is built on this side.

This fixes compilation errors in (at least)
interface/src/tfm_crypto_api.c after the
update of MbedTLS to 3.6.0.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-02 09:42:34 -07:00
Tomi Fontanilles 8d3c5efc33 modules: mbedtls: fix RSA's dependency on ASN1
With MbedTLS updated to 3.6.0 the RSA module does not
depend on PK anymore. However, it is now dependent on ASN1.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-02 09:42:34 -07:00
Tomi Fontanilles 3ae670199b manifest: mcuboot: apply fix for MbedTLS 3.6.0
Fixes issues with MbedTLS's check_config.h.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-02 09:42:34 -07:00
Tomi Fontanilles 3f70496d30 manifest: trusted-firmware-m: adapt to MbedTLS 3.6.0
Apply patches to the current TF-M version (2.0)
so that it works with the updated MbedTLS (3.6.0).

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-02 09:42:34 -07:00
Tomi Fontanilles 6d8d23eb01 manifest: mbedtls: bump to 3.6.0
Update MbedTLS from 3.5.2 to 3.6.0.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-02 09:42:34 -07:00
Aleksander Wasaznik 2dd987713b Bluetooth: Coverity fix dereference before null check
https://scan9.scan.coverity.com/reports.htm#v45144/p12996/fileInstanceId=132890135&defectInstanceId=9972463&mergedDefectId=363710

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-05-02 16:59:08 +02:00
Aleksander Wasaznik 34f78b8fde Bluetooth: Coverity fix untrusted value
https://scan9.scan.coverity.com/reports.htm#v45144/p12996/fileInstanceId=132890129&defectInstanceId=9972487&mergedDefectId=330721

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-05-02 16:59:08 +02:00
Aleksander Wasaznik 2e702e3065 Bluetooth: Coverity fix dereference before null check
https://scan9.scan.coverity.com/reports.htm#v45144/p12996/fileInstanceId=132878471&defectInstanceId=9972432&mergedDefectId=330636

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-05-02 16:59:08 +02:00
Aleksander Wasaznik 272af07279 Bluetooth: Coverity fix dereference before null check
https://scan9.scan.coverity.com/reports.htm#v45144/p12996/fileInstanceId=132878471&defectInstanceId=9972464&mergedDefectId=330625

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-05-02 16:59:08 +02:00
Martin Jäger 9f77f88548 samples: subsys: lorawan: class_a: remove clock sync and multicast
These LoRaWAN services are now covered by the FUOTA sample.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-05-02 16:54:43 +02:00
Martin Jäger 1479f9d239 samples: subsys: lorawan: fuota: add basic sample application
Add basic sample application that starts the LoRaWAN FUOTA services.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-05-02 16:54:43 +02:00
Martin Jäger 9e341b49c8 tests: subsys: lorawan: add frag_decoder unit-test
The unit test allows to test the frag decoder algorithms using random
binary data.

The coded fragments are created on the fly using the encoder algorithm
described by Semtech in the LoRaWAN TS004-1.0.0 document.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-05-02 16:54:43 +02:00
Martin Jäger f3e41c6a25 lorawan: services: add Fragmented Data Block Transport
This service receives fragmented data (usually firmware images) and
stores them in the slot1_partition in the flash.

Also update CMakeLists.txt in loramac-node module to be able to use
FragDecoder.c

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-05-02 16:54:43 +02:00
Martin Jäger e85074329e west.yml: update loramac-node for FragDecoder Kconfig
Required to allow configuring FragDecoder via Kconfig.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-05-02 16:54:43 +02:00
Szymon Janc 37f9cb75cc bluetooth: tester: Add support for OTS
This implemnets OTS service and provides OTS instance with two objects
for behavior valid and invalid test cases. Service implementation is
inspired by peripheral_ots sample.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-05-02 16:51:42 +02:00
Emil Gydesen 954eb4face docs: Bluetooth: Audio: Move audio related files to subdir
Add a new subdir, audio, and move all the audio related
documentation files to that directory, similar to mesh.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-05-02 16:51:03 +02:00
frei tycho 14cb7d5b03 kernel: coding guidelines: add explicit cast to void
- added explicit cast to void when returned value is expectedly ignored

Signed-off-by: frei tycho <tfrei@baumer.com>
2024-05-02 16:49:36 +02:00
Vinayak Kariappa Chettimada 64f41309d1 Bluetooth: Controller: Use reschedule margin as minimum ticks_slot
Use reschedule margin as minimum ticks_slot when ticker with
reschedule expires. This will ensure not too many unreserved
tickers expire in close proximity that can lead of pile up
of CPU processing time and eventually causing timeout
callbacks to be delayed. This mitigate possible LL asserts
due to overhead in start of radio events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-05-02 12:18:49 +01:00
Vinayak Kariappa Chettimada 263357e042 Bluetooth: Controller: Enable ticker slot window yield for mesh
Enable use of ticker slow window yield feature under mesh
usecase. This is make sure scan window either slides within
is window or skips to next interval so that it does not
lead to advertising event being skipped.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-05-02 12:18:49 +01:00
Vinayak Kariappa Chettimada 7d1bc1789e Bluetooth: Controller: Fix short prepare preempt timeout start
Fix short prepare preempt timeout start, such that if there
are any normal prepare before a short prepare in the
pipeline, then find the short prepare and start its preempt
timeout.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-05-02 12:18:49 +01:00
Vinayak Kariappa Chettimada acc806889f Bluetooth: Controller: Add prepare pipeline assertion checks
Add prepare pipeline assertion checks to detect faults
like stopping preempt timeout without prior start. Also,
check if the preemptor param is correct when preemption
is performed. Check that the prepare pipeline is not
infinitely looping.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-05-02 12:18:49 +01:00
Vinayak Kariappa Chettimada 0e0cb3033a Bluetooth: Controller: Add assertion check for use of scan aux context
Add assertion check for use of scan aux context so that
scan aux context is not assigned again while there is
already an existing LLL scheduling in use by the scan
context.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-05-02 12:18:49 +01:00
Vinayak Kariappa Chettimada 9383e4fbf8 Bluetooth: Controller: Fix BT_CTLR_EARLY_ABORT_PREVIOUS_PREPARE
Fix BT_CTLR_EARLY_ABORT_PREVIOUS_PREPARE to setup new
shorter preempt timeout irrespective of whether there
is a previous prepare enqueued in the prepare pipeline.

Relates to commit d573951f0d ("Bluetooth: Controller:
Revert back early abort of previous prepare").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-05-02 12:18:49 +01:00
Vinayak Kariappa Chettimada 0c5b4f383d tests: bsim: Bluetooth: Fix sim_length for central_hr_peripheral_hr
Fix sim_length value for central_hr_peripheral_hr so that
the simulation does not end while the test is still in
progress.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-05-02 12:18:49 +01:00
TOKITA Hiroshi 5733075ce3 boards: arduino: uno_r4: Add Arduino connector for Minima and WiFi
Add Arduino connector definitions for Minima and WiFi

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2024-05-02 12:18:39 +01:00
Sylvio Alves a332064e1e west.yaml: update hal_espressif after SDHC porting
Update revision reference for PR #71165 as needed.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-05-02 10:06:40 +01:00
cyliang tw 15c4d24c83 tests: drivers: adc_api: support numaker_m2l31ki
Add support for Nuvoton numaker board numaker_m2l31ki.

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2024-05-02 09:58:43 +01:00
cyliang tw 0190ed2713 drivers: adc: support Nuvoton numaker m2l31x
Update m2l31x.dtsi for adc support and update adc_numaker.c
to support acquisition time in 0~255 ADC ticks.

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2024-05-02 09:58:43 +01:00
Andrej Butok 3216254730 scripts: runner: linkserver: Add flash support for Intel Hex files
Enables flash support for Intel Hex files,
added with LinkServer v1.5.30.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-05-02 09:58:20 +01:00
Yves Vandervennet d6b7412e72 west: linkserver: change to flash command line as required by v1.5.xx
There is no need to specify the core with the flash command line. This
is actually rejected with linkserver v1.5.xx and after.

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2024-05-02 09:57:57 +01:00
Grant Ramsay 0933cdec15 doc: kernel: code-relocation: Remove kernel example and add tips
The Kernel code relocation example does not work, as the kernel
contains early initialization code that executes before code
relocation takes place

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2024-05-02 09:56:11 +01:00
Gerson Fernando Budke 5fb62ca960 mgmt: updatehub: Fix json arrays
After the changes introduced by #50816 the UpdateHub could not decode
anymore the JSON object. This introduce missing parsing definitions
to allow JSON parser undertood the correct UpdateHub probe object.

Fixes #69297

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2024-05-02 10:55:34 +02:00
Hess Nathan 7659cfd4dc coding guidelines: comply with MISRA Rule 2.2
- avoided dead stores

Signed-off-by: Hess Nathan <nhess@baumer.com>
2024-05-02 09:32:46 +01:00
Fin Maaß 0012e1ff76 mgmt: hawkbit: reset action id
Be able to reset the hawkBit action id.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-05-02 09:32:18 +01:00
Aurelien Jarno ea995f6378 lorawan/nvm: do not call settings_save() after writing individual settings
The lorawan subsystem do not use settings handler, and instead uses
individual calls to settings_save_one(). With this strategy there is no
need to call settings_save() at the end.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2024-05-01 22:56:34 +01:00
Aurelien Jarno e94fe44805 subsys/settings: add a function to save subtree
When running multiple subsystems or applications on a MCU, the usual
strategy is to use different settings subtrees.

The API provides a way to load or commit a subtree, to avoid adding
dependencies between subsystems or applications, but lacks the way to
save a subtree only. Fix that by adding a settings_save_subtree()
function.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2024-05-01 22:56:19 +01:00