Commit graph

86100 commits

Author SHA1 Message Date
Ali Hozhabri 154023f754 drivers: spi: update drivers that were using spi cpol and cpha
Modified files (yaml, dts, overlay, and c) which were using spi-cpol
and spi-cpha to be compatible with the new structure.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2023-10-25 18:30:28 -07:00
Ali Hozhabri e2c0cb979f include: zephyr: drivers: modify SPI_CONFIG_DT to add CPOL, CPHA, HOLD_CS
Modify SPI_CONFIG_DT macro to config SPI clock polarity (CPOL),
clock phase (CPHA), and hold-cs.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2023-10-25 18:30:28 -07:00
Ali Hozhabri eb2f5ceb19 dts: bindings: spi: add support to set CPOL, CPHA, and HOLD_CS in dts file
Add support to set SPI clock polarity (CPOL), clock phase (CPHA), and
hold-on-cs in a dts file to get rid of using related macros in spi.c driver
since each board may work on a different SPI mode rather than the default
one (based on CPOL and CPHA).

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2023-10-25 18:30:28 -07:00
Manuel Argüelles 339cd5a45f s32z270dc2_r52: make nxp_s32dbg the default runner
Make NXP S32 Debug Probe runner the default on this board and keep
Lauterbach TRACE32 runner as an alternative.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-10-25 18:14:51 -07:00
Manuel Argüelles a7bda08960 nxp: s32ze: take exceptions in Arm mode
Cortex-R52 supports both Arm and Thumb-2 mode, but Zephyr's ASM
code for Armv-8 Aarch32 is written for Arm mode only. This Soc
has a general purpose register that can set the core TEINIT signal
to change the mode exceptions are taken before booting up the core.
The debugger startup scripts or firmware booting up the core may
configure this bit to Thumb mode, as is the case of the NXP S32 debug
probe startup scripts for S32ZE.

Due to above reason, clear SCTLR.TE bit at reset so that TEINIT value
is ignored and exceptions are always taken into Arm mode, compatible
with current Zephyr ASM code. At least until taking execeptions in Thumb
mode is supported in Zephyr.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-10-25 18:14:51 -07:00
Manuel Argüelles 006a650690 doc: flash_debug: add NXP S32 debug probe docs
Document needed steps to download, install and setup the debug host
tools for NXP S32 Debug Probe.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-10-25 18:14:51 -07:00
Manuel Argüelles 52e9671fa8 west: add tests for NXP S32 Debug Probe
Add minimal set of tests to verify behavior of supported commands.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-10-25 18:14:51 -07:00
Manuel Argüelles e938a5a31a west: add NXP S32 Debug Probe runner
The NXP S32 Debug Probe is a JTAG-based probe that enables debugging on
NXP S32 devices. This probe is designed to work in conjunction with NXP
S32 Design Studio and this runner offers a wrapper to launch a debug
session from cli.

`flash` command is not implemented at the moment because presently there
are no zephyr boards that can make use of it and test it.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-10-25 18:14:51 -07:00
Manuel Argüelles 1bc53ff84d west: core: allow to pass keywords args to server and client
Allow the runners to pass extra keywords arguments to both the server
and client subprocesses calls, as can be useful for instance to set
a specific execution environment.
ZephyrBinaryRunner.check_call() already supports passing kwargs to
the inner subprocess call but this is currently not possible when
starting server/client processes. So pass through the kwargs to each of
the client/server subprocess calls.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-10-25 18:14:51 -07:00
Manuel Argüelles c35d024b8d west: core: add search path argument to require()
Allow the runners to override the default search path, e.g. when
provided through command line. The default is to search for the program
binary on the system PATH.

This is useful when the runner allows to optionally override the search
path of the tool, in the case there are multiple versions or
installations, and not necessarily the tools path are present in the
system PATH environment variable. For example:
`tool = self.require(tool_name, path=args.tool_path_override)`

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-10-25 18:14:51 -07:00
Peter Mitsis 467ce89458 cmsis: resolve undefined reference to k_calloc()
When no heap has been configured, osMessageQueueNew() will no
longer include a call to k_calloc() (which needs the heap).
In such a configuration, if osMessageQueueNew() indicates that
the buffer must be allocated, it will fail and return NULL.

Fixes #61196

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-25 19:54:13 +02:00
Georgij Cernysiov e364f29bff drivers: ethernet: fix adin set_config
Corrects set_config to allow MAC config
at runtime.

* Add missing device lock
* Use correct mac argument

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2023-10-25 17:36:37 +02:00
Seppo Takalo cf513451eb net: lwm2m: Keep user_data between blocks
CoAP reply structure user_data should be kept between
ongoing blocks, so that callbacks for LwM2M send continue
to work on blockwise transfers.

Fixes #64290

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-10-25 17:36:30 +02:00
Emil Gydesen 34058146a5 Bluetooth: BAP: Shell: Remove unused variable stream_frame_duration_us
The variable was unsused and caused compiler warnings.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-25 17:36:22 +02:00
Michael Arnold 973e226bfd arch: Enable ramfunc feature on RISC-V PRIVILEGE SOC family
Allow to place functions in ram.

Signed-off-by: Michael Arnold <marnold@baumer.com>
2023-10-25 17:35:07 +02:00
Michael Arnold 9e4a403d21 tests: arch: Make ramfunc test generic and enable test for riscv arch
The ramfunc test can be reused for multiple architectures.

Signed-off-by: Michael Arnold <marnold@baumer.com>
2023-10-25 17:35:07 +02:00
Michael Arnold f67c11cb2a tests: arch: Move ramfunc test from arm specific to common
The feature ramfunc is generic and can be
reused for other architectures.

Signed-off-by: Michael Arnold <marnold@baumer.com>
2023-10-25 17:35:07 +02:00
Michael Arnold aa08d5cc5c arch: Enable ramfunc support for other arch than arm
long_call is not supported on risc-v.
Enable long_call only on supported arm architecture.

Signed-off-by: Michael Arnold <marnold@baumer.com>
2023-10-25 17:35:07 +02:00
Francois Ramu 40a0d3c1a2 boards: stm32 boards with LPTIM node has CONFIG_STM32_LPTIM_CLOCK defined
Define the CONFIG_STM32_LPTIM_CLOCK_LSE when the board DTS
has STM32_SRC_LSE has lptim clock source.
CONFIG_STM32_LPTIM_CLOCK_LSI is defined by default.
The CONFIG_SYS_CLOCK_TICKS_PER_SEC is set by soc/arm/st_stm32/common/
Kconfig.defconfig.series.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-10-25 17:34:09 +02:00
Ben Marsh 3d4208d191 boards/arm/stm32h735g_disco: Enable L2 Ethernet
The stm32h735g_disco board support Ethernet but the L2 Ethernet driver
was not being enabled.

The L2 Ethernet driver is now enabled along with Networking.

Signed-off-by: Ben Marsh <ben.marsh@helvar.com>
2023-10-25 17:34:02 +02:00
Erwan Gouriou c2715b1fa5 drivers: i2c: stm32: Don't abuse of pm_device_runtime_get/put
In driver runtime configuration function, calling
calling pm_device_runtime_get/put() will have the effect of performing
pinctrl change from sleep to default and back from default to sleep
which is useless and in turn enables and disables GPIO clocks two times.

Stop this crazyness and purely enable/disable clock, which might be
superfluous in some cases but which remains much more reasonable than
than the previous implementation.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-10-25 17:33:56 +02:00
Erwan Gouriou b6fa34f1d3 drivers: i2c: stm32: Simplify device init
pm_device_runtime_enable() will call i2c_stm32_suspend() if
pm_device_init_suspended() isn't called.
Since the aim is to perform suspension, just need to call
pm_device_runtime_enable().

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-10-25 17:33:56 +02:00
Erwan Gouriou 85fb82e1d6 drivers: stm32: Don't use pm_device_busy for configure
During i2c_configure API execution, there is no way core
can go in low power mode. Hence, call to pm_device_busy_set/get API
is useless.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-10-25 17:33:56 +02:00
Erwan Gouriou b9b3e91dba boards: nucleo_wba52cg: Enable flash and debug using OpenOCD
OpenOCD can now be used to flash and debug nucleo_wba52cg.
However, today, it requires use of recent upstream OpenOCD.
Add instructions on how to proceed.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-10-25 17:33:49 +02:00
Martin Kiepfer 82b1df21cf shields: Add support for M5Stack-Core2 base shield.
M5Stack-Core2 comes with a base shield that is connected to the M5Stack
extention connector. It features a MPU6886 6-axis motion tracker
and a SPM1423 microphone.

Signed-off-by: Martin Kiepfer <m.kiepfer@teleschirm.org>
2023-10-25 17:33:35 +02:00
Martin Kiepfer aef1611e1f sensors: mpu6050: Add support for variant mpu6886
This commit adds support for mpu6886, which has compatible register
layout.

Signed-off-by: Martin Kiepfer <m.kiepfer@teleschirm.org>
2023-10-25 17:33:35 +02:00
Martin Kiepfer bc5f78d9ba boards: m5stack_core2: Add support for mbus connector
This commit adds basic support for the mbus connection port to
m5stack_core2 board.

Signed-off-by: Martin Kiepfer <m.kiepfer@teleschirm.org>
2023-10-25 17:33:35 +02:00
Martin Kiepfer a169f581d3 gpios: shields: Add definition for M5Stack M-Bus port
This commit adds basic support for m5stacks M-Bus extenions port that is
support my core and core2 module.

Signed-off-by: Martin Kiepfer <m.kiepfer@teleschirm.org>
2023-10-25 17:33:35 +02:00
Aleksandr Senin d8b153e00f drivers: eth: eth_stm32_hal: Add DSA support
This commit adds DSA functionality support to the Ethernet driver
for the STM32 SoC.

Signed-off-by: Aleksandr Senin <al@meshium.net>
2023-10-25 09:55:42 -05:00
Martin Åberg fd4e66499c SPARC: Update the Flush windows software trap
This commit re-implements the SPARC V8 ABI "Flush windows" software
trap. The trap is generated by C++ compilers for exceptions and also by
the C standard library function longjmp().

There were two issues with the previous implementation:
1. It did reads and writes via the stack pointer of the trap window,
   which is not defined.
2. It executed with traps enabled but without the processor run-time
   state set to safely handle traps. In particular there was no valid
   stack for trap processing. Even though interrupt priority was set to
   highest level, the behavior at other traps was not deterministic. For
   example non-maskable interrupt (15) trap or bus error trap for
   instruction fetch.

This new implementation does not store backup copies of CPU registers to
the stack, and it executes with traps disabled.

Fixes #63901

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2023-10-25 09:54:31 -05:00
Alberto Escolar Piedras 3f1eed17f8 nrf53_bsim: Get IPC shared memory buffer size from DT
Before we were defining the buffer in the runner context
which is simpler and less error prone, but it had a hardcoded
size decoupled from DT as it could not be based on DT
information.
Instead, let's allocate the buffer in the application core
image. This allows us to size it based on the device tree
configuration.
Note that this then requires the application core image
to be present during link time of the final executable
when the IPC subsystem is used.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-25 17:31:59 +03:00
Alberto Escolar Piedras adf9e4000f samples ipc static_vrings: Convert to sysbuild
Convert this sample application build to sysbuild.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-25 17:31:27 +03:00
Alberto Escolar Piedras 19cc0fe099 samples ipc icmsg: Convert to sysbuild
Convert this sample application build to sysbuild.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-25 17:31:27 +03:00
Alberto Escolar Piedras 433f47ee57 samples ipc icmsg_me: Convert to sysbuild
Convert this sample application build to sysbuild.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-25 17:31:27 +03:00
Dmitry Lukyantsev 357d6cec45 boards: Add support for the NXP MIMXRT595 DSP core
Add board and soc files for the NXP MIMXRT595 DSP core.

Signed-off-by: Dmitry Lukyantsev <dmitrylu@google.com>
2023-10-25 09:55:10 -04:00
Dmitry Lukyantsev 0ae68a3857 soc: nxp_adsp: Refactor imx8/imx8m Kconfig
In preparation for RT500 ADSP enablement, consolidate common Xtensa
configuration parameters in top level Kconfig.defconfig.

Signed-off-by: Dmitry Lukyantsev <dmitrylu@google.com>
2023-10-25 09:55:10 -04:00
Anders Storrø d4037ce6a1 Bluetooth: Mesh: Correct pack of net idx hb_status
Ensures correct packing of net idx in Heartbeat Publication Status
messages on the Configuration Server.

Reference to net idx packing format: MshPRTv1.1 section 4.3.1.1

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-25 14:50:22 +02:00
Anders Storrø 05774c5d76 Bluetooth: Mesh: Fix unpacking of hb_pub status
Fixes incorrect unpacking of Heartbeat Publication status
messages on the Configuration client.

Reference to packing format: MshPRTv1.1 section 4.3.2.63

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-25 14:50:22 +02:00
Anders Storrø 46d9c97991 Bluetooth: Mesh: HB pub status for unassigned addr
Fixes issue where Heartbeat Publication Status message sends
garbage data when destination field is set to the unassigned address.

MshPRTv1.1, section 4.4.1.2.15:
"When the Destination field is set to the unassigned address, the values
of the CountLog, PeriodLog, TTL, and Features fields shall be set to
0x00 and NetKeyIndex field shall be set to 0x0000."

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-25 14:50:22 +02:00
Anders Storrø c51bb9c13b Bluetooth: Mesh: Update spec ref 1.0.1->1.1
Updates Bluetooth mesh specification references:

- Change "Profile" to "Protocol" since the main specification has
changed its name.
- Update/align formating of specification references. This will
make it easier to find spec references in the future.
- Change some section references to point to the correct section of the
newest version of the specification (v1.1).

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-25 14:50:14 +02:00
Alberto Escolar Piedras 587c43a602 tests/posix/common: Fix filtering for POSIX arch
All these tests where filtered for the whole POSIX
architecture, but quite a few of them can be run in
native_sim.
So let's filter out native_posix(_64) in general,
(allowing other native simulator based targes),
and filter for thsi arch out explicitly the 2 tests
which need NEWLIB as this arch does not provide it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-25 07:44:12 -04:00
Alberto Escolar Piedras 32ea1566db tests/posix/fs: Improve filtering around posix arch
These tests cannot be run on the native_posix(_64) targets,
so let's filter them explicitly. Before they were filtered
due to the "filter", but using platform_exclude is faster.

Also the tests that depend on newlib cannot be run
in this architecture at all, so let's filter them by
architecture too.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-25 07:44:12 -04:00
Alberto Escolar Piedras a2d1e979ef tests posix timer: Fix timer check
The timer check does not work properly for platforms
which have a system tick timer with a period that
does not properly divide the configured time interval.

In those, depending on when the timer is started and
stopped, one signal less may be received.

This is for example the case for nrf5x platforms,
where the system tick timer is driven by a 32.768KHz
clock.

=> Correct the test, to accept receiving 1 signal
too little during the wait.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-25 07:44:12 -04:00
Joakim Andersson dc431a7397 boards: Fix nrf9160 NS flash partition layout
Fix secure and non-secure images overlapping because of incompatible
flash layout configurations.

Align the board configurations to match the nRF9160 DK default
partition layout.

This enforces that the SPU alignment requirement is satisfied for
the nrf9160 MCU.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2023-10-25 11:22:06 +02:00
Alberto Escolar Piedras 572491ab95 Revert "modules: tinycrypt: Options only when module is available"
This reverts commit 713ca15224.

This change broken several BT unit tests breaking CI in the main
branch. Let's revert it.

Fixes https://github.com/zephyrproject-rtos/zephyr/issues/64344

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-25 11:04:43 +02:00
Henrik Brix Andersen 9a7671e521 ci: test using Python 3.11 as well
Run CI tests against Python v3.11 as well.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-10-25 10:06:01 +02:00
Peter Mitsis 9f7244ee04 tests: obj_core: Increase stack sizes
Increase the size of the thread stacks used by the obj_core tests
by CONFIG_TEST_EXTRA_STACK_SIZE bytes. This is useful to prevent
stack overflow/corruption when options such such as
    "--coverage --gcov-tool gcov"
are applied to twister runs.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-25 10:05:52 +02:00
romain pelletant efebb1841f modem_chat: fix hard fault on script stop
Fix fault on modem_cellular disconnection/reconnection
Issue #64291

Signed-off-by: romain pelletant <romainp@kickmaker.net>
2023-10-25 10:05:45 +02:00
Jamie McCrae f2b3a5ea3a samples: mgmt: mcumgr: smp_svr: Fix start if USB already init
Fixes an issue whereby the application init will stall if USB init
failed if it's already been setup, this is likely due to USB CDC
being enabled in which case the failure can be ignored

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-10-25 10:05:37 +02:00
Rick Tsao 7c25a7562b riscv: pmp: Fix assertion for PMP misaligned start address and size
Fix assertion to check whether the start address and size align with
PMP granularity.

Signed-off-by: Rick Tsao <rick592@andestech.com>
2023-10-25 10:05:24 +02:00