-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Abstract Clock Subsystem Architecture #19030
Comments
For gPTP (generalized Precicion Time Protocol) enabled system, there is a high accuracy clock source, with nanosecond accuracy, provided by Ethernet controller. For example frdm-k64f (eth_mcux driver) and sam-e70-xplained (eth_sam_gmac driver) boards have support for gPTP. |
If that clock provides high-accuracy realtime (e.g. UTC or TA1) it could certainly be useful. |
Some questions/comments:
|
I have not read through all of the related issues but one thing appears to be absent from this discussion, which is power consumption. I've been working with the SAMD21 and Zephyr recently and have discovered that the clock domain used for the system timers is the same clock used to clock the CPU. That is a problem for a low power application. To achieve low power on the SAMD21, the SAMD21 RTC needs to be clocked by the 32KHz lower power clock source. This implies another clock domain. Has anyone considered the implications of this with respect to this work? |
Yes. Initial thoughts, at least. It depends on the second TBD in #19282 relating to a domain model for clocks, which considers fixed rates, monotonicity, and the effect of discontinuities when mapping between domains. |
This comment was marked as outdated.
This comment was marked as outdated.
I'd vote in favor. This is what Linux does under the notion of "dynamic clocks", see clock_getres(2) |
This comment was marked as outdated.
This comment was marked as outdated.
Ah, I see - this one should probably be assigned to me. Is it ok if I take this one, @nordic-krch ? It was originally created by Peter.
This is very much a WIP area, as I'm literally tying in the pieces for The monotonic clock should likely not be adjusted, but the realtime clock, certainly. For something like
For now, I would suggest we stick to monotonic and real-time clocks for now. Advanced features will be added to the agenda as well.
Sort of - likely what should be done is that a separate but parallel Zephyr clock subsystem / library / whatever is needed, and then the posix layer should be a very thin layer that wraps around it. However, there are some potentially non-obvious things, like
I'd prefer to leave this open as well, but thanks for commenting on this ticket again, because it's directly relevant. |
This comment was marked as duplicate.
This comment was marked as duplicate.
My guess is that you're looking at Linux man pages. Would be better to stick with POSIX via https://pubs.opengroup.org/onlinepubs/9699919799/ Not 100% sure ATM if adjusting monotonic is part of POSIX. We could make it a kconfig option for a deviation though, and support it anyway. If we were to support adjustments on monotonic on the Zephyr side, it would very likely need to be done outside of the existing k_uptime_get() machinery, but at least there is no spec to restrict that. |
@fgrandel - This API is mainly for hardware real-time clocks, and less for e.g. clock_gettime(CLOCK_REALTIME). .. ah, I see Bjarki got to it already. |
This comment was marked as outdated.
This comment was marked as outdated.
@fgrandel I would suggest you focus this issue on what you actually want to achieve, instead of writing all you grievances in lists in comments. Its hard to follow and respond to concisely, leading to repetitions of answers and lack of focus. Put simply, The RTC and Counter APIs are the lowest level APIs for the hardware (as already stated). For this reason, there is an inherent contradiction and possible lack of understanding when you state:
Higher level abstractions are just that, higher level, built upon the lower levels. Please read the documentation regarding API API Status and Guidelines, specifically the API Lifetime section, then look at a few of the existing RTC device drivers RTC Drivers to gain an understanding of how the API is used and what the hardware capabilities are. Lastly, look into what the rtc-emul driver is actually used for Hint This should address most of your points, and help focus this issue. |
@bjarki-trackunit You are right, the rtc.h discussion belongs in separate issues (I opened some as you've seen). Unfortunately it landed here because of my initial misunderstanding about the role of rtc.h. With hindsight the error is obvious. UPDATE: rtc.h-related discussion entries which turned out to be irrelevant wrt the clock subsystem architecture were hidden from this RFC. If you wish you can hide yours as well then focus of this RFC will be completely restored. |
Introduces a well-defined intermediate concept of syntonized scalar nanosecond resolution time with overflow protection above low-level counters/cycles/ticks and below higher level time abstractions (timescales, calenders, etc.). The rationale of this type has been extensively documented and contrasted to already existing time representations to ensure that it fills a well defined gap without overlap. This change prepares for later changes in this change set that will unify the usage of time across the network subsystem (RX/TX timestamps, timed TX, CSL, scheduled reception windows, (g)PTP integration, etc.). The type is EXPERIMENTAL and named net_time_t while it is not used in a larger clock subsystems, the details of which are still being discussed (see #60400 for details). See #19030 (comment) for its embedding in a larger clock subsystem architecture relevant to the network stack, IEEE 802.15.4 and the POSIX roadmap. Signed-off-by: Florian Grandel <[email protected]>
Introduces a well-defined intermediate concept of syntonized scalar nanosecond resolution time with overflow protection above low-level counters/cycles/ticks and below higher level time abstractions (timescales, calenders, etc.). The rationale of this type has been extensively documented and contrasted to already existing time representations to ensure that it fills a well defined gap without overlap. This change prepares for later changes in this change set that will unify the usage of time across the network subsystem (RX/TX timestamps, timed TX, CSL, scheduled reception windows, (g)PTP integration, etc.). The type is EXPERIMENTAL and named net_time_t while it is not used in a larger clock subsystems, the details of which are still being discussed (see #60400 for details). See zephyrproject-rtos/zephyr#19030 (comment) for its embedding in a larger clock subsystem architecture relevant to the network stack, IEEE 802.15.4 and the POSIX roadmap. (cherry picked from commit bd34c94) Original-Signed-off-by: Florian Grandel <[email protected]> GitOrigin-RevId: bd34c94 Change-Id: I02bbf2ef44c1bf44a0a473daef406a115d068bd0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4729808 Commit-Queue: Yuval Peress <[email protected]> Tested-by: ChromeOS Prod (Robot) <[email protected]> Tested-by: Yuval Peress <[email protected]> Reviewed-by: Yuval Peress <[email protected]>
Introduces a well-defined intermediate concept of syntonized scalar nanosecond resolution time with overflow protection above low-level counters/cycles/ticks and below higher level time abstractions (timescales, calenders, etc.). The rationale of this type has been extensively documented and contrasted to already existing time representations to ensure that it fills a well defined gap without overlap. This change prepares for later changes in this change set that will unify the usage of time across the network subsystem (RX/TX timestamps, timed TX, CSL, scheduled reception windows, (g)PTP integration, etc.). The type is EXPERIMENTAL and named net_time_t while it is not used in a larger clock subsystems, the details of which are still being discussed (see zephyrproject-rtos#60400 for details). See zephyrproject-rtos#19030 (comment) for its embedding in a larger clock subsystem architecture relevant to the network stack, IEEE 802.15.4 and the POSIX roadmap. Signed-off-by: Florian Grandel <[email protected]>
Introduces a well-defined intermediate concept of syntonized scalar nanosecond resolution time with overflow protection above low-level counters/cycles/ticks and below higher level time abstractions (timescales, calenders, etc.). The rationale of this type has been extensively documented and contrasted to already existing time representations to ensure that it fills a well defined gap without overlap. This change prepares for later changes in this change set that will unify the usage of time across the network subsystem (RX/TX timestamps, timed TX, CSL, scheduled reception windows, (g)PTP integration, etc.). The type is EXPERIMENTAL and named net_time_t while it is not used in a larger clock subsystems, the details of which are still being discussed (see #60400 for details). See zephyrproject-rtos/zephyr#19030 (comment) for its embedding in a larger clock subsystem architecture relevant to the network stack, IEEE 802.15.4 and the POSIX roadmap. Signed-off-by: Florian Grandel <[email protected]>
* drivers: serial: Add optional reset line for uart_ns16550 If the optional hardware reset line is available, this change will use that reset line to assert the uart module and bring it out of reset state to use. Signed-off-by: Girisha Dengi <[email protected]> * drivers: pm_cpu_ops: Add support for multiple PSCI versions Each PSCI interface versions have different DT compatible strings like arm,psci-0.2, arm,psci-1.1 and so on. However, the same driver can be used for all the versions by adding #define DT_COMPAT for required version and #undef DT_COMPAT for default version. Add support for PSCI cold reset, warm reset and cpu-on function IDs. Signed-off-by: Girisha Dengi <[email protected]> Signed-off-by: Navinkumar Balabakthan <[email protected]> * samples: subsys: shell: Custom configs for intel_socfpga_agilex* boards The intent of this change is to add custom shell configurations for intel_socfpga_agilex* based boards. As of now, configurations are added for 'intel_socfpga_agilex5_socdk' board. Signed-off-by: Girisha Dengi <[email protected]> * CODEOWNERS: Add code owners for Intel Agilex5 platform drivers Code owners for all the required Intel Agilex5 platform drivers. Signed-off-by: Girisha Dengi <[email protected]> * MAINTAINERS: Add self as maintainer for Intel Agilex platform Add maintainer and collaborators for Intel Agilex platforms and related drivers. Signed-off-by: Girisha Dengi <[email protected]> * MAINTAINERS: fix path for xtensa/riscv esp32 soc The correct paths are soc/xtensa/espressif_esp32 and soc/riscv/espressif_esp32, not soc/xtensa/esp32 and soc/riscv/esp32. Signed-off-by: Bartosz Bilas <[email protected]> * scripts: compliance: always run the MaintainersFormat check The check currently only runs if the maintainers file itself is changed, but that means that the check is going to miss every PR that moves directory or delete files that can potentially trigger an error. This check is cheap to run, just run it unconditionally. Signed-off-by: Fabio Baltieri <[email protected]> * MAINTAINERS: fix a bunch of directory paths Fix various incorrect maintainer file entry for directories. These are currently matching files, but would break few scripts if we were to upgrade the CI image to Python 3.11 due to a change in behavior of Path.glob(). Fixes various: MAINTAINERS.yml: glob pattern '...' in 'files' in area '...' does not match any files on machines running Python 3.11 or newer. Link: https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob Signed-off-by: Fabio Baltieri <[email protected]> * arch/common: add 64bit register access functions for 64bit arch Some 64bit arch SoC happens to have 64bit registers. Signed-off-by: Yong Cong Sin <[email protected]> * drivers: crypto: Add NXP MCUX DCP driver Add a shim driver for NXP's Data Co-Processor (DCP) driver. Signed-off-by: Pieter De Gendt <[email protected]> * dts: arm: nxp: Enable DCP for i.MX RT10XX SoC Add device tree entry for DCP driver support on i.MX RT10XX platforms. Signed-off-by: Pieter De Gendt <[email protected]> * samples: drivers: crypto: Simplify configuration Use a default prj.conf to be used for all samples and use EXTRA_CONF_FILE for specifics. Signed-off-by: Pieter De Gendt <[email protected]> * samples: drivers: crypto: Aligned AES key Some drivers require the encryption key to be 4-byte aligned. Signed-off-by: Pieter De Gendt <[email protected]> * samples: drivers: crypto: Add testcase for NXP MCUX DCP Add a testcase for mimxrt1064_evk to be able to run the crypto sample. Signed-off-by: Pieter De Gendt <[email protected]> * drivers: counter: Add Infineon CAT1 counter driver Add initial version of Infineon CAT1 counter driver Add initial version of binding file for Infineon Add counters to psco6 dtsi Add external trigger pin that runs counter Signed-off-by: Pavlo Havrylyuk <[email protected]> * lib: json: add helper macro for named array of array Variant of JSON_OBJ_DESCR_ARRAY_ARRAY that can be used when the structure and JSON field names differ. Signed-off-by: Bartosz Bilas <[email protected]> * drivers: i2c: i2c_nrfx_twim: remove redundant buffer size from config There are two different i2c node properites `zephyr,flash-buf-max-size` and `zephyr,concat-buf-size`. In the end max value of that two is used to define size of the message buffer. It's redundant to store both values in device config structure. Changed config structure to contain only bigger value. Signed-off-by: Adam Wojasinski <[email protected]> * drivers: i2c: i2c_nrfx_twim: Utilize memory-region prop from devicetree This commit aligns TWIM shim to utilize memory-region property. The memory-region is not required property that enables user to specify placement of dma buffers in memory region. It is done by assigning to memory-region property, phandle to node with zephyr,memory-region and mimo-sram compatible. When memory-region property is not specified for given instance, buffer is placed in default RAM region with other data. Signed-off-by: Adam Wojasinski <[email protected]> * soc: riscv: Add ability to use custom sys_io functions Add Kconfig RISCV_SOC_HAS_CUSTOM_SYS_IO symbol so that a riscv SoC can set to specify that it has a custom implementation for sys_io functions. Signed-off-by: Yong Cong Sin <[email protected]> * drivers: memc: add NXP S32 QSPI controller The NXP S32 QSPI controller acts as an interface to up to two serial flash memory devices, each with up to eight bidirectional data lines, depending on the platform. It is based on a LUT enginee to interface through commands with different memory types including flash NOR and Hyperram. This patch adds support for the QSPI in S32K344 which supports a single memory device (side A) with up to four bidirectional data lines and SDR only. Nevertheless, the memory controller is implemented flexible enough to be extended to support more feature-rich QSPI blocks. Signed-off-by: Manuel Argüelles <[email protected]> * drivers: flash: add NXP S32 QSPI flash NOR driver Add support for flash NOR memory devices on a NXP S32 QSPI bus. The driver uses a fixed LUT configuration assuming a default standard page size and erase types, and allows to select between multiple read/program instructions/modes. It is also possible to read the flash device characteristics from the device at run-time as long as the memory is JESD216 compatible, providing more flexibility. Signed-off-by: Manuel Argüelles <[email protected]> * boards: mr_canhubk3: enable flash controller for QSPI This board has a MX25L6433F memory connected to the only QSPI port available in S32K344. Signed-off-by: Manuel Argüelles <[email protected]> * samples: enable flash samples for mr_canhubk3 board Various samples enabled to use the on-board QSPI memory. Signed-off-by: Manuel Argüelles <[email protected]> * tests: enable flash tests for mr_canhubk3 board Various tests enabled to use the on-board QSPI memory. Signed-off-by: Manuel Argüelles <[email protected]> * drivers: spi_nrfx_spis: Fix obtaining dev pointer in event handler This is a follow-up to commit 4c20403629df1ae6a58d37a7a5bd73d4698cc11a. CONTAINER_OF() cannot be used to obtain the device pointer from its data pointer as this data is not contained in the device structure. Instead, use a dedicated member in the device data structure to store the device pointer. Signed-off-by: Andrzej Głąbek <[email protected]> * gpio: stellaris: implement `gpio_pin_get_config` Implement `gpio_pin_get_config` for the stellaris platform, and by extension `qemu_cortex_m3`. Signed-off-by: Jordan Yates <[email protected]> * pm: device: add driver init helper Adds a helper function for initializing devices into the expected power state, through the devices `pm_device_action_cb_t`. This eliminates code duplication between the init functions and the PM callback. The expected device states in order of priority are: * No power applied to device, `OFF` * `zephyr,pm-device-runtime-auto` enabled, `SUSPEND` * Otherwise, `ACTIVE` Signed-off-by: Jordan Yates <[email protected]> * power_domain: gpio: compile without `PM_DEVICE_POWER_DOMAIN` Let the driver compile without `PM_DEVICE_POWER_DOMAIN`, in which case the driver only controls the GPIO, without notifying dependant devices. Signed-off-by: Jordan Yates <[email protected]> * power_domain: gpio: init with `pm_device_driver_init` Startup power domains according to the expected final state given the power supply and PM device runtime support. Signed-off-by: Jordan Yates <[email protected]> * tests: pm: update power domain behaviour Update the expected power domain behaviour in the tests in line with the driver implementation changes. Signed-off-by: Jordan Yates <[email protected]> * tests: pm: test `pm_device_driver_init` Test that `pm_device_driver_init` puts devices into the appropriate state depending on the devicetree configuration. Signed-off-by: Jordan Yates <[email protected]> * drivers: usb: fix common misspellings in USB drivers Fix common misspellings in USB drivers. Signed-off-by: Johann Fischer <[email protected]> * usb: fix common misspellings in USB support Fix common misspellings in USB device next and host. Signed-off-by: Johann Fischer <[email protected]> * drivers: mbox: Add Andestech mailbox driver Support the Andes mailbox driver via software plic. Signed-off-by: Kevin Wang <[email protected]> * samples: drivers: mbox: Support the new board adp_xc7k_ae350 Modify the related source in mbox sample to support board adp_xc7k_ae350. Signed-off-by: Kevin Wang <[email protected]> * drivers: sensor: a01nyub: added driver Added a driver for the DFRobot A01NYUB distance sensor. This sensor sends its readings via UART at 9600 baud. This driver uses interrupts to read the data from the sensor. Signed-off-by: Oliver King <[email protected]> * shared_multi_heap: Use proper enum instead of int We have an enum for the memory attr, use that instead of a generic unsigned int. Signed-off-by: Carlo Caione <[email protected]> * shared_multi_heap: Rename heap counter We are calling the heap counter `attr_cnt` and that is misleading. Rename it. Signed-off-by: Carlo Caione <[email protected]> * shared_multi_heap: Use a data struct Embed all the helper structs in one single data struct for easy access indexed on the memory attr. Signed-off-by: Carlo Caione <[email protected]> * west.yaml: MCUboot synchronization from upstream Update Zephyr fork of MCUboot to revision: 76d19b3b8885ea7ae25a6f4f5d8501f7ec646447 Brings following Zephyr relevant fixes: - 76d19b3 boot: bootutil: Fix missing packed attributes, add hash size define - 018b770 imgtool: Fix getpriv error return with private key - 9fad4c1 boot: boot_serial: Fix wrong cbor type for confirm Signed-off-by: Jamie McCrae <[email protected]> * mgmt: mcumgr: Use MCUboot bootutil file instead of outdated copy Uses the MCUboot bootutil image.h file directly instead of an outdated copy which resides in the zephyr tree. Signed-off-by: Jamie McCrae <[email protected]> * doc: dts: bindings: pinctrl: minor readability improvement Improves readability of input/output-enable/disable flags. Signed-off-by: Florian Grandel <[email protected]> * drivers: cc13xx_cc26xx: pinctrl: fix header conflict CC13/26xx's pinctrl_cc13xx_cc26xx.c driver included ioc.h and (indirectly) pinctrl_soc.h which contained duplicate defines. This change removes the header conflict and redundant definitions. This prepares for subsequent changes in this change set that add additional flags to the pinctrl driver which would otherwise trigger the header conflict. Signed-off-by: Florian Grandel <[email protected]> * drivers: cc13xx_cc26xx: pinctrl: support drive strength Introduces support for drive-strength configuration to the CC13/26xx pinctrl driver. Signed-off-by: Florian Grandel <[email protected]> * drivers: cc13xx_cc26xx: pinctrl: support edge detection Introduces support for SoC-specific input-edge-detect configuration to the CC13/26xx pinctrl driver. Signed-off-by: Florian Grandel <[email protected]> * drivers: pinctrl: Add pinctrl driver for Gecko Series 1 This adds a new pinctrl driver for EFM32. Co-authored-by: Todd Dust <[email protected]> Signed-off-by: Wojciech Sipak <[email protected]> * bluetooth: tester: gap: Add support for extended advertising Needed for LE Audio tests. Signed-off-by: Magdalena Kasenberg <[email protected]> * soc: xtensa: nxp: add resource_table section in linker script Add resource_table section in linker script for nxp_adsp_imx8m for inter-process communication. Signed-off-by: Iuliana Prodan <[email protected]> * dts: xtensa: nxp: add nodes for IPC Add mailbox and interrupt-controller nodes used for inter-process communication. Add also the dt binding for the interrupt-controller. For now, this is used just to fix some compile errors, since the mailbox requires an interrupt-controller. For DSP, we have a direct interrupt line to the core. Signed-off-by: Iuliana Prodan <[email protected]> * samples: add support for nxp_adsp_imx8m in openamp_rsc_table Add the dts and config overlay for nxp_adsp_imx8m board in order to have the openamp_rsc_table sample working on HiFi4 DSP from i.MX 8M Plus. Signed-off-by: Iuliana Prodan <[email protected]> * samples: openamp_rsc_table: increase stack size While testing openamp_rsc_table sample for HiFi4 DSP from i.MX8MP, realized the stack is not enough. Increase the size based on Thread Analyzer measurements: *** Booting Zephyr OS build zephyr-v3.4.0-971-g9415baf2c211 *** Starting application threads! OpenAMP[remote] linux responder demo started OpenAMP[remote] Linux sample client responder started OpenAMP[remote] Linux tty responder started [00:00:00.020,000] <dbg> openamp_rsc_table: mailbox_notify: mailbox_notify: msg received [00:00:00.024,000] <dbg> openamp_rsc_table: mailbox_notify: mailbox_notify: msg received Thread analyze: 0x9240c5a0 : STACK: unused 240 usage 1296 / 1536 (84 %); CPU: 10% : Total CPU cycles used: 3388523 0x9240c628 : STACK: unused 240 usage 784 / 1024 (76 %); CPU: 10% : Total CPU cycles used: 4086621 0x9240c6b0 : STACK: unused 408 usage 616 / 1024 (60 %); CPU: 7% : Total CPU cycles used: 3553673 0x9240c738 : STACK: unused 152 usage 872 / 1024 (85 %); CPU: 44% : Total CPU cycles used: 25529572 0x9240c7c0 : STACK: unused 352 usage 672 / 1024 (65 %); CPU: 21% : Total CPU cycles used: 13742359 0x9240c888 : STACK: unused 936 usage 88 / 1024 (8 %); CPU: 0% : Total CPU cycles used: 0 ISR0 : STACK: unused 1536 usage 512 / 2048 (25 %) Signed-off-by: Iuliana Prodan <[email protected]> * west: update open-amp repo Update open-amp repository with new sha. Signed-off-by: Iuliana Prodan <[email protected]> * usb: device: clarify the impact of Kconfig option USB_COMPOSITE_DEVICE Effectively, this option changes code triple in device descriptor. Although the name is misleading, renaming it would again lead to negative user experiences. Instead, clarify what the option does and always select it where it is required. Signed-off-by: Johann Fischer <[email protected]> * sample/tests: remove CONFIG_USB_COMPOSITE_DEVICE usage This is no longer necessary, as this option is selected as a dependency for class implementations where it is required. Also remove redundant test cases. Signed-off-by: Johann Fischer <[email protected]> * include: usb: revise BOS support header Hide parts that are not relevant to the application and are only used internally by the stack. Add minimal documentation. Signed-off-by: Johann Fischer <[email protected]> * doc: usb: add reference to BOS support API Add a reference to the BOS support API. Signed-off-by: Johann Fischer <[email protected]> * soc: xtensa: esp32s3: add support for SPIRAM Add support for external PSRAM for esp32s3. Signed-off-by: Lucas Tamborrino <[email protected]> * tests: boards: espressif: add esp32s3 to cache coex test Test esp32s3 for cache coexistence. Update test documentation. Signed-off-by: Lucas Tamborrino <[email protected]> * soc: xtensa: esp32s3: Add external ram noinit section Add section to allocate memory of WiFi and NET stack in SPIRAM Signed-off-by: Lucas Tamborrino <[email protected]> * samples: basic: hash_map: fix libc heap size setting The malloc arena/heap size setting can be adjusted using different Kconfig options, depending on the libc implementation. This means prj.conf can't be used to set this value on projects that can be built for multiple libcs without generating a Kconfig warning. Signed-off-by: Gerard Marull-Paretas <[email protected]> * lib: hash: use new c++ Kconfig symbols SYS_HASH_MAP_CXX was using deprecated C++ symbols. Signed-off-by: Gerard Marull-Paretas <[email protected]> * drivers: pinctrl: add driver for EOS S3 This adds a new pinctrl driver for Quicklogic EOS S3 SoC Signed-off-by: Wojciech Sipak <[email protected]> * boards: quick_feather: use pinctrl driver Pinmuxing was previously done in the board.c file. Now it is done by the pinctrl driver. Signed-off-by: Wojciech Sipak <[email protected]> * boards: qomu: use pinctrl driver Pinmuxing was previously done in the board.c file. Now it is done by the pinctrl driver. Signed-off-by: Wojciech Sipak <[email protected]> * soc: quicklogic_eos_s3: remove unneeded code Pinmuxing is now done by a pinctrl driver, not by board.c, so the code used previously for pinmuxing can be removed. Fixes #59186. Signed-off-by: Wojciech Sipak <[email protected]> * boards: arm: xmc45_relax_kit: Update supported drivers Updates list of supported drivers on the xmc45_relax_kit. Signed-off-by: Andriy Gelman <[email protected]> * drivers: pwm: Add driver for xmc4xxx using ccu4 module Adds driver for pwm on xmc4xxx using Capture Compare Unit 4 (CCU4) module. There are four CCU4 with each one having four channels Thus it's possible to have up to 16 pwm output signals. The output of each channel can only be connected to a specific port/pin. The possible connection and gpio configurations are defined using pinctrl. The CCU4 module also has a capture mode. Capture support will be added in the future. Signed-off-by: Andriy Gelman <[email protected]> * drivers: pwm: Add driver for xmc4xxx using ccu8 module Adds driver for pwm on xmc4xxx using Capture Compare Unit 8 (CCU8) module. There are two CCU8 nodes with each one having four slices. Each slice has two output channels. Unlike CCU4, this module can generate complementary high-side/low-side signals for each output channel. A variable dead time can be added during the off to on transitions to make sure that the high-side/low-side signals are not on at the same time. Signed-off-by: Andriy Gelman <[email protected]> * drivers: sensor: add mutex to cmd_get_sensor() Add a mutex to protect shared data-structures, since shell can have multiple backends. Signed-off-by: Marco Argiolas <[email protected]> * pm: device_runtime: allow calling pm_device_runtime_get from ISRs pm_device_runtime_get() uses a semaphore to protect resources. pm_device_runtime_get() blocked forever until obtaining the lock, making it unusable from contexts where blocking is not allowed, e.g. ISRs. With this patch, we give the chance to use the function from an ISR by not waiting on the lock and returning -EWOULDBLOCK instead. If device is suspending (from a previous put_async() operation) the same value is returned as we can't wait either. Signed-off-by: Gerard Marull-Paretas <[email protected]> * dts: arm: st: move cpu-power-states to SoC dts files The `cpu-power-states` property needs to be defined at SoC dts files, since it's a property of the SoC, not board. Signed-off-by: Gerard Marull-Paretas <[email protected]> * dts: arm: nxp: ke1xf: move cpu-power-states to SoC dts files CPU power states are not board dependent, but a property of the SoC. Signed-off-by: Gerard Marull-Paretas <[email protected]> * pm: state: allow disabling certain power states In some platforms it may be desirable to disable certain CPU power states, for example, because they have extra requirements not available on all boards/applications. Because `cpu-power-states` are defined at SoC dts file levels, the only way to achieve that now was by re-defining `cpu-power-states` property in e.g. a board file. With this patch, one can now selectively set `status = "disabled";` to any power state and it will be skipped by the PM subsystem. Signed-off-by: Gerard Marull-Paretas <[email protected]> * dts: arm: silabs: move cpu-power-states to SoC dts files CPU power states is a property of the SoC, not dts. Signed-off-by: Gerard Marull-Paretas <[email protected]> * dts: arm: silabs: remove redundant pstate_em4 state This state is never used in practice, even if handled by the PM subsystem hooks. Shutdown-like states are always invoked manually, so they don't need to be described in DT. Signed-off-by: Gerard Marull-Paretas <[email protected]> * boards: arm: stm32f412g_disco: Fix LED4 pin On the stm32f412g_disco board, the LED LD4 (blue LED) is actually on the pin 3 of GPIOE and not on the pin 4 (see https://www.st.com/resource/en/user_manual/um2032-discovery-kit-with-stm32f412zg-mcu-stmicroelectronics.pdf, page 31) Signed-off-by: Jacques Supcik <[email protected]> * emul: sbs_gauge: Return err or unsupported feature The fuel gauge emulators will attempt to access a 0 pointer when running a backend emulator function that hasn't been implemented. Add an explicit runtime check to return -ENOTSUP to signify the emulator feature is not supported. We do not ASSERT here so we can write tests that are generic and can run with various emulators that support a variety of features. Signed-off-by: Aaron Massey <[email protected]> * driver: wifi: esp32: increase default stack values When testing Wi-Fi with MQTT/HTTP/Socket features, network stacks can be full very fast, causing network issues and eventual crash. By analyzing used stacks,increasing the stack size described in this PR fixes most use cases related above. Signed-off-by: Sylvio Alves <[email protected]> * tests: sbs_gauge: Factor fixture out of test In the near future we'll be adding SBS tests that are linked in based on configs. Extract the test fixture as a header that can be shared by multiple tests. Signed-off-by: Aaron Massey <[email protected]> * shell: fix possible negative indexing Fixes #60808 Signed-off-by: Jakub Rzeszutko <[email protected]> * Bluetooth: Controller: Stop following aux ptr if DATA_LEN_MAX is hit If the aux scanner already has CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX advertising data, there is no point in following an aux ptr - instead flush the data and produce an incomplete report Signed-off-by: Troels Nilsson <[email protected]> * Bluetooth: Controller: Fix truncation of adv. data Truncation of advertising data has to be done at a PDU boundary; Including only part of a PDUs advertising data is not allowed Signed-off-by: Troels Nilsson <[email protected]> * Bluetooth: Controller: Kconfig: Move BT_LL_SW_SPLIT specific configs These configs are very tied to the BT_LL_SW_SPLIT implementation, so it makes sense that these are only visible when that link layer is used. For the ones that may be used by other controllers in the future, a dependency has been added. Signed-off-by: Rubin Gerritsen <[email protected]> * soc: nordic_nrf: Add nRF52840 QFAA variant This variant has fewer pins. Signed-off-by: Carles Cufi <[email protected]> * soc: nordic_nrf: Add nRF52833 QDAA variant This variant has fewer pins. Signed-off-by: Carles Cufi <[email protected]> * mgmt: mcumgr: grp: img_mgmt: Fix renamed define Fixes an issue whereby a define was renamed in one place but not another. Signed-off-by: Jamie McCrae <[email protected]> * tests: mgmt: mcumgr: all_options: Add additional checks Adds additional checks to enable more options for the build-only check that compilation is successful. Signed-off-by: Jamie McCrae <[email protected]> * manifest: Update nRF HW models to latest The nRF HW models have been updated to include the following fixes and improvements. * RADIO: Improve T_IFS support, and fix for low latency mode * docs: Miscelaneous improvements Signed-off-by: Alberto Escolar Piedras <[email protected]> * manifest: hal_nordic: Pull PWM driver fix for nrfx_pwm_stopped_check() When `nrfx_pwm_stopped_check()` was called multiple times it was returning incorrect value after second and next calls. Signed-off-by: Adam Wojasinski <[email protected]> * soc: nordic_nrf: nrf52840-qfaa has no USB The QFN48 version has no USB peripheral, remove it from the Devicetree. Signed-off-by: Carles Cufi <[email protected]> * soc: nordic: Make all compatibles lower case Devicetree specification v0.4, Section 2.3.1: "The compatible string should consist only of lowercase letters, digits and dashes, and should start with a letter." Signed-off-by: Carles Cufi <[email protected]> * pinctrl: gecko: fix compilation and UART handling LEUART_Typedef isn't defined for every possible target. It should be included in the conditional compilation part. For proper handling of UART location, the driver needs to remember pin configuration of both TX and RX. This was broken in #60695 is brought back here. Signed-off-by: Wojciech Sipak <[email protected]> * drivers: eth_smsc91x: Fix the missing of selecting bank 3 Fix the missing of selecting bank 3 at the beginning of the function `smsc_miibus_writereg`. Signed-off-by: Huifeng Zhang <[email protected]> * mgmt: smp: SMP Client enabler SMP client support for generate request and handling response message. Updated SMP transport for send request. Added API for register SMP transport. Signed-off-by: Juha Heiskanen <[email protected]> * mgmt: smp: MCUmgr Client support MCUmgr client basic implementation for support Image and OS grpup commands. Image Group: * Image state read/write * Image Upload secondary slot * Image Erase secondary slot OS group: * Reset * Echo service, disabled by default Opeartion's are blocked call and cant't call inside worker queue. IMG and OS need to be SMP client object for transport. Signed-off-by: Juha Heiskanen <[email protected]> * tests: mcumgr: MCUmgr and smp client unit test Added unit test for testing IMG and OS group component's. Added Unit test for SMP Client. Signed-off-by: Juha Heiskanen <[email protected]> * sensor: bme280: return ENOTSUP on invalid channel ENOTSUP should be returned for unsupported channels. Signed-off-by: Josep Puigdemont <[email protected]> * sensor: bme280: BMP280 has no humidity sensor Return ENOTSUP when getting the humidity channel if the driver is used with a BMP280, since this device does not provide humidity readings. Signed-off-by: Josep Puigdemont <[email protected]> * Kconfig: Provide name to orphan configuration choice symbol Kconfig choice section for LINKER_ORPHAN configuration has no name. This prevents configuring a default value in .defconfig files and constrain to set in _defconfig /.prj files. Then it is not possible to generalize this setting to a whole set of boards (soc series for instance) or make it dependent on another symbol. Provide it a name to add this flexibility. Signed-off-by: Erwan Gouriou <[email protected]> * posix arch: Fix very rare segfault on program termination In some very rare cases (< 1/1000 runs), in very loaded machines, a race in the glibc pthread_cancel() seems to be triggered. In this the cancelled thread cleanup overtakes the pthread_cancel() code, and frees the pthread structure before pthread_cancel() has finished, resulting in a dereference into already free'd memory, and therefore a segfault. Calling pthread_cancel() during cleanup is not required beyond preventing a valgrind memory leak report (all threads will be stopped immediately on exit). Therefore we stop doing this, to avoid this very rare crashes. This issue was reproduced in Ubuntu 22.04, with its default gcc 11.3.0 and glibc 2.35. The issue may also have been seen very rarely in Zephyr's CI. Signed-off-by: Alberto Escolar Piedras <[email protected]> * drivers: can: add kconfig CAN_MAX_MB Each CAN instance of S32K344 has different maximum number of message buffers, depends on payload. Add kconfig that defines maximum number of message buffers for concurrent active instances and update driver to compatible support S32k344. Signed-off-by: Cong Nguyen Huu <[email protected]> * boards: arm: mr_canhubk3: enable support for FlexCAN Reuse existing MCUX-based shim driver for FlexCAN. Enable flexcan0 for Zephyr canbus to run tests. Signed-off-by: Cong Nguyen Huu <[email protected]> * samples: net: zperf: add Ethernet twister test add one Ethernet twister test for nucleo_h563zi, nucleo_h743zi, nucleo_f429zi, nucleo_f746zg. remove the common: harnesses: net that are not supported leave harnesses: net for all other test execpt the one we use Signed-off-by: Marc Desvaux <[email protected]> * drivers: i2c_mcux: update to compatible with S32K344 Update to shim driver compatible with the hardware block in S32K344. Configure the pins before initializing I2C to avoid happening bus busy. Signed-off-by: Cong Nguyen Huu <[email protected]> * tests: drivers: enable tests eeprom and i2c for mr_canhubk3 Enable tests: tests/drivers/eeprom/api, tests/drivers/i2c/i2c_target_api. Signed-off-by: Cong Nguyen Huu <[email protected]> * board: add cy8ckit 062 pioneer Tested with hello_world and blinky projects Signed-off-by: David Ullmann <[email protected]> * west debugserver: openocd: configure rtos This enables thread awareness in the spawned OpenOCD server. Signed-off-by: Bruno Mendes <[email protected]> * lib: cpp: name the choice group for selecting C++ standard Add a name to the choice group for selecting the C++ standard to be able to override the default standard in Kconfig.* files. Signed-off-by: Damian Krolik <[email protected]> * usb: device: move the content of usb_msc.h to implementation file The usb_msc.h header does not provide any API. The content is only used by the MSC implementation for the current USB device stack and is not required for any use of MSC by the application. The content has no proper namespace and must not be reused for anything else in (new) USB support. Signed-off-by: Johann Fischer <[email protected]> * native_simulator: Align with upstream latest Upstream SHA: c8d3e4134ee24f8c3bbc598dfc80520c5a0c46d5 Signed-off-by: Alberto Escolar Piedras <[email protected]> * tests: thrift: check for channel closure before throwing Previously, the binary protocol variant of ThriftTest would fail consistently in CI for `qemu_x86_64` with the message below. ``` E: failed to poll fds -1, -1: 1 ``` Note: 1 corresponds to EPERM The root cause of this is that we do not yet have support for standard synchronization primitives in C++, and there is slightly racey behaviour in thrift until we do have support for standard synchronization primitives. With the addition of dynamic thread stacks, conforming pthreads, and some additional work in the toolchain area (re gthr-posix.h), we should soon be able to enable proper synchronization primitives. This change is a temporary workaround but solves the test failure (which would occur even when tests all passed). Signed-off-by: Christopher Friedt <[email protected]> * boards: arm: stm32f746g_disco: Use specified USB serial The 'west flash' command allows specifying the port where the target is attached via the '--serial' option, allowing users to set the USB serial port for flashing. However, the 'stm32f746g_disco' script file currently ignores the _ZEPHYR_BOARD_SERIAL variable set by this option, preventing effective port specification. This commit fixes it by correctly setting the openocd adapter serial when _ZEPHYR_BOARD_SERIAL variable is set, enabling proper USB serial port specification during flashing. Signed-off-by: Gustavo Romero <[email protected]> * dts: bindings: rename st-morpho-header pin identifiers So far pin identifiers were named after CN7 and CN10 connector names on Nucleo-64 boards. In case of Nucleo-144 there are ST Morpho connectors on both sides, but bigger (up to 72 instead of 38 pins on each side). First 38 pins out of 72 on each side usually map to the same pins (e.g. PA5 being 13th pin on right ST Morpho connector). This means that single ST Morpho connector definition will suffice. Leaving CN7 and CN10 (name of pin headers on Nucleo-64 boards) is confusing in context of Nucleo-144 boards, since corresponding pin headers are named CN11 and CN12. Rename: * s/ST_MORPHO_CN7_/ST_MORPHO_L_/ * s/ST_MORPHO_CN10_/ST_MORPHO_R_/ so that pin identifiers make more sense in context of Nucleo-144 boards. Signed-off-by: Marcin Niestroj <[email protected]> * dts: bindings: extend st-morpho-header to support Nucleo-144 Nucleo-144 boards have up to 72 pins (there are boards with only 70) on each ST Morpho header. Extend pin identifiers to support that number. Signed-off-by: Marcin Niestroj <[email protected]> * boards: nucleo_h563zi: add ST Morpho connector nexus node Add a new GPIO nexus node for the ST Morpho connector in the board. Signed-off-by: Marcin Niestroj <[email protected]> * drivers: flash: stm32l5: use write-block-size when validating STM32L5 have a write block size of 8, but STM32U5 and STM32H5 have a write block size of 16. Use write-block-size from the device tree instead of hardcoding this value when validating the range of write operations. Fixes #60724 Signed-off-by: Florian Vaussard <[email protected]> * drivers: flash: stm32l5: use write-block-size when writing STM32L5 have a write block size of 8, but STM32U5 and STM32H5 have a write block size of 16. Convert write_dword() and flash_stm32_write_range() to write write-block-size data at a time. Fixes #60724 Signed-off-by: Florian Vaussard <[email protected]> * drivers: flash: stm32: add a weak flash_stm32_valid_range() Most implementations have the same logic, with only a different write block size. Now that we are using write-block-size from the device tree, it is possible to use a default implementation that can be overridden if necessary. Signed-off-by: Florian Vaussard <[email protected]> * drivers: mipi_dsi: dsi_mcux: add support for MIPI generic long write CMD Add support for MIPI generic long write commands to DSI MCUX driver. Signed-off-by: Daniel DeGrasse <[email protected]> * drivers: mipi_dsi: dsi_mcux_2l: add support for MIPI generic long write CMD Add support for MIPI generic long write commands to DSI MCUX 2L driver Signed-off-by: Daniel DeGrasse <[email protected]> * drivers: display: add driver for HX8394 TFT LCD controller Add driver for HX8394 TFT LCD controller. This controller is driven via MIPI DSI, and is configured for a 720x1280 display Signed-off-by: Daniel DeGrasse <[email protected]> * boards: shields: add rk055hdmipi4ma0 shield Add rk055hdmipi4ma0 shield, which uses an HX8394 TFT LCD controller and GT911 touch IC. This shield is enabled on the RT595 and RT1170 EVK, which have 40 pin FFC interfaces capable of connecting to the display. Signed-off-by: Daniel DeGrasse <[email protected]> * net: introduce scalar nanosecond time representation Introduces a well-defined intermediate concept of syntonized scalar nanosecond resolution time with overflow protection above low-level counters/cycles/ticks and below higher level time abstractions (timescales, calenders, etc.). The rationale of this type has been extensively documented and contrasted to already existing time representations to ensure that it fills a well defined gap without overlap. This change prepares for later changes in this change set that will unify the usage of time across the network subsystem (RX/TX timestamps, timed TX, CSL, scheduled reception windows, (g)PTP integration, etc.). The type is EXPERIMENTAL and named net_time_t while it is not used in a larger clock subsystems, the details of which are still being discussed (see #60400 for details). See https://github.com/zephyrproject-rtos/zephyr/issues/19030#issuecomment-1597226731 for its embedding in a larger clock subsystem architecture relevant to the network stack, IEEE 802.15.4 and the POSIX roadmap. Signed-off-by: Florian Grandel <[email protected]> * doc: net: ptp: PTP structs Improves documentation of PTP structs and explains basic underlying concepts to increase the probability that these structs will be used correctly and consistently. Also introduces references to the underlying specifications. Note: We currently (ab)use the PTP structs for timestamps in the IEEE 802.15.4 context for which they are undefined. It is also not ideal that the generic `struct net_pkt` depends directly on PTP. Future changes will therefore have to remove the reference to PTP structs in net_pkt and replace them by net_time_t. Clients will then have to convert these to PTP structures if required. Signed-off-by: Florian Grandel <[email protected]> * doc: drivers: ieee802154: radio API Improves the documentation of the IEEE 802.15.4 radio API. Signed-off-by: Florian Grandel <[email protected]> * drivers: ieee802154: nRF5: fix return type Adapts a return type to the API specification. The changed return type is not referenced anywhere so it can be changed without breaking backwards compatibility. Signed-off-by: Florian Grandel <[email protected]> * tests: subsys: openthread: simplify configure mocks Removes redundant fakes. Signed-off-by: Florian Grandel <[email protected]> * tests: subsys: openthread: support TXTIME Adds a test suite configuration that enables TXTIME. Signed-off-by: Florian Grandel <[email protected]> * tests: subsys: openthread: support CSL Introduces coverage for OpenThread CSL platform API as far as channel samples are concerned. Signed-off-by: Florian Grandel <[email protected]> * drivers: ieee802154: consistent high res timestamps The IEEE 802.15.4 API and networking subsystem were using several inconsistent timestamp resolutions and types. This change defines all timestamps with nanosecond resolution and reduces the number of available types to represent timestamps to two: * `struct net_ptp_time` for PTP timestamps * `net_time_t` for all other high resolution timestamps All timestamps (including PTP timestamps) are now referred to a "virtual" local network subsystem clock source based on the well-defined types above. It is the responsibility of network subsystem L2/driver implementations (notably Ethernet and IEEE 802.15.4 L2 stacks) to ensure consistency of all timestamps and radio timer values exposed by the driver API to such a network subsystem uptime reference clock independent of internal implementation details. The "virtual" network clock source may be implemented based on arbitrary hardware peripherals (e.g. a coarse low power RTC counter during sleep time plus a high resolution/high precision radio timer while receiving or sending). Such implementation details must be hidden from API clients, as if the driver used a single high resolution clock source instead. For IEEE 802.15.4, whenever timestamps refer to packet send or receive times, they are measured when the end of the IEEE 802.15.4 SFD (message timestamp point) is present at the local antenna (reference plane). Due to its limited range of ~290 years, net_time_t timestamps (and therefore net_pkt timestamps and times) must not be used to represent absolute points in time referred to an external epoch independent of system uptime (e.g. UTC, TAI, PTP, NTP, ...). Signed-off-by: Florian Grandel <[email protected]> * doc: release-notes: document net subsys time consolidation Documents the changes to the internal API in the release notes. Signed-off-by: Florian Grandel <[email protected]> * drivers: sdhc: enable pwr-gpios property within SPI SDHC driver Enable SPI SDHC driver to manage card power via pwr-gpios property. Control for this property was previously partially implemented. When this property is present, the SPI SDHC driver will use it to control power to the SD card. Power is toggled during SD init, so this power control can make SD init more reliable as the power toggle will insure the SD card state is reset. Signed-off-by: Daniel DeGrasse <[email protected]> * canbus: isotp: Fix ISO-TP padding config usage ISOTP_ENABLE_TX_PADDING makes the device transmit frames with TX padding. ISOTP_REQUIRE_RX_PADDING ensures other devices on the bus use TX padding, by rejecting non-padded RX frames Signed-off-by: Grant Ramsay <[email protected]> * canbus: isotp: Enable TX padding by default if RX padding is required It would be strange to enforce padding for other bus participants but not use it yourself. This default suggests the likely proper usage, although it is not a hard dependency Signed-off-by: Grant Ramsay <[email protected]> * tests: canbus: isotp: conformance: Update test to check padding correctly The tests now properly validate frames under all padding configurations. Part of test_sender_fc_errors was testing a receive FC error, this sub-test is moved to test_receiver_fc_errors Signed-off-by: Grant Ramsay <[email protected]> * tests: canbus: isotp: conformance: Add helper function to prepare FC frames This reduces duplication in the tests Signed-off-by: Grant Ramsay <[email protected]> * soc: arm: st_stm32: remove redundant PM_STATE_ACTIVE case pm_state_exit_post_ops() will never be called with PM_STATE_ACTIVE. Signed-off-by: Gerard Marull-Paretas <[email protected]> * samples: subsys: pm: latency: remove redundant PM_STATE_ACTIVE case pm_state_set() will never be called with PM_STATE_ACTIVE. Signed-off-by: Gerard Marull-Paretas <[email protected]> * tests: subsys: pm: pwer_mgmt_multicore: remove PM_STATE_ACTIVE pm_state_set() is never called with PM_STATE_ACTIVE. Signed-off-by: Gerard Marull-Paretas <[email protected]> * lib: os: hex: add explicit unsigned suffices add explicit unsigned suffices to various immediate numbers, matching them to size_t, complying with required [misra-c2012-10.4] rule which states; Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category. Found as a coding guideline violation (Rule 10.4) by static code scanning tool. Note: Tested on STM32L5 Nucleo-144 board (stm32l552xx). Signed-off-by: ferar alashkar <[email protected]> * lib: os: hex: correct explicit cast type change explicit type cast of essential character type, complying with required [misra-c2012-10.2] rule which states; Expressions of essentially character type shall not be used inappropriately in addition and subtraction operations. Found as a coding guideline violation (Rule 10.2) by static code scanning tool. Note: Tested on STM32L5 Nucleo-144 board (stm32l552xx). Signed-off-by: ferar alashkar <[email protected]> * lib: os: dec: add misra-c2012 compliance changes 1. change explicit type cast of essential character type, complying with required [misra-c2012-10.2] rule which states; Expressions of essentially character type shall not be used inappropriately in addition and subtraction operations, and 2. add explicit boolean type to 'if' statement controlling expression, consolidating it with 'buflen' type, thus improving code readability and maintainability , complying with required [misra-c2012-14.4] rule which states; ; The controlling expression of an if statement and the controlling expression of an iteration-statement shall have essentially boolean type, and 3. add enclosing parentheses enforcing and clarifying precedence of operators, improving code readability and maintainability, complying with *advisory* [misra-c2012-12.1] rule which states; The precedence of operators within expressions should be made explicit. Found as a coding guideline violation (Rules 10.2, 14.4), and coding guideline recommendation (Rule 12.1) by static code scanning tool. Note: Tested on STM32L5 Nucleo-144 board (stm32l552xx). Signed-off-by: ferar alashkar <[email protected]> * boards: mr_canhubk3: enable GPIO when CAN is enabled Currently, mr_canhubk3 is enabling GPIO by default. GPIO will be built even if it is not necessary. Update to enable it for supporting CAN transceiver when CAN is enabled. Signed-off-by: Cong Nguyen Huu <[email protected]> * doc: bin blobs: State that blobs will not be fetched in CI As a follow-up to a recent discussion in the PR below: https://github.com/zephyrproject-rtos/zephyr/pull/59991 document that binary blobs will not be fetched in CI. Signed-off-by: Carles Cufi <[email protected]> * twister: bugfix: Make BuildError exception cause test to report error When no/too many elf files are detected after a build a BuildError exception is raised. However, it was not being counted as an issue with a test. With the patch satuses of tests' with such exception are reported as errors. Whithout it, twister finished without reported errors and was getting green CI checks. Signed-off-by: Maciej Perkowski <[email protected]> * boards: up_squared: override CPU devicetree node to have 2 CPUs The device tree file for up_squared includes the base dts file for Apollo Lake which only defines 1 CPU. UP Squared have different SKUs with different CPUs, and overall has a minimal of 2 CPUs. So amend the up_squared device tree overlay to have 2 CPU nodes. Signed-off-by: Daniel Leung <[email protected]> * toolchain: xcc/xt-clang: include llvm.h for xt-clang... ...and removed the copied macros. This allows xt-clang to inherit macros from llvm.h to align with any LLVM related additions. Signed-off-by: Daniel Leung <[email protected]> * intel_adsp: Add option about switch off hpsram Add an option to control whether or not hpsram banks should be switched off during the power down. This is particular useful when running tests because we don't want to lose the contents of the memory window before we capture it. Signed-off-by: Flavio Ceolin <[email protected]> * twister: improve handling of ELF file parsing We have been dealing with missing and multiple binaries the same way and both would result in a build error, which is not accurate. multiple binaries in the build directory are fine, we just need to pick the right one for parsing. If we get no binaries, raise an exception and report failure, however, if we have multiple binaries, filter intermediate artifacts out and parse what remains. qemu binaries generated after a run are also being filtered here. Those are not build artificats and appear only after running in qemu. However they have been causing issues on retries. Signed-off-by: Anas Nashif <[email protected]> * drivers: adc: add NXP S32 ADC SAR driver Add support ADC SAR for NXP S32. ADC SAR diver support 3 group channels (precision, standard and external), run normal trigger in oneshot conversion mode with 2 callbacks normal end of conversion and normal end chain callbacks. An instance only run on 1 group channel and 1 kind of callback at the same time. Signed-off-by: Cong Nguyen Huu <[email protected]> * boards: mr_canhubk3: add support adc Add device tree of adc instances for s32k344 Signed-off-by: Cong Nguyen Huu <[email protected]> * tests: drivers: adc: adc_api: enbale test for mr_canhubk3 Enable adc0 with 2 channels 22, 23 on standard group with normal end of conversion callback. Channels correspond to VREFL(0V), VREFH(3.3V). Signed-off-by: Cong Nguyen Huu <[email protected]> * samples: drivers: adc: enbale test for mr_canhubk3 Enable all channels that available connector on board. ADC0 channel 6 on precision group with normal end chain callback. ADC1 channel 2 on precision group with normal end of conversion callback. ADC2 channels 3, 4, 5 on precision group with normal end of conversion callback. Signed-off-by: Cong Nguyen Huu <[email protected]> * drivers: stm32: SPI: Check that SPI buffers are in a nocache region DMA only works with non-cached memory regions in H7. Check them and return an error if they don't match this condition. Signed-off-by: Daniel Gaston Ochoa <[email protected]> * Bluetooth: Host: Remove 'Experimental' flag of EAD Nordic Semiconductor has been testing the feature extensively on its CI. The tests includes the sample data and the PTS tests. Signed-off-by: Théo Battrel <[email protected]> * sensor: akm09918c: Fix conversion constant The sensor driver uses the value 500 to convert bit counts to microgauss values, but it should actually be 1500. Edit the driver unit test to use the macro instead of a magic number. Signed-off-by: Tristan Honscheid <[email protected]> * emul: Introduce emulator backend API and generic sensor test This PR introduces a backend API to be implemented by sensor emulators that creates a standardized mechanism for setting expected sensor readings in tests. This unlocks the ability to create a generic sensor test that can automatically set expected values in supported sensor emulators and verify them through the existing sensor API. An implementation of this API is provided for the AKM09918C magnetometer. A generic sensor test is also created to exercise this implementation. Observe that this test knows nothing about the AKM09918C; info about supported channels and sample ranges is discovered through the backend API. The test iterates over all devices attached to the virtual I2C and SPI buses in the test binary's device tree, which (theoretically) covers all sensors. Sensors whose emulator does not exist yet or does not support the backend API are skipped. Signed-off-by: Tristan Honscheid <[email protected]> * boards: x86: Add boards and SoCs for Intel ISH Adds new boards and SoCs for the Intel Sensor Hub (ISH). Signed-off-by: Dong Wang <[email protected]> * manifest: west.yml: add Intel HAL as a new HAL module It provides a low level Hardware Abstraction Layer for Intel specific hardware, like Intel ISH Signed-off-by: Dong Wang <[email protected]> * ish: add module Kconfig for Intel HAL Add a new Kconfig option to enable the build of Intel HAL and select it always for ish SoCs Signed-off-by: Dong Wang <[email protected]> * drivers: serial: Add Intel SEDI driver Adds a new serial shim driver for Intel SoCs. Builds upon the SEDI bare metal UART driver in the hal-intel module. Signed-off-by: Nachiketa Kumar <[email protected]> Signed-off-by: Dong Wang <[email protected]> * rtio: Update documentation Revise the documentation around canceling pending SQEs. Signed-off-by: Yuval Peress <[email protected]> * boards: adafruit_feather_m0_basic_proto: add zephyr_udc0 nodelabel Add zephyr_udc0 nodelabel to allow building all USB device samples for adafruit_feather_m0_basic_proto board out of the box. Signed-off-by: Johann Fischer <[email protected]> * MAINTAINERS: move to my ampere account I'm using a new account now. Do the corresponding CODEOWNERS change just for consistency as well. Signed-off-by: Martí Bolívar <[email protected]> * thrift: add temporary Mutex implementation The Thrift library has its own abstraction for mutexes, which normally just a wrapper around `std::mutex` using the PIMPL idiom (pointer-to-impl). Since Zephyr does not yet support `std::mutex`, a workaround was added in Zephyr that was essentially no-op, and actually the PIMPL idiom made it quite easy to do that. However, pretending there is no synchronization requirement is not a solution for it. We can't yet just use a `struct k_mutex` yet, because we don't yet support userspace, but for now we can fake a mutex interface with a spinlock. We hope to eventually drop this workaround entirely and just support `std::mutex`. Signed-off-by: Christopher Friedt <[email protected]> * tests: thrift: replace unused variable with NULL in pthread_join There is no need to pass a second parameter to `pthread_join()` if it is unused. Just use `NULL` instead. Signed-off-by: Christopher Friedt <[email protected]> * tests: drivers: build_all: sensor: do not run build-only testsuite A recent modification to the `build_all/sensor` testsuite changed `build-only` to `false` in `testcase.yaml`, which is causing CI to go bonkers. https://bit.ly/3rSe0Te Do not run build-only testsuites. Signed-off-by: Christopher Friedt <[email protected]> * posix: pthread: report appropriate return value instead of 0 Discovered this while implementing c11 threads, but there was a regression recently that made it so that `pthread_join()` would report success when attempting to join a thread that had been detached with `pthread_detach()`. Technically now that is undefined behaviour, but historically, we have reported `EINVAL`, which was the older specified return value. Signed-off-by: Christopher Friedt <[email protected]> * tests: posix: common: pthread_join should fail on detached A thread that has been previously detached using `pthread_detach()` should not be able to be joined. A recent change made it so that `pthread_join()` would always report success (0), even when `ret` (return value) had an error. Signed-off-by: Christopher Friedt <[email protected]> * posix: pthread: thread return value not set by pthread_join() Ensure that the thread return value is set by `pthread_join()` when `status` is non-NULL. Additionally, we have an opportunity to synchronously clean up thread stacks in `pthread_join()`, which is preferable. Signed-off-by: Christopher Friedt <[email protected]> * tests: posix: common: check return value in pthread_join() Ensure that the thread return value is set by `pthread_join()` when `status` is non-NULL. Signed-off-by: Christopher Friedt <[email protected]> * boards: stm32: Fix vendor name when required Now that vendor name in board compatible is meant to be actually used, it should be properly filled. Update when not correct and don't put any name when vendor is not known Signed-off-by: Erwan Gouriou <[email protected]> * drivers: w1: doc: Doxygen doc for 1-Wire commands Added Doxygen comments for 1-Wire commands Signed-off-by: Benjamin Cabé <[email protected]> * tests: logging: fix double-promotion warnings Double promotion warnings are generated with the flag -Wdouble-promotion Signed-off-by: Ryan McClelland <[email protected]> * test: Relocate posix mqueue receive buffer For platforms that select Kconfig option CONFIG_KERNEL_COHERENCE, the receive buffer used in mq_timedreceive() must not be on the stack. This is because the k_msgq that underlies the POSIX mqueue will attempt to perform a direct to buffer copy from the sender when there is a waiting reader. Fixes #60796 Signed-off-by: Peter Mitsis <[email protected]> * drivers: interrupt_controller: plic: support edge triggered interrupts This adds a check and option for edge triggered interrupts Signed-off-by: Joshua Lilly <[email protected]> * net: tcp: Avoid partial ACK canceling retransmission timer At any ack, the retransmission timer was cancelled. This means when an ACK is only partially acknowledging pending data, followed by a packet loss, the connection ended in a deadlock eventually timing out. By checking if there is any pending data for transmission before canceling the retransmission timer, there is no risk of this lock-up any more. Signed-off-by: Sjors Hettinga <[email protected]> * bindings: ethernet: replace phy-dev with phy-handle Rename the phy-dev property with phy-handle to match the Linux ethernet-controller binding and move it up to ethernet.yaml so that it can be used by other drivers. Signed-off-by: Fabio Baltieri <[email protected]> * bindings: ethernet: rename ethernet to ethernet-controller Rename the ethernet.yaml template to ethernet-controller.yaml to match the Linux one. Signed-off-by: Fabio Baltieri <[email protected]> * tests: subsys: canbus changing the test thread priority The test thread and the system workqueue have the same priority, so it is a bit arbitrary whether the workqueue cleans up the send context before the next send. Signed-off-by: Francois Ramu <[email protected]> * samples: subsys: nvs on nucleo_g474re requires 6kB for storage partition Add the overlay for running the samples/subsys/nvs/ application on the nucleo_g474re. Define a 6kB storage_partition at the end of the 512kB flash. Signed-off-by: Francois Ramu <[email protected]> * drivers: can: mcan: add CAN_MCAN_DT_MRBA() and CAN_MCAN_DT_INST_MRBA() Add CAN_MCAN_DT_MRBA() and CAN_MCAN_DT_INST_MRBA() macros for retrieving the Bosch M_CAN Message RAM Base Address (MRBA) and clarify that the existing CAN_MCAN_DT_MRAM_ADDR() and CAN_MCAN_DT_INST_MRAM_ADDR() macros do not retrieve the base address, but rather the base address + the offset, if any. Signed-off-by: Henrik Brix Andersen <[email protected]> * drivers: can: stm32h7: fix message RAM address calculations Calculate the Bosch M_CAN Message RAM addresses relative to the Message RAM Base Address (MRBA), not the offset. Fixes: #59624 Signed-off-by: Henrik Brix Andersen <[email protected]> * tests: thrift: re-order shared_ptr reset to prevent fd leak This change fixes a file descriptor leak that snuck-in undetected in the original `gsoc-2022-thrift` project. Signed-off-by: Christopher Friedt <[email protected]> * ethernet: eth_stm32_hal: fix unused variable build warning Fix an unused variable build warning that was happening in certain configurations. Move the variables in the only condition where they are actually used. west build -p -b nucleo_f429zi \ -T samples/net/cloud/aws_iot_mqtt/sample.net.cloud.aws_iot_mqtt Signed-off-by: Fabio Baltieri <[email protected]> * mgmt: mcumgr: grp: fs_mgmt: Fix wrong error checking Fixes an issue with not properly checking error responses. Signed-off-by: Jamie McCrae <[email protected]> * doc: services: device_mgmt: smp_groups: Clarify img_mgmt upload Clarifies the details in the upload section of img_mgmt for MCUmgr to better describe when fields should be sent, including a note when a server responds with offset of 0. Signed-off-by: Jamie McCrae <[email protected]> * mgmt: mcumgr: grp: img_mgmt: Fix not checking image upload size Fixes an issue whereby upload image size would not be checked in the first packet of an upload, which would allow an image to be uploaded until it reached the point of it being too large to fit anymore. Signed-off-by: Jamie McCrae <[email protected]> * mgmt: mcumgr: grp: img_mgmt: Fix not checking write bounds Fixes an issue whereby the data packets were not checked to ensure that the client has not attempted to write more data than the size that was provided in the original upload packet. Signed-off-by: Jamie McCrae <[email protected]> * Bluetooth: ISO: Add advanced unicast ISO parameters Add support for setting advanced unicast ISO parameters using the ISO test commands. This allows the host to set ISO parameters that the controller normally would handle. Signed-off-by: Emil Gydesen <[email protected]> * Bluetooth: ISO: Add broadcast RTN check in valid_chan_io_qos The RTN value range for broadcast is more limited than connected ISO. Signed-off-by: Emil Gydesen <[email protected]> * samples: Bluetooth: ISO connected benchmark advanced ISO Add (optional) advanced ISO support for the benchmark ISO sample. The CONFIG_BT_ISO_ADVANCED Kconfig simply needs to be enabled in order to support the advanced settings. This also reduces the number of default channels supported to 1. Signed-off-by: Emil Gydesen <[email protected]> * Bluetooth: ISO: Add advanced broadcast ISO parameters Add support for setting advanced broadcast ISO parameters using the ISO test commands. This allows the host to set ISO parameters that the controller normally would handle. Signed-off-by: Emil Gydesen <[email protected]> * samples: Bluetooth: ISO broadcash benchmark advanced ISO Add (optional) advanced ISO support for the benchmark ISO sample. The CONFIG_BT_ISO_ADVANCED Kconfig simply needs to be enabled in order to support the advanced settings. Signed-off-by: Emil Gydesen <[email protected]> * tests: Bluetooth: Refactor ISO broadcast ISO BSIM test Refactor the test function to split it into multiple smaller functions. This makes the main function much shorter and easier to follow, and allows reusing of the individual steps. Signed-off-by: Emil Gydesen <[email protected]> * tests: Bluetooth: Add advanced BIG create BSIM test Extended the ISO broadcaster BSIM test with an additional step to create a BIG using the test parameters. Since this isn't properly implemented in the controller, CONFIG_BT_ISO_ADVANCED has not been enabled in the prj.conf yet. Signed-off-by: Emil Gydesen <[email protected]> * soc/arm/silabs: Kconfig: add SOC_GECKO_USE_RAIL kconfig option Currently on zephyr, RAIL is used only for bluetooth. RAIL library is needed to use efr32 radio regardless of the protocol used. We add SOC_GECKO_USE_RAIL kconfig option to indicate if we use radio. FPU is needed when using RAIL, we configure it if SOC_GECKO_USE_RAIL is set. Signed-off-by: Antoine Bout <[email protected]> * mgmt: mcumgr: grp: Fix error translation function indent Fixes lines not being indented and looking like a single blob Signed-off-by: Jamie McCrae <[email protected]> * net: tcp: Remove trigger of send_data_timer when window full Likely this trigger of the send_data_timer was an alternative for the function that has been filled in by the ZWP transmission. At the moment this timer has the potential to cause spurious retransmissions that can degrade the throughput of the network stack. Second to that it can accelerate the retransmission process, quickly running to the number of retransmissions, causing a connection failure. Signed-off-by: Sjors Hettinga <[email protected]> * net: sockets: socketpair: Allow statically allocated socketpairs When the target board does not have heap by default, allows statically reserving the space for required socketpairs. Signed-off-by: Seppo Takalo <[email protected]> * boards: nucleo_l552ze_q: Fix green led port/pin definition This commit fixes the definition of the green led pin on the nucleo-L552ZE-Q board The new port/pin for this led (LED1) …
Closed in favor of #76335 which summarizes results from this and prior discussions for easier reference and visibility. Feel free to re-open if you think that this RFC still has merit on its own. |
This RFC was closed in favor of a full summary in #76335
Based on discussion in #17162 the following describes a proposed API extension that is enabled by #17155 given a few minor API changes.
Proposed Zephyr Clocks
I would like the end goal to be support for the following clocks:
K_CLOCK_HARDWARE
corresponds to the Zephyr hardware clock. It is provided byk_cycle_get()
. This is a monotonic non-decreasing non-wrapping 64-bit source with zero at the instant the system hardware clock is initialized. A duration of 1 corresponds to a Zephyrcycle
. The rateZ_HZ_cyc
is a constant number of nominal cycles per second, but the actual rate may vary, and may not be a compile-time constant.K_CLOCK_SYSTEM
corresponds to the the system clock. This is a monotonic non-decreasing non-wrapping 64-bit source with a zero at the instant of the zero ofK_CLOCK_HARDWARE
. A duration of 1 corresponds to a Zephyrtick
. The rateZ_HZ_ticks
is a compile-time constant, but the criteria for advancing the clock depends onCONFIG_TICKLESS_KERNEL
. For a tickless kernel this source is a linear transformation scalingK_CLOCK_HARDWARE
byZ_HZ_ticks / Z_HZ_cyc
.K_CLOCK_MONOTONIC
is the documented clock used for the timeout API defined in New timeout API #17155. It should be an alias forK_CLOCK_SYSTEM
.K_CLOCK_UPTIME
corresponds tok_uptime_get()
. This is a linear transformation usingK_CLOCK_MONOTONIC
nominal tick rate to convert to a time scale where a duration of 1 corresponds to one millisecond. This probably isn't necessary, though it might be convenient.K_CLOCK_REALTIME
would correspond to something that tracks civil time a la NTP. This is very TBD.Let
k_clock_id_t
denote the type of the aboveK_CLOCK_FOO
constants. Additional clock sources are possible by a Kconfig option to enable them for specific devices. This would extend the device API with functions provide frequency, gettime, and alarm capabilities for the provider. For example:would provide a clock id for timeouts that use that counter to control their duration, assuming the counter identified by
dev
was configured to support use as a clock source. Other non-counter providers may exist as well. Any clock id could be used in the following generic API:We then have:
k_clock_get(K_CLOCK_HARDWARE)
==k_cycle_get()
k_clock_get(K_CLOCK_UPTIME)
==k_uptime_get()
k_clock_get(K_CLOCK_SYSTEM)
returns the tick counter (curr_tick
)Currently the opaque
k_ticks_t
value encodes a count in ticks that is either relative or absolute. In the future it should also encode the id of the clock to which it applies, so we should be able to usez_add_timeout
and have that record on the queue for the corresponding clock.We will also need API extensions:
K_TIMEOUT_suffix(args...)
will have a correspondingK_CLOCK_TIMEOUT_suffix(id, args...)
which implements it for clocks other thanK_CLOCK_MONOTONIC
.k_?s_to_ticks_suffix(args...)
will have a correspondingk_?s_to_clock_ticks_suffix(id, args...)
which implements the conversion between time and clock values/durations using the rate for a specific clock.k_delay(k_timeout_t t)
that extends the capability ofk_sleep()
to other clock sources.The text was updated successfully, but these errors were encountered: