Commit graph

91865 commits

Author SHA1 Message Date
Björn Stenberg 6a4514ddc0 adc: Use int64_t in voltage divider calculation to avoid overflow
int32_t overflows above 1.3kOhm if using vref 3300 mV.

Signed-off-by: Björn Stenberg <bjorn@haxx.se>
2024-03-07 09:23:53 +01:00
Anas Nashif d7223e7bba samples: pong: k_thread_foreach needs CONFIG_THREAD_MONITOR
When debugging and dumping thread related info, CONFIG_THREAD_MONITOR is
needed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 21:40:33 -05:00
Anas Nashif 0d8da5ff93 kernel: rename scheduler spinlock variable and make it private
rename sched_spinlock to _sched_spinglock to maintain it is privacy and
to avoid any misuse.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif 868f099d61 kernel: sched: z_set_prio -> z_thread_prio_set
Rename private function to make it clear what priority we are setting
and to be consistent across the code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif 477a04a098 kernel: rename h -> heap
Avoid single characker variables that renders code unreadable and might
cause conflicts in maing, similar to t for both timeout and thread in
some places.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif c506cdfece kernel: rename thread/timeout parameter
Using t for both thread and timeout can be confusing at times.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif 595ff63f00 kernel: thread: use consistent thread parameter
Use thread wherever it makes sense, using 't' in some places can get
confused with 't' used for timeouts for example.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif 3dc0c4544b kernel: move float operations out of thread.c
Move float operation out and add missing vrfy hook for enabling float.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif 6c003bdbcf kernel: remove unused code in headers
List of functions defined in headers and not being used anywhere.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif 9e83413542 kernel: split thread monitor
Move thread monitor related functions, not enabled in most cases outside
of thread.c and cleanup headers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif e10665531f spelling: add enabeld typo
add typo of enabeld.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif 5e591c38f1 kernel: do not export z_thread_priority_set
This function is only being used by a test, so instead of reimplementing
a syscall in the test, provide a Kconfig option to provide the
functionality that only works with tests and remove some of the
duplication and extra code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif 3ca50f5060 kernel: move z_init_static_threads to where it is being used
Move out of thread and put directly in init.c where it is being used.
Also remove definition from kernel.h, this is an internal function and
should not be in a public header.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif a6ce422b10 kernel: remove cmsis-rtos layering violation
We shouldn't be calling hooks from optional and upper layer subsystems
in the kernel, instead, just call the hook to set thread status in the
API where it is needed.

This now clears related bit in cmsis thread status bitarray when
terminating a thread in the cmsis rtos v1 layer directly and not in the
kenrel code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif 077222c975 kernel: split cpu_mask handling into own file
In an effort to cleanup sched.c, move sections of code that can be
compiled in based on options into own files. CPU mask here is managed by
a kconfig and is not widely used (SMP affinity on multicore systems).

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif 6e95bdeca6 kernel: reorg Kconfigs and split them
The kernel kconfig is becoming too big and unmanageable with too many
options scattered across the file. Move some areas out and reorg main
Kconfig slightly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif 8791012ed1 kernel: move essential flag related routines out
The functions to manipulate the essential flag indeed operate on
threads, but they are misplaced in the thread implementation file. Put
them alongside other routines setting other thread flags and cleanup
headers a bit.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif 2c31db4cc8 kernel: split irq_offload ccode into own file
Move irq_offload code out of thread.c into own file. This code is not
related to threads.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif a7d74f80ce kernel: move spinlock validation to own file
Move spin_lock validation outside of thread.c into own file. This code
really has nothing to do with the thread code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Stephanos Ioannidis 7df7e834d9 ci: twister: Set build job timeout to 24 hours
This commit increases the twister build job timeout from the default value
of 6 hours to 24 hours because scheduled (weekly) build runs take longer
than 6 hours to complete.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-03-06 16:42:33 -05:00
Stephanos Ioannidis cb81b295e0 tests: kernel: thread_runtime_stats: Relax precision test for QEMU
This commit relaxes the idle event statistics test precision requirement
for emulated QEMU targets because the cycle counts may be inaccurate when
the host CPU is overloaded (e.g. when running tests with twister) and a
high failure rate is observed for this test in the CI.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-03-06 16:42:33 -05:00
Stephanos Ioannidis c64d0b9ce5 testsuite: ztest: Increase ZTEST_TEST_DELAY_MS to 5000
This commit increases the default value of `ZTEST_TEST_DELAY_MS` from 3000
to 5000 milliseconds because the current value of 3000ms may not be
sufficient for the hosts with lower CPU clock frequency (e.g. new Zephyr CI
runners with cost-effective processors).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-03-06 16:42:33 -05:00
Stephanos Ioannidis de68ea7ce0 ci: twister: Set twister timeout multiplier to 2
This commit sets the twister timeout multiplier to 2, which effectively
increases the default test timeout from 60 to 120 seconds, because the new
cost-effective Zephyr runners may take longer to execute tests and the
default timeout is not sufficient for some tests to complete.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-03-06 16:42:33 -05:00
Stephanos Ioannidis 527435d642 ci: twister: Prioritise remote Redis cache storage
This commit updates the twister workflow such that ccache only uses remote
Redis cache storage when available.

The purpose of this to reduce the individual runner local disk IOPS
requirement; thereby, reducing the overall load on the SAN.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-03-06 16:42:33 -05:00
Stephanos Ioannidis d3f9f391ad ci: twister: Add --specs to ccache ignore option list
This commit adds the compiler `--specs=*` flag to the ccache ignore option
list because ccache is unable to resolve the toolchain-provided specs file
path and will consider source files to be uncacheable if it is unable to
read the specified specs file.

Note that adding `--specs=*` to the ignore option list is not a problem
because it is unlikely for the content of the toolchain libc spec file to
change without the compiler executable itself changing.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-03-06 16:42:33 -05:00
Stephanos Ioannidis 3823f1f0db ci: twister: Use Redis remote storage for ccache
This commit updates the twister workflow to, when available, use Redis
remote storage backend for the ccache compilation cache data.

The Redis cache server is hosted in the Kubernetes cluster in which the
zephyr-runner pods run -- the Redis remote storage backend will be ignored
if the server is unavailable.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-03-06 16:42:33 -05:00
Stephanos Ioannidis 1be3aacad3 ci: twister: Store ccache data in node cache
This commit updates the twister workflow to store ccache data in the
zephyr-runner v2 node cache.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-03-06 16:42:33 -05:00
Stephanos Ioannidis 9a9bebb9f9 ci: twister: Print cloud service information
This commit updates the twister workflow jobs that run on the zephyr-runner
v2 to print the underlying cloud service information in the logs to help
trace and debug potential runner issues.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-03-06 16:42:33 -05:00
Stephanos Ioannidis 7c19bc70bf ci: twister: Use zephyr-runner v2
This commit updates the twister workflow to use the new zephyr-runner v2 CI
runner deployment.

It also updates the workflow to use the `ci-repo-cache` Docker image, which
includes the Zephyr repository cache, because the node level repository
cache is no longer available in the zephyr-runner v2.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-03-06 16:42:33 -05:00
Pieter De Gendt 0db120abd4 net: lib: shell: iface: Fix when building ethernet without IP support
The count stack variable is also used when CONFIG_NET_L2_ETHERNET_MGMT is
enabled. Make sure it is available.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-03-06 15:23:52 -06:00
Henrik Brix Andersen 7987d802e3 doc: releases: release-notes: 3.7: mention automatic CAN sample points
Add a note on the extended support for automatic CAN sample point location.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-06 15:23:13 -06:00
Henrik Brix Andersen 49653d39dd drivers: can: extend support for automatic sample point location
Extend support for automatic sample point location to also cover
can_calc_timing() and can_calc_timing_data().

Previously, automatic sample point location was only supported by
can_set_bitrate() and can_set_bitrate_data().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-06 15:23:13 -06:00
Anas Nashif b2cfdc41d2 MAINTAINERS: add xtensa tests to area
Add xtensa arch tests to respective area.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 15:30:08 -05:00
Anas Nashif c6a01e7342 tests: xtensa: fix test identifier
start with arch.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 15:30:08 -05:00
Armin Brauns 5f844f5252 include: disk.h: make name field in struct disk_info const
This isn't modified anywhere, which is good, because it is typically
initialized with a string literal, which would likely blow up if you tried.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2024-03-06 21:29:11 +01:00
Robert Lubos a487addc61 sys: Include sys/util.h header in sys/atomic.h
Commit a1358aaedf introduced ROUND_UP
macro use within sys/atomic.h header, but did not include the header
(sys/util.h) which actually defines the macro. This commit fixes it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-03-06 12:51:52 -05:00
Jukka Rissanen 47db2e050e doc: migration-guide-3.7: Add IPv4 netmask information
The IPv4 netmask handling is changed and it might need
adjustments from user if using more than one IPv4 address
inside one specific network interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-06 15:59:22 +00:00
Ivan Iushkov 8f458bb51f modules: crypto: update tinycrypt revision
update tinycrypt revision to fix
warnings reported by ubsan

Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
2024-03-06 15:58:59 +00:00
Fin Maaß abdfc4b1fe logging: support using real time as timestamp
Adds a option to use real time from posix instant
of the system uptime as the logging timestamp.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-03-06 15:58:43 +00:00
TOKITA Hiroshi c00bd4a8d5 boards: arm: rpi_pico: Add default serial for connector definition
Add `pico_serial` which is alias of `uart0` as a definition
related to pico_header.
The uart0(GP0 and GP1)  is shown as default serial port
in pinout diaglam.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-03-06 15:58:29 +00:00
Dawid Niedzwiecki 4d97dcf115 ec_host_cmd: introduce Host Command state
Introduce a current state of Host Command subsystem.

It makes sures that a backend has been initilized and doesn't allow
sending a response twice. There is a possibility, that a command handler
that calls ec_host_cmd_send_response function returns anyway (which is a
mistake).

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2024-03-06 14:35:34 +01:00
Armin Brauns 99fd397147 scripts/check_compliance: pass --no-ext-diff to git diff
If $GIT_EXTERNAL_DIFF is set, this difftool is used instead of the default
internal unified diff, which breaks the Checkpatch check.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2024-03-06 14:34:22 +01:00
Henrik Brix Andersen 68f4f12c1b drivers: can: respect minimum supported prescaler value
Respect the minimum supported prescaler value when calculating CAN timing.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-06 14:18:08 +01:00
Henrik Brix Andersen 5e1ce7e0f7 drivers: can: minor improvements to internal timing calculation code
Improve the internal CAN timing calculation code readability by unifying
variable and function naming, avoiding unnecessary casting, and rewording
comments.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-06 14:18:08 +01:00
Ederson de Souza 4440d6a189 kernel/userspace: Fix dynamic thread stack allocation at userspace
It wasn't saving adjusted stack size at either the private stack or the
k_object, thus failing subsequent checks.

Test added to check for this case and prevent regressions.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-03-06 14:17:53 +01:00
TOKITA Hiroshi 7e78df8c40 samples: drivers: led_ws2812: Rename boards files to follow hwmv2
The esp32s3_devkitm and the nrf5340dk_nrf5340 only have ws2812 in
each configurations that is procpu and cpuapp respectively.
Rename overlay and conf files to avoid building with unnecessary
configurations.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-03-06 14:17:27 +01:00
TOKITA Hiroshi 0f458c9564 drivers: led_strip: ws2812_rpi_pico_pio: Change output-pin to gpios
For sharing pin definition property with `worldsemi,ws2812-gpio`,
rename `output-pin` to `gpios`.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-03-06 14:17:27 +01:00
TOKITA Hiroshi 0702f0eb45 drivers: led_strip: ws2812_gpio: Rename in-gpios property to gpios
ws2812-gpio's `in-gpios` property is not used as an input pin.
Renaming it to `gpios` to reflect the actual situation.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-03-06 14:17:27 +01:00
Fabio Baltieri 8b9464089c input: add a pmw3610 driver
Add a driver for the Pixart PMW3610 mouse sensor device.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-03-06 13:34:16 +01:00
Jukka Rissanen 1d96454dc7 tests: net: dns: Fix the tests to check the exponential backoff
Make sure that we do needed number of exponential backoff queries
if configured so.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-06 13:33:50 +01:00