Commit graph

81299 commits

Author SHA1 Message Date
Eric Holmberg e408d0ea06 boards: esp32s3_devkitm: update CAN support
Add CAN to supported list and update documentation.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2023-07-10 15:13:52 +02:00
Eric Holmberg 1b919bbc28 tests: drivers: can: api: add virtual CAN TX <-> RX Jumper
Remove the need for the can_transceiver fixture by assigning the CAN TX
and CAN RX lines to the same GPIO pin to allow for testing without a
transceiver or physical jumper.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2023-07-10 15:13:52 +02:00
Eric Holmberg 2789e6a3c0 soc: esp32s3: add TWAI driver configuration
Add TWAI configuration for CAN.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2023-07-10 15:13:52 +02:00
Francois Ramu 8a603b2fbf boards: arm: stm32h573 disco kit board with USB bus
Enables the USB bus on PA11/PA12 of the stm32h573i_dk board

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-07-10 15:13:28 +02:00
Francois Ramu 036c8f6697 boards: arm: stm32h563 nucleo board with USB bus
Enables the USB bus on PA11/PA12 of the nucleo_stm32h563 board

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-07-10 15:13:28 +02:00
Francois Ramu b6f27cda4c dts: arm: stm32h5 serie has a full-speed USB 2.0 bus
Introduce the stm32H5 USB node for the stm32H5 serie

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-07-10 15:13:28 +02:00
Benedikt Schmidt 39391b4a16 drivers: spi: replace timeout for STM32 DMA slave mode
Replace the timeout for a SPI transceive in slave mode for STM32 DMA
operations with a K_FOREVER. Being an SPI slave means we do not
know when the transaction will start, hence it does not make sense
to have a timeout in such a case.
This will resolve issue #60000.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-07-10 15:13:19 +02:00
Keith Packard 40bc3ec346 subsys/net: Increase management stack size for thread local storage
The management thread *barely* fits in 768 bytes of stack; when thread
local storage is in use and TLS variables are also allocated from the same
region, this stack can overflow.

Increase to 800 bytes to leave plenty of room for TLS variables.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-07-10 15:11:15 +02:00
Keith Packard 021923b58a libc/picolibc: Use mutexes instead of semaphores for non-recursive locks
Picolibc has both recursive and non-recursive mutex uses. The bulk of the
library locking uses the global libc lock, which is a recursive mutex as
that greatly simplifies the implementation.

The only use of non-recursive mutexes is in the stdio code when dealing
with file system I/O via fopen.

Using mutexes for both APIs is valid; the assumption picolibc makes is that
the non-recursive mutexes are somehow cheaper or faster and should be
preferred. However, in Zephyr, recursive mutexes are the default and the
non-recursive locks for picolibc were implemented using semaphores.

Switch the non-recursive picolibc locks to just invoking the existing
recursive functions using mutexes. This avoids pulling in another lock
implementation, saving a bit of space.

This also lets the kernel.memory_protection.mem_map test work on
qemu_x86_tiny where the amount of memory available is 320kB and that is
nearly filled by this test case, leaving too little space for allocating
pages in the k_mem_map_unmap test.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-07-10 15:11:15 +02:00
Wojciech Sipak 490281a1d0 drivers: adc: fix missing ref_internal in iadc_gecko
The adc_driver_api structure provides .ref_internal
which previously was unset.
Now .ref_internal is set to the proper value.

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
2023-07-10 15:10:23 +02:00
Marek Matej 0038620b37 soc: xtensa: disable SPIRAM when MCUBOOT
Some boards has ESP_SPIRAM enabled by default, which is
causing issues when MCUboot is used as 2nd bootloader.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2023-07-10 15:10:14 +02:00
Fabio Baltieri db22c3bc7b shields: lmp90100: drop GPIO and EEPROM priority override
Drop the GPIO and EEPROM priority override. The current settings have
been introduced as part of a major priority refactoring but I don't
think they are needed anymore, and they currently result in this error:

ERROR: /soc/spi@4002d000 POST_KERNEL 70 <
	/soc/gpio@400ff100 POST_KERNEL 99

found with:

west build -p -b frdm_k64f samples/shields/lmp90100_evb/rtd \
	     -DCONFIG_CHECK_INIT_PRIORITIES=y

Dropping the two overrides should work fine, leaving the ADC override as
that seems like is still needed.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-07-10 15:08:39 +02:00
Manoel Brunnen 368b0e0d16 twister: Initialise unbound 'hardware' variable
hardware was referenced as return value, without being declared. When the
program goes into the 'except' path, hardware is unbound, but returned,
which throws an error:

`UnboundLocalError`: local variable 'hardware' referenced before assignment

Signed-off-by: Manoel Brunnen <manoel.brunnen@ithinx.io>
2023-07-10 13:57:21 +02:00
Jamie McCrae e8095b1a8b west.yaml: MCUboot synchronization from upstream
Update Zephyr fork of MCUboot to revision:
  6a8746d7acd75ff81fb6888d7776f412663f7897

Brings following Zephyr relevant fixes:
 - 6a8746d boot_serial: fix image number handle in image upload
           request
 - f2cb550 boot_serial: fix misuse of 'matched' param from
           zcbor_map_decode_bulk()
 - 82feb9a boot_serial: Fix showing images that are not valid
 - 61962b9 bootutil: fix FIH int conversion for security_cnt
 - e6e4801 zephyr/boot_serial_extension: Fix zcbor header path
 - a5db515 bootutil/crypto: SHA256 abort function return state
 - 0361ad3 bootutil/crypto: SHA256 init functions should return a
           status
 - f92a219 bootutil/crypto: Fix minor typos in comments for RSA
           modules
 - 4854700 bootutil: Add image_index to additional logging messages
 - 2f85b7e bootutil/crypto: Fix the common.h header
 - c321a70 bootutil/crypto: Add a crypto backend for SHA256 based
           on PSA Crypto APIs
 - 02bf072 bootutil/crypto: Refactor the RSA signature verification
           and encryption
 - ba5fb1c bootutil: Add image_index to common prints

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-10 12:05:37 +02:00
Jamie McCrae 7fa4570d10 doc: mgmt: mcumgr: Fix date typo
Fixes an issue where data was used instead of date

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-10 12:05:14 +02:00
Jamie McCrae ff8c78154f tests: application_development: code_relocation: Add absolute paths
Adds some absolute paths to check that the feature is working
correctly.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-10 12:05:00 +02:00
Jamie McCrae 695616c177 cmake: Fix code relocation functions with absolute paths
Fixes an issue whereby absolute paths in libraries would have
duplicate paths in the name, causing issues in that they would
not be relocated.

Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-10 12:05:00 +02:00
Jamie McCrae c9a4764c10 mgmt: mcumgt: smp: Fix not checking returned status
Fixes not checking if a zcbor operation was successful.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-10 12:04:40 +02:00
Jamie McCrae d98656f081 doc: kernel: code-relocation: Remove erroneous note
The note about required position for the function is not valid.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-10 10:01:42 +00:00
Kirill Kobelev 4a8d61248a doc: introduction: Improve style and grammar across the chapter
The changes are cosmetic and they do not change the meaning of the docs.

Signed-off-by: Kirill Kobelev <kobelev17@cdsan.com>
2023-07-10 10:01:08 +00:00
Armando Visconti 76e5760545 drivers/sensor: lis2dh: move h/w reg debug print right after it is read
Move LOG_DBG print just after the printed h/w register is read, to avoid
coverity complaining about uninitialized variable.

  Fix:
     Coverity-CID: 316407 (issue #58591)

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2023-07-10 10:00:48 +00:00
Alberto Escolar Piedras 1842c602ec drivers serial native ptty: Split in top and bottom
Split the native ptty serial driver in a top and bottom
to enable using it with embedded libCs.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-07-10 09:53:22 +02:00
Alberto Escolar Piedras ee268a6d4b posix arch cmake: Add clarification on use of target_link_options
Clarify why we use target_link_options() instead of
target_link_libraries()

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-07-10 09:51:25 +02:00
Alberto Escolar Piedras ed27a4fa3d tests flash simulator: Enable for native_sim
Add overlays for the native_sim boards, and
change test filters so they also run for these.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-07-10 09:50:56 +02:00
Alberto Escolar Piedras 2d3c53f705 flash simulator: Refactor native part so it works with emb libC
Refactor the part of the flash simulator that interacts with the
host when build for native platforms, so it is possible to use
it also with the embedded libCs.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-07-10 09:50:56 +02:00
Fabio Baltieri 5a4fd10624 shields: st_b_lcd40_dsi1_mb1166: bump up display init priority
MIPI-DSI initialization priority got delayed in fed377f622, but now
that's at the same priority as the OTM8009A for this board
configuration, and OTM8009A needs MIPI-DSI to be initialized. Being at
the same priority means that it may or may not work depending on the
linking order, this is exposed with:

$ west build -p -b stm32h747i_disco_m7 samples/subsys/display/lvgl \
		-DSHIELD=st_b_lcd40_dsi1_mb1166 \
		-DCONFIG_CHECK_INIT_PRIORITIES=y
...
WARNING: /soc/dsihost@50000000/otm8009a@0 POST_KERNEL 86 ==
	/soc/dsihost@50000000 POST_KERNEL 86

Bumping the display priority up to make sure it still works.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-07-10 09:33:45 +02:00
Harshil Bhatt 8b2a41904d posix: implement timer_getoverrun()
Address missing POSIX function and tests #59956

Signed-off-by: Harshil Bhatt <harshilbhatt2001@gmail.com>
2023-07-10 09:30:33 +02:00
Vaishnav Achath 21ada0da83 MAINTAINERS: Add vaishnavachath as maintainer for hal_ti
Add myself as a maintainer for TI HAL layer (hal_ti),
this update was missed while changing the maintainer details
for the rest of TI platforms.

Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com>
2023-07-10 09:30:24 +02:00
Gustavo Silva 4eedd45c85 drivers: pwm: pwm_mcux: fix for coverity 321142
Fix `PWM_SetupPwm` function being called with `numOfChnls`
argument equal to 2, when in fact only one channel is being set up.

Also add 'U' suffix to `pwmFreq_Hz` unsigned integer argument in
the function call.

Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
2023-07-10 09:30:05 +02:00
Nikolay Agishev a983abe426 ARC: Turn off stack checking for hsdk4xd
Turn off unsupported configuration for hsdk4xd

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2023-07-10 09:29:43 +02:00
Iuliana Prodan dc49a314fd west: sign.py: fix sign when CONFIG_KERNEL_BIN_NAME is used
This fixes the following build error:
```
zephyr/zephyr.elf', needed by 'zephyr/zephyr.ri', missing and no known
rule to make it
```
This appears when CONFIG_KERNEL_BIN_NAME is used.

Therefore, do not use zephyr.elf since some samples might be called
based on CONFIG_KERNEL_BIN_NAME.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-07-10 09:29:33 +02:00
Marc Herbert e1f36c40eb west: sign.py: de-duplicate the bootloader condition
De-duplicate the `if target in ('imx8', 'imx8m'):` copy/paste/diverge
before someone updates one and not the other. Also better to define
bootloader always.

Zero functional change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-07-10 09:29:33 +02:00
Florian Grandel 4b66680477 net: l2: ieee802154: simplify/fix ACK procedure
Removes redundant ACK state from `struct ieee802154_context` and
simplifies the ACK procedure.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-10 09:29:10 +02:00
Florian Grandel 46d4ee326d net: l2: ieee802154: improve context doc
Improves the documentation of `struct ieee802154_context` members.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-10 09:29:10 +02:00
Florian Grandel 27bfe68204 net: l2: ieee802154: mgmt: improve association procedure spec compliance
This change introduces test coverage for association request and
response. Based on this coverage, several closely related issues were
found in the association process which cannot be split into separate
changes without breaking the build.

Most notably did the associate and disassociate net_mgmt commands send
already encoded IEEE 802.15.4 MPDUs to L3 rather than L2. L3 treated
them as payload and made L2 wrap them with another LL header/footer
which produced invalid packets.

The tests also enforce better aligment of the association process with
the IEEE 802.15.4-2020 standard:

* Association requests now ask for ACK as required by the standard. The
  fake driver was enhanced to produce ACK packages when requested.
* macPanId and macCoordinator* MAC PIB attributes are set in the right
  order for improved filtering of association responses.
* The coordinator may decide not to assign a short address to the end
  device even when associated. This is now supported.
* The coordinator may or may not use a short address. Coordinators
  choosing not to support short addresses are now supported.
* Updating the association will now remove any previously added short
  address from the hardware filter.
* The short address may no longer be changed by the user while
  associated to a PAN. Only the coordinator is allowed to allocate short
  addresses.
* Validation of outgoing and incoming association request/response
  packets is improved.

All changes are documented by pointers into the spec.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-10 09:29:10 +02:00
Florian Grandel 3d54e975a7 net: l2: ieee802154: association address parsing
Fixes an off-by-one bug in the parsing routine of the coordinator
address when associating via shell command.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-10 09:29:10 +02:00
Florian Grandel 389f6ac81a net: l2: ieee802154: endianness of PAN ID
Fixes an endianness bug in PAN ID assignment.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-10 09:29:10 +02:00
Florian Grandel d7d5a53f36 net: l2: ieee802154: mgmt: improve input validation
Input validation of some of the IEEE 802.15.4 net_mgmt commands was
incomplete and/or inconsistent. This change introduces a consistent
approach to input validation that is easier to follow.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-10 09:29:10 +02:00
Florian Grandel d452ef9863 net: l2: ieee802154: correctly calculate macResponseWaitTime
Calculates macResponseWaitTime and applies it to the association
process.

As the timing calculation re-uses symbol period calculations and other
PHY timing constants previously introduced, these are now shared as
utility functions.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-10 09:29:10 +02:00
Florian Grandel 4edf46d86c net: l2: ieee802154: radio: fix radio utils naming
The IEEE 802.15.4 stack defines radio API helpers that provide
simplified and encapsulated access to radio API features.

These helpers were missing the `_radio_` infix. This infix is introduced
to clearly distinguish between MAC and PHY concerns. While PHY features
may be shared between L2 implementations (including the functions
concerned here), this is not true for MAC features.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-10 09:29:10 +02:00
Florian Grandel 3aa668f3ca net: l2: ieee802154: introduce IEEE 802.15.4-2020 association type
The IEEE 802.15.4-2020 standard introduces an association type field to
support fast association, see sections 6.4.3 and 7.5.2. We do not yet
implement fast association but we introduce the flag to make this
obvious.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-10 09:29:10 +02:00
Florian Grandel 415351f46a net: l2: ieee802154: frag configuration
Minor simplification in the definition of IEEE 802.15.4 Kconfig packet
fragmentation configuration.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-10 09:29:10 +02:00
Marcin Gasiorek 5894bec82f net: pkt_filter: Introduce additional hooks for pkt_filter
The additional hooks provide infrastructure to construct
rules on another network stack levels. Main benefit of this
approach is packets are pre-parsed and e.g. IP filter is
easier to implement. These hooks are equivalent of prerouting
and local_in in linux's netfilter.

Signed-off-by: Marcin Gasiorek <marcin.gasiorek@nordicsemi.no>
2023-07-10 09:27:47 +02:00
Marcin Gasiorek eb16ab551f tests: net: pkt_filter: Add TCs for new hooks
Add new TCs to cover new hooks functionality.
These tests implement simple IP filter.

Signed-off-by: Marcin Gasiorek <marcin.gasiorek@nordicsemi.no>
2023-07-10 09:27:47 +02:00
Jaroslaw Stelter 0bf467bbcd mm_drv: tlb: Fix context save for remapped pages
In case of remapped reference counter for physical page
is differ to zero, but TLB entry for virtual address equal to
physical address will be disabled. Valid entry will be somewhere
in virtual space where particular physical page is remapped.

Since in adsp_mm_save_context() routine we go through physical
memory range, we need to include these pages in context save loop.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-07-10 09:27:31 +02:00
Florian Grandel e256b7d244 kernel: spinlock: LOCKED -> K_SPINLOCK
Let the kernel use the new K_SPINLOCK macro and remove the alias.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-10 09:27:21 +02:00
Florian Grandel 5132022a3c kernel: spinlock: add assertion to protect K_SPINLOCK
Adds an assertion for the GCC toolchain to check whether the K_SPINLOCK
block was left without unlocking the spinlock, e.g. by calling break,
return or goto.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-10 09:27:21 +02:00
Florian Grandel 816d09c453 kernel: spinlock: expose LOCKED macro as public API
While the LOCKED pattern is universally useful it can be misused. This
change therefore exposes the LOCKED pattern with extensive usage
documentation to reduce the risk of abuse or unintended deadlock.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-10 09:27:21 +02:00
Florian Grandel 244c33549f kernel: spinlock: remove internal function from docs
Hides a function marked internal from the documentation.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-10 09:27:21 +02:00
Joseph Yates f87a589f5d boards: shields: Adding support for the adafruit can picowbell shield
Adding support for the adafruit can picowbell shield for the
raspberry pi picoi. Also added nodelable for spi0 called 'pico_spi'
as well as an GPIO nexus node 'pico_header'

Signed-off-by: Joseph Yates <joeyatessecond@gmail.com>
2023-07-10 09:26:42 +02:00