Commit graph

86339 commits

Author SHA1 Message Date
Peter Mitsis 4e426fbfa1 tests: app_kernel: extend msgq test
Extends the msgq benchmark test to obtain data for larger message
queues (messages of size 192 bytes). This allows for a better
indication of what the impact of data size is on message queue
performance.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis fa33147bf9 tests: app_kernel: Add user support
Add user thread support to message queue, semaphore, mutex and
pipe tests. Mailbox and memory map tests are restricted from
executing from user threads.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis f9cf48313b tests: app_kernel: Add custom syscalls
Adds two custom syscalls. The first allows a user thread to
change its priority to a higher priority level. The second
is used to obtain a timestamp from a user thread.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis bf2ab9be60 tests: app_kernel: Add bench_mem_partition
Adds macros for placing variables into bench_mem_partition.
This partition will be used to place global data in the test
that will need to be accessed from user threads.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis 5479090c91 tests: app_kernel: Use dynamic threads
Use dynamic threads instead of statically defined threads. This will
make it easier to add support for user threads to this test.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis 3234145669 tests: app_kernel: Rename fifo to msgq
Changed references of fifo to msgq as the fifo name was a remnant
of the old microkernel.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis 77cedbf630 tests: app_kernel: Simplify benchmark control loop
Eliminates the loop surrounding the execution of the benchmark
components as it was not doing anything.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis 8d663558d6 tests: app_kernel: Remove FP configurations
As nothing in the app_kernel uses floating point, there is no
reason to enable it.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis 56011222a4 tests: app_kernel: Remove unused symbols
Begin cleaning the the app_kernel benchmark project by removing
unused symbols.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis 6899c0d73a tests: latency_measure: Misc updates
Adds userspace configuration to testcase.yaml.

Updates the README.rst with output from runs on a frdm_k64f board
as not only have the descriptions changed, but there is now
additional output for userspace configurations.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis 1a7e5c6c8d tests: latency_measure: Use syscall to get timestamp
Many architectures and platforms can not directly read a timestamp
from userspace as the relevant MMIO registers are inaccessible.
This necessitates that the timestamp be obtained by a system call.

The additional overhead from these system calls can be taken into
account and the recorded times adjusted depending upon whether
the test occurred entirely within kernel space, entirely within
user space, or a mix between the two.

It is worth noting that when the test requires a mix of both user
and kernel space threads, the overhead is estimated as the mean
average of purely kernel threads and purely user threads overhead
times. This might not be technically correct, but it ought to
provide a reasonable enough approximation.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis 9b38aec366 tests: latency_measure: Update mutexes
Updates the mutex benchmark tests to support user threads.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis 4c4453d697 tests: latency_measure: Update semaphores
Updates the semaphore benchmarking in the latency_benchmark code
to support user threads.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis 13ac14f2bb tests: latency_measure: Update thread ops
Update the thread ops (create/start/suspend/resume/abort) to include
support for userspace.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis 4e7bb482b1 tests: latency_measure: Update interrupt latency
Updates the interrupt to thread benchmark tests to address
a number of items.
  1. Updates descriptions to correctly indicate that it is not
     interrupt latency being measured, but the time to leave
     the interrupt and return to a thread.
  2. Repeats the test numerous times instead of just once to
     get an average.
  3. Overhead from obtaining timestamps is now accounted for.
  4. Adds support for returning to a user thread.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis 8c80bbb96e tests: latency_measure: Update context switch
Updates both the preemptive and cooperative thread context switch
benchmark tests so that not only will they share the same
infrastructure, but they can both get the context switch times
when switching from ...
  1. Kernel thread to kernel thread
  2. Kernel thread to user thread
  3. User thread to kernel thread
  4. User thread to user thread

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Arkadiusz Cholewinski 6304e9a302 PM: add device_on_power_domian testcase.
Add test case to increase code coverage of device.c file.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2023-10-31 08:58:21 +01:00
Flavio Ceolin 6e02f02464 kernel: Fix k_thread_name_get signature
k_thread_name_get has inconsistent signature. In the function
declaration it uses k_tid_t but in the implementation it is using
struct k_thread *. Change the implementation to use k_tid_t.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-30 17:34:45 -04:00
Andrej Butok 7db93097da boards: arm: lpcxpresso55s16/06: add boot and slot1 flash partitions.
Add boot_partition and slot1_partition to the lpcxpresso55s16
and lpcxpresso55s06 dts.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-10-30 15:02:25 -05:00
Jamie McCrae e3c06c5d8f mgmt: mcumgr: transport: Fix UDP user data buffer overflow
Fixes a buffer overflow issue if UDP is enabled for IPv4 only
but IPv6 networking is enabled

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-10-30 14:58:49 -05:00
Benjamin Lucke 9c323d685b Bluetooth: BAP: Shell: Fixed some bap shell cmds
Added missing initialization for cmd_stream_qos and cmd_sync_broadcast.

Signed-off-by: Benjamin Lucke <git@lucke.tech>
2023-10-30 14:57:33 -05:00
Benjamin Lemouzy 9fd0185c3b drivers: audio: add Audio Codec shell commands
Add shell commands to start, stop and set properties of an Audio Codec
device.

Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>
2023-10-30 13:51:28 -04:00
Benjamin Lemouzy 5690387462 drivers: audio: add errors management
Add audio_codec_clear_errors and audio_codec_register_errors_callback
functions to manage audio codec errors.
Callback has to be called from dedicated thread to allow I2C or SPI
operations.

Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>
2023-10-30 13:50:37 -04:00
Simon Hein 169de2c0ee scripts: utils: add guidelines converter script
Add a guidelines rst converter script
to convert the rst document written coding guidelines
into another format.
First supported format is the format for cppcheck

Signed-off-by: Simon Hein <Shein@baumer.com>
2023-10-30 13:46:23 -04:00
Benedikt Schmidt d28262905e tests: kernel: fix thread function signatures
Fix thread function signatures to avoid stack corruption on exit.
Fixes #64578

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-10-30 17:45:59 +00:00
Alberto Escolar Piedras 08f6532b67 Bluetooth: Controller: Fix corruption during BIG_CHANNEL_MAP_IND
radio_pkt_big_ctrl_get() returns a statically allocated
buffer of type pdu_big_ctrl, but the callers expect a
buffer where a whole PDU for a BIG control packet can fit
(not just space for the payload),
and use it as such, overflowing this statically
allocated buffer, and smashing other variables after.

Let's fix it by allocating a buffer of the correct size
to fit a BIG control PDU.

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

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-30 18:36:39 +01:00
Franciszek Zdobylak 0249f15767 tests: drivers: Fix adc labels in sensors test
Fix the labels used in io-channels to be consistent in whole
tests/drivers/build_all/sensor/adc.dtsi file.

Signed-off-by: Franciszek Zdobylak <fzdobylak@antmicro.com>
2023-10-30 12:51:20 -04:00
Flavio Ceolin ecc544d69f headers: arch/cache: Drop extern attr from functions
Drop extern attribute from function signature.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-30 12:51:04 -04:00
Flavio Ceolin 8aa215ff45 headers: syscall_handler: Drop extern attr from functions
Drop extern attribute from function signature.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-30 12:51:04 -04:00
Flavio Ceolin 9910702378 headers: sw_isr_table: Drop extern attr from functions
Drop extern attribute from function signature.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-30 12:51:04 -04:00
Flavio Ceolin f1482c18c2 headers: posix/dirent: Drop extern attr from functions
Drop extern attribute from function signature.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-30 12:51:04 -04:00
Flavio Ceolin 079a83d7f1 headers: sys/printk: Drop extern attr from functions
Drop extern attribute from function signature.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-30 12:51:04 -04:00
Flavio Ceolin b7c3965991 headers: kernel_structs: Drop extern attr from functions
Drop extern attribute from function signature.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-30 12:51:04 -04:00
Flavio Ceolin 49a2ff75d3 headers: kernel_version: Drop extern attr from functions
Drop extern attribute from function signature.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-30 12:51:04 -04:00
Flavio Ceolin a629ac5fac headers: posix/unistd: Drop extern attr from functions
Drop extern attribute from function signature.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-30 12:51:04 -04:00
Flavio Ceolin 51754e3a53 headers: sys/atomic_arch: Drop extern attr from functions
Drop extern attribute from function signature.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-30 12:51:04 -04:00
Flavio Ceolin a077079f45 headers: sys/atomic: Drop extern attr from functions
Drop extern attribute from function signature.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-30 12:51:04 -04:00
Flavio Ceolin 1f86454d1a headers: sys/reboot: Drop extern attr from functions
Drop extern attribute from function signature.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-30 12:51:04 -04:00
Flavio Ceolin 01d61ba18b headers: kernel: Drop extern attr from functions
Using extern attribute in function signatures is not
necessary and it is not consistently across Zephyr headers.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-30 12:51:04 -04:00
Grzegorz Chwierut bbab631021 twister: unittests: Use mock for os.name in unittests
Use mock.patch instead of monkeypatch for os.name in unittests
to fix error when executing tests under VSCode

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2023-10-30 11:50:48 -04:00
Andrej Butok f289c3149b doc: kernel: Fix double "the" for k_thread_deadline_set()
Fix double "the" in the k_thread_deadline_set() description.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-10-30 11:50:16 -04:00
Yong Cong Sin 1782011d2c tests: devicetree: api: add tests for new DT APIs
Add tests for new DT APIs added in the previous commit:
- `DT_IRQN_BY_IDX`
- `DT_INST_IRQN_BY_IDX`

Added additional tests for the following existing DT APIs when
`CONFIG_MULTI_LEVEL_INTERRUPTS` is enabled:
- `DT_IRQN`
- `DT_INST_IRQN`

Added `qemu_riscv32` for the multi-level interrupt tests.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-10-30 11:43:39 -04:00
Yong Cong Sin df2c0681d3 devicetree: encode multi-level interrupt number in C devicetree magic
The multi-level encoding of the interrupt number currently
happens in the `gen_defines.py`, which is called in the
`dts.cmake` module after `kconfig.cmake`. However, the number
of bits used by each level is defined in Kconfig and this means
that `gen_defines.py` will not be able to get that information
during build.

To fix this, do the multi-level encoding in C devicetree macro
magic instead of the python script. This ticks one of a
long-standing TODO item from the `gen_defines.py`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-10-30 11:43:39 -04:00
Yong Cong Sin d7302f417e irq: relocate multi-level irq out of irq.h
Relocate multi-level interrupts APIs out of `irq.h` into
a new file named `irq_multilevel.h` to provide cleaner
separation between typical irq & multilevel ones.

Added preprocessor versions of `irq_to_level_x` as `IRQ_TO_Lx`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-10-30 11:43:39 -04:00
Bjarki Arge Andreasen 42676e322b doc: gnss: Add GNSS documentation
- Added GNSS documentation entry to peripherals
- Added GNSS API entry to the API overview as 3.6 experimental

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-10-30 11:43:19 -04:00
Bjarki Arge Andreasen b6a8424e95 samples: gnss: Add GNSS sample application
This commit adds a sample which configures a GNSS modem
to enable all available systems, registers callbacks to
the GNSS data and satellites callbacks, and prints the
GNSS data and satellites from the callbacks when invoked
using printk.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-10-30 11:43:19 -04:00
Bjarki Arge Andreasen b60eb1881b drivers: gnss: Add GNSS driver for Quectel LCX6G
This commit adds a GNSS driver for the Quectel LCX6G
series of GNSS modems (LC26G, LC76G, LC86G). It is
based on the modem subsystem, and the GNSS utilities
added in the two previous commits.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-10-30 11:43:19 -04:00
Bjarki Arge Andreasen 2b14e5d84a drivers: gnss: Add nmea0183 match utilities
This commit adds generic matches and handlers for the RMC,
GGA and GSV messages to be implemented as part of all
NMEA0183 based GNSS modems.

NMEA0183 based GNSS modems must place the
struct gnss_nmea0183_match_data struct as the first struct
in their data struct. Their data struct shall then be set
as the user_data for the modem_chat instance.

Lastly, the gnss_nmea0183_match callbacks must be included
in the unsolicited matches for the modem_chat instance.

The GNSS modems will initialize the NMEA0183 match instance
using gnss_nmea0183_match_init.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-10-30 11:43:19 -04:00
Bjarki Arge Andreasen d8bb7c87cf drivers: gnss: Add parsing utils for NMEA0183
This commit adds utilites to parse the RMC and GGA
NMEA0183 messages, which contain all data which shall be
published using the struct gnss_data.

It also adds a test suite for the added utilities.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-10-30 11:43:19 -04:00
Bjarki Arge Andreasen 4cfea4a520 drivers: gnss: Add GNSS parsing utilities
This commit adds parsing utilites for common string
representations of values contained in GNSS messages.

These utilites both parse and validate the integrity of
the data.

Unit tests are also added to validate the parsing
utilities.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-10-30 11:43:19 -04:00