diff --git a/.github/workflows/devicetree_checks.yml b/.github/workflows/devicetree_checks.yml index fd902ac457957f..d0bf180c0f3f1b 100644 --- a/.github/workflows/devicetree_checks.yml +++ b/.github/workflows/devicetree_checks.yml @@ -27,9 +27,9 @@ jobs: strategy: matrix: python-version: ['3.10', '3.11', '3.12'] - os: [ubuntu-22.04, macos-11, windows-2022] + os: [ubuntu-22.04, macos-14, windows-2022] exclude: - - os: macos-11 + - os: macos-14 python-version: 3.6 - os: windows-2022 python-version: 3.6 diff --git a/.github/workflows/hello_world_multiplatform.yaml b/.github/workflows/hello_world_multiplatform.yaml index bcd11ee3ecc37a..bbcce51d9e570b 100644 --- a/.github/workflows/hello_world_multiplatform.yaml +++ b/.github/workflows/hello_world_multiplatform.yaml @@ -26,7 +26,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-12, macos-14, windows-2022] + os: [ubuntu-22.04, macos-13, macos-14, windows-2022] runs-on: ${{ matrix.os }} steps: - name: Checkout diff --git a/.github/workflows/west_cmds.yml b/.github/workflows/west_cmds.yml index c1e38695dc9e98..f3de00d82bb7b7 100644 --- a/.github/workflows/west_cmds.yml +++ b/.github/workflows/west_cmds.yml @@ -30,9 +30,9 @@ jobs: strategy: matrix: python-version: ['3.10', '3.11', '3.12'] - os: [ubuntu-22.04, macos-11, windows-2022] + os: [ubuntu-22.04, macos-14, windows-2022] exclude: - - os: macos-11 + - os: macos-14 python-version: 3.6 - os: windows-2022 python-version: 3.6 diff --git a/CMakeLists.txt b/CMakeLists.txt index d5d5b370153d60..d856841eaedafd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1989,22 +1989,39 @@ elseif(CONFIG_LOG_MIPI_SYST_USE_CATALOG) endif() if(LOG_DICT_DB_NAME_ARG) - if (NOT CONFIG_LOG_DICTIONARY_DB_TARGET) - set(LOG_DICT_DB_ALL_TARGET ALL) - endif() - add_custom_command( - OUTPUT ${LOG_DICT_DB_NAME} - COMMAND + set(log_dict_gen_command ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/logging/dictionary/database_gen.py ${KERNEL_ELF_NAME} ${LOG_DICT_DB_NAME_ARG}=${LOG_DICT_DB_NAME} --build-header ${PROJECT_BINARY_DIR}/include/generated/zephyr/version.h - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - COMMENT "Generating logging dictionary database: ${LOG_DICT_DB_NAME}" - DEPENDS ${logical_target_for_zephyr_elf} ) - add_custom_target(log_dict_db_gen ${LOG_DICT_DB_ALL_TARGET} DEPENDS ${LOG_DICT_DB_NAME}) + + if (NOT CONFIG_LOG_DICTIONARY_DB_TARGET) + # If not using a separate target for generating logging dictionary + # database, add the generation to post build command to make sure + # the database is actually being generated. + list(APPEND + post_build_commands + COMMAND ${CMAKE_COMMAND} -E echo "Generating logging dictionary database: ${LOG_DICT_DB_NAME}" + COMMAND ${log_dict_gen_command} + ) + list(APPEND + post_build_byproducts + ${LOG_DICT_DB_NAME} + ) + else() + # Seprate build target for generating logging dictionary database. + # This needs to be explicitly called/used to generate the database. + add_custom_command( + OUTPUT ${LOG_DICT_DB_NAME} + COMMAND ${log_dict_gen_command} + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + COMMENT "Generating logging dictionary database: ${LOG_DICT_DB_NAME}" + DEPENDS ${logical_target_for_zephyr_elf} + ) + add_custom_target(log_dict_db_gen DEPENDS ${LOG_DICT_DB_NAME}) + endif() endif() # Add post_build_commands to post-process the final .elf file produced by @@ -2050,9 +2067,9 @@ set(TSVIMAGELOADER_NAME IMAGE0_testfile.hex) add_custom_command( OUTPUT ${STRIPPED_KERNEL_HEX_NAME} COMMAND ${TAIL_EXECUTABLE} -n +2 ${PROJECT_BINARY_DIR}/${KERNEL_HEX_NAME} >> ${PROJECT_BINARY_DIR}/${STRIPPED_HEX_NAME} - COMMAND ${HEAD_EXECUTABLE} -n +65 ${ZEPHYR_BASE}/${TSVBOOTLOADER_NAME} >> ${PROJECT_BINARY_DIR}/${TSVIMAGELOADER_NAME} + COMMAND ${HEAD_EXECUTABLE} -n +48 ${ZEPHYR_BASE}/${TSVBOOTLOADER_NAME} >> ${PROJECT_BINARY_DIR}/${TSVIMAGELOADER_NAME} COMMAND ${HEAD_EXECUTABLE} -n +1 ${PROJECT_BINARY_DIR}/${STRIPPED_HEX_NAME} >> ${PROJECT_BINARY_DIR}/${TSVIMAGELOADER_NAME} - COMMAND ${TAIL_EXECUTABLE} -n +67 ${ZEPHYR_BASE}/${TSVBOOTLOADER_NAME} >> ${PROJECT_BINARY_DIR}/${TSVIMAGELOADER_NAME} + COMMAND ${TAIL_EXECUTABLE} -n +50 ${ZEPHYR_BASE}/${TSVBOOTLOADER_NAME} >> ${PROJECT_BINARY_DIR}/${TSVIMAGELOADER_NAME} COMMAND ${TAIL_EXECUTABLE} -n +1 ${PROJECT_BINARY_DIR}/${STRIPPED_HEX_NAME} >> ${PROJECT_BINARY_DIR}/${TSVIMAGELOADER_NAME} DEPENDS ${MERGED_KERNEL_HEX_NAME} ) diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index aa9e2cc22ab520..d18919a3625620 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -783,8 +783,7 @@ DFU: - dfu Devicetree: - status: maintained - maintainers: [] + status: odd fixes collaborators: - decsny - galak @@ -804,8 +803,7 @@ Devicetree: - libraries.devicetree Devicetree Bindings: - status: maintained - maintainers: [] + status: odd fixes collaborators: - decsny - galak @@ -1010,6 +1008,7 @@ Release Notes: - samples/modules/canopennode/ - samples/net/sockets/can/ - samples/subsys/canbus/ + - scripts/west_commands/runners/canopen_program.py - subsys/canbus/ - subsys/net/l2/canbus/ - tests/drivers/build_all/can/ @@ -3046,7 +3045,6 @@ Twister: collaborators: - PerMac - hakehuang - - gopiotr - golowanow - gchwier - LukaszMrugala @@ -4132,8 +4130,7 @@ VFS: - filesystem West: - status: maintained - maintainers: [] + status: odd fixes collaborators: - mbolivar-ampere - carlescufi @@ -4669,6 +4666,7 @@ West: - ceolin collaborators: - ithinuel + - valeriosetti files: - modules/mbedtls/ labels: @@ -5030,7 +5028,7 @@ Random: # This area is to be converted to a subarea Testing with Renode: - status: maintained + status: odd fixes collaborators: - mateusz-holenko - fkokosinski diff --git a/VERSION b/VERSION index 6e31d4f8f88985..415da95a8064ed 100644 --- a/VERSION +++ b/VERSION @@ -2,4 +2,4 @@ VERSION_MAJOR = 3 VERSION_MINOR = 7 PATCHLEVEL = 0 VERSION_TWEAK = 0 -EXTRAVERSION = rc1 +EXTRAVERSION = rc2 diff --git a/arch/common/isr_tables.c b/arch/common/isr_tables.c index b3bdd136e0c20a..183f80738fe246 100644 --- a/arch/common/isr_tables.c +++ b/arch/common/isr_tables.c @@ -15,11 +15,11 @@ struct int_list_header { uint32_t table_size; uint32_t offset; -#if IS_ENABLED(CONFIG_ISR_TABLES_LOCAL_DECLARATION) +#if defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) uint32_t swi_table_entry_size; uint32_t shared_isr_table_entry_size; uint32_t shared_isr_client_num_offset; -#endif /* IS_ENABLED(CONFIG_ISR_TABLES_LOCAL_DECLARATION) */ +#endif /* defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) */ }; /* These values are not included in the resulting binary, but instead form the @@ -29,13 +29,13 @@ struct int_list_header { Z_GENERIC_SECTION(.irq_info) __used struct int_list_header _iheader = { .table_size = IRQ_TABLE_SIZE, .offset = CONFIG_GEN_IRQ_START_VECTOR, -#if IS_ENABLED(CONFIG_ISR_TABLES_LOCAL_DECLARATION) +#if defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) .swi_table_entry_size = sizeof(struct _isr_table_entry), -#if IS_ENABLED(CONFIG_SHARED_INTERRUPTS) +#if defined(CONFIG_SHARED_INTERRUPTS) .shared_isr_table_entry_size = sizeof(struct z_shared_isr_table_entry), .shared_isr_client_num_offset = offsetof(struct z_shared_isr_table_entry, client_num), -#endif /* IS_ENABLED(CONFIG_SHARED_INTERRUPTS) */ -#endif /* IS_ENABLED(CONFIG_ISR_TABLES_LOCAL_DECLARATION) */ +#endif /* defined(CONFIG_SHARED_INTERRUPTS) */ +#endif /* defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) */ }; /* These are placeholder tables. They will be replaced by the real tables diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 76ea74026ac3d2..f25b1ca7c950d0 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -48,10 +48,11 @@ config RISCV_EXCEPTION_STACK_TRACE menu "RISCV Processor Options" config INCLUDE_RESET_VECTOR - bool "Include Reset vector" + bool "Jumps to __initialize directly" help - Include the reset vector stub, which initializes the stack and - prepares for running C code. + Select 'y' here to use the Zephyr provided default implementation that + jumps to `__initialize` directly. Otherwise a SOC needs to provide its + custom `__reset` routine. config RISCV_PRIVILEGED bool diff --git a/arch/x86/core/intel64/irq.c b/arch/x86/core/intel64/irq.c index f8e251b804613c..51410646dbaf94 100644 --- a/arch/x86/core/intel64/irq.c +++ b/arch/x86/core/intel64/irq.c @@ -100,8 +100,8 @@ void z_x86_irq_connect_on_vector(unsigned int irq, */ int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority, - void (*func)(const void *arg), - const void *arg, uint32_t flags) + void (*routine)(const void *parameter), + const void *parameter, uint32_t flags) { uint32_t key; int vector; @@ -124,7 +124,7 @@ int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority, #endif /* CONFIG_INTEL_VTD_ICTL */ z_irq_controller_irq_config(vector, irq, flags); - z_x86_irq_connect_on_vector(irq, vector, func, arg); + z_x86_irq_connect_on_vector(irq, vector, routine, parameter); } irq_unlock(key); diff --git a/arch/xtensa/core/ptables.c b/arch/xtensa/core/ptables.c index f06b7f872126aa..675949cb342f66 100644 --- a/arch/xtensa/core/ptables.c +++ b/arch/xtensa/core/ptables.c @@ -317,6 +317,13 @@ void xtensa_mmu_init(void) xtensa_init_paging(xtensa_kernel_ptables); + /* + * This is used to determine whether we are faulting inside double + * exception if this is not zero. Sometimes SoC starts with this not + * being set to zero. So clear it during boot. + */ + XTENSA_WSR(ZSR_DEPC_SAVE_STR, 0); + arch_xtensa_mmu_post_init(_current_cpu->id == 0); } diff --git a/boards/espressif/esp32_devkitc_wroom/doc/index.rst b/boards/espressif/esp32_devkitc_wroom/doc/index.rst index 58106b69ab6e04..d81c10d9fb5dc5 100644 --- a/boards/espressif/esp32_devkitc_wroom/doc/index.rst +++ b/boards/espressif/esp32_devkitc_wroom/doc/index.rst @@ -141,9 +141,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/espressif/esp32_devkitc_wrover/doc/index.rst b/boards/espressif/esp32_devkitc_wrover/doc/index.rst index 7a29912dfbc9d5..8ada4229ee8885 100644 --- a/boards/espressif/esp32_devkitc_wrover/doc/index.rst +++ b/boards/espressif/esp32_devkitc_wrover/doc/index.rst @@ -141,9 +141,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/espressif/esp32_ethernet_kit/doc/index.rst b/boards/espressif/esp32_ethernet_kit/doc/index.rst index 2f8ff821aad210..180382858bc989 100644 --- a/boards/espressif/esp32_ethernet_kit/doc/index.rst +++ b/boards/espressif/esp32_ethernet_kit/doc/index.rst @@ -463,9 +463,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/espressif/esp32c3_devkitm/doc/index.rst b/boards/espressif/esp32c3_devkitm/doc/index.rst index 9028d0c3cabd20..48b38b5be909f8 100644 --- a/boards/espressif/esp32c3_devkitm/doc/index.rst +++ b/boards/espressif/esp32c3_devkitm/doc/index.rst @@ -116,9 +116,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/espressif/esp32c6_devkitc/doc/index.rst b/boards/espressif/esp32c6_devkitc/doc/index.rst index 9eb87fe2a8acf7..ba847d2a90b48c 100644 --- a/boards/espressif/esp32c6_devkitc/doc/index.rst +++ b/boards/espressif/esp32c6_devkitc/doc/index.rst @@ -146,9 +146,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/espressif/esp32s2_devkitc/doc/index.rst b/boards/espressif/esp32s2_devkitc/doc/index.rst index 427596e31473bb..94e6c0c07ed622 100644 --- a/boards/espressif/esp32s2_devkitc/doc/index.rst +++ b/boards/espressif/esp32s2_devkitc/doc/index.rst @@ -112,9 +112,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/espressif/esp32s2_saola/doc/index.rst b/boards/espressif/esp32s2_saola/doc/index.rst index 485614db8e7d86..9567efb208870a 100644 --- a/boards/espressif/esp32s2_saola/doc/index.rst +++ b/boards/espressif/esp32s2_saola/doc/index.rst @@ -112,9 +112,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/espressif/esp32s3_devkitc/doc/index.rst b/boards/espressif/esp32s3_devkitc/doc/index.rst index a7d6c7d60d5ae0..c4287b4539ea32 100644 --- a/boards/espressif/esp32s3_devkitc/doc/index.rst +++ b/boards/espressif/esp32s3_devkitc/doc/index.rst @@ -161,9 +161,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/espressif/esp32s3_devkitm/doc/index.rst b/boards/espressif/esp32s3_devkitm/doc/index.rst index 17af80ed318699..de654567100f69 100644 --- a/boards/espressif/esp32s3_devkitm/doc/index.rst +++ b/boards/espressif/esp32s3_devkitm/doc/index.rst @@ -161,9 +161,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/espressif/esp_wrover_kit/doc/index.rst b/boards/espressif/esp_wrover_kit/doc/index.rst index fdef0efd6c709c..24373e4a2ee82f 100644 --- a/boards/espressif/esp_wrover_kit/doc/index.rst +++ b/boards/espressif/esp_wrover_kit/doc/index.rst @@ -527,9 +527,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/franzininho/esp32s2_franzininho/doc/index.rst b/boards/franzininho/esp32s2_franzininho/doc/index.rst index 54de95ecb40130..99ccf84c3be34f 100644 --- a/boards/franzininho/esp32s2_franzininho/doc/index.rst +++ b/boards/franzininho/esp32s2_franzininho/doc/index.rst @@ -79,9 +79,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/hardkernel/odroid_go/doc/index.rst b/boards/hardkernel/odroid_go/doc/index.rst index 9fa4d107b1398b..dce256d3b6cd43 100644 --- a/boards/hardkernel/odroid_go/doc/index.rst +++ b/boards/hardkernel/odroid_go/doc/index.rst @@ -120,9 +120,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/heltec/heltec_wifi_lora32_v2/doc/index.rst b/boards/heltec/heltec_wifi_lora32_v2/doc/index.rst index b97a998051219b..4fc7b0279477f7 100644 --- a/boards/heltec/heltec_wifi_lora32_v2/doc/index.rst +++ b/boards/heltec/heltec_wifi_lora32_v2/doc/index.rst @@ -67,9 +67,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/heltec/heltec_wireless_stick_lite_v3/doc/index.rst b/boards/heltec/heltec_wireless_stick_lite_v3/doc/index.rst index 85470571981f48..a6b48d6c71a818 100644 --- a/boards/heltec/heltec_wireless_stick_lite_v3/doc/index.rst +++ b/boards/heltec/heltec_wireless_stick_lite_v3/doc/index.rst @@ -181,9 +181,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/infineon/cyw920829m2evk_02/doc/img/cyw920829m2evk_02.webp b/boards/infineon/cyw920829m2evk_02/doc/img/cyw920829m2evk_02.webp index 130fc8dac65755..a93d6f396969d9 100644 Binary files a/boards/infineon/cyw920829m2evk_02/doc/img/cyw920829m2evk_02.webp and b/boards/infineon/cyw920829m2evk_02/doc/img/cyw920829m2evk_02.webp differ diff --git a/boards/infineon/cyw920829m2evk_02/doc/index.rst b/boards/infineon/cyw920829m2evk_02/doc/index.rst index fbb6e024392618..cac878c01a5958 100644 --- a/boards/infineon/cyw920829m2evk_02/doc/index.rst +++ b/boards/infineon/cyw920829m2evk_02/doc/index.rst @@ -19,9 +19,8 @@ Hardware For more information about the CYW20829 SoC and CYW920829M2EVK-02 board: -- `CYW920829M2EVK-02 Website`_ -- `CYW920829M2EVK-02 BT User Guide`_ - +- `CYW20829 SoC Website`_ +- `CYW920829M2EVK-02 Board Website`_ Kit Features: ============= @@ -86,51 +85,76 @@ To fetch Binary Blobs: Build blinking led sample ************************* -Here is an example for the :zephyr:code-sample:`blinky` application. +Here is an example for building the :zephyr:code-sample:`blinky` sample application. .. zephyr-app-commands:: :zephyr-app: samples/basic/blinky :board: cyw920829m2evk_02 - :goals: build flash + :goals: build -OpenOCD Installation -==================== +Programming and Debugging +************************* -To get the OpenOCD package, it is required that you +The CYW920829M2EVK-02 includes an onboard programmer/debugger (`KitProg3`_) to provide debugging, flash programming, and serial communication over USB. Flash and debug commands use OpenOCD and require a custom Infineon OpenOCD version, that supports KitProg3, to be installed. -1. Download and install the `ModusToolbox`_ software. -2. After the installation, add the directory containing the OpenOCD scripts to your environment's PATH variable. +Infineon OpenOCD Installation +============================= +Both the full `ModusToolbox`_ and the `ModusToolbox Programming Tools`_ packages include Infineon OpenOCD. Installing either of these packages will also install Infineon OpenOCD. If neither package is installed, a minimal installation can be done by downloading the `Infineon OpenOCD`_ release for your system and manually extract the files to a location of your choice. -Programming and Debugging -************************* +.. note:: Linux requires device access rights to be set up for KitProg3. This is handled automatically by the ModusToolbox and ModusToolbox Programming Tools installations. When doing a minimal installation, this can be done manually by executing the script ``openocd/udev_rules/install_rules.sh``. + +West Commands +============= -The CYW920829M2EVK-02 includes an onboard programmer/debugger (KitProg3) to provide debugging, flash programming, and serial communication over USB. Flash and debug commands must be pointed to the Cypress OpenOCD you downloaded above. +The path to the installed Infineon OpenOCD executable must be available to the ``west`` tool commands. There are multiple ways of doing this. The example below uses a permanent CMake argument to set the CMake variable ``OPENOCD``. -On Windows: + .. tabs:: + .. group-tab:: Windows -.. code-block:: shell + .. code-block:: shell - west flash --openocd path/to/infineon/openocd/bin/openocd.exe - west debug --openocd path/to/infineon/openocd/bin/openocd.exe + # Run west config once to set permanent CMake argument + west config build.cmake-args -- -DOPENOCD=path/to/infineon/openocd/bin/openocd.exe -On Linux: + # Do a pristine build once after setting CMake argument + west build -b cyw920829m2evk_02 -p always samples/basic/blinky -.. code-block:: shell + west flash + west debug - west flash --openocd path/to/infineon/openocd/bin/openocd - west debug --openocd path/to/infineon/openocd/bin/openocd + .. group-tab:: Linux + + .. code-block:: shell + + # Run west config once to set permanent CMake argument + west config build.cmake-args -- -DOPENOCD=path/to/infineon/openocd/bin/openocd + + # Do a pristine build once after setting CMake argument + west build -b cyw920829m2evk_02 -p always samples/basic/blinky + + west flash + west debug Once the gdb console starts after executing the west debug command, you may now set breakpoints and perform other standard GDB debugging on the CYW20829 CM33 core. -.. _CYW920829M2EVK-02 Website: +.. _CYW20829 SoC Website: https://www.infineon.com/cms/en/product/wireless-connectivity/airoc-bluetooth-le-bluetooth-multiprotocol/airoc-bluetooth-le/cyw20829/ +.. _CYW920829M2EVK-02 Board Website: + https://www.infineon.com/cms/en/product/evaluation-boards/cyw920829m2evk-02/ + .. _CYW920829M2EVK-02 BT User Guide: https://www.infineon.com/cms/en/product/wireless-connectivity/airoc-bluetooth-le-bluetooth-multiprotocol/airoc-bluetooth-le/cyw20829/#!?fileId=8ac78c8c8929aa4d018a16f726c46b26 .. _ModusToolbox: https://softwaretools.infineon.com/tools/com.ifx.tb.tool.modustoolbox +.. _ModusToolbox Programming Tools: + https://softwaretools.infineon.com/tools/com.ifx.tb.tool.modustoolboxprogtools + .. _Infineon OpenOCD: - https://github.com/infineon/openocd/releases/tag/release-v4.3.0 + https://github.com/Infineon/openocd/releases/latest + +.. _KitProg3: + https://github.com/Infineon/KitProg3 diff --git a/boards/lilygo/ttgo_lora32/doc/index.rst b/boards/lilygo/ttgo_lora32/doc/index.rst index b149fa6fa0c55a..5b6d3702f210ad 100644 --- a/boards/lilygo/ttgo_lora32/doc/index.rst +++ b/boards/lilygo/ttgo_lora32/doc/index.rst @@ -111,9 +111,9 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. -.. code-block:: cfg + .. code-block:: cfg - CONFIG_BOOTLOADER_MCUBOOT=y + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/lilygo/ttgo_t8c3/doc/index.rst b/boards/lilygo/ttgo_t8c3/doc/index.rst index 73e092bb94ca0d..51b2c212c5e7ba 100644 --- a/boards/lilygo/ttgo_t8c3/doc/index.rst +++ b/boards/lilygo/ttgo_t8c3/doc/index.rst @@ -108,9 +108,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/luatos/esp32c3_luatos_core/doc/index.rst b/boards/luatos/esp32c3_luatos_core/doc/index.rst index 21c9a7bfc5998b..1cd9c909b9b5af 100644 --- a/boards/luatos/esp32c3_luatos_core/doc/index.rst +++ b/boards/luatos/esp32c3_luatos_core/doc/index.rst @@ -134,9 +134,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/luatos/esp32s3_luatos_core/doc/index.rst b/boards/luatos/esp32s3_luatos_core/doc/index.rst index 687851ea6a4417..c7ada6e3f9a4e2 100644 --- a/boards/luatos/esp32s3_luatos_core/doc/index.rst +++ b/boards/luatos/esp32s3_luatos_core/doc/index.rst @@ -160,9 +160,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/m5stack/m5stickc_plus/doc/index.rst b/boards/m5stack/m5stickc_plus/doc/index.rst index 1e5907d50cd673..62a059b30e359f 100644 --- a/boards/m5stack/m5stickc_plus/doc/index.rst +++ b/boards/m5stack/m5stickc_plus/doc/index.rst @@ -109,9 +109,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/m5stack/stamp_c3/doc/index.rst b/boards/m5stack/stamp_c3/doc/index.rst index 9ac2a05b7ec987..414f684d71d7e8 100644 --- a/boards/m5stack/stamp_c3/doc/index.rst +++ b/boards/m5stack/stamp_c3/doc/index.rst @@ -78,9 +78,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/nxp/imx8mm_evk/imx8mm_evk-pinctrl.dtsi b/boards/nxp/imx8mm_evk/imx8mm_evk-pinctrl.dtsi index b994d31c67a2ad..0568cc734b6844 100644 --- a/boards/nxp/imx8mm_evk/imx8mm_evk-pinctrl.dtsi +++ b/boards/nxp/imx8mm_evk/imx8mm_evk-pinctrl.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, NXP + * Copyright 2022,2024 NXP * SPDX-License-Identifier: Apache-2.0 * */ @@ -12,7 +12,7 @@ pinmux = <&iomuxc_uart2_rxd_uart_rx_uart2_rx>, <&iomuxc_uart2_txd_uart_tx_uart2_tx>; slew-rate = "fast"; - drive-strength = "40-ohm"; + drive-strength = "x6"; }; }; @@ -21,7 +21,7 @@ pinmux = <&iomuxc_uart4_rxd_uart_rx_uart4_rx>, <&iomuxc_uart4_txd_uart_tx_uart4_tx>; slew-rate = "fast"; - drive-strength = "40-ohm"; + drive-strength = "x6"; }; }; diff --git a/boards/nxp/imx8mn_evk/imx8mn_evk-pinctrl.dtsi b/boards/nxp/imx8mn_evk/imx8mn_evk-pinctrl.dtsi index ea200728c8afb7..827e8e94a61c73 100644 --- a/boards/nxp/imx8mn_evk/imx8mn_evk-pinctrl.dtsi +++ b/boards/nxp/imx8mn_evk/imx8mn_evk-pinctrl.dtsi @@ -1,5 +1,5 @@ /* - * Copyright 2022 NXP + * Copyright 2022,2024 NXP * SPDX-License-Identifier: Apache-2.0 * */ @@ -12,7 +12,7 @@ pinmux = <&iomuxc_uart2_rxd_uart_rx_uart2_rx>, <&iomuxc_uart2_txd_uart_tx_uart2_tx>; slew-rate = "fast"; - drive-strength = "40-ohm"; + drive-strength = "x6"; }; }; @@ -21,7 +21,7 @@ pinmux = <&iomuxc_uart4_rxd_uart_rx_uart4_rx>, <&iomuxc_uart4_txd_uart_tx_uart4_tx>; slew-rate = "fast"; - drive-strength = "40-ohm"; + drive-strength = "x6"; }; }; diff --git a/boards/nxp/lpcxpresso55s16/lpcxpresso55s16.yaml b/boards/nxp/lpcxpresso55s16/lpcxpresso55s16.yaml index e08460382fde62..f9380c7ab11cd3 100644 --- a/boards/nxp/lpcxpresso55s16/lpcxpresso55s16.yaml +++ b/boards/nxp/lpcxpresso55s16/lpcxpresso55s16.yaml @@ -23,4 +23,5 @@ supported: - i2c - spi - usb_device + - usbd vendor: nxp diff --git a/boards/nxp/lpcxpresso55s36/lpcxpresso55s36.yaml b/boards/nxp/lpcxpresso55s36/lpcxpresso55s36.yaml index 5a28b2149c54e6..806fadc48d3172 100644 --- a/boards/nxp/lpcxpresso55s36/lpcxpresso55s36.yaml +++ b/boards/nxp/lpcxpresso55s36/lpcxpresso55s36.yaml @@ -19,4 +19,6 @@ supported: - gpio - pwm - dac + - usb_device + - usbd vendor: nxp diff --git a/boards/nxp/mimxrt1170_evk/doc/index.rst b/boards/nxp/mimxrt1170_evk/doc/index.rst index 3055cde68065b2..f3260f9c2734a3 100644 --- a/boards/nxp/mimxrt1170_evk/doc/index.rst +++ b/boards/nxp/mimxrt1170_evk/doc/index.rst @@ -363,9 +363,6 @@ Using LinkServer ---------------- Known limitations with LinkServer and these boards include: -- ``west debug`` does not yet work correctly, and the application image is not -properly written to the memory. `NXP MCUXpresso for Visual Studio Code`_ -can be used to debug Zephyr applications with LinkServer. - ``west flash`` will not write images to non-flash locations. The flash command only works when all data in the image is written to flash memory regions. diff --git a/boards/olimex/olimex_esp32_evb/doc/index.rst b/boards/olimex/olimex_esp32_evb/doc/index.rst index c5457d5612c7a9..d640af8a522390 100644 --- a/boards/olimex/olimex_esp32_evb/doc/index.rst +++ b/boards/olimex/olimex_esp32_evb/doc/index.rst @@ -136,9 +136,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/others/icev_wireless/doc/index.rst b/boards/others/icev_wireless/doc/index.rst index 5484924e8d64de..c422ba3204b1aa 100644 --- a/boards/others/icev_wireless/doc/index.rst +++ b/boards/others/icev_wireless/doc/index.rst @@ -123,9 +123,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis-pinctrl.dtsi b/boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis-pinctrl.dtsi index 91efe29d219ca2..928908a6162175 100644 --- a/boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis-pinctrl.dtsi +++ b/boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis-pinctrl.dtsi @@ -12,7 +12,7 @@ pinmux = <&iomuxc_uart4_rxd_uart_rx_uart4_rx>, <&iomuxc_uart4_txd_uart_tx_uart4_tx>; slew-rate = "fast"; - drive-strength = "40-ohm"; + drive-strength = "x6"; }; }; @@ -21,7 +21,7 @@ pinmux = <&iomuxc_uart3_rxd_uart_rx_uart3_rx>, <&iomuxc_uart3_txd_uart_tx_uart3_tx>; slew-rate = "fast"; - drive-strength = "40-ohm"; + drive-strength = "x6"; }; }; @@ -32,7 +32,7 @@ <&iomuxc_sai3_txfs_uart_tx_uart2_rx>, <&iomuxc_sai3_txc_uart_rx_uart2_tx>; slew-rate = "fast"; - drive-strength = "40-ohm"; + drive-strength = "x6"; }; }; @@ -43,7 +43,7 @@ <&iomuxc_sai2_rxd0_uart_rts_b_uart1_rts_b>, <&iomuxc_sai2_txfs_uart_cts_b_uart1_cts_b>; slew-rate = "fast"; - drive-strength = "40-ohm"; + drive-strength = "x6"; }; }; }; diff --git a/boards/seeed/xiao_esp32c3/doc/index.rst b/boards/seeed/xiao_esp32c3/doc/index.rst index dc86a6c20ca7af..1aa5d48cdde894 100644 --- a/boards/seeed/xiao_esp32c3/doc/index.rst +++ b/boards/seeed/xiao_esp32c3/doc/index.rst @@ -105,9 +105,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/seeed/xiao_esp32s3/doc/index.rst b/boards/seeed/xiao_esp32s3/doc/index.rst index cca9a3d8a274f7..8341a79b22a44d 100644 --- a/boards/seeed/xiao_esp32s3/doc/index.rst +++ b/boards/seeed/xiao_esp32s3/doc/index.rst @@ -120,9 +120,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/boards/st/nucleo_h533re/board.cmake b/boards/st/nucleo_h533re/board.cmake index cec3a36c40362f..97abaa6f5770ec 100644 --- a/boards/st/nucleo_h533re/board.cmake +++ b/boards/st/nucleo_h533re/board.cmake @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 -board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw") +board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") board_runner_args(pyocd "--target=stm32h533retx") diff --git a/boards/st/nucleo_h563zi/board.cmake b/boards/st/nucleo_h563zi/board.cmake index 8899e82de74511..24b1a15215cc4b 100644 --- a/boards/st/nucleo_h563zi/board.cmake +++ b/boards/st/nucleo_h563zi/board.cmake @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 -board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw") +board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") board_runner_args(pyocd "--target=stm32h563zitx") diff --git a/boards/st/nucleo_u575zi_q/board.cmake b/boards/st/nucleo_u575zi_q/board.cmake index a37e241d2ce08f..44f3e8cbcfc477 100644 --- a/boards/st/nucleo_u575zi_q/board.cmake +++ b/boards/st/nucleo_u575zi_q/board.cmake @@ -1,4 +1,4 @@ -board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw") +board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") board_runner_args(openocd "--tcl-port=6666") diff --git a/boards/st/stm32f429i_disc1/board.cmake b/boards/st/stm32f429i_disc1/board.cmake index 402b28d32c035d..bc72082b038af9 100644 --- a/boards/st/stm32f429i_disc1/board.cmake +++ b/boards/st/stm32f429i_disc1/board.cmake @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 -board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw") +board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") board_runner_args(jlink "--device=STM32F429ZI" "--speed=4000") include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/st/stm32h573i_dk/board.cmake b/boards/st/stm32h573i_dk/board.cmake index 95bd27bc2000b6..762f2e32b85776 100644 --- a/boards/st/stm32h573i_dk/board.cmake +++ b/boards/st/stm32h573i_dk/board.cmake @@ -4,7 +4,7 @@ if(CONFIG_STM32_MEMMAP) board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") board_runner_args(stm32cubeprogrammer "--extload=MX25LM51245G_STM32H573I-DK-RevB-SFIx.stldr") else() -board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw") +board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") endif() board_runner_args(pyocd "--target=stm32h573iikx") diff --git a/boards/st/stm32h747i_disco/doc/index.rst b/boards/st/stm32h747i_disco/doc/index.rst index 06b8c88e1ace2a..a9635dd2e40c39 100644 --- a/boards/st/stm32h747i_disco/doc/index.rst +++ b/boards/st/stm32h747i_disco/doc/index.rst @@ -175,11 +175,11 @@ support in Zephyr by adding the shield ``st_b_lcd40_dsi1_mb1166`` or .. note:: The shield comes in different hardware revisions, the MB1166-A09 is utilizing a NT35510 panel controller and shall specifically - use ``st_b_lcd40_dsi1_mb1166_a09`` as SHIELD when building + use ``st_b_lcd40_dsi1_mb1166_a09`` as SHIELD when building. Prior versions are utilizing an OTM8009a controller and shall - use shield name without postfix, that is: ``st_b_lcd40_dsi1_mb1166`` + use shield name without postfix, that is: ``st_b_lcd40_dsi1_mb1166``. Shield version is printed on a sticker placed below the two bottom - mounting holes and has the format: MB1166-Axx + mounting holes and has the format: MB1166-Axx. Resources sharing ================= diff --git a/boards/st/stm32h750b_dk/board.cmake b/boards/st/stm32h750b_dk/board.cmake index c38a92dfacc7de..b9fb74f99cf4a3 100644 --- a/boards/st/stm32h750b_dk/board.cmake +++ b/boards/st/stm32h750b_dk/board.cmake @@ -7,7 +7,7 @@ if(CONFIG_STM32_MEMMAP) board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") board_runner_args(stm32cubeprogrammer "--extload=MT25TL01G_STM32H750B-DISCO.stldr") else() -board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw" ) +board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw" ) endif() include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake) diff --git a/boards/st/stm32h7b3i_dk/board.cmake b/boards/st/stm32h7b3i_dk/board.cmake index 027413fd66cf20..71ce6d59e4387f 100644 --- a/boards/st/stm32h7b3i_dk/board.cmake +++ b/boards/st/stm32h7b3i_dk/board.cmake @@ -8,7 +8,7 @@ if(CONFIG_STM32_MEMMAP) board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") board_runner_args(stm32cubeprogrammer "--extload=MX25LM51245G_STM32H7B3I-DISCO.stldr") else() -board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw" ) +board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw" ) endif() include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake) diff --git a/boards/st/stm32h7s78_dk/board.cmake b/boards/st/stm32h7s78_dk/board.cmake index 04b6ed24de4607..585770c48b4515 100644 --- a/boards/st/stm32h7s78_dk/board.cmake +++ b/boards/st/stm32h7s78_dk/board.cmake @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 -board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw") +board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") board_runner_args(openocd --target-handle=_CHIPNAME.cpu0) include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake) diff --git a/boards/st/stm32u5a9j_dk/board.cmake b/boards/st/stm32u5a9j_dk/board.cmake index dadc06c643e089..ac9a18d42fb720 100644 --- a/boards/st/stm32u5a9j_dk/board.cmake +++ b/boards/st/stm32u5a9j_dk/board.cmake @@ -1,7 +1,7 @@ # Copyright (c) 2023 STMicroelectronics # SPDX-License-Identifier: Apache-2.0 -board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw") +board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") board_runner_args(openocd "--tcl-port=6666") board_runner_args(openocd --cmd-pre-init "gdb_report_data_abort enable") diff --git a/boards/vcc-gnd/yd_esp32/doc/index.rst b/boards/vcc-gnd/yd_esp32/doc/index.rst index 236d076dfcb3a7..bf7efff35c25f3 100644 --- a/boards/vcc-gnd/yd_esp32/doc/index.rst +++ b/boards/vcc-gnd/yd_esp32/doc/index.rst @@ -141,9 +141,10 @@ There are two options to be used when building an application: User can select the MCUboot bootloader by adding the following line to the board default configuration file. - ``` - CONFIG_BOOTLOADER_MCUBOOT=y - ``` + + .. code:: cfg + + CONFIG_BOOTLOADER_MCUBOOT=y Sysbuild ======== diff --git a/cmake/flash/CMakeLists.txt b/cmake/flash/CMakeLists.txt index 9c2b18b6e898d1..81929df05aab6d 100644 --- a/cmake/flash/CMakeLists.txt +++ b/cmake/flash/CMakeLists.txt @@ -131,8 +131,6 @@ function(create_runners_yaml) # Write the final contents and set its location in the cache. file(GENERATE OUTPUT "${runners_yaml}" CONTENT $) - set(ZEPHYR_RUNNERS_YAML "${runners_yaml}" CACHE INTERNAL - "a configuration file for the runners Python package") endfunction() get_property(RUNNERS GLOBAL PROPERTY ZEPHYR_RUNNERS) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index e72b7ac229861f..4a9861f7a1d3aa 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -47,6 +47,16 @@ set(SPHINX_ENV DOT_EXECUTABLE=${DOXYGEN_DOT_EXECUTABLE} ) +if(DEFINED ENV{ZEPHYR_DOXYGEN_OVERLAY}) + if(EXISTS $ENV{ZEPHYR_DOXYGEN_OVERLAY}) + set(INCLUDE_CUSTOM_FILE "@INCLUDE = $ENV{ZEPHYR_DOXYGEN_OVERLAY}") + else() + message(FATAL_ERROR "Zephyr Doxygen overlay $ENV{ZEPHYR_DOXYGEN_OVERLAY} does not exist!") + endif() +else() + set(INCLUDE_CUSTOM_FILE "") +endif() + set(DOCS_CFG_DIR ${CMAKE_CURRENT_LIST_DIR}) set(DOCS_DOCTREE_DIR ${CMAKE_CURRENT_BINARY_DIR}/doctrees) set(DOCS_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/doc/_static/css/custom.css b/doc/_static/css/custom.css index a374fda4d37fe8..b820543f3dedb8 100644 --- a/doc/_static/css/custom.css +++ b/doc/_static/css/custom.css @@ -194,6 +194,9 @@ a.icon-home:visited { border-color: var(--code-border-color); } +.rst-content table.docutils caption, .rst-content table.field-list caption, .wy-table caption { + color: var(--body-color); +} .wy-table-odd td, .wy-table-striped tr:nth-child(2n-1) td, .rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td { diff --git a/doc/_templates/layout.html b/doc/_templates/layout.html index 6d58c015548a5c..2420dad6f7f31b 100644 --- a/doc/_templates/layout.html +++ b/doc/_templates/layout.html @@ -9,7 +9,7 @@
This is the documentation for the latest (main) development branch of Zephyr. If you are looking for the documentation of previous releases, use - the drop-down menu on the left and select the desired version. + the drop-down list at the bottom of the left panel and select the desired version.
{% endif %} {{ super() }} diff --git a/doc/connectivity/bluetooth/api/audio/bluetooth-le-audio-arch.rst b/doc/connectivity/bluetooth/api/audio/bluetooth-le-audio-arch.rst index ef4bf447d3d760..259063e3b585f6 100644 --- a/doc/connectivity/bluetooth/api/audio/bluetooth-le-audio-arch.rst +++ b/doc/connectivity/bluetooth/api/audio/bluetooth-le-audio-arch.rst @@ -3,11 +3,17 @@ LE Audio Stack ############## -.. figure:: img/ble_audio_arch.svg - :align: center - :alt: Bluetooth Audio Architecture - - Bluetooth Audio Architecture +.. graphviz:: + :caption: Bluetooth Audio Architecture + + digraph bluetooth_audio_arch { + r [shape=record, width=5, height=3 + label="{{TMAP | HAP | PBP | GMAP | ...} | + GAF | + {{{ GATT | GAP } | Low-level protocols (L2CAP, ATT, etc.)} | GAP | ISO} + | HCI Driver (USB, UART, SPI, virtual, etc.)}" + ]; + } Overall design ************** @@ -42,22 +48,306 @@ audio streams or broadcast (unconnected) audio streams. GAF mandates the use of the LC3 codec, but also supports other codecs. -.. figure:: img/gaf.svg - :align: center - :alt: Generic Audio Framework - - Generic Audio Framework +.. graphviz:: + :caption: Generic Audio Framework (GAF) + + digraph gaf { + node [shape=record]; + edge [style=invis]; + compound=true; + nodesep=0.1; + + subgraph hap_layer { + cluster=true; + label="HAP"; + HAS; + BAS [style=dashed]; + IAS [style=dashed]; + } + + subgraph pbp_layer { + cluster=true; + label="PBP"; + PBS[style=invis]; // Make it possible to treat PBP like the others + } + + subgraph tmap_layer { + cluster=true; + label="TMAP"; + TMAS; + } + + subgraph gmap_layer { + cluster=true; + label="GMAP"; + GMAS; + } + + subgraph gaf_layer { + cluster=true; + label="Generic Audio Framework"; + + subgraph transition_and_coordination_control_layer { + cluster=true; + label="Transition and Coordination Control"; + style=dashed; + + subgraph cap_layer { + cluster=true; + style=solid; + label="CAP"; + CAS; + } + + subgraph csip_layer { + cluster=true; + style=solid; + label="CSIP"; + CSIS; + } + } + + subgraph stream_control_layer { + cluster=true; + label="Stream Control"; + style=dashed; + + subgraph bap_layer { + cluster=true; + label="BAP"; + style=solid; + PACS [style=dashed]; + ASCS [style=dashed]; + BASS [style=dashed]; + } + } + + subgraph content_control_layer { + cluster=true; + label="Content Control"; + style=dashed; + + subgraph mcp_layer { + cluster=true; + label="MCP"; + style=solid; + MCS; + } + + subgraph ccp_layer { + cluster=true; + label="CCP"; + style=solid; + TBS; + } + } + + subgraph rendering_and_capture_control_layer { + cluster=true; + label="Rendering and Capture Control"; + style=dashed; + + subgraph micp_layer { + cluster=true; + label="MICP"; + style=solid; + MICS; + MICP_AICS [style=dashed]; + } + + subgraph vcp_layer { + cluster=true; + label="VCP"; + style=solid; + VCS; + VOCS [style=dashed]; + VCP_AICS [style=dashed]; + } + } + } + + HAS -> CAS; + PBS -> CAS; + TMAS -> CAS; + GMAS -> CAS; + + CAS -> MCS; + CAS -> TBS; + CAS -> ASCS; + CAS -> PACS; + CAS -> BASS; + CAS -> MICS; + CAS -> MICP_AICS; + CAS -> VCS; + CAS -> VOCS; + CAS -> VCP_AICS; + + CSIS -> MCS; + CSIS -> TBS; + CSIS -> ASCS; + CSIS -> PACS; + CSIS -> BASS; + CSIS -> MICS; + CSIS -> MICP_AICS; + CSIS -> VCS; + CSIS -> VOCS; + CSIS -> VCP_AICS; + } The top-level profiles TMAP and HAP are not part of the GAF, but rather provide top-level requirements for how to use the GAF. -GAF has been implemented in Zephyr with the following structure. - -.. figure:: img/zephyr_gaf.svg - :align: center - :alt: Generic Audio Framework - - Zephyr Generic Audio Framework +GAF and the top layer profiles gave been implemented in Zephyr with the following structure. + +.. graphviz:: + :caption: Zephyr Generic Audio Framework + + digraph gaf { + node [shape=record]; + edge [style=invis]; + compound=true; + nodesep=0.1; + + subgraph hap_layer { + cluster=true; + label="HAP"; + HAS_H [label="has.h"]; + BAS_H [label="bas.h"]; + IAS_H [label="ias.h"]; + } + + subgraph pbp_layer { + cluster=true; + label="PBP"; + PBP_H [label="pbp.h"]; // Make it possible to treat PBP like the others + } + + subgraph tmap_layer { + cluster=true; + label="TMAP"; + TMAP_H [label="tmap.h"]; + } + + subgraph gmap_layer { + cluster=true; + label="GMAP"; + GMAP_H [label="gmap.h"]; + GMAP_PRESET_H [label="gmap_lc3_preset.h"]; + } + + subgraph gaf_layer { + cluster=true; + label="Generic Audio Framework"; + AUDIO_H [label="audio.h"]; + LC3_H [label="lc3.h"]; + + subgraph transition_and_coordination_control_layer { + cluster=true; + label="Transition and Coordination Control"; + style=dashed; + + subgraph cap_layer { + cluster=true; + style=solid; + label="CAP"; + CAP_H [label="cap.h"]; + } + + subgraph csip_layer { + cluster=true; + style=solid; + label="CSIP"; + CSIP_H [label="csip.h"]; + } + } + + subgraph stream_control_layer { + cluster=true; + label="Stream Control"; + style=dashed; + + subgraph bap_layer { + cluster=true; + label="BAP"; + style=solid; + PACS_H [label="pacs.h"]; + BAP_H [label="bap.h"]; + BAP_PRESET_H [label="bap_lc3_preset.h"]; + } + } + + subgraph content_control_layer { + cluster=true; + label="Content Control"; + style=dashed; + + subgraph mcp_layer { + cluster=true; + label="MCP"; + style=solid; + MCS_H [label="mcs.h"]; + MCC_H [label="mcc.h"]; + MP_H [label="media_proxy.h"]; + } + + subgraph ccp_layer { + cluster=true; + label="CCP"; + style=solid; + TBS_H [label="tbs.h"]; + } + } + + subgraph rendering_and_capture_control_layer { + cluster=true; + label="Rendering and Capture Control"; + style=dashed; + + subgraph micp_layer { + cluster=true; + label="MICP"; + style=solid; + MICP_H [label="micp.h"]; + AICS_H [label="aics.h"]; + } + + subgraph vcp_layer { + cluster=true; + label="VCP"; + style=solid; + VCP_H [label="vcp.h"]; + VOCS_H [label="vocs.h"]; + AICS_H [label="aics.h"]; + } + } + } + + HAS_H -> CAP_H; + PBP_H -> CAP_H; + TMAP_H -> CAP_H; + GMAP_H -> CAP_H; + GMAP_PRESET_H -> CAP_H; + + CAP_H -> MCS_H; + CAP_H -> MCC_H; + CAP_H -> MP_H; + CAP_H -> TBS_H; + CAP_H -> BAP_H; + CAP_H -> BAP_PRESET_H; + CAP_H -> PACS_H; + CAP_H -> MICP_H; + CAP_H -> VCP_H; + + CSIP_H -> MCS_H; + CSIP_H -> MCC_H; + CSIP_H -> MP_H; + CSIP_H -> TBS_H; + CSIP_H -> BAP_H; + CSIP_H -> BAP_PRESET_H; + CSIP_H -> PACS_H; + CSIP_H -> MICP_H; + CSIP_H -> VCP_H; + } Bluetooth Audio Stack Status ============================ @@ -141,13 +431,15 @@ Bluetooth Audio Stack. | | | | | - BSIM test | | | | | | | - Sample Application | | +--------+-------------------------------+---------+------------------+-----------------------+--------------------------------------------------+ - | CAP | Acceptor | 1.0 | 3.2 | - Feature complete | - Sample Application | + | CAP | Acceptor | 1.0 | 3.2 | - Feature complete | | | | | | | - Shell Module | | | | | | | - BSIM test | | + | | | | | - Sample Application | | | +-------------------------------+---------+------------------+-----------------------+--------------------------------------------------+ - | | Initiator | 1.0 | 3.3 | - Feature complete | - Sample Application | + | | Initiator | 1.0 | 3.3 | - Feature complete | | | | | | | - Shell Module | | | | | | | - BSIM test | | + | | | | | - Sample Application | | | +-------------------------------+---------+------------------+-----------------------+--------------------------------------------------+ | | Commander | | | - WIP | - Feature complete | | | | | | | - Shell Module | diff --git a/doc/connectivity/bluetooth/api/audio/img/ble_audio_arch.svg b/doc/connectivity/bluetooth/api/audio/img/ble_audio_arch.svg deleted file mode 100644 index 21190a05353424..00000000000000 --- a/doc/connectivity/bluetooth/api/audio/img/ble_audio_arch.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - -
HCI Driver (USB, UART, SPI, virtual, etc)
HCI Driver (USB, UART, SPI, virtual, etc)
Low-level protocols (L2CAP, ATT, etc)
Low-level protocols (L2CAP, ATT, etc)
GATT
GATT
SMP
SMP
GAP
GAP
GAF
GAF
TMAP
TMAP
HAP
HAP
PBP
PBP
...
...
ISO
ISO
Text is not SVG - cannot display
\ No newline at end of file diff --git a/doc/connectivity/bluetooth/api/audio/img/gaf.svg b/doc/connectivity/bluetooth/api/audio/img/gaf.svg deleted file mode 100644 index 1cc2739b534291..00000000000000 --- a/doc/connectivity/bluetooth/api/audio/img/gaf.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - -
Generic Audio Framework
















Generic Audio Framework...
Stream Control
Stream Control
Rendering and Capture Control
Rendering and Capture Control
Content Control
Content Control
BAP



BAP...
PACS
PACS
ACSS
ACSS
BASS
BASS
MCP


 
MCP...
MCS
MCS
CCP


 
CCP...
TBS
TBS
CSIP


 
CSIP...
CSIS
CSIS
MICP


 
MICP...
MICS
MICS
VCP


 
VCP...
VCS
VCS
VOCS
VOCS
AICS
AICS
CAP


 
CAP...
CAS
CAS
TMAP


 
TMAP...
TMAS
TMAS
HAP


 
HAP...
HAS
HAS
BAS
BAS
IAS
IAS
AICS
AICS
PBP



PBP...
Transition and Coordination Control
Transition and Coordination Contr...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/doc/connectivity/bluetooth/api/audio/img/zephyr_gaf.svg b/doc/connectivity/bluetooth/api/audio/img/zephyr_gaf.svg deleted file mode 100644 index 9eea9a77e7b1e5..00000000000000 --- a/doc/connectivity/bluetooth/api/audio/img/zephyr_gaf.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - -
Generic Audio Framework

























Generic Audio Framework...
Content Control
Content Control
Stream Control
Stream Control
Rendering and Capture Control
Rendering and Capture Control
BAP



BAP...
bap.h
bap.h
MCP


 
MCP...
mcs.h
mcs.h
MICP


 
MICP...
mics.h
mics.h
VCP


 
VCP...
vcs.h
vcs.h
vocs.h
vocs.h
aics.h
aics.h
aics.h
aics.h
Transition and Coordination Control
Transition and Coordination Cont...
CAP
CAP
cap.h
cap.h
CSIP


 
CSIP...
csis.h
csis.h
CCP
CCP
tbs.h
tbs.h
audio.h
audio.h
Text is not SVG - cannot display
\ No newline at end of file diff --git a/doc/connectivity/networking/api/net_config.rst b/doc/connectivity/networking/api/net_config.rst index 85103ec11aebf5..9c6ea17b981130 100644 --- a/doc/connectivity/networking/api/net_config.rst +++ b/doc/connectivity/networking/api/net_config.rst @@ -50,6 +50,18 @@ setup the system: this option tells that the network application needs IPv6 router to exists before continuing. This means in practice that the application wants to wait until it receives IPv6 router advertisement message before continuing." + ":kconfig:option:`CONFIG_NET_CONFIG_MY_IPV6_ADDR`","Local static IPv6 address assigned to + the default network interface." + ":kconfig:option:`CONFIG_NET_CONFIG_PEER_IPV6_ADDR`","Peer static IPv6 address. This is mainly + useful in testing setups where the application can connect to a pre-defined host." + ":kconfig:option:`CONFIG_NET_CONFIG_MY_IPV4_ADDR`","Local static IPv4 address assigned to + the default network interface." + ":kconfig:option:`CONFIG_NET_CONFIG_MY_IPV4_NETMASK`","Static IPv4 netmask assigned to the IPv4 + address." + ":kconfig:option:`CONFIG_NET_CONFIG_MY_IPV4_GW`","Static IPv4 gateway address assigned to the + default network interface." + ":kconfig:option:`CONFIG_NET_CONFIG_PEER_IPV4_ADDR`","Peer static IPv4 address. This is mainly + useful in testing setups where the application can connect to a pre-defined host." Sample usage ************ diff --git a/doc/develop/modules.rst b/doc/develop/modules.rst index 0369a0e670c1fd..8188e12bc00a87 100644 --- a/doc/develop/modules.rst +++ b/doc/develop/modules.rst @@ -785,7 +785,7 @@ module ``bar`` to be present in the build system: name: foo build: depends: - - bar + - bar This example will ensure that ``bar`` is present when ``foo`` is included into the build system, and it will also ensure that ``bar`` is processed before diff --git a/doc/develop/test/twister.rst b/doc/develop/test/twister.rst index e6d347a90f6d82..a95a0b509dc6a0 100644 --- a/doc/develop/test/twister.rst +++ b/doc/develop/test/twister.rst @@ -615,8 +615,11 @@ harness_config: If the scope is set to ``function``, DUT is launched for every test case in python script. For ``session`` scope, DUT is launched only once. - robot_test_path: (default empty) - Specify a path to a file containing a Robot Framework test suite to be run. + robot_testsuite: (default empty) + Specify one or more paths to a file containing a Robot Framework test suite to be run. + + robot_option: (default empty) + One or more options to be send to robotframework. bsim_exe_name: If provided, the executable filename when copying to BabbleSim's bin @@ -673,7 +676,33 @@ harness_config: robot.example: harness: robot harness_config: - robot_test_path: [robot file path] + robot_testsuite: [robot file path] + + It can be more than one test suite using a list. + + .. code-block:: yaml + + tests: + robot.example: + harness: robot + harness_config: + robot_testsuite: + - [robot file path 1] + - [robot file path 2] + - [robot file path n] + + One or more options can be passed to robotframework. + + .. code-block:: yaml + + tests: + robot.example: + harness: robot + harness_config: + robot_testsuite: [robot file path] + robot_option: + - --exclude tag + - --stop-on-error filter: Filter whether the test scenario should be run by evaluating an expression diff --git a/doc/develop/west/basics.rst b/doc/develop/west/basics.rst index 2695a4f8036bfa..afedb33f5c8928 100644 --- a/doc/develop/west/basics.rst +++ b/doc/develop/west/basics.rst @@ -6,14 +6,20 @@ Basics This page introduces west's basic concepts and provides references to further reading. -West's built-in commands allow you to work with *projects* (Git -repositories) under a common *workspace* directory. +West's built-in commands allow you to work with :term:`projects ` +(Git repositories) under a common :term:`workspace ` directory. + +West works in the following manner: the ``west init`` command creates the +:term:`west workspace`, and clones the :term:`manifest repo `, while the ``west update`` command initially clones, and later updates, the +:term:`projects ` listed in the manifest in the workspace. Example workspace ***************** -If you've followed the upstream Zephyr getting started guide, your -workspace looks like this: +If you've followed the :ref:`getting_started`, your local +:term:`west workspace`, which in this case is the folder named +:file:`zephyrproject` as well as all its subfolders, looks like this: .. code-block:: none diff --git a/doc/glossary.rst b/doc/glossary.rst index e9e892320c44f9..7c643a9495e8fe 100644 --- a/doc/glossary.rst +++ b/doc/glossary.rst @@ -173,15 +173,30 @@ Glossary of Terms :term:`west manifest`. Its location is given by the :ref:`manifest.path configuration option `. See :ref:`west-basics`. + west project + Each of the entries in a :term:`west manifest`, which describe a Git + repository that will be cloned and managed by west when working with the + corresponding :term:`west manifest repository`. Note that a west project + is different from a :term:`zephyr module`, although many projects are also + modules. See :ref:`west-manifests-projects` for additional information. + west workspace - A directory on your system with a :file:`.west` subdirectory and - a :term:`west manifest repository`. You clone the Zephyr source - code onto your system by creating a west workspace using the - ``west init`` command. See :ref:`west-basics`. + A folder on your system with a :file:`.west` subdirectory and a + :term:`west manifest repository` in it. You clone the Zephyr source code, + as well as that of its :term:`west projects ` onto your + system by creating a west workspace using the ``west init`` command. See + :ref:`west-basics`. XIP (eXecute In Place) a method of executing programs directly from long term storage rather than copying it into RAM, saving writable memory for dynamic data and not the static program code. + zephyr module + A Git repository containing a :file:`zephyr/module.yml` file, used by the + Zephyr build system to integrate the source code and configuration files + of the module into a regular Zephyr build. Zephyr modules may be west + projects, but they do not have to. See :ref:`modules` for additional + details. + .. _System on a chip: https://en.wikipedia.org/wiki/System_on_a_chip diff --git a/doc/releases/migration-guide-3.7.rst b/doc/releases/migration-guide-3.7.rst index ae7575593321f3..6321d5fed3acc1 100644 --- a/doc/releases/migration-guide-3.7.rst +++ b/doc/releases/migration-guide-3.7.rst @@ -238,6 +238,27 @@ Device Drivers and Devicetree }; }; +* The driver for :dtcompatible:`invensense,icm42688` now correctly supports device + tree configuration(:github:`74267`). Prior devicetrees may have tried to use + the bindings to set sample rate and scale for the accel/gyro without any + effect. The devicetree usage should now use the provided defines and include + file along with new bindings which take these values. + + For example: + + .. code-block:: devicetree + + #include + + icm42688: icm42688@0 { + accel-pwr-mode = ; + accel-fs = ; + accel-odr = ; + gyro-pwr-mode= ; + gyro-fs = ; + gyro-odr = ; + }; + * `st,lis2mdl` property `spi-full-duplex` changed to `duplex = SPI_FULL_DUPLEX`. Full duplex is now the default. @@ -756,6 +777,22 @@ Bluetooth Host longer used in Zephyr 3.4.0 and later. Any references to this field should be removed. No further action is needed. +* :c:macro:`BT_LE_ADV_PARAM` now returns a :code:`const` pointer. + Any place where the result is stored in a local variable such as + :code:`struct bt_le_adv_param *param = BT_LE_ADV_CONN;` will need to + be updated to :code:`const struct bt_le_adv_param *param = BT_LE_ADV_CONN;` or use it for + initialization like :code:`struct bt_le_adv_param param = *BT_LE_ADV_CONN;` + + The change to :c:macro:`BT_LE_ADV_PARAM` also affects all of its derivatives, including but not + limited to: + + * :c:macro:`BT_LE_ADV_CONN` + * :c:macro:`BT_LE_ADV_NCONN` + * :c:macro:`BT_LE_EXT_ADV_SCAN` + * :c:macro:`BT_LE_EXT_ADV_CODED_NCONN_NAME` + + (:github:`75065`) + Bluetooth Crypto ================ diff --git a/doc/releases/release-notes-3.7.rst b/doc/releases/release-notes-3.7.rst index 97514eadf2e8b1..7646f82ec83f75 100644 --- a/doc/releases/release-notes-3.7.rst +++ b/doc/releases/release-notes-3.7.rst @@ -7,18 +7,69 @@ Zephyr 3.7.0 (Working Draft) We are pleased to announce the release of Zephyr version 3.7.0. +This release is the last non-maintenance 3.x release and, as such, will be the next +:ref:`Long Term Support (LTS) release `. + Major enhancements with this release include: -* A new, completely overhauled hardware model has been introduced. This changes - the way both SoCs and boards are named, defined and constructed in Zephyr. +* A new, completely overhauled hardware model has been introduced. This change the way both SoCs and + boards are named, defined and constructed in Zephyr. Additional information can be found in the :ref:`board_porting_guide`. -* Zephyr now requires Python 3.10 or higher +* A long-awaited HTTP server library, and associated service API, allow to easily implement HTTP/1.1 + and HTTP/2 servers in Zephyr. Resources can be registered statically or at runtime, and WebSocket + support is included. +* POSIX support has been extended, with all the Option Requirements of POSIX Subprofiling Option + Groups now being supported for PSE51, PSE52, and PSE53 profiles. +* Bluetooth Host has been extended with support for the Nordic UART Service (NUS), Hands-free Audio + Gateway (AG), Advanced Audio Distribution Profile (A2DP), and Audio/Video Distribution Transport + Protocol (AVDTP). +* Sensor abstraction model has been overhauled to adopt a read-then-decode approach that enables + more types of sensors and data flows than the previous fetch/get APIs. +* A new LLEXT Extension Development Kit (EDK) makes it easier to develop and integrate custom + extensions into Zephyr, including outside of the Zephyr tree. +* Native simulator now supports leveraging native host networking stack without having to rely on + complex setup of the host environment. * Trusted Firmware-M (TF-M) 2.1.0 and Mbed TLS 3.6.0 have been integrated into Zephyr. Both of these versions are LTS releases. +* New documentation pages have been introduced to help developers setup their local development + environment with Visual Studio Code and CLion. An overview of the changes required or recommended when migrating your application from Zephyr v3.6.0 to Zephyr v3.7.0 can be found in the separate :ref:`migration guide`. +While you may refer to release notes from previous 3.x releases for a full description, other major +enhancements and changes since previous LTS release, Zephyr 2.7.0, include: + +* Added support for Picolibc as the new default C library. +* Added support for the following types of hardware peripherals: + + * 1-Wire + * Battery Charger + * Cellular Modem + * Fuel Gauge + * GNSS + * Hardware Spinlock + * I3C + * RTC (Real Time Clock) + * SMBus + +* Added support for snippets. Snippets are common configuration settings that can be used across + platforms. +* Added support for Linkable Loadable Extensions (LLEXT). +* Summary of breaking changes (refer to release notes and migration guides from previous release + notes for more details): + + * All Zephyr public headers have been moved to :file:`include/zephyr`, meaning they need to be + prefixed with ```` when included. + * Pinmux API has been removed. Pin control needs to be used as its replacement, refer to + :ref:`pinctrl-guide` for more details. + + * The following deprecated or experimental features have been removed: + + * 6LoCAN + * civetweb module. See Zephyr 3.7's new HTTP server as a replacement. + * tinycbor module. You may use zcbor as a replacement. + The following sections provide detailed lists of changes by component. Security Vulnerability Related @@ -234,7 +285,8 @@ Boards & SoC Support * Added support for :ref:`Raspberry Pi 5 board `: ``rpi_5``. * Added support for :ref:`Seeed Studio XIAO RP2040 board `: ``xiao_rp2040``. * Added support for :ref:`Mikroe RA4M1 Clicker board `: ``mikroe_clicker_ra4m1``. - * Added support for :ref:`Arduino UNO R4 WiFi board `: : ``arduino_uno_r4_wifi``. + * Added support for :ref:`Arduino UNO R4 WiFi board `: ``arduino_uno_r4_wifi``. + * Added support for :ref:`Renesas EK-RA8M1 board `: ``ek_ra8m1``. * Added support for these Xtensa boards: @@ -281,6 +333,8 @@ Build system and Infrastructure * Fixed issue whereby files used in a project (e.g. devicetree overlays or Kconfig fragments) were not correctly watched and CMake would not reconfigure if they were changed. + * Added flash support for Intel Hex files for the LinkServer runner. + Drivers and Sensors ******************* @@ -395,6 +449,19 @@ Drivers and Sensors * Flash * Added support for Ambiq Apollo3 series. + * Added support for multiple instances of the SPI NOR driver (spi_nor.c). + * Added preliminary support for non-erase devices with introduction of + device capabilities to c:struct:`flash_parameters` and the utility function + c:func:`flash_params_get_erase_cap` that allows to obtain the erase type + provided by a device; added c:macro:`FLASH_ERASE_C_EXPLICIT`, which is + currently the only supported erase type and is set by all flash devices. + * Added the c:func:`flash_flatten` function that can be used on devices, + with or without erase requirement, when erase has been used not for preparing + a device for a random data write, but rather to remove/scramble data from + that device. + * Added the c:func:`flash_fill` utility function which allows to write + a single value across a provided range in a selected device. + * Added support for RRAM on nrf54l15 devices. * GNSS @@ -517,24 +584,39 @@ Drivers and Sensors * Wi-Fi - * Added support for configuring RTS threshold. With this, users can set the RTS threshold value or - disable the RTS mechanism. + * Fixed message parsing for esp-at. + * Fixed esp-at connect failures. + * Implement :c:func:`bind` and :c:func:`recvfrom` for UDP sockets for esp-at. + * Added option for setting maximum data size for eswifi. - * Added support for configuring AP parameters. With this, users can set AP parameters at - build and run time. +Networking +********** - * Added support to configure "max_inactivity" BSS parameter. Users can set this both build and runtime - duration to control the maximum time duration after which AP may disconnect a STA due to inactivity - from STA. +* ARP: - * Added support to configure "inactivity_poll" BSS parameter. Users can set build only AP parameter - to control whether AP may poll the STA before throwing away STA due to inactivity. + * Added support for gratuitous ARP transmission. + * Fixed a possible deadlock between TX and RX threads within ARP module. + * Fixed a possible ARP entry leak. + * Improved ARP debug logs. - * Added support to configure "max_num_sta" BSS parameter. Users can set this both build and run time - parameter to control the maximum number of STA entries. +* CoAP: -Networking -********** + * Fixed CoAP observe age overflows. + * Increased upper limit for CoAP retransmissions (:kconfig:option:`CONFIG_COAP_MAX_RETRANSMIT`). + * Fixed CoAP observations in CoAP client library. + * Added new CoAP client :c:func:`coap_client_cancel_requests` API which allows + to cancel active observations. + * Fixed CoAP ID generation for responses in CoAP Server sample. + +* Connection manager: + + * Added support for new net_mgmt events, which allow to track IPv4 and IPv6 + connectivity independently: + + * :c:macro:`NET_EVENT_L4_IPV4_CONNECTED` + * :c:macro:`NET_EVENT_L4_IPV4_DISCONNECTED` + * :c:macro:`NET_EVENT_L4_IPV6_CONNECTED` + * :c:macro:`NET_EVENT_L4_IPV6_DISCONNECTED` * DHCPv4: @@ -542,36 +624,254 @@ Networking :kconfig:option:`CONFIG_NET_DHCPV4_OPTION_CALLBACKS_VENDOR_SPECIFIC` callbacks can be registered with :c:func:`net_dhcpv4_add_option_vendor_callback` to handle these options after being initialised with :c:func:`net_dhcpv4_init_option_vendor_callback`. - * Added support for the "Vendor class identifier" option. Use the :kconfig:option:`CONFIG_NET_DHCPV4_VENDOR_CLASS_IDENTIFIER` to enable it and :kconfig:option:`CONFIG_NET_DHCPV4_VENDOR_CLASS_IDENTIFIER_STRING` to set it. - * The NTP server from the DHCPv4 option can now be used to set the system time. This is done by default, if :kconfig:option:`CONFIG_NET_CONFIG_CLOCK_SNTP_INIT` is enabled. + * The syslog server address can now be set with DHCPv4 option. This is done by + default, if :kconfig:option:`CONFIG_LOG_BACKEND_NET_USE_DHCPV4_OPTION` is enabled. + * Fixed a bug, where options with registered callbacks were not requested from + the server. + * Fixed a bug, where netmask received from the server was not applied correctly. + * Reimplemented DHCPv4 client RENEW/REBIND logic to be compliant with RFC2131. + * Improved declined addresses management in DHCPv4 server, which now can be + reused after configured time. + * Fixed including the client ID option in the DHCPv4 server response, according to RFC6842. + * Added :kconfig:option:`CONFIG_NET_DHCPV4_SERVER_NAK_UNRECOGNIZED_REQUESTS` which + allows to override RFC-defined behavior, and NAK requests from unrecognized + clients. + * Other minor fixes in DHCPv4 client and server implementations. + +* DHCPv6: + + * Fixed incorrect DHCPv6 events code base for net_mgmt events. + * Added :kconfig:option:`CONFIG_NET_DHCPV6_DUID_MAX_LEN` which allows to configure + maximum supported DUID length. + * Added documentation page for DHCPv6. + +* DNS/mDNS/LLMNR: -* LwM2M: + * Fixed an issue where the mDNS Responder did not work when the mDNS Resolver was also enabled. + The mDNS Resolver and mDNS Responder can now be used simultaneously. + * Reworked LLMNR and mDNS responders, and DNS resolver to use sockets and socket services API. + * Added ANY query resource type. + * Added support for mDNS to provide records in runtime. + * Added support for caching DNS records. + * Fixed error codes returned when socket creation fails, and when all results have been returned. + * Fixed DNS retransmission timeout calculation. - * Added new API function: +* gPTP/PTP: - * :c:func:`lwm2m_set_bulk` + * Added support for IEEE 1588-2019 PTP. + * Added support for SO_TIMESTAMPING socket option to get timestamping information in socket + ancillary data. + * Fixed race condition on timestamp callback. + * Fixed clock master sync send SM if we are not the GM clock. - * Added new ``offset`` parameter to :c:type:`lwm2m_engine_set_data_cb_t` callback type. - This affects post write and validate callbacks as well as some firmware callbacks. +* HTTP: + + * Added HTTP/2 server library and sample application with support for static, + dynamic and Websocket resource types. + * Added HTTP shell component. + * Improved HTTP client error reporting. + * Moved HTTP client library out of experimental. * IPSP: * Removed IPSP support. ``CONFIG_NET_L2_BT`` does not exist anymore. +* IPv4: + + * Implemented IPv4 Address Conflict Detection, according to RFC 5227. + * Added :c:func:`net_ipv4_is_private_addr` API function. + * IPv4 netmask is now set individually for each address instead of being set + for the whole interface. + * Other minor fixes and improvements. + +* IPv6: + + * Implemented IPv6 Privacy Extensions according to RFC 8981. + * Added :c:func:`net_ipv6_is_private_addr` API function. + * Implemented reachability hint for IPv6. Upper layers can use + c:func:`net_if_nbr_reachability_hint` to report Neigbor reachability and + avoid unnecessary Neighbor Discovery solicitations. + * Added :kconfig:option:`CONFIG_NET_IPV6_MTU` allowing to set custom IPv6 MTU. + * Added :kconfig:option:`CONFIG_NET_MCAST_ROUTE_MAX_IFACES` which allows to set + multiple interfaces for multicast forwarding entries. + * Added :kconfig:option:`CONFIG_NET_MCAST_ROUTE_MLD_REPORTS` which allows to + report multicast routes in MLDv2 reports. + * Fixed IPv6 hop limit handling for multicast packets. + * Improved IPv6 Neighbor Discovery test coverage. + * Fixed a bug, where Neighbor Advertisement packets reporting Duplicate address + detection conflict were dropped. + * Other minor fixes and improvements. + +* LwM2M: + + * Added new API functions: + + * :c:func:`lwm2m_set_bulk` + * :c:func:`lwm2m_rd_client_set_ctx` + + * Added new ``offset`` parameter to :c:type:`lwm2m_engine_set_data_cb_t` callback type. + This affects post write and validate callbacks as well as some firmware callbacks. + * Fixed block context not being reset upon receiving block number 0 in block transfer. + * Fixed block size negotiation with the server in block transfer. + * Added :kconfig:option:`CONFIG_LWM2M_ENGINE_ALWAYS_REPORT_OBJ_VERSION` which + allows to force the client to always report object version. + * Block transfer is now possible with resource w/o registered callback. + * Fixed a bug, where an empty ACK sent from the registered callback would not + be sent immediately. + * Removed deprecated API functions and definitions. + * Other minor fixes and improvements. + +* Misc: + + * Improved overall networking API doxygen documentation. + * Converted TFTP library to use ``zsock_*`` API. + * Added SNTP :c:func:`sntp_simple_addr` API function to perform SNTP query + when the server IP address is already known. + * Added :kconfig:option:`CONFIG_NET_TC_THREAD_PRIO_CUSTOM` allowing to override + default traffic class threads priority. + * Fixed the IPv6 event handler initialization order in net config library. + * Reworked telnet shell backend to use sockets and socket services API. + * Fixed double dereference of IGMP packets. + * Moved from ``native_posix`` to ``native_sim`` support in various tests and + samples. + * Added support for copying user data in network buffers. + * Fixed cloning of zero sized network buffers. + * Added net_buf APIs to handle 40 bit data format. + * Added receive callback for dummy L2, applicable in certain use cases + (for example packet capture). + * Implemented pseudo interface, a.k.a "any" interface for packet capture use + case. + * Added cooded mode capture support. This allows non-IP based network data capture. + * Generate network events when starting or stopping packet capture. + * Removed obsolete and unused ``tcp_first_msg`` :c:struct:`net_pkt` flag. + * Added new :zephyr:code-sample:`secure-mqtt-sensor-actuator` sample. + * Added support for partial L3 and L4 checksum offloading. + * Updated :zephyr:code-sample:`mqtt-azure` with new CA certificates, the current + on expires soon. + * Added new driver for Native Simulator offloaded sockets. + * Overhauled VLAN support to use Virtual network interfaces. + * Added statistics collection for Virtual network interfaces. + +* MQTT: + + * Added ALPN support for MQTT TLS backend. + * Added user data field in :c:struct:`mqtt_client` context structure. + +* Network Interface: + + * Added new API functions: + + * :c:func:`net_if_ipv4_maddr_foreach` + * :c:func:`net_if_ipv6_maddr_foreach` + + * Improved debug logging in the network interface code. + * Added reference counter to the :c:struct:`net_if_addr` structure. + * Fixed IPv6 DAD and MLDv2 operation when interface goes up. + * Other minor fixes. + +* OpenThread + + * Removed deprecated ``openthread_set_state_changed_cb()`` function. + * Added implementation of BLE TCAT advertisement API. + +* PPP + + * Removed deprecated ``gsm_modem`` driver and sample. + * Optimized memory allocation in PPP driver. + * Misc improvements in the :zephyr:code-sample:`cellular-modem` sample + * Added PPP low level packet capture support. + +* Shell: + + * Added ``net ipv4 gateway`` command to set IPv4 gateway address. + * Added argument validation in network shell macros. + * Fixed net_mgmt sockets information printout. + * Reworked VLAN information printout. + * Added option to set random MAC address with ``net iface set_mac`` command. + * Added multicast join status when printing multicast address information. + +* Sockets: + + * Implemented new networking POSIX APIs: + + * :c:func:`if_nameindex` + * :c:func:`inet_ntoa` + * :c:func:`inet_addr` + + * Added support for tracing socket API calls. + * TLS sockets are no longer experimental API. + * Fixed the protocol field endianness for ``AF_PACKET`` type sockets. + * Fixed :c:func:`getsockname` for TCP. + * Improve :c:func:`sendmsg` support when using DTLS sockets. + +* Syslog: + + * Added new API functions: + + * :c:func:`log_backend_net_set_ip` to initialize syslog net backend with IP + address directly. + * :c:func:`log_backend_net_start` to facilitate syslog net backend activation. + + * Added structured logging support to syslog net backend. + * Added TCP support to syslog net backend. + * TCP: + * Fixed possible deadlock when accepting new TCP connection. + * Fixed ACK number verification during connection teardown. + * Fixed a bug, where data bytes included in FIN packet were ignored. + * Fixed a possible TCP context leak in case initial SYN packet transmission failed. + * Deprecated :kconfig:option:`CONFIG_NET_TCP_ACK_TIMEOUT` as it was redundant with other configs. + * Improved debug logs, so that they're easier to follow under heavy load. * ISN generation now uses SHA-256 instead of MD5. Moreover it now relies on PSA APIs instead of legacy Mbed TLS functions for hash computation. -* mDNS: +* Websocket: - * Fixed an issue where the mDNS Responder did not work when the mDNS Resolver was also enabled. - The mDNS Resolver and mDNS Responder can now be used simultaneously. + * Added new Websocket APIs: + + * :c:func:`websocket_register` + * :c:func:`websocket_unregister` + + * Converted Websocket library to use ``zsock_*`` API. + * Added Object Core support to Websocket sockets. + +* Wi-Fi: + + * Reduce memory usage of 5 GHz channel list. + * Added channel validity check in AP mode. + * Added support for BSSID configuration in connect call. + * Wifi shell help text fixes. Option parsing fixes. + * Support WPA auto personal security mode. + * Collect unicast received/sent network packet statistics. + * Added support for configuring RTS threshold. With this, users can set the RTS threshold + value or disable the RTS mechanism. + * Added support for configuring AP parameters. With this, users can set AP parameters at + build and run time. + * Added support to configure ``max_inactivity`` BSS parameter. Users can set this both + build and runtime duration to control the maximum time duration after which AP may + disconnect a STA due to inactivity from STA. + * Added support to configure ``inactivity_poll`` BSS parameter. Users can set build + only AP parameter to control whether AP may poll the STA before throwing away STA + due to inactivity. + * Added support to configure ``max_num_sta`` BSS parameter. Users can set this both + build and run time parameter to control the maximum number of STA entries. + +* zperf: + + * Fixed ``IP_TOS`` and ``IPV6_TCLASS`` options handling in zperf. + * Fixed throughput calculation during long zperf sessions. + * Fixed error on TCP upload session end in case multicast IP address was used. + * Fixed a bug, where IPv6 socket was bound with IPv4 address, giving error. + * Added an option to specify the network interface to use during zperf sessions. + * Added a new ``ZPERF_SESSION_PERIODIC_RESULT`` event for periodic updates + during TCP upload sessions. + * Fixed possible socket leak in case of errors during zperf session. USB *** @@ -653,6 +953,11 @@ Libraries / Subsystems for the Mbed TLS's p256-m driver PSA crypto library. This is a Cortex-M SW optimized implementation of secp256r1 curve. +* CMSIS-NN + + * CMSIS-NN was updated to v6.0.0 from v4.1.0: + https://arm-software.github.io/CMSIS-NN/latest/rev_hist.html + * Random * Besides the existing :c:func:`sys_rand32_get` function, :c:func:`sys_rand8_get`, @@ -688,6 +993,16 @@ Libraries / Subsystems * FS: It is now possible to truncate a file while opening using :c:func:`fs_open` and by passing ``FS_O_TRUNC`` flag. + * Flash Map: TinyCrypt has been replaced with PSA Crypto in Flash Area integrity check. + + * Flash Map: :c:func:`flash_area_flatten` has been added to be used where an erase + operation has been previously used for removing/scrambling data rather than + to prepare a device for a random data write. + + * Flash Map: :c:macro:`FIXED_PARTITION_NODE_OFFSET`, :c:macro:`FIXED_PARTITION_NODE_SIZE` + and :c:macro:`FIXED_PARTITION_NODE_DEVICE` have been added to allow obtaining + fixed partition information from a devicetree node rather than a label. + * POSIX API * LoRa/LoRaWAN diff --git a/doc/services/portability/posix/aep/index.rst b/doc/services/portability/posix/aep/index.rst index 651bc43b0cf52f..aeb591f2ab0a48 100644 --- a/doc/services/portability/posix/aep/index.rst +++ b/doc/services/portability/posix/aep/index.rst @@ -50,8 +50,8 @@ The *Minimal Realtime System Profile* (PSE51) includes all of the :ref:`POSIX_C_LANG_JUMP `, yes, :ref:`POSIX_C_LANG_SUPPORT `, yes, - :ref:`POSIX_DEVICE_IO `,yes, :kconfig:option:`CONFIG_POSIX_DEVICE_IO` - :ref:`POSIX_SIGNALS `, yes, :kconfig:option:`CONFIG_POSIX_SIGNALS` :ref:`†` + :ref:`POSIX_DEVICE_IO `,, :kconfig:option:`CONFIG_POSIX_DEVICE_IO` + :ref:`POSIX_SIGNALS `,, :kconfig:option:`CONFIG_POSIX_SIGNALS` :ref:`POSIX_SINGLE_PROCESS `, yes, :kconfig:option:`CONFIG_POSIX_SINGLE_PROCESS` :ref:`XSI_THREADS_EXT `, yes, :kconfig:option:`CONFIG_XSI_THREADS_EXT` @@ -101,7 +101,7 @@ The *Realtime Controller System Profile* (PSE52) includes all features from PSE5 :widths: 50, 10, 50 :ref:`POSIX_C_LANG_MATH `, yes, - :ref:`POSIX_FD_MGMT `, yes, :kconfig:option:`CONFIG_POSIX_FD_MGMT` + :ref:`POSIX_FD_MGMT `,, :kconfig:option:`CONFIG_POSIX_FD_MGMT` :ref:`POSIX_FILE_SYSTEM `,, :kconfig:option:`CONFIG_POSIX_FILE_SYSTEM` .. csv-table:: PSE52 Option Requirements diff --git a/doc/services/portability/posix/option_groups/index.rst b/doc/services/portability/posix/option_groups/index.rst index 08a4b3e68fcad4..e67523ae3d7c5c 100644 --- a/doc/services/portability/posix/option_groups/index.rst +++ b/doc/services/portability/posix/option_groups/index.rst @@ -244,34 +244,26 @@ POSIX_SIGNALS Signal services are a basic mechanism within POSIX-based systems and are required for error and event handling. -.. note:: - As processes are not yet supported in Zephyr, the ISO C functions ``abort()``, ``signal()``, - and ``raise()``, as well as the other POSIX functions listed below, may exhibit undefined - behaviour. The POSIX functions ``kill()``, ``pause()``, ``sigaction()``, ``sigpending()``, - ``sigsuspend()``, and ``sigwait()`` are implemented to ensure that conformant applications can - link, but they are expected to fail, setting errno to ``ENOSYS`` - :ref:`†`. - .. csv-table:: POSIX_SIGNALS :header: API, Supported :widths: 50,10 - abort(),yes :ref:`†` - alarm(),yes :ref:`†` - kill(),yes :ref:`†` - pause(),yes :ref:`†` - raise(),yes :ref:`†` - sigaction(),yes :ref:`†` + abort(),yes + alarm(), + kill(), + pause(), + raise(), + sigaction(), sigaddset(),yes sigdelset(),yes sigemptyset(),yes sigfillset(),yes sigismember(),yes - signal(),yes :ref:`†` - sigpending(),yes :ref:`†` + signal(), + sigpending(), sigprocmask(),yes - sigsuspend(),yes :ref:`†` - sigwait(),yes :ref:`†` + sigsuspend(), + sigwait(), strsignal(),yes .. _posix_option_group_device_io: @@ -279,10 +271,6 @@ required for error and event handling. POSIX_DEVICE_IO =============== -.. note:: - When using Newlib, Picolibc, or other C libraries conforming to the ISO C Standard, the - C89 components of the ``POSIX_DEVICE_IO`` Option Group are considered supported. - .. csv-table:: POSIX_DEVICE_IO :header: API, Supported :widths: 50,10 @@ -293,48 +281,48 @@ POSIX_DEVICE_IO FD_ZERO(),yes clearerr(),yes close(),yes - fclose(),yes - fdopen(), yes - feof(),yes - ferror(),yes - fflush(),yes - fgetc(),yes - fgets(),yes - fileno(), yes - fopen(),yes + fclose(), + fdopen(), + feof(), + ferror(), + fflush(), + fgetc(), + fgets(), + fileno(), + fopen(), fprintf(),yes fputc(),yes fputs(),yes - fread(),yes - freopen(),yes - fscanf(),yes + fread(), + freopen(), + fscanf(), fwrite(),yes - getc(),yes - getchar(),yes - gets(),yes + getc(), + getchar(), + gets(), open(),yes perror(),yes poll(),yes printf(),yes - pread(),yes - pselect(),yes + pread(), + pselect(), putc(),yes putchar(),yes puts(),yes - pwrite(),yes + pwrite(), read(),yes - scanf(),yes + scanf(), select(),yes - setbuf(),yes - setvbuf(),yes - stderr,yes - stdin,yes - stdout,yes - ungetc(),yes + setbuf(), + setvbuf(), + stderr, + stdin, + stdout, + ungetc(), vfprintf(),yes - vfscanf(),yes + vfscanf(), vprintf(),yes - vscanf(),yes + vscanf(), write(),yes .. _posix_option_group_barriers: @@ -546,26 +534,24 @@ POSIX_TIMERS POSIX_FD_MGMT ============= -.. note:: - When using Newlib, Picolibc, or other C libraries conforming to the ISO C Standard, the - C89 components of the ``POSIX_FD_MGMT`` Option Group are considered supported. +This table lists service support status in Zephyr for `POSIX_FD_MGMT`: .. csv-table:: POSIX_FD_MGMT :header: API, Supported :widths: 50,10 - dup(), yes - dup2(), yes - fcntl(), yes - fgetpos(), yes - fseek(), yes - fseeko(), yes - fsetpos(), yes - ftell(), yes - ftello(), yes - ftruncate(), yes - lseek(), yes - rewind(), yes + dup(), + dup2(), + fcntl(), + fgetpos(), + fseek(), + fseeko(), + fsetpos(), + ftell(), + ftello(), + ftruncate(),yes + lseek(), + rewind(), .. _posix_option_group_file_locking: diff --git a/doc/zephyr.doxyfile.in b/doc/zephyr.doxyfile.in index 268f2337802a2b..df01f7954c79ae 100644 --- a/doc/zephyr.doxyfile.in +++ b/doc/zephyr.doxyfile.in @@ -2816,3 +2816,5 @@ GENERATE_LEGEND = YES # The default value is: YES. DOT_CLEANUP = YES + +@INCLUDE_CUSTOM_FILE@ diff --git a/drivers/adc/adc_lmp90xxx.c b/drivers/adc/adc_lmp90xxx.c index d47789333c41a0..f71d6f4fa3879c 100644 --- a/drivers/adc/adc_lmp90xxx.c +++ b/drivers/adc/adc_lmp90xxx.c @@ -639,7 +639,7 @@ static int lmp90xxx_adc_read_channel(const struct device *dev, if (buf[3] != crc) { LOG_ERR("CRC mismatch (0x%02x vs. 0x%02x)", buf[3], crc); - return err; + return -EIO; } } diff --git a/drivers/adc/adc_stm32.c b/drivers/adc/adc_stm32.c index 3e5c67ad4586db..b670b5506e397f 100644 --- a/drivers/adc/adc_stm32.c +++ b/drivers/adc/adc_stm32.c @@ -22,6 +22,7 @@ #include #include #include +#include #if defined(CONFIG_SOC_SERIES_STM32U5X) #include #endif /* CONFIG_SOC_SERIES_STM32U5X */ @@ -535,6 +536,24 @@ static void adc_stm32_calibration_start(const struct device *dev) defined(CONFIG_SOC_SERIES_STM32WBAX) LL_ADC_StartCalibration(adc); #elif defined(CONFIG_SOC_SERIES_STM32U5X) + if (adc != ADC4) { + uint32_t dev_id = LL_DBGMCU_GetDeviceID(); + uint32_t rev_id = LL_DBGMCU_GetRevisionID(); + + /* Some U5 implement an extended calibration to enhance ADC performance. + * It is not available for ADC4. + * It is available on all U5 except U575/585 (dev ID 482) revision X (rev ID 2001). + * The code below applies the procedure described in RM0456 in the ADC chapter: + * "Extended calibration mode" + */ + if ((dev_id != 0x482UL) && (rev_id != 0x2001UL)) { + adc_stm32_enable(adc); + MODIFY_REG(adc->CR, ADC_CR_CALINDEX, 0x9UL << ADC_CR_CALINDEX_Pos); + MODIFY_REG(adc->CALFACT2, 0xFFFFFF00UL, 0x03021100UL); + SET_BIT(adc->CALFACT, ADC_CALFACT_LATCH_COEF); + adc_stm32_disable(adc); + } + } LL_ADC_StartCalibration(adc, LL_ADC_CALIB_OFFSET); #elif defined(CONFIG_SOC_SERIES_STM32H7X) LL_ADC_StartCalibration(adc, LL_ADC_CALIB_OFFSET, LL_ADC_SINGLE_ENDED); @@ -1446,7 +1465,28 @@ static int adc_stm32_init(const struct device *dev) !DT_HAS_COMPAT_STATUS_OKAY(st_stm32f1_adc) && \ !DT_HAS_COMPAT_STATUS_OKAY(st_stm32f4_adc) LL_ADC_EnableInternalRegulator(adc); + /* Wait for Internal regulator stabilisation + * Some series have a dedicated status bit, others relie on a delay + */ +#if defined(CONFIG_SOC_SERIES_STM32H7X) && defined(ADC_VER_V5_V90) + /* ADC3 on H72x/H73x doesn't have the LDORDY status bit */ + if (adc == ADC3) { + k_busy_wait(LL_ADC_DELAY_INTERNAL_REGUL_STAB_US); + } else { + while (LL_ADC_IsActiveFlag_LDORDY(adc) == 0) { + } + } +#elif defined(CONFIG_SOC_SERIES_STM32H7X) || \ + defined(CONFIG_SOC_SERIES_STM32U5X) || \ + defined(CONFIG_SOC_SERIES_STM32WBAX) + /* Don't use LL_ADC_IsActiveFlag_LDORDY since not present in U5 LL (1.5.0) + * (internal issue 185106) + */ + while ((READ_BIT(adc->ISR, LL_ADC_FLAG_LDORDY) != (LL_ADC_FLAG_LDORDY))) { + } +#else k_busy_wait(LL_ADC_DELAY_INTERNAL_REGUL_STAB_US); +#endif #endif if (config->irq_cfg_func) { diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index 5e2a4f5ae2b7c6..e6adca872e54b2 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -71,6 +71,7 @@ config BT_STM32WBA default y depends on DT_HAS_ST_HCI_STM32WBA_ENABLED select HAS_STM32LIB + select BT_HCI_SET_PUBLIC_ADDR help ST STM32WBA HCI Bluetooth interface diff --git a/drivers/bluetooth/hci/hci_stm32wba.c b/drivers/bluetooth/hci/hci_stm32wba.c index 34e2385b2414d7..490f2b7258b552 100644 --- a/drivers/bluetooth/hci/hci_stm32wba.c +++ b/drivers/bluetooth/hci/hci_stm32wba.c @@ -52,6 +52,20 @@ static K_SEM_DEFINE(hci_sem, 1, 1); #define DIVC(x, y) (((x)+(y)-1)/(y)) +#if defined(CONFIG_BT_HCI_SETUP) +/* Bluetooth LE public STM32WBA default device address (if udn not available) */ +static bt_addr_t bd_addr_dflt = {{0x65, 0x43, 0x21, 0x1E, 0x08, 0x00}}; + +#define ACI_HAL_WRITE_CONFIG_DATA BT_OP(BT_OGF_VS, 0xFC0C) +#define HCI_CONFIG_DATA_PUBADDR_OFFSET 0 +static bt_addr_t bd_addr_udn; +struct aci_set_ble_addr { + uint8_t config_offset; + uint8_t length; + uint8_t value[6]; +} __packed; +#endif + static uint32_t __noinit buffer[DIVC(BLE_DYN_ALLOC_SIZE, 4)]; static uint32_t __noinit gatt_buffer[DIVC(BLE_GATT_BUF_SIZE, 4)]; @@ -380,7 +394,90 @@ static int bt_hci_stm32wba_open(const struct device *dev, bt_hci_recv_t recv) return ret; } +#if defined(CONFIG_BT_HCI_SETUP) + +bt_addr_t *bt_get_ble_addr(void) +{ + bt_addr_t *bd_addr; + uint32_t udn; + uint32_t company_id; + uint32_t device_id; + + /* Get the 64 bit Unique Device Number UID */ + /* The UID is used by firmware to derive */ + /* 48-bit Device Address EUI-48 */ + udn = LL_FLASH_GetUDN(); + + if (udn != 0xFFFFFFFF) { + /* Get the ST Company ID */ + company_id = LL_FLASH_GetSTCompanyID(); + /* Get the STM32 Device ID */ + device_id = LL_FLASH_GetDeviceID(); + + /* + * Public Address with the ST company ID + * bit[47:24] : 24bits (OUI) equal to the company ID + * bit[23:16] : Device ID. + * bit[15:0] : The last 16bits from the UDN + * Note: In order to use the Public Address in a final product, a dedicated + * 24bits company ID (OUI) shall be bought. + */ + + bd_addr_udn.val[0] = (uint8_t)(udn & 0x000000FF); + bd_addr_udn.val[1] = (uint8_t)((udn & 0x0000FF00) >> 8); + bd_addr_udn.val[2] = (uint8_t)device_id; + bd_addr_udn.val[3] = (uint8_t)(company_id & 0x000000FF); + bd_addr_udn.val[4] = (uint8_t)((company_id & 0x0000FF00) >> 8); + bd_addr_udn.val[5] = (uint8_t)((company_id & 0x00FF0000) >> 16); + bd_addr = &bd_addr_udn; + } else { + bd_addr = &bd_addr_dflt; + } + + return bd_addr; +} + +static int bt_hci_stm32wba_setup(const struct device *dev, + const struct bt_hci_setup_params *params) +{ + bt_addr_t *uid_addr; + struct aci_set_ble_addr *param; + struct net_buf *buf; + int err; + + uid_addr = bt_get_ble_addr(); + if (!uid_addr) { + return -ENOMSG; + } + + buf = bt_hci_cmd_create(ACI_HAL_WRITE_CONFIG_DATA, sizeof(*param)); + if (!buf) { + return -ENOBUFS; + } + + param = net_buf_add(buf, sizeof(*param)); + param->config_offset = HCI_CONFIG_DATA_PUBADDR_OFFSET; + param->length = 6; + + if (bt_addr_eq(¶ms->public_addr, BT_ADDR_ANY)) { + bt_addr_copy((bt_addr_t *)param->value, uid_addr); + } else { + bt_addr_copy((bt_addr_t *)param->value, &(params->public_addr)); + } + + err = bt_hci_cmd_send_sync(ACI_HAL_WRITE_CONFIG_DATA, buf, NULL); + if (err) { + return err; + } + + return 0; +} +#endif /* CONFIG_BT_HCI_SETUP */ + static const struct bt_hci_driver_api drv = { +#if defined(CONFIG_BT_HCI_SETUP) + .setup = bt_hci_stm32wba_setup, +#endif .open = bt_hci_stm32wba_open, .send = bt_hci_stm32wba_send, }; diff --git a/drivers/cache/cache_andes.c b/drivers/cache/cache_andes.c index e9907cfaa462ec..8008013a86d60e 100644 --- a/drivers/cache/cache_andes.c +++ b/drivers/cache/cache_andes.c @@ -467,19 +467,19 @@ int cache_instr_flush_and_invd_range(void *addr, size_t size) return -ENOTSUP; } -#if IS_ENABLED(CONFIG_DCACHE_LINE_SIZE_DETECT) +#if defined(CONFIG_DCACHE_LINE_SIZE_DETECT) size_t cache_data_line_size_get(void) { return cache_cfg.data_line_size; } -#endif /* IS_ENABLED(CONFIG_DCACHE_LINE_SIZE_DETECT) */ +#endif /* defined(CONFIG_DCACHE_LINE_SIZE_DETECT) */ -#if IS_ENABLED(CONFIG_ICACHE_LINE_SIZE_DETECT) +#if defined(CONFIG_ICACHE_LINE_SIZE_DETECT) size_t cache_instr_line_size_get(void) { return cache_cfg.instr_line_size; } -#endif /* IS_ENABLED(CONFIG_ICACHE_LINE_SIZE_DETECT) */ +#endif /* defined(CONFIG_ICACHE_LINE_SIZE_DETECT) */ static int andes_cache_init(void) { @@ -492,7 +492,7 @@ static int andes_cache_init(void) LOG_ERR("Platform doesn't support I-cache, " "please disable CONFIG_ICACHE"); } -#if IS_ENABLED(CONFIG_ICACHE_LINE_SIZE_DETECT) +#if defined(CONFIG_ICACHE_LINE_SIZE_DETECT) /* Icache line size */ if (line_size <= 5) { cache_cfg.instr_line_size = 1 << (line_size + 2); @@ -507,7 +507,7 @@ static int andes_cache_init(void) #else LOG_ERR("Please specific the i-cache-line-size " "CPU0 property of the DT"); -#endif /* IS_ENABLED(CONFIG_ICACHE_LINE_SIZE_DETECT) */ +#endif /* defined(CONFIG_ICACHE_LINE_SIZE_DETECT) */ } if (IS_ENABLED(CONFIG_DCACHE)) { @@ -516,7 +516,7 @@ static int andes_cache_init(void) LOG_ERR("Platform doesn't support D-cache, " "please disable CONFIG_DCACHE"); } -#if IS_ENABLED(CONFIG_DCACHE_LINE_SIZE_DETECT) +#if defined(CONFIG_DCACHE_LINE_SIZE_DETECT) /* Dcache line size */ if (line_size <= 5) { cache_cfg.data_line_size = 1 << (line_size + 2); @@ -531,7 +531,7 @@ static int andes_cache_init(void) #else LOG_ERR("Please specific the d-cache-line-size " "CPU0 property of the DT"); -#endif /* IS_ENABLED(CONFIG_DCACHE_LINE_SIZE_DETECT) */ +#endif /* defined(CONFIG_DCACHE_LINE_SIZE_DETECT) */ } if (!(csr_read(NDS_MMSC_CFG) & MMSC_CFG_CCTLCSR)) { diff --git a/drivers/cache/cache_andes_l2.h b/drivers/cache/cache_andes_l2.h index d6de7551821807..962bf837fd8c62 100644 --- a/drivers/cache/cache_andes_l2.h +++ b/drivers/cache/cache_andes_l2.h @@ -208,7 +208,7 @@ static ALWAYS_INLINE int nds_l2_cache_init(void) { unsigned long line_size; -#if IS_ENABLED(CONFIG_SYSCON) +#if defined(CONFIG_SYSCON) #if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(syscon), andestech_atcsmu100, okay) uint32_t system_cfg; const struct device *syscon_dev = DEVICE_DT_GET(DT_NODELABEL(syscon)); @@ -228,7 +228,7 @@ static ALWAYS_INLINE int nds_l2_cache_init(void) return 0; } #endif /* andestech_atcsmu100 dts node status okay */ -#endif /* IS_ENABLED(CONFIG_SYSCON) */ +#endif /* defined(CONFIG_SYSCON) */ uint32_t l2c_ctrl; diff --git a/drivers/can/can_nxp_s32_canxl.c b/drivers/can/can_nxp_s32_canxl.c index 010f291ce160b8..d3e7f5568233ef 100644 --- a/drivers/can/can_nxp_s32_canxl.c +++ b/drivers/can/can_nxp_s32_canxl.c @@ -65,6 +65,7 @@ struct can_nxp_s32_config { CANXL_RXFIFO_Type * base_rx_fifo; CANXL_RXFIFO_CONTROL_Type *base_rx_fifo_ctrl; #endif + CANXL_MRU_Type * base_mru; uint8 instance; const struct device *clock_dev; clock_control_subsys_t clock_subsys; @@ -1003,11 +1004,16 @@ static int can_nxp_s32_init(const struct device *dev) return 0; } -static void can_nxp_s32_isr_rx_tx(const struct device *dev) +static void can_nxp_s32_isr_rx_tx_mru(const struct device *dev) { const struct can_nxp_s32_config *config = dev->config; Canexcel_Ip_RxTxIRQHandler(config->instance); + + if ((config->base_mru->CHXCONFIG[0u].CH_CFG0 & CANXL_MRU_CH_CFG0_CHE_MASK) + == CANXL_MRU_CH_CFG0_CHE_MASK) { + Canexcel_Ip_MruIRQHandler(config->instance); + } } static void can_nxp_s32_isr_error(const struct device *dev) @@ -1164,6 +1170,7 @@ static const struct can_driver_api can_nxp_s32_driver_api = { DT_INST_REG_ADDR_BY_NAME(n, rx_fifo), \ .base_rx_fifo_ctrl = (CANXL_RXFIFO_CONTROL_Type *) \ DT_INST_REG_ADDR_BY_NAME(n, rx_fifo_ctrl),)) \ + .base_mru = (CANXL_MRU_Type *)DT_INST_REG_ADDR_BY_NAME(n, mru), \ .instance = CAN_NXP_S32_HW_INSTANCE(n), \ .clock_dev = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR(n)), \ .clock_subsys = (clock_control_subsys_t) \ diff --git a/drivers/can/can_sam.c b/drivers/can/can_sam.c index a77c189ba0a54e..23d9dd5089f65c 100644 --- a/drivers/can/can_sam.c +++ b/drivers/can/can_sam.c @@ -25,6 +25,7 @@ struct can_sam_config { const struct atmel_sam_pmc_config clock_cfg; const struct pinctrl_dev_config *pcfg; int divider; + mm_reg_t dma_base; }; static int can_sam_read_reg(const struct device *dev, uint16_t reg, uint32_t *val) @@ -101,7 +102,13 @@ static int can_sam_init(const struct device *dev) return ret; } - ret = can_mcan_configure_mram(dev, 0U, sam_cfg->mram); + /* get actual message ram base address */ + uint32_t mrba = sam_cfg->mram & 0xFFFF0000; + + /* keep lower 16bit; update DMA Base Register */ + sys_write32(sam_cfg->dma_base, (sys_read32(sam_cfg->dma_base) & 0x0000FFFF) | mrba); + + ret = can_mcan_configure_mram(dev, mrba, sam_cfg->mram); if (ret != 0) { return ret; } @@ -174,6 +181,7 @@ static void config_can_##inst##_irq(void) .divider = DT_INST_PROP(inst, divider), \ .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \ .config_irq = config_can_##inst##_irq, \ + .dma_base = (mm_reg_t) DT_INST_REG_ADDR_BY_NAME(inst, dma_base) \ }; \ \ static const struct can_mcan_config can_mcan_cfg_##inst = \ diff --git a/drivers/clock_control/clock_control_renesas_ra.c b/drivers/clock_control/clock_control_renesas_ra.c index 26bb3ab3eb74de..0b058633151cfd 100644 --- a/drivers/clock_control/clock_control_renesas_ra.c +++ b/drivers/clock_control/clock_control_renesas_ra.c @@ -286,6 +286,13 @@ static int clock_control_ra_init(const struct device *dev) } } + SYSTEM_write8(OPCCR_OFFSET, 0); + while ((SYSTEM_read8(OPCCR_OFFSET) & BIT(OPCCR_OPCMTSF_POS)) != 0) { + ; + } + + SYSTEM_write8(MEMWAIT_OFFSET, 1); + SYSTEM_write32(SCKDIVCR_OFFSET, SCKDIVCR_INIT_VALUE); SYSTEM_write8(SCKSCR_OFFSET, SCKSCR_INIT_VALUE); @@ -293,12 +300,6 @@ static int clock_control_ra_init(const struct device *dev) sysclk = SYSTEM_read8(SCKSCR_OFFSET); z_clock_hw_cycles_per_sec = clock_freqs[sysclk]; - SYSTEM_write8(OPCCR_OFFSET, 0); - while ((SYSTEM_read8(OPCCR_OFFSET) & BIT(OPCCR_OPCMTSF_POS)) != 0) { - ; - } - - SYSTEM_write8(MEMWAIT_OFFSET, 1); SYSTEM_write16(PRCR_OFFSET, PRCR_KEY); return 0; diff --git a/drivers/ethernet/eth_e1000.c b/drivers/ethernet/eth_e1000.c index 766ed79dec43e7..31dd7e28b24cca 100644 --- a/drivers/ethernet/eth_e1000.c +++ b/drivers/ethernet/eth_e1000.c @@ -371,27 +371,27 @@ static int ptp_clock_e1000_rate_adjust(const struct device *dev, double ratio) float val; /* No change needed. */ - if (ratio == 1.0f) { + if (ratio == 1.0) { return 0; } ratio *= context->clk_ratio; /* Limit possible ratio. */ - if ((ratio > 1.0f + 1.0f/(2 * hw_inc)) || - (ratio < 1.0f - 1.0f/(2 * hw_inc))) { + if ((ratio > 1.0 + 1.0/(2.0 * hw_inc)) || + (ratio < 1.0 - 1.0/(2.0 * hw_inc))) { return -EINVAL; } /* Save new ratio. */ context->clk_ratio = ratio; - if (ratio < 1.0f) { + if (ratio < 1.0) { corr = hw_inc - 1; - val = 1.0f / (hw_inc * (1.0f - ratio)); - } else if (ratio > 1.0f) { + val = 1.0 / (hw_inc * (1.0 - ratio)); + } else if (ratio > 1.0) { corr = hw_inc + 1; - val = 1.0f / (hw_inc * (ratio - 1.0f)); + val = 1.0 / (hw_inc * (ratio - 1.0)); } else { val = 0; corr = hw_inc; diff --git a/drivers/ethernet/eth_e1000_priv.h b/drivers/ethernet/eth_e1000_priv.h index 2d0b6afa26d271..64b7497b917e8e 100644 --- a/drivers/ethernet/eth_e1000_priv.h +++ b/drivers/ethernet/eth_e1000_priv.h @@ -92,7 +92,7 @@ struct e1000_dev { uint8_t rxb[NET_ETH_MTU]; #if defined(CONFIG_ETH_E1000_PTP_CLOCK) const struct device *ptp_clock; - float clk_ratio; + double clk_ratio; #endif }; diff --git a/drivers/ethernet/eth_stm32_hal_priv.h b/drivers/ethernet/eth_stm32_hal_priv.h index 6402a9a3069695..9502537ac52976 100644 --- a/drivers/ethernet/eth_stm32_hal_priv.h +++ b/drivers/ethernet/eth_stm32_hal_priv.h @@ -10,7 +10,7 @@ #include /* Naming of the ETH PTP Config Status changes depending on the stm32 serie */ -#if defined(CONFIG_SOC_SERIES_STM32F7X) || defined(CONFIG_SOC_SERIES_STM32F4X) +#if defined(CONFIG_SOC_SERIES_STM32F4X) #define ETH_STM32_PTP_CONFIGURED HAL_ETH_PTP_CONFIGURATED #define ETH_STM32_PTP_NOT_CONFIGURED HAL_ETH_PTP_NOT_CONFIGURATED #else diff --git a/drivers/ethernet/phy/phy_mii.c b/drivers/ethernet/phy/phy_mii.c index 041be3dafaa322..9b11e6517a6b66 100644 --- a/drivers/ethernet/phy/phy_mii.c +++ b/drivers/ethernet/phy/phy_mii.c @@ -49,6 +49,10 @@ static inline int reg_read(const struct device *dev, uint16_t reg_addr, { const struct phy_mii_dev_config *const cfg = dev->config; + /* if there is no mdio (fixed-link) it is not supported to read */ + if (cfg->mdio == NULL) { + return -ENOTSUP; + } return mdio_read(cfg->mdio, cfg->phy_addr, reg_addr, value); } @@ -57,6 +61,10 @@ static inline int reg_write(const struct device *dev, uint16_t reg_addr, { const struct phy_mii_dev_config *const cfg = dev->config; + /* if there is no mdio (fixed-link) it is not supported to write */ + if (cfg->mdio == NULL) { + return -ENOTSUP; + } return mdio_write(cfg->mdio, cfg->phy_addr, reg_addr, value); } diff --git a/drivers/flash/flash_simulator.c b/drivers/flash/flash_simulator.c index 3a7d578a250a6d..204da43c22f807 100644 --- a/drivers/flash/flash_simulator.c +++ b/drivers/flash/flash_simulator.c @@ -274,7 +274,7 @@ static int flash_sim_write(const struct device *dev, const off_t offset, #endif /* CONFIG_FLASH_SIMULATOR_STATS */ /* only pull bits to zero */ -#if IS_ENABLED(CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE) +#if defined(CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE) #if FLASH_SIMULATOR_ERASE_VALUE == 0xFF *(MOCK_FLASH(offset + i)) &= *((uint8_t *)data + i); #else diff --git a/drivers/flash/flash_util.c b/drivers/flash/flash_util.c index 26acfdf65cc823..fcd6509b802f00 100644 --- a/drivers/flash/flash_util.c +++ b/drivers/flash/flash_util.c @@ -67,14 +67,14 @@ int z_impl_flash_flatten(const struct device *dev, off_t offset, size_t size) (const struct flash_driver_api *)dev->api; __maybe_unused const struct flash_parameters *params = api->get_parameters(dev); -#if IS_ENABLED(CONFIG_FLASH_HAS_EXPLICIT_ERASE) +#if defined(CONFIG_FLASH_HAS_EXPLICIT_ERASE) if ((flash_params_get_erase_cap(params) & FLASH_ERASE_C_EXPLICIT) && api->erase != NULL) { return api->erase(dev, offset, size); } #endif -#if IS_ENABLED(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE) +#if defined(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE) return flash_fill(dev, params->erase_value, offset, size); #else return -ENOSYS; diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index de9cfd423450db..c15722082a3416 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -184,7 +184,7 @@ static int flash_nrf_write(const struct device *dev, off_t addr, return -EINVAL; } -#if !IS_ENABLED(CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS) +#if !defined(CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS) if (!is_aligned_32(addr) || (len % sizeof(uint32_t))) { LOG_ERR("not word-aligned: 0x%08lx:%zu", (unsigned long)addr, len); diff --git a/drivers/flash/spi_flash_at45.c b/drivers/flash/spi_flash_at45.c index a223fb0863d64f..ebdf522480e7d8 100644 --- a/drivers/flash/spi_flash_at45.c +++ b/drivers/flash/spi_flash_at45.c @@ -525,7 +525,7 @@ static void spi_flash_at45_pages_layout(const struct device *dev, *layout = &cfg->pages_layout; *layout_size = 1; } -#endif /* IS_ENABLED(CONFIG_FLASH_PAGE_LAYOUT) */ +#endif /* defined(CONFIG_FLASH_PAGE_LAYOUT) */ static int power_down_op(const struct device *dev, uint8_t opcode, uint32_t delay) @@ -636,7 +636,7 @@ static int spi_flash_at45_pm_action(const struct device *dev, return 0; } -#endif /* IS_ENABLED(CONFIG_PM_DEVICE) */ +#endif /* defined(CONFIG_PM_DEVICE) */ static const struct flash_parameters * flash_at45_get_parameters(const struct device *dev) diff --git a/drivers/gnss/gnss_u_blox_m10.c b/drivers/gnss/gnss_u_blox_m10.c index e5641ab634a93c..c2cb82de09ba0f 100644 --- a/drivers/gnss/gnss_u_blox_m10.c +++ b/drivers/gnss/gnss_u_blox_m10.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "gnss_nmea0183.h" #include "gnss_nmea0183_match.h" diff --git a/drivers/i2c/i2c_ambiq.c b/drivers/i2c/i2c_ambiq.c index f3c5b90e90031f..3091f8875360dd 100644 --- a/drivers/i2c/i2c_ambiq.c +++ b/drivers/i2c/i2c_ambiq.c @@ -60,7 +60,6 @@ static void i2c_ambiq_callback(void *callback_ctxt, uint32_t status) data->callback(dev, status, data->callback_data); } data->transfer_status = status; - k_sem_give(&data->transfer_sem); } #endif @@ -72,6 +71,7 @@ static void i2c_ambiq_isr(const struct device *dev) am_hal_iom_interrupt_status_get(data->iom_handler, false, &ui32Status); am_hal_iom_interrupt_clear(data->iom_handler, ui32Status); am_hal_iom_interrupt_service(data->iom_handler, ui32Status); + k_sem_give(&data->transfer_sem); } static int i2c_ambiq_read(const struct device *dev, struct i2c_msg *msg, uint16_t addr) @@ -197,6 +197,7 @@ static int i2c_ambiq_transfer(const struct device *dev, struct i2c_msg *msgs, ui } if (ret != 0) { + k_sem_give(&data->bus_sem); return ret; } } @@ -237,8 +238,8 @@ static int i2c_ambiq_init(const struct device *dev) } #ifdef CONFIG_I2C_AMBIQ_DMA - am_hal_iom_interrupt_clear(data->iom_handler, AM_HAL_IOM_INT_CQUPD | AM_HAL_IOM_INT_ERR); - am_hal_iom_interrupt_enable(data->iom_handler, AM_HAL_IOM_INT_CQUPD | AM_HAL_IOM_INT_ERR); + am_hal_iom_interrupt_clear(data->iom_handler, AM_HAL_IOM_INT_DCMP | AM_HAL_IOM_INT_CMDCMP); + am_hal_iom_interrupt_enable(data->iom_handler, AM_HAL_IOM_INT_DCMP | AM_HAL_IOM_INT_CMDCMP); config->irq_config_func(); #endif diff --git a/drivers/i2c/i2c_ll_stm32_v2.c b/drivers/i2c/i2c_ll_stm32_v2.c index 24d51eed45ea7c..e67ae28bbf90cc 100644 --- a/drivers/i2c/i2c_ll_stm32_v2.c +++ b/drivers/i2c/i2c_ll_stm32_v2.c @@ -1119,7 +1119,7 @@ int stm32_i2c_configure_timing(const struct device *dev, uint32_t clock) return -EINVAL; } - LOG_INF("I2C TIMING = 0x%x\n", timing); + LOG_INF("I2C TIMING = 0x%x", timing); LL_I2C_SetTiming(i2c, timing); return 0; diff --git a/drivers/ieee802154/ieee802154_nrf5.c b/drivers/ieee802154/ieee802154_nrf5.c index 13f4132a01dfd7..613c913868bfdf 100644 --- a/drivers/ieee802154/ieee802154_nrf5.c +++ b/drivers/ieee802154/ieee802154_nrf5.c @@ -739,7 +739,7 @@ static int nrf5_continuous_carrier(const struct device *dev) } #endif -#if !IS_ENABLED(CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT) +#if !defined(CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT) static void nrf5_radio_irq(const void *arg) { ARG_UNUSED(arg); @@ -752,7 +752,7 @@ static void nrf5_irq_config(const struct device *dev) { ARG_UNUSED(dev); -#if !IS_ENABLED(CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT) +#if !defined(CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT) IRQ_CONNECT(DT_IRQN(DT_NODELABEL(radio)), NRF_802154_IRQ_PRIORITY, nrf5_radio_irq, NULL, 0); irq_enable(DT_IRQN(DT_NODELABEL(radio))); #endif diff --git a/drivers/input/input_ite_it8xxx2_kbd.c b/drivers/input/input_ite_it8xxx2_kbd.c index 5681b331833229..e03b87d45c16fe 100644 --- a/drivers/input/input_ite_it8xxx2_kbd.c +++ b/drivers/input/input_ite_it8xxx2_kbd.c @@ -63,6 +63,7 @@ static void it8xxx2_kbd_drive_column(const struct device *dev, int col) const uint8_t ksol_mask = kso_mask & 0xff; const uint8_t ksoh1_mask = (kso_mask >> 8) & 0xff; uint32_t kso_val; + unsigned int key; /* Tri-state all outputs */ if (col == INPUT_KBD_MATRIX_COLUMN_DRIVE_NONE) { @@ -77,7 +78,17 @@ static void it8xxx2_kbd_drive_column(const struct device *dev, int col) /* Set KSO[17:0] output data */ inst->KBS_KSOL = (inst->KBS_KSOL & ~ksol_mask) | (kso_val & ksol_mask); + /* + * Disable global interrupts for critical section + * The KBS_KSOH1 register contains both keyboard and GPIO output settings. + * Not all bits are for the keyboard will be driven, so a critical section + * is needed to avoid race conditions. + */ + key = irq_lock(); inst->KBS_KSOH1 = (inst->KBS_KSOH1 & ~ksoh1_mask) | ((kso_val >> 8) & ksoh1_mask); + /* Restore interrupts */ + irq_unlock(key); + if (common->col_size > 16) { inst->KBS_KSOH2 = (kso_val >> 16) & 0xff; } diff --git a/drivers/interrupt_controller/intc_plic.c b/drivers/interrupt_controller/intc_plic.c index 144e448a04d4a7..efebfc07f9d705 100644 --- a/drivers/interrupt_controller/intc_plic.c +++ b/drivers/interrupt_controller/intc_plic.c @@ -357,7 +357,7 @@ static void plic_irq_handler(const struct device *dev) z_irq_spurious(NULL); } -#if IS_ENABLED(PLIC_DRV_HAS_COMPAT(andestech_nceplic100)) +#if PLIC_DRV_HAS_COMPAT(andestech_nceplic100) trig_val = riscv_plic_irq_trig_val(dev, local_irq); /* * Edge-triggered interrupts on Andes NCEPLIC100 have to be acknowledged first before @@ -377,7 +377,7 @@ static void plic_irq_handler(const struct device *dev) * PLIC controller that the IRQ has been handled * for level triggered interrupts. */ -#if IS_ENABLED(PLIC_DRV_HAS_COMPAT(andestech_nceplic100)) +#if PLIC_DRV_HAS_COMPAT(andestech_nceplic100) /* For NCEPLIC100, handle only if level-triggered */ if (trig_val == PLIC_TRIG_LEVEL) { sys_write32(local_irq, claim_complete_addr); diff --git a/drivers/ipm/ipm_imx.c b/drivers/ipm/ipm_imx.c index 7a4b3b1e210118..b8e716af7b09d9 100644 --- a/drivers/ipm/ipm_imx.c +++ b/drivers/ipm/ipm_imx.c @@ -167,7 +167,7 @@ static int imx_mu_ipm_send(const struct device *dev, int wait, uint32_t id, const struct imx_mu_config *config = dev->config; MU_Type *base = MU(config); uint32_t data32[IMX_IPM_DATA_REGS] = {0}; -#if !IS_ENABLED(CONFIG_HAS_MCUX) +#if !defined(CONFIG_HAS_MCUX) mu_status_t status; #endif int i; diff --git a/drivers/net/nsos_adapt.c b/drivers/net/nsos_adapt.c index 91be0b4cf5b482..44310253f12436 100644 --- a/drivers/net/nsos_adapt.c +++ b/drivers/net/nsos_adapt.c @@ -625,6 +625,7 @@ int nsos_adapt_getsockopt(int fd, int nsos_mid_level, int nsos_mid_optname, return nsos_adapt_getsockopt_int(fd, SOL_SOCKET, SO_KEEPALIVE, nsos_mid_optval, nsos_mid_optlen); } + break; case NSOS_MID_IPPROTO_TCP: switch (nsos_mid_optname) { @@ -641,6 +642,7 @@ int nsos_adapt_getsockopt(int fd, int nsos_mid_level, int nsos_mid_optname, return nsos_adapt_getsockopt_int(fd, IPPROTO_TCP, TCP_KEEPCNT, nsos_mid_optval, nsos_mid_optlen); } + break; case NSOS_MID_IPPROTO_IPV6: switch (nsos_mid_optname) { @@ -648,6 +650,7 @@ int nsos_adapt_getsockopt(int fd, int nsos_mid_level, int nsos_mid_optname, return nsos_adapt_getsockopt_int(fd, IPPROTO_IPV6, IPV6_V6ONLY, nsos_mid_optval, nsos_mid_optlen); } + break; } return -NSOS_MID_EOPNOTSUPP; @@ -727,6 +730,7 @@ int nsos_adapt_setsockopt(int fd, int nsos_mid_level, int nsos_mid_optname, return nsos_adapt_setsockopt_int(fd, SOL_SOCKET, SO_KEEPALIVE, nsos_mid_optval, nsos_mid_optlen); } + break; case NSOS_MID_IPPROTO_TCP: switch (nsos_mid_optname) { @@ -743,6 +747,7 @@ int nsos_adapt_setsockopt(int fd, int nsos_mid_level, int nsos_mid_optname, return nsos_adapt_setsockopt_int(fd, IPPROTO_TCP, TCP_KEEPCNT, nsos_mid_optval, nsos_mid_optlen); } + break; case NSOS_MID_IPPROTO_IPV6: switch (nsos_mid_optname) { @@ -750,6 +755,7 @@ int nsos_adapt_setsockopt(int fd, int nsos_mid_level, int nsos_mid_optname, return nsos_adapt_setsockopt_int(fd, IPPROTO_IPV6, IPV6_V6ONLY, nsos_mid_optval, nsos_mid_optlen); } + break; } return -NSOS_MID_EOPNOTSUPP; diff --git a/drivers/net/nsos_sockets.c b/drivers/net/nsos_sockets.c index 7991cf683da658..ac82e1ad525919 100644 --- a/drivers/net/nsos_sockets.c +++ b/drivers/net/nsos_sockets.c @@ -1095,6 +1095,7 @@ static int nsos_getsockopt(void *obj, int level, int optname, NSOS_MID_SOL_SOCKET, NSOS_MID_SO_KEEPALIVE, optval, optlen); } + break; case IPPROTO_TCP: switch (optname) { @@ -1115,6 +1116,7 @@ static int nsos_getsockopt(void *obj, int level, int optname, NSOS_MID_IPPROTO_TCP, NSOS_MID_TCP_KEEPCNT, optval, optlen); } + break; case IPPROTO_IPV6: switch (optname) { @@ -1123,6 +1125,7 @@ static int nsos_getsockopt(void *obj, int level, int optname, NSOS_MID_IPPROTO_IPV6, NSOS_MID_IPV6_V6ONLY, optval, optlen); } + break; } errno = EOPNOTSUPP; @@ -1261,6 +1264,7 @@ static int nsos_setsockopt(void *obj, int level, int optname, NSOS_MID_SOL_SOCKET, NSOS_MID_SO_KEEPALIVE, optval, optlen); } + break; case IPPROTO_TCP: switch (optname) { @@ -1281,6 +1285,7 @@ static int nsos_setsockopt(void *obj, int level, int optname, NSOS_MID_IPPROTO_TCP, NSOS_MID_TCP_KEEPCNT, optval, optlen); } + break; case IPPROTO_IPV6: switch (optname) { @@ -1289,6 +1294,7 @@ static int nsos_setsockopt(void *obj, int level, int optname, NSOS_MID_IPPROTO_IPV6, NSOS_MID_IPV6_V6ONLY, optval, optlen); } + break; } errno = EOPNOTSUPP; diff --git a/drivers/regulator/regulator_da1469x.c b/drivers/regulator/regulator_da1469x.c index fe6d6a8ccc1ff6..2273fe363bdef9 100644 --- a/drivers/regulator/regulator_da1469x.c +++ b/drivers/regulator/regulator_da1469x.c @@ -408,7 +408,7 @@ static int regulator_da1469x_init(const struct device *dev) return regulator_common_init(dev, 0); } -#if IS_ENABLED(CONFIG_PM_DEVICE) +#if defined(CONFIG_PM_DEVICE) static int regulator_da1469x_pm_action(const struct device *dev, enum pm_device_action action) { diff --git a/drivers/sensor/bosch/bme280/bme280.h b/drivers/sensor/bosch/bme280/bme280.h index 2499174d5e6d10..b386e6234f3279 100644 --- a/drivers/sensor/bosch/bme280/bme280.h +++ b/drivers/sensor/bosch/bme280/bme280.h @@ -206,6 +206,14 @@ struct bme280_decoder_header { struct bme280_encoded_data { struct bme280_decoder_header header; + struct { + /** Set if `temp` has data */ + uint8_t has_temp: 1; + /** Set if `press` has data */ + uint8_t has_press: 1; + /** Set if `humidity` has data */ + uint8_t has_humidity: 1; + } __attribute__((__packed__)); struct bme280_reading reading; }; diff --git a/drivers/sensor/bosch/bme280/bme280_async.c b/drivers/sensor/bosch/bme280/bme280_async.c index 780a7a28c1e40d..bd981102dcf260 100644 --- a/drivers/sensor/bosch/bme280/bme280_async.c +++ b/drivers/sensor/bosch/bme280/bme280_async.c @@ -20,21 +20,6 @@ void bme280_submit(const struct device *dev, struct rtio_iodev_sqe *iodev_sqe) const struct sensor_chan_spec *const channels = cfg->channels; const size_t num_channels = cfg->count; - /* Check if the requested channels are supported */ - for (size_t i = 0; i < num_channels; i++) { - switch (channels[i].chan_type) { - case SENSOR_CHAN_AMBIENT_TEMP: - case SENSOR_CHAN_HUMIDITY: - case SENSOR_CHAN_PRESS: - case SENSOR_CHAN_ALL: - break; - default: - LOG_ERR("Unsupported channel type %d", channels[i].chan_type); - rtio_iodev_sqe_err(iodev_sqe, -ENOTSUP); - return; - } - } - rc = rtio_sqe_rx_buf(iodev_sqe, min_buf_len, min_buf_len, &buf, &buf_len); if (rc != 0) { LOG_ERR("Failed to get a read buffer of size %u bytes", min_buf_len); @@ -45,8 +30,33 @@ void bme280_submit(const struct device *dev, struct rtio_iodev_sqe *iodev_sqe) struct bme280_encoded_data *edata; edata = (struct bme280_encoded_data *)buf; - edata->header.timestamp = k_ticks_to_ns_floor64(k_uptime_ticks()); + edata->has_temp = 0; + edata->has_humidity = 0; + edata->has_press = 0; + + /* Check if the requested channels are supported */ + for (size_t i = 0; i < num_channels; i++) { + switch (channels[i].chan_type) { + case SENSOR_CHAN_AMBIENT_TEMP: + edata->has_temp = 1; + break; + case SENSOR_CHAN_HUMIDITY: + edata->has_humidity = 1; + break; + case SENSOR_CHAN_PRESS: + edata->has_press = 1; + break; + case SENSOR_CHAN_ALL: + edata->has_temp = 1; + edata->has_humidity = 1; + edata->has_press = 1; + break; + default: + continue; + break; + } + } rc = bme280_sample_fetch_helper(dev, SENSOR_CHAN_ALL, &edata->reading); if (rc != 0) { diff --git a/drivers/sensor/bosch/bme280/bme280_decoder.c b/drivers/sensor/bosch/bme280/bme280_decoder.c index 7158fd37d5a8ce..469922c5121887 100644 --- a/drivers/sensor/bosch/bme280/bme280_decoder.c +++ b/drivers/sensor/bosch/bme280/bme280_decoder.c @@ -10,12 +10,33 @@ static int bme280_decoder_get_frame_count(const uint8_t *buffer, struct sensor_chan_spec chan_spec, uint16_t *frame_count) { - ARG_UNUSED(buffer); - ARG_UNUSED(chan_spec); + const struct bme280_encoded_data *edata = (const struct bme280_encoded_data *)buffer; + int32_t ret = -ENOTSUP; + + if (chan_spec.chan_idx != 0) { + return ret; + } /* This sensor lacks a FIFO; there will always only be one frame at a time. */ - *frame_count = 1; - return 0; + switch (chan_spec.chan_type) { + case SENSOR_CHAN_AMBIENT_TEMP: + *frame_count = edata->has_temp ? 1 : 0; + break; + case SENSOR_CHAN_PRESS: + *frame_count = edata->has_press ? 1 : 0; + break; + case SENSOR_CHAN_HUMIDITY: + *frame_count = edata->has_humidity ? 1 : 0; + break; + default: + return ret; + } + + if (*frame_count > 0) { + ret = 0; + } + + return ret; } static int bme280_decoder_get_size_info(struct sensor_chan_spec chan_spec, size_t *base_size, @@ -91,19 +112,31 @@ static int bme280_decoder_decode(const uint8_t *buffer, struct sensor_chan_spec switch (chan_spec.chan_type) { case SENSOR_CHAN_AMBIENT_TEMP: - bme280_convert_signed_temp_raw_to_q31(edata->reading.comp_temp, - &out->readings[0].temperature); - out->shift = BME280_TEMP_SHIFT; + if (edata->has_temp) { + bme280_convert_signed_temp_raw_to_q31(edata->reading.comp_temp, + &out->readings[0].temperature); + out->shift = BME280_TEMP_SHIFT; + } else { + return -ENODATA; + } break; case SENSOR_CHAN_PRESS: - bme280_convert_unsigned_pressure_raw_to_q31(edata->reading.comp_press, - &out->readings[0].pressure); - out->shift = BME280_PRESS_SHIFT; + if (edata->has_press) { + bme280_convert_unsigned_pressure_raw_to_q31(edata->reading.comp_press, + &out->readings[0].pressure); + out->shift = BME280_PRESS_SHIFT; + } else { + return -ENODATA; + } break; case SENSOR_CHAN_HUMIDITY: - bme280_convert_unsigned_humidity_raw_to_q31(edata->reading.comp_humidity, - &out->readings[0].humidity); - out->shift = BME280_HUM_SHIFT; + if (edata->has_humidity) { + bme280_convert_unsigned_humidity_raw_to_q31(edata->reading.comp_humidity, + &out->readings[0].humidity); + out->shift = BME280_HUM_SHIFT; + } else { + return -ENODATA; + } break; default: return -EINVAL; diff --git a/drivers/serial/uart_pl011.c b/drivers/serial/uart_pl011.c index 160d6887f9d4c3..799e8c55ae232d 100644 --- a/drivers/serial/uart_pl011.c +++ b/drivers/serial/uart_pl011.c @@ -21,10 +21,10 @@ #if defined(CONFIG_PINCTRL) #include #endif -#if IS_ENABLED(CONFIG_RESET) +#if defined(CONFIG_RESET) #include #endif -#if IS_ENABLED(CONFIG_CLOCK_CONTROL) +#if defined(CONFIG_CLOCK_CONTROL) #include #endif @@ -41,10 +41,10 @@ struct pl011_config { #if defined(CONFIG_PINCTRL) const struct pinctrl_dev_config *pincfg; #endif -#if IS_ENABLED(CONFIG_RESET) +#if defined(CONFIG_RESET) const struct reset_dt_spec reset; #endif -#if IS_ENABLED(CONFIG_CLOCK_CONTROL) +#if defined(CONFIG_CLOCK_CONTROL) const struct device *clock_dev; clock_control_subsys_t clock_id; #endif @@ -88,6 +88,20 @@ static void pl011_disable_fifo(const struct device *dev) get_uart(dev)->lcr_h &= ~PL011_LCRH_FEN; } +static void pl011_set_flow_control(const struct device *dev, bool rts, bool cts) +{ + if (rts) { + get_uart(dev)->cr |= PL011_CR_RTSEn; + } else { + get_uart(dev)->cr &= ~PL011_CR_RTSEn; + } + if (cts) { + get_uart(dev)->cr |= PL011_CR_CTSEn; + } else { + get_uart(dev)->cr &= ~PL011_CR_CTSEn; + } +} + static int pl011_set_baudrate(const struct device *dev, uint32_t clk, uint32_t baudrate) { @@ -240,6 +254,10 @@ static int pl011_runtime_configure_internal(const struct device *dev, switch (cfg->flow_ctrl) { case UART_CFG_FLOW_CTRL_NONE: + pl011_set_flow_control(dev, false, false); + break; + case UART_CFG_FLOW_CTRL_RTS_CTS: + pl011_set_flow_control(dev, true, true); break; default: goto enable; @@ -445,7 +463,7 @@ static int pl011_init(const struct device *dev) DEVICE_MMIO_MAP(dev, K_MEM_CACHE_NONE); -#if IS_ENABLED(CONFIG_RESET) +#if defined(CONFIG_RESET) if (config->reset.dev) { ret = reset_line_toggle_dt(&config->reset); if (ret) { @@ -454,7 +472,7 @@ static int pl011_init(const struct device *dev) } #endif -#if IS_ENABLED(CONFIG_CLOCK_CONTROL) +#if defined(CONFIG_CLOCK_CONTROL) if (config->clock_dev) { clock_control_on(config->clock_dev, config->clock_id); clock_control_get_rate(config->clock_dev, config->clock_id, &data->clk_freq); @@ -506,7 +524,7 @@ static int pl011_init(const struct device *dev) if (!data->sbsa) { get_uart(dev)->dmacr = 0U; barrier_isync_fence_full(); - get_uart(dev)->cr &= ~(BIT(14) | BIT(15) | BIT(1)); + get_uart(dev)->cr &= ~PL011_CR_SIREN; get_uart(dev)->cr |= PL011_CR_RXE | PL011_CR_TXE; barrier_isync_fence_full(); } @@ -560,7 +578,7 @@ static int pl011_init(const struct device *dev) #define PINCTRL_INIT(n) #endif /* CONFIG_PINCTRL */ -#if IS_ENABLED(CONFIG_RESET) +#if defined(CONFIG_RESET) #define RESET_INIT(n) \ IF_ENABLED(DT_INST_NODE_HAS_PROP(0, resets), (.reset = RESET_DT_SPEC_INST_GET(n),)) #else @@ -641,7 +659,9 @@ void pl011_isr(const struct device *dev) .parity = UART_CFG_PARITY_NONE, \ .stop_bits = UART_CFG_STOP_BITS_1, \ .data_bits = UART_CFG_DATA_BITS_8, \ - .flow_ctrl = UART_CFG_FLOW_CTRL_NONE, \ + .flow_ctrl = DT_INST_PROP(n, hw_flow_control) \ + ? UART_CFG_FLOW_CTRL_RTS_CTS \ + : UART_CFG_FLOW_CTRL_NONE, \ }, \ .clk_freq = COND_CODE_1( \ DT_NODE_HAS_COMPAT(DT_INST_CLOCKS_CTLR(n), fixed_clock), \ diff --git a/drivers/spi/spi_dw.h b/drivers/spi/spi_dw.h index 6c073b4747160a..e1df26d1c14ef5 100644 --- a/drivers/spi/spi_dw.h +++ b/drivers/spi/spi_dw.h @@ -179,7 +179,7 @@ static int reg_test_bit(uint8_t bit, mm_reg_t addr, uint32_t off) /* Common registers settings, bits etc... */ /* CTRLR0 settings */ -#if !IS_ENABLED(CONFIG_SPI_DW_HSSI) +#if !defined(CONFIG_SPI_DW_HSSI) #define DW_SPI_CTRLR0_SCPH_BIT (6) #define DW_SPI_CTRLR0_SCPOL_BIT (7) #define DW_SPI_CTRLR0_TMOD_SHIFT (8) diff --git a/drivers/spi/spi_gd32.c b/drivers/spi/spi_gd32.c index c5c37a82f21dc8..1dabc620bcf694 100644 --- a/drivers/spi/spi_gd32.c +++ b/drivers/spi/spi_gd32.c @@ -414,11 +414,13 @@ static int spi_gd32_transceive_impl(const struct device *dev, #ifdef CONFIG_SPI_GD32_DMA dma_error: + SPI_CTL1(cfg->reg) &= + ~(SPI_CTL1_DMATEN | SPI_CTL1_DMAREN); #endif spi_context_cs_control(&data->ctx, false); SPI_CTL0(cfg->reg) &= - ~(SPI_CTL0_SPIEN | SPI_CTL1_DMATEN | SPI_CTL1_DMAREN); + ~(SPI_CTL0_SPIEN); error: spi_context_release(&data->ctx, ret); diff --git a/drivers/spi/spi_gecko.c b/drivers/spi/spi_gecko.c index 3c79bdb4e2f1bc..56dd0cfd7f71e1 100644 --- a/drivers/spi/spi_gecko.c +++ b/drivers/spi/spi_gecko.c @@ -346,8 +346,13 @@ static int spi_gecko_transceive(const struct device *dev, { struct spi_gecko_data *data = dev->data; uint16_t control = 0; + int ret; + + ret = spi_config(dev, config, &control); + if (ret < 0) { + return ret; + } - spi_config(dev, config, &control); spi_context_buffers_setup(&data->ctx, tx_bufs, rx_bufs, 1); spi_gecko_xfer(dev, config); return 0; diff --git a/drivers/spi/spi_pl022.c b/drivers/spi/spi_pl022.c index ed30dddf1e1efb..817a826d4da7f9 100644 --- a/drivers/spi/spi_pl022.c +++ b/drivers/spi/spi_pl022.c @@ -275,11 +275,11 @@ struct spi_pl022_cfg { const uint32_t reg; const uint32_t pclk; const bool dma_enabled; -#if IS_ENABLED(CONFIG_CLOCK_CONTROL) +#if defined(CONFIG_CLOCK_CONTROL) const struct device *clk_dev; const clock_control_subsys_t clk_id; #endif -#if IS_ENABLED(CONFIG_RESET) +#if defined(CONFIG_RESET) const struct reset_dt_spec reset; #endif #if defined(CONFIG_PINCTRL) @@ -354,7 +354,7 @@ static int spi_pl022_configure(const struct device *dev, return 0; } -#if IS_ENABLED(CONFIG_CLOCK_CONTROL) +#if defined(CONFIG_CLOCK_CONTROL) ret = clock_control_get_rate(cfg->clk_dev, cfg->clk_id, &pclk); if (ret < 0 || pclk == 0) { return -EINVAL; @@ -906,7 +906,7 @@ static int spi_pl022_init(const struct device *dev) struct spi_pl022_data *data = dev->data; int ret; -#if IS_ENABLED(CONFIG_CLOCK_CONTROL) +#if defined(CONFIG_CLOCK_CONTROL) if (cfg->clk_dev) { ret = clock_control_on(cfg->clk_dev, cfg->clk_id); if (ret < 0) { @@ -916,7 +916,7 @@ static int spi_pl022_init(const struct device *dev) } #endif -#if IS_ENABLED(CONFIG_RESET) +#if defined(CONFIG_RESET) if (cfg->reset.dev) { ret = reset_line_toggle_dt(&cfg->reset); if (ret < 0) { diff --git a/drivers/usb/udc/udc_dwc2.c b/drivers/usb/udc/udc_dwc2.c index 6ca435f4537b08..fd9f11ccde4354 100644 --- a/drivers/usb/udc/udc_dwc2.c +++ b/drivers/usb/udc/udc_dwc2.c @@ -2029,7 +2029,6 @@ static int dwc2_driver_preinit(const struct device *dev) k_mutex_init(&data->mutex); - data->caps.rwup = true; data->caps.addr_before_status = true; data->caps.mps0 = UDC_MPS0_64; diff --git a/drivers/usb/udc/udc_kinetis.c b/drivers/usb/udc/udc_kinetis.c index 38dd1db2d04066..b424ce03724879 100644 --- a/drivers/usb/udc/udc_kinetis.c +++ b/drivers/usb/udc/udc_kinetis.c @@ -448,6 +448,8 @@ static void usbfsotg_event_submit(const struct device *dev, ret = k_mem_slab_alloc(&usbfsotg_ee_slab, (void **)&ev, K_NO_WAIT); if (ret) { udc_submit_event(dev, UDC_EVT_ERROR, ret); + LOG_ERR("Failed to allocate slab"); + return; } ev->dev = dev; diff --git a/drivers/usb/udc/udc_stm32.c b/drivers/usb/udc/udc_stm32.c index 157902a1216404..7eae1a1810d9de 100644 --- a/drivers/usb/udc/udc_stm32.c +++ b/drivers/usb/udc/udc_stm32.c @@ -322,6 +322,13 @@ void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) return; } + if (udc_ep_buf_has_zlp(buf) && ep != USB_CONTROL_EP_IN) { + udc_ep_buf_clear_zlp(buf); + HAL_PCD_EP_Transmit(&priv->pcd, ep, buf->data, 0); + + return; + } + udc_buf_get(dev, ep); if (ep == USB_CONTROL_EP_IN) { @@ -542,6 +549,16 @@ static int udc_stm32_disable(const struct device *dev) irq_disable(DT_INST_IRQN(0)); + if (udc_ep_disable_internal(dev, USB_CONTROL_EP_OUT)) { + LOG_ERR("Failed to disable control endpoint"); + return -EIO; + } + + if (udc_ep_disable_internal(dev, USB_CONTROL_EP_IN)) { + LOG_ERR("Failed to disable control endpoint"); + return -EIO; + } + status = HAL_PCD_Stop(&priv->pcd); if (status != HAL_OK) { LOG_ERR("PCD_Stop failed, %d", (int)status); @@ -768,6 +785,23 @@ static int udc_stm32_ep_dequeue(const struct device *dev, return 0; } +static enum udc_bus_speed udc_stm32_device_speed(const struct device *dev) +{ + struct udc_stm32_data *priv = udc_get_private(dev); + +#ifdef USBD_HS_SPEED + if (priv->pcd.Init.speed == USBD_HS_SPEED) { + return UDC_BUS_SPEED_HS; + } +#endif + + if (priv->pcd.Init.speed == USBD_FS_SPEED) { + return UDC_BUS_SPEED_FS; + } + + return UDC_BUS_UNKNOWN; +} + static const struct udc_api udc_stm32_api = { .lock = udc_stm32_lock, .unlock = udc_stm32_unlock, @@ -784,6 +818,7 @@ static const struct udc_api udc_stm32_api = { .ep_clear_halt = udc_stm32_ep_clear_halt, .ep_enqueue = udc_stm32_ep_enqueue, .ep_dequeue = udc_stm32_ep_dequeue, + .device_speed = udc_stm32_device_speed, }; /* ----------------- Instance/Device specific data ----------------- */ diff --git a/drivers/wifi/infineon/airoc_wifi.c b/drivers/wifi/infineon/airoc_wifi.c index 1b4ccaa1cf4931..e3d8e6a3c7d3bd 100644 --- a/drivers/wifi/infineon/airoc_wifi.c +++ b/drivers/wifi/infineon/airoc_wifi.c @@ -125,8 +125,7 @@ static void airoc_wifi_scan_cb_search(whd_scan_result_t **result_ptr, void *user if (status == WHD_SCAN_COMPLETED_SUCCESSFULLY) { k_sem_give(&airoc_wifi_data.sema_scan); } else if ((status == WHD_SCAN_INCOMPLETE) && (user_data != NULL) && - ((**result_ptr).SSID.length > 0)) { - + ((**result_ptr).SSID.length == ((whd_scan_result_t *)user_data)->SSID.length)) { if (strncmp(((whd_scan_result_t *)user_data)->SSID.value, (**result_ptr).SSID.value, (**result_ptr).SSID.length) == 0) { memcpy(user_data, *result_ptr, sizeof(whd_scan_result_t)); diff --git a/dts/arm/atmel/same70.dtsi b/dts/arm/atmel/same70.dtsi index 8fcaae98307204..fa954af21f5ca6 100644 --- a/dts/arm/atmel/same70.dtsi +++ b/dts/arm/atmel/same70.dtsi @@ -439,7 +439,8 @@ can0: can@40030000 { compatible = "atmel,sam-can"; - reg = <0x40030000 0x100>; + reg = <0x40030000 0x100>, <0x40088110 0x04>; + reg-names = "m_can", "dma_base"; interrupts = <35 0>, <36 0>; interrupt-names = "int0", "int1"; clocks = <&pmc PMC_TYPE_PERIPHERAL 35>; @@ -450,7 +451,8 @@ can1: can@40034000 { compatible = "atmel,sam-can"; - reg = <0x40034000 0x100>; + reg = <0x40034000 0x100>, <0x40088114 0x4>; + reg-names = "m_can", "dma_base"; interrupts = <37 0>, <38 0>; interrupt-names = "int0", "int1"; clocks = <&pmc PMC_TYPE_PERIPHERAL 37>; diff --git a/dts/arm/nxp/nxp_imx8mm_m4.dtsi b/dts/arm/nxp/nxp_imx8mm_m4.dtsi index 87712243c4f956..59f95701ef099b 100644 --- a/dts/arm/nxp/nxp_imx8mm_m4.dtsi +++ b/dts/arm/nxp/nxp_imx8mm_m4.dtsi @@ -5,3 +5,8 @@ */ #include + +&pinctrl { + status = "okay"; + compatible = "nxp,imx8mp-pinctrl"; +}; diff --git a/dts/arm/nxp/nxp_s32z27x_r52.dtsi b/dts/arm/nxp/nxp_s32z27x_r52.dtsi index c212400a6917d4..e5b7e5d260ed08 100644 --- a/dts/arm/nxp/nxp_s32z27x_r52.dtsi +++ b/dts/arm/nxp/nxp_s32z27x_r52.dtsi @@ -695,12 +695,13 @@ compatible = "nxp,s32-canxl"; reg = <0x4741b000 0x1000>, <0x47423000 0x1000>, - <0x47425000 0x1000>; - reg-names = "sic", "rx_fifo", "rx_fifo_ctrl"; + <0x47425000 0x1000>, + <0x47427000 0x1000>; + reg-names = "sic", "rx_fifo", "rx_fifo_ctrl", "mru"; status = "disabled"; interrupts = , - ; - interrupt-names = "rx_tx", "error"; + ; + interrupt-names = "rx_tx_mru", "error"; clocks = <&clock NXP_S32_P5_CANXL_PE_CLK>; }; @@ -708,12 +709,13 @@ compatible = "nxp,s32-canxl"; reg = <0x4751b000 0x1000>, <0x47523000 0x1000>, - <0x47525000 0x1000>; - reg-names = "sic", "rx_fifo", "rx_fifo_ctrl"; + <0x47525000 0x1000>, + <0x47527000 0x1000>; + reg-names = "sic", "rx_fifo", "rx_fifo_ctrl", "mru"; status = "disabled"; interrupts = , - ; - interrupt-names = "rx_tx", "error"; + ; + interrupt-names = "rx_tx_mru", "error"; clocks = <&clock NXP_S32_P5_CANXL_PE_CLK>; }; }; diff --git a/dts/arm64/nxp/nxp_mimx8mm_a53.dtsi b/dts/arm64/nxp/nxp_mimx8mm_a53.dtsi index 9c6564ce2697bc..58412c35a62745 100644 --- a/dts/arm64/nxp/nxp_mimx8mm_a53.dtsi +++ b/dts/arm64/nxp/nxp_mimx8mm_a53.dtsi @@ -100,7 +100,7 @@ status = "okay"; pinctrl: pinctrl { status = "okay"; - compatible = "nxp,imx8m-pinctrl"; + compatible = "nxp,imx8mp-pinctrl"; }; }; diff --git a/dts/arm64/nxp/nxp_mimx8mn_a53.dtsi b/dts/arm64/nxp/nxp_mimx8mn_a53.dtsi index ce7b840747bb74..2432877711f17b 100644 --- a/dts/arm64/nxp/nxp_mimx8mn_a53.dtsi +++ b/dts/arm64/nxp/nxp_mimx8mn_a53.dtsi @@ -100,7 +100,7 @@ status = "okay"; pinctrl: pinctrl { status = "okay"; - compatible = "nxp,imx8m-pinctrl"; + compatible = "nxp,imx8mp-pinctrl"; }; }; diff --git a/dts/bindings/can/atmel,sam-can.yaml b/dts/bindings/can/atmel,sam-can.yaml index c224604fa0bd9c..7c28ec56da20f5 100644 --- a/dts/bindings/can/atmel,sam-can.yaml +++ b/dts/bindings/can/atmel,sam-can.yaml @@ -9,6 +9,15 @@ include: properties: reg: required: true + description: | + 2 reg blocks needed; Register block for the MCAN configuration registers; + Register block for the DMA Base Address + + reg-names: + type: string-array + required: true + description: | + description of reg blocks interrupts: required: true diff --git a/dts/bindings/cpu/arm,cortex-m55.yaml b/dts/bindings/cpu/arm,cortex-m55.yaml new file mode 100644 index 00000000000000..21c55105bc4361 --- /dev/null +++ b/dts/bindings/cpu/arm,cortex-m55.yaml @@ -0,0 +1,8 @@ +# Copyright (c) 2024 Meta Platforms +# SPDX-License-Identifier: Apache-2.0 + +description: ARM Cortex-M55 CPU + +compatible: "arm,cortex-m55" + +include: arm,cortex-m.yaml diff --git a/dts/bindings/cpu/arm,cortex-m55f.yaml b/dts/bindings/cpu/arm,cortex-m55f.yaml new file mode 100644 index 00000000000000..ca6d8574605f34 --- /dev/null +++ b/dts/bindings/cpu/arm,cortex-m55f.yaml @@ -0,0 +1,8 @@ +# Copyright (c) 2024 Meta Platforms +# SPDX-License-Identifier: Apache-2.0 + +description: ARM Cortex-M55F CPU + +compatible: "arm,cortex-m55f" + +include: arm,cortex-m.yaml diff --git a/dts/riscv/efinix/sapphire_soc.dtsi b/dts/riscv/efinix/sapphire_soc.dtsi index b83c9bc1b0f35a..72092a4bc93008 100644 --- a/dts/riscv/efinix/sapphire_soc.dtsi +++ b/dts/riscv/efinix/sapphire_soc.dtsi @@ -54,7 +54,7 @@ #interrupt-cells = <2>; interrupt-controller; interrupts-extended = <&hlic 11>; - reg = <0xf8c00000 0x04000000>; + reg = <0xf8c00000 0x0400000>; riscv,max-priority = <3>; riscv,ndev = <32>; }; diff --git a/dts/riscv/openisa/rv32m1.dtsi b/dts/riscv/openisa/rv32m1.dtsi index cb234eba998275..d514cf946420bf 100644 --- a/dts/riscv/openisa/rv32m1.dtsi +++ b/dts/riscv/openisa/rv32m1.dtsi @@ -23,14 +23,14 @@ cpu@0 { device_type = "cpu"; compatible = "openisa,ri5cy", "riscv"; - riscv,isa = "rv32ima_zicsr_zifencei"; + riscv,isa = "rv32imc_zicsr_zifencei"; reg = <0>; }; cpu@1 { device_type = "cpu"; compatible = "openisa,zero-ri5cy", "riscv"; - riscv,isa = "rv32ima_zicsr_zifencei"; + riscv,isa = "rv32imc_zicsr_zifencei"; reg = <1>; }; }; diff --git a/include/zephyr/arch/riscv/irq.h b/include/zephyr/arch/riscv/irq.h index 3d81415e0d767d..1cebd2ae94a27d 100644 --- a/include/zephyr/arch/riscv/irq.h +++ b/include/zephyr/arch/riscv/irq.h @@ -18,6 +18,8 @@ extern "C" { #endif +#include + #ifndef _ASMLANGUAGE #include #include diff --git a/include/zephyr/arch/x86/arch.h b/include/zephyr/arch/x86/arch.h index 61036288671c8b..90d2fa0c51a1a4 100644 --- a/include/zephyr/arch/x86/arch.h +++ b/include/zephyr/arch/x86/arch.h @@ -216,7 +216,7 @@ static ALWAYS_INLINE int sys_test_and_clear_bit(mem_addr_t addr, * at build time and defined via the linker script. On Intel64, it's an array. */ -extern unsigned char _irq_to_interrupt_vector[]; +extern unsigned char _irq_to_interrupt_vector[CONFIG_MAX_IRQ_LINES]; #define Z_IRQ_TO_INTERRUPT_VECTOR(irq) \ ((unsigned int) _irq_to_interrupt_vector[(irq)]) diff --git a/include/zephyr/bindesc.h b/include/zephyr/bindesc.h index a45e69a2b9cee3..48cb71c401a777 100644 --- a/include/zephyr/bindesc.h +++ b/include/zephyr/bindesc.h @@ -128,7 +128,7 @@ extern "C" { * @endcond */ -#if !IS_ENABLED(_LINKER) +#if !defined(_LINKER) #include @@ -264,10 +264,6 @@ extern "C" { */ #define BINDESC_GET_SIZE(name) BINDESC_NAME(name).len -/** - * @} - */ - /* * An entry of the binary descriptor header. Each descriptor is * described by one of these entries. @@ -291,107 +287,111 @@ BUILD_ASSERT(offsetof(struct bindesc_entry, tag) == 0, "Incorrect memory layout" BUILD_ASSERT(offsetof(struct bindesc_entry, len) == 2, "Incorrect memory layout"); BUILD_ASSERT(offsetof(struct bindesc_entry, data) == 4, "Incorrect memory layout"); -#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_STRING) +#if defined(CONFIG_BINDESC_KERNEL_VERSION_STRING) extern const struct bindesc_entry BINDESC_NAME(kernel_version_string); -#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_STRING) */ +#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_STRING) */ -#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MAJOR) +#if defined(CONFIG_BINDESC_KERNEL_VERSION_MAJOR) extern const struct bindesc_entry BINDESC_NAME(kernel_version_major); -#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MAJOR) */ +#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_MAJOR) */ -#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MINOR) +#if defined(CONFIG_BINDESC_KERNEL_VERSION_MINOR) extern const struct bindesc_entry BINDESC_NAME(kernel_version_minor); -#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MINOR) */ +#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_MINOR) */ -#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL) +#if defined(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL) extern const struct bindesc_entry BINDESC_NAME(kernel_version_patchlevel); -#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL) */ +#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL) */ -#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_NUMBER) +#if defined(CONFIG_BINDESC_KERNEL_VERSION_NUMBER) extern const struct bindesc_entry BINDESC_NAME(kernel_version_number); -#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_NUMBER) */ +#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_NUMBER) */ -#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_STRING) +#if defined(CONFIG_BINDESC_APP_VERSION_STRING) extern const struct bindesc_entry BINDESC_NAME(app_version_string); -#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_STRING) */ +#endif /* defined(CONFIG_BINDESC_APP_VERSION_STRING) */ -#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MAJOR) +#if defined(CONFIG_BINDESC_APP_VERSION_MAJOR) extern const struct bindesc_entry BINDESC_NAME(app_version_major); -#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MAJOR) */ +#endif /* defined(CONFIG_BINDESC_APP_VERSION_MAJOR) */ -#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MINOR) +#if defined(CONFIG_BINDESC_APP_VERSION_MINOR) extern const struct bindesc_entry BINDESC_NAME(app_version_minor); -#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MINOR) */ +#endif /* defined(CONFIG_BINDESC_APP_VERSION_MINOR) */ -#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL) +#if defined(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL) extern const struct bindesc_entry BINDESC_NAME(app_version_patchlevel); -#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL) */ +#endif /* defined(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL) */ -#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_NUMBER) +#if defined(CONFIG_BINDESC_APP_VERSION_NUMBER) extern const struct bindesc_entry BINDESC_NAME(app_version_number); -#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_NUMBER) */ +#endif /* defined(CONFIG_BINDESC_APP_VERSION_NUMBER) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_YEAR) +#if defined(CONFIG_BINDESC_BUILD_TIME_YEAR) extern const struct bindesc_entry BINDESC_NAME(build_time_year); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_YEAR) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_YEAR) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MONTH) +#if defined(CONFIG_BINDESC_BUILD_TIME_MONTH) extern const struct bindesc_entry BINDESC_NAME(build_time_month); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MONTH) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_MONTH) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_DAY) +#if defined(CONFIG_BINDESC_BUILD_TIME_DAY) extern const struct bindesc_entry BINDESC_NAME(build_time_day); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_DAY) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_DAY) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_HOUR) +#if defined(CONFIG_BINDESC_BUILD_TIME_HOUR) extern const struct bindesc_entry BINDESC_NAME(build_time_hour); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_HOUR) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_HOUR) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MINUTE) +#if defined(CONFIG_BINDESC_BUILD_TIME_MINUTE) extern const struct bindesc_entry BINDESC_NAME(build_time_minute); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MINUTE) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_MINUTE) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_SECOND) +#if defined(CONFIG_BINDESC_BUILD_TIME_SECOND) extern const struct bindesc_entry BINDESC_NAME(build_time_second); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_SECOND) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_SECOND) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_UNIX) +#if defined(CONFIG_BINDESC_BUILD_TIME_UNIX) extern const struct bindesc_entry BINDESC_NAME(build_time_unix); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_UNIX) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_UNIX) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_TIME_STRING) +#if defined(CONFIG_BINDESC_BUILD_DATE_TIME_STRING) extern const struct bindesc_entry BINDESC_NAME(build_date_time_string); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_TIME_STRING) */ +#endif /* defined(CONFIG_BINDESC_BUILD_DATE_TIME_STRING) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_STRING) +#if defined(CONFIG_BINDESC_BUILD_DATE_STRING) extern const struct bindesc_entry BINDESC_NAME(build_date_string); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_STRING) */ +#endif /* defined(CONFIG_BINDESC_BUILD_DATE_STRING) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_STRING) +#if defined(CONFIG_BINDESC_BUILD_TIME_STRING) extern const struct bindesc_entry BINDESC_NAME(build_time_string); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_STRING) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_STRING) */ -#if IS_ENABLED(CONFIG_BINDESC_HOST_NAME) +#if defined(CONFIG_BINDESC_HOST_NAME) extern const struct bindesc_entry BINDESC_NAME(host_name); -#endif /* IS_ENABLED(CONFIG_BINDESC_HOST_NAME) */ +#endif /* defined(CONFIG_BINDESC_HOST_NAME) */ -#if IS_ENABLED(CONFIG_BINDESC_C_COMPILER_NAME) +#if defined(CONFIG_BINDESC_C_COMPILER_NAME) extern const struct bindesc_entry BINDESC_NAME(c_compiler_name); -#endif /* IS_ENABLED(CONFIG_BINDESC_C_COMPILER_NAME) */ +#endif /* defined(CONFIG_BINDESC_C_COMPILER_NAME) */ -#if IS_ENABLED(CONFIG_BINDESC_C_COMPILER_VERSION) +#if defined(CONFIG_BINDESC_C_COMPILER_VERSION) extern const struct bindesc_entry BINDESC_NAME(c_compiler_version); -#endif /* IS_ENABLED(CONFIG_BINDESC_C_COMPILER_VERSION) */ +#endif /* defined(CONFIG_BINDESC_C_COMPILER_VERSION) */ -#if IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_NAME) +#if defined(CONFIG_BINDESC_CXX_COMPILER_NAME) extern const struct bindesc_entry BINDESC_NAME(cxx_compiler_name); -#endif /* IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_NAME) */ +#endif /* defined(CONFIG_BINDESC_CXX_COMPILER_NAME) */ -#if IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_VERSION) +#if defined(CONFIG_BINDESC_CXX_COMPILER_VERSION) extern const struct bindesc_entry BINDESC_NAME(cxx_compiler_version); -#endif /* IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_VERSION) */ +#endif /* defined(CONFIG_BINDESC_CXX_COMPILER_VERSION) */ -#endif /* !IS_ENABLED(_LINKER) */ +#endif /* !defined(_LINKER) */ + +/** + * @} + */ #ifdef __cplusplus } diff --git a/include/zephyr/device.h b/include/zephyr/device.h index 4f8c9a260a7d85..2862c0befd38b4 100644 --- a/include/zephyr/device.h +++ b/include/zephyr/device.h @@ -422,10 +422,6 @@ struct device { */ Z_DEVICE_DEPS_CONST device_handle_t *deps; #endif /* CONFIG_DEVICE_DEPS */ -#if defined(CONFIG_PM_POLICY_DEVICE_CONSTRAINTS) || defined(__DOXYGEN__) - struct pm_state_constraint const *pm_constraints; - size_t pm_constraints_size; -#endif /* CONFIG_PM */ #if defined(CONFIG_PM_DEVICE) || defined(__DOXYGEN__) /** * Reference to the device PM resources (only available if @@ -876,59 +872,6 @@ __syscall int device_init(const struct device *dev); } #endif /* CONFIG_DEVICE_DEPS */ - -#if defined(CONFIG_PM_POLICY_DEVICE_CONSTRAINTS) || defined(__DOXYGEN__) - -/** - * @brief Synthesize the name of the object that holds a device pm constraint. - * - * @param dev_id Device identifier. - */ -#define Z_DEVICE_PM_CONSTRAINTS_NAME(dev_id) _CONCAT(__devicepmconstraints_, dev_id) - -/** - * @brief initialize a device pm constraint with information from devicetree. - * - * @param node_id Node identifier. - */ -#define Z_PM_STATE_CONSTRAINT_DT_INIT(node_id) \ - { \ - .state = PM_STATE_DT_INIT(node_id), \ - .substate_id = DT_PROP_OR(node_id, substate_id, 0), \ - } - -#define Z_PM_STATE_FROM_DT_DEVICE(i, node_id) \ - COND_CODE_1(DT_NODE_HAS_STATUS(DT_PHANDLE_BY_IDX(node_id, \ - zephyr_disabling_power_states, i), okay), \ - (Z_PM_STATE_CONSTRAINT_DT_INIT(DT_PHANDLE_BY_IDX(node_id, \ - zephyr_disabling_power_states, i)),), ()) - -/** - * @brief Helper macro to generate a list of device pm constraints. - */ -#define Z_PM_STATE_CONSTRAINTS_FROM_DT_DEVICE(node_id) \ - { \ - LISTIFY(DT_PROP_LEN_OR(node_id, zephyr_disabling_power_states, 0), \ - Z_PM_STATE_FROM_DT_DEVICE, (), node_id) \ - } - -/** - * @brief Define device pm constraints. - * - * Defines a list of `pm_state_constraint` for a specific device from its - * devicetree definition. - * - * This information tell us which power states would cause power loss - * and intended to be used by a device to set power state constraints when - * it is in the middle of an operation. - */ -#define Z_DEVICE_PM_CONSTRAINTS_DEFINE(node_id, dev_id, ...) \ - Z_DECL_ALIGN(struct pm_state_constraint) \ - Z_DEVICE_PM_CONSTRAINTS_NAME(dev_id)[] = \ - Z_PM_STATE_CONSTRAINTS_FROM_DT_DEVICE(node_id); - -#endif /* CONFIG_PM_POLICY_DEVICE_CONSTRAINTS */ - #if defined(CONFIG_DEVICE_DT_METADATA) || defined(__DOXYGEN__) /** * @brief Devicetree node labels associated with a device @@ -1065,10 +1008,11 @@ device_get_dt_nodelabels(const struct device *dev) * @param api_ Reference to device API ops. * @param state_ Reference to device state. * @param deps_ Reference to device dependencies. + * @param node_id_ Devicetree node identifier * @param dev_id_ Device identifier token, as passed to Z_DEVICE_BASE_DEFINE */ -#define Z_DEVICE_INIT(name_, pm_, data_, config_, api_, state_, deps_, \ - constraints_size_, constraints_, dev_id_) \ +#define Z_DEVICE_INIT(name_, pm_, data_, config_, api_, state_, deps_, node_id_, \ + dev_id_) \ { \ .name = name_, \ .config = (config_), \ @@ -1076,13 +1020,11 @@ device_get_dt_nodelabels(const struct device *dev) .state = (state_), \ .data = (data_), \ IF_ENABLED(CONFIG_DEVICE_DEPS, (.deps = (deps_),)) /**/ \ - IF_ENABLED(CONFIG_PM_POLICY_DEVICE_CONSTRAINTS, \ - (.pm_constraints = (constraints_),)) \ - IF_ENABLED(CONFIG_PM_POLICY_DEVICE_CONSTRAINTS, \ - (.pm_constraints_size = (constraints_size_),)) \ - IF_ENABLED(CONFIG_PM_DEVICE, ({ .pm_base = (pm_),})) /**/ \ + IF_ENABLED(CONFIG_PM_DEVICE, ({ .pm_base = (pm_),},)) /**/ \ IF_ENABLED(CONFIG_DEVICE_DT_METADATA, \ - (.dt_meta = &Z_DEVICE_DT_METADATA_NAME_GET(dev_id_),)) \ + (IF_ENABLED(DT_NODE_EXISTS(node_id_), \ + (.dt_meta = &Z_DEVICE_DT_METADATA_NAME_GET( \ + dev_id_),)))) \ } /** @@ -1111,14 +1053,13 @@ device_get_dt_nodelabels(const struct device *dev) * @param ... Optional dependencies, manually specified. */ #define Z_DEVICE_BASE_DEFINE(node_id, dev_id, name, pm, data, config, level, prio, api, state, \ - deps, constraints) \ + deps) \ COND_CODE_1(DT_NODE_EXISTS(node_id), (), (static)) \ COND_CODE_1(Z_DEVICE_IS_MUTABLE(node_id), (), (const)) \ STRUCT_SECTION_ITERABLE_NAMED_ALTERNATE( \ device, COND_CODE_1(Z_DEVICE_IS_MUTABLE(node_id), (device_mutable), (device)), \ Z_DEVICE_SECTION_NAME(level, prio), DEVICE_NAME_GET(dev_id)) = \ - Z_DEVICE_INIT(name, pm, data, config, api, state, deps, \ - DT_PROP_LEN_OR(node_id, zephyr_disabling_power_states, 0), constraints, dev_id) + Z_DEVICE_INIT(name, pm, data, config, api, state, deps, node_id, dev_id) /* deprecated device initialization levels */ #define Z_DEVICE_LEVEL_DEPRECATED_EARLY \ @@ -1203,15 +1144,12 @@ device_get_dt_nodelabels(const struct device *dev) IF_ENABLED(CONFIG_DEVICE_DEPS, \ (Z_DEVICE_DEPS_DEFINE(node_id, dev_id, __VA_ARGS__);)) \ \ - IF_ENABLED(CONFIG_PM_POLICY_DEVICE_CONSTRAINTS, \ - (Z_DEVICE_PM_CONSTRAINTS_DEFINE(node_id, dev_id, __VA_ARGS__);))\ - \ IF_ENABLED(CONFIG_DEVICE_DT_METADATA, \ - (Z_DEVICE_DT_METADATA_DEFINE(node_id, dev_id);)) \ + (IF_ENABLED(DT_NODE_EXISTS(node_id), \ + (Z_DEVICE_DT_METADATA_DEFINE(node_id, dev_id);))))\ \ Z_DEVICE_BASE_DEFINE(node_id, dev_id, name, pm, data, config, level, \ - prio, api, state, Z_DEVICE_DEPS_NAME(dev_id), \ - Z_DEVICE_PM_CONSTRAINTS_NAME(dev_id)); \ + prio, api, state, Z_DEVICE_DEPS_NAME(dev_id)); \ COND_CODE_1(DEVICE_DT_DEFER(node_id), \ (Z_DEFER_DEVICE_INIT_ENTRY_DEFINE(node_id, dev_id, \ init_fn)), \ diff --git a/include/zephyr/display/cfb.h b/include/zephyr/display/cfb.h index 9d425be464e8aa..6d10debe676c36 100644 --- a/include/zephyr/display/cfb.h +++ b/include/zephyr/display/cfb.h @@ -241,6 +241,13 @@ int cfb_get_numof_fonts(const struct device *dev); */ int cfb_framebuffer_init(const struct device *dev); +/** + * @brief Deinitialize Character Framebuffer. + * + * @param dev Pointer to device structure for driver instance + */ +void cfb_framebuffer_deinit(const struct device *dev); + #ifdef __cplusplus } #endif diff --git a/include/zephyr/logging/log.h b/include/zephyr/logging/log.h index 7edfca9ad8fabb..fbbefd6486676f 100644 --- a/include/zephyr/logging/log.h +++ b/include/zephyr/logging/log.h @@ -328,7 +328,8 @@ void z_log_vprintk(const char *fmt, va_list ap); log_source_const_data, \ Z_LOG_ITEM_CONST_DATA(_name)) = \ { \ - .name = COND_CODE_1(CONFIG_LOG_FMT_SECTION, \ + .name = IS_ENABLED(LOG_FMT_SECTION_STRIP) ? NULL : \ + COND_CODE_1(CONFIG_LOG_FMT_SECTION, \ (UTIL_CAT(_name, _str)), (STRINGIFY(_name))), \ .level = (_level) \ } diff --git a/include/zephyr/logging/log_output_dict.h b/include/zephyr/logging/log_output_dict.h index 23271cf34950d7..12ab2aaad800e7 100644 --- a/include/zephyr/logging/log_output_dict.h +++ b/include/zephyr/logging/log_output_dict.h @@ -30,10 +30,10 @@ enum log_dict_output_msg_type { */ struct log_dict_output_normal_msg_hdr_t { uint8_t type; - uint32_t domain:3; - uint32_t level:3; - uint32_t package_len:10; - uint32_t data_len:12; + uint32_t domain:4; + uint32_t level:4; + uint32_t package_len:16; + uint32_t data_len:16; uintptr_t source; log_timestamp_t timestamp; } __packed; diff --git a/include/zephyr/mgmt/mcumgr/grp/img_mgmt/img_mgmt.h b/include/zephyr/mgmt/mcumgr/grp/img_mgmt/img_mgmt.h index c11e423e26dd3a..82e642c737577d 100644 --- a/include/zephyr/mgmt/mcumgr/grp/img_mgmt/img_mgmt.h +++ b/include/zephyr/mgmt/mcumgr/grp/img_mgmt/img_mgmt.h @@ -345,7 +345,7 @@ int img_mgmt_state_confirm(void); */ int img_mgmt_vercmp(const struct image_version *a, const struct image_version *b); -#if IS_ENABLED(CONFIG_MCUMGR_GRP_IMG_MUTEX) +#if defined(CONFIG_MCUMGR_GRP_IMG_MUTEX) /* * @brief Will reset the image management state back to default (no ongoing upload), * requires that CONFIG_MCUMGR_GRP_IMG_MUTEX be enabled to allow for mutex diff --git a/include/zephyr/mgmt/mcumgr/mgmt/mgmt.h b/include/zephyr/mgmt/mcumgr/mgmt/mgmt.h index 9a139b3a04b785..a247a1c283de95 100644 --- a/include/zephyr/mgmt/mcumgr/mgmt/mgmt.h +++ b/include/zephyr/mgmt/mcumgr/mgmt/mgmt.h @@ -74,7 +74,7 @@ typedef int (*mgmt_handler_fn)(struct smp_streamer *ctxt); struct mgmt_handler { mgmt_handler_fn mh_read; mgmt_handler_fn mh_write; -#if IS_ENABLED(CONFIG_MCUMGR_MGMT_HANDLER_USER_DATA) +#if defined(CONFIG_MCUMGR_MGMT_HANDLER_USER_DATA) void *user_data; #endif }; @@ -93,7 +93,7 @@ struct mgmt_group { /** The numeric ID of this group. */ uint16_t mg_group_id; -#if IS_ENABLED(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL) +#if defined(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL) /** A function handler for translating version 2 SMP error codes to version 1 SMP error * codes (optional) */ @@ -152,7 +152,7 @@ const struct mgmt_group *mgmt_find_group(uint16_t group_id); */ const struct mgmt_handler *mgmt_get_handler(const struct mgmt_group *group, uint16_t command_id); -#if IS_ENABLED(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL) +#if defined(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL) /** * @brief Finds a registered error translation function for converting from SMP * version 2 error codes to legacy SMP version 1 error codes. diff --git a/include/zephyr/mgmt/mcumgr/smp/smp.h b/include/zephyr/mgmt/mcumgr/smp/smp.h index fc148e2fad71eb..c72461a939a325 100644 --- a/include/zephyr/mgmt/mcumgr/smp/smp.h +++ b/include/zephyr/mgmt/mcumgr/smp/smp.h @@ -56,7 +56,7 @@ struct cbor_nb_writer { struct net_buf *nb; zcbor_state_t zs[CONFIG_MCUMGR_SMP_CBOR_MAX_ENCODING_LEVELS + 2]; -#if IS_ENABLED(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL) +#if defined(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL) uint16_t error_group; uint16_t error_ret; #endif @@ -127,7 +127,7 @@ __deprecated inline bool smp_add_cmd_ret(zcbor_state_t *zse, uint16_t group, uin return smp_add_cmd_err(zse, group, ret); } -#if IS_ENABLED(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL) +#if defined(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL) /** @typedef smp_translate_error_fn * @brief Translates a SMP version 2 error response to a legacy SMP version 1 error code. * diff --git a/include/zephyr/net/socket.h b/include/zephyr/net/socket.h index a1df517d0f2eb6..9af729faecd85a 100644 --- a/include/zephyr/net/socket.h +++ b/include/zephyr/net/socket.h @@ -625,10 +625,7 @@ static inline int zsock_ioctl_wrapper(int sock, unsigned long request, ...) * it may conflict with generic POSIX ``poll()`` function). * @endrst */ -static inline int zsock_poll(struct zsock_pollfd *fds, int nfds, int timeout) -{ - return zvfs_poll(fds, nfds, timeout); -} +__syscall int zsock_poll(struct zsock_pollfd *fds, int nfds, int timeout); /** * @brief Get various socket options diff --git a/include/zephyr/net/socket_poll.h b/include/zephyr/net/socket_poll.h index 934ca3ce6f1625..97e03804311ab2 100644 --- a/include/zephyr/net/socket_poll.h +++ b/include/zephyr/net/socket_poll.h @@ -7,8 +7,6 @@ #ifndef ZEPHYR_INCLUDE_NET_SOCKET_POLL_H_ #define ZEPHYR_INCLUDE_NET_SOCKET_POLL_H_ -#include - /* Setting for pollfd to avoid circular inclusion */ /** @@ -27,7 +25,11 @@ extern "C" { * * An array of these descriptors is passed as an argument to poll(). */ -#define zsock_pollfd zvfs_pollfd +struct zsock_pollfd { + int fd; /**< Socket descriptor */ + short events; /**< Requested events */ + short revents; /**< Returned events */ +}; #ifdef __cplusplus } diff --git a/include/zephyr/net/socket_select.h b/include/zephyr/net/socket_select.h index 3eaa9aacfcfe86..5fca2950d6a596 100644 --- a/include/zephyr/net/socket_select.h +++ b/include/zephyr/net/socket_select.h @@ -19,18 +19,17 @@ * @{ */ -#include - #include #include -#include #ifdef __cplusplus extern "C" { #endif /** Socket file descriptor set. */ -typedef struct zvfs_fd_set zsock_fd_set; +typedef struct zsock_fd_set { + uint32_t bitset[(CONFIG_ZVFS_OPEN_MAX + 31) / 32]; +} zsock_fd_set; /** * @brief Legacy function to poll multiple sockets for events @@ -48,19 +47,13 @@ typedef struct zvfs_fd_set zsock_fd_set; * it may conflict with generic POSIX ``select()`` function). * @endrst */ -static inline int zsock_select(int nfds, zsock_fd_set *readfds, zsock_fd_set *writefds, - zsock_fd_set *exceptfds, struct zsock_timeval *timeout) -{ - struct timespec to = { - .tv_sec = (timeout == NULL) ? 0 : timeout->tv_sec, - .tv_nsec = (long)((timeout == NULL) ? 0 : timeout->tv_usec * NSEC_PER_USEC)}; - - return zvfs_select(nfds, (struct zvfs_fd_set *)readfds, (struct zvfs_fd_set *)writefds, - (struct zvfs_fd_set *)exceptfds, (timeout == NULL) ? NULL : &to, NULL); -} +__syscall int zsock_select(int nfds, zsock_fd_set *readfds, + zsock_fd_set *writefds, + zsock_fd_set *exceptfds, + struct zsock_timeval *timeout); /** Number of file descriptors which can be added to zsock_fd_set */ -#define ZSOCK_FD_SETSIZE ZVFS_FD_SETSIZE +#define ZSOCK_FD_SETSIZE (sizeof(((zsock_fd_set *)0)->bitset) * 8) /** * @brief Initialize (clear) fd_set @@ -74,10 +67,7 @@ static inline int zsock_select(int nfds, zsock_fd_set *readfds, zsock_fd_set *wr * if :kconfig:option:`CONFIG_POSIX_API` is defined. * @endrst */ -static inline void ZSOCK_FD_ZERO(zsock_fd_set *set) -{ - ZVFS_FD_ZERO(set); -} +void ZSOCK_FD_ZERO(zsock_fd_set *set); /** * @brief Check whether socket is a member of fd_set @@ -91,10 +81,7 @@ static inline void ZSOCK_FD_ZERO(zsock_fd_set *set) * if :kconfig:option:`CONFIG_POSIX_API` is defined. * @endrst */ -static inline int ZSOCK_FD_ISSET(int fd, zsock_fd_set *set) -{ - return ZVFS_FD_ISSET(fd, set); -} +int ZSOCK_FD_ISSET(int fd, zsock_fd_set *set); /** * @brief Remove socket from fd_set @@ -108,10 +95,7 @@ static inline int ZSOCK_FD_ISSET(int fd, zsock_fd_set *set) * if :kconfig:option:`CONFIG_POSIX_API` is defined. * @endrst */ -static inline void ZSOCK_FD_CLR(int fd, zsock_fd_set *set) -{ - ZVFS_FD_CLR(fd, set); -} +void ZSOCK_FD_CLR(int fd, zsock_fd_set *set); /** * @brief Add socket to fd_set @@ -125,10 +109,7 @@ static inline void ZSOCK_FD_CLR(int fd, zsock_fd_set *set) * if :kconfig:option:`CONFIG_POSIX_API` is defined. * @endrst */ -static inline void ZSOCK_FD_SET(int fd, zsock_fd_set *set) -{ - ZVFS_FD_SET(fd, set); -} +void ZSOCK_FD_SET(int fd, zsock_fd_set *set); /** @cond INTERNAL_HIDDEN */ @@ -172,6 +153,8 @@ static inline void FD_SET(int fd, zsock_fd_set *set) } #endif +#include + /** * @} */ diff --git a/include/zephyr/posix/fcntl.h b/include/zephyr/posix/fcntl.h index 9aeef0caa6fbc4..9689d1ae8c3fbf 100644 --- a/include/zephyr/posix/fcntl.h +++ b/include/zephyr/posix/fcntl.h @@ -8,13 +8,9 @@ #define ZEPHYR_POSIX_FCNTL_H_ #ifdef CONFIG_PICOLIBC -#define O_CREAT 0x0040 -#define O_TRUNC 0x0200 -#define O_APPEND 0x0400 +#define O_CREAT 0x0040 #else -#define O_APPEND 0x0008 -#define O_CREAT 0x0200 -#define O_TRUNC 0x0400 +#define O_CREAT 0x0200 #endif #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) @@ -23,6 +19,7 @@ #define O_WRONLY 01 #define O_RDWR 02 +#define O_APPEND 0x0400 #define O_EXCL 0x0800 #define O_NONBLOCK 0x4000 diff --git a/include/zephyr/posix/posix_types.h b/include/zephyr/posix/posix_types.h index f90b21374fc8e7..cbe51fa7e8f9ff 100644 --- a/include/zephyr/posix/posix_types.h +++ b/include/zephyr/posix/posix_types.h @@ -21,7 +21,9 @@ extern "C" { #endif +#if !defined(CONFIG_ARCMWDT_LIBC) typedef int pid_t; +#endif #ifndef __useconds_t_defined typedef unsigned long useconds_t; diff --git a/include/zephyr/posix/signal.h b/include/zephyr/posix/signal.h index 7a1efdbd449ce8..165050f2ded928 100644 --- a/include/zephyr/posix/signal.h +++ b/include/zephyr/posix/signal.h @@ -77,16 +77,6 @@ typedef struct { #define SIG_UNBLOCK 2 #endif -#define SIG_DFL ((void *)0) -#define SIG_IGN ((void *)1) -#define SIG_ERR ((void *)-1) - -#define SI_USER 1 -#define SI_QUEUE 2 -#define SI_TIMER 3 -#define SI_ASYNCIO 4 -#define SI_MESGQ 5 - typedef int sig_atomic_t; /* Atomic entity type (ANSI) */ union sigval { @@ -102,34 +92,12 @@ struct sigevent { int sigev_signo; }; -typedef struct { - int si_signo; - int si_code; - union sigval si_value; -} siginfo_t; - -struct sigaction { - void (*sa_handler)(int signno); - sigset_t sa_mask; - int sa_flags; - void (*sa_sigaction)(int signo, siginfo_t *info, void *context); -}; - -unsigned int alarm(unsigned int seconds); -int kill(pid_t pid, int sig); -int pause(void); -int raise(int signo); -int sigaction(int sig, const struct sigaction *ZRESTRICT act, struct sigaction *ZRESTRICT oact); -int sigpending(sigset_t *set); -int sigsuspend(const sigset_t *sigmask); -int sigwait(const sigset_t *ZRESTRICT set, int *ZRESTRICT signo); char *strsignal(int signum); int sigemptyset(sigset_t *set); int sigfillset(sigset_t *set); int sigaddset(sigset_t *set, int signo); int sigdelset(sigset_t *set, int signo); int sigismember(const sigset_t *set, int signo); -void (*signal(int signo, void (*)(int signo)))(int signo); int sigprocmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset); int pthread_sigmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset); diff --git a/include/zephyr/posix/sys/select.h b/include/zephyr/posix/sys/select.h index 78d900f5316b2f..fc61c018e249f3 100644 --- a/include/zephyr/posix/sys/select.h +++ b/include/zephyr/posix/sys/select.h @@ -13,20 +13,16 @@ extern "C" { #endif -#undef fd_set #define fd_set zsock_fd_set - -#define FD_SETSIZE ZVFS_FD_SETSIZE +#define FD_SETSIZE ZSOCK_FD_SETSIZE +#define FD_ZERO ZSOCK_FD_ZERO +#define FD_SET ZSOCK_FD_SET +#define FD_CLR ZSOCK_FD_CLR +#define FD_ISSET ZSOCK_FD_ISSET struct timeval; -int pselect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, - const struct timespec *timeout, const void *sigmask); -int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout); -void FD_CLR(int fd, fd_set *fdset); -int FD_ISSET(int fd, fd_set *fdset); -void FD_SET(int fd, fd_set *fdset); -void FD_ZERO(fd_set *fdset); +int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); #ifdef __cplusplus } diff --git a/include/zephyr/retention/blinfo.h b/include/zephyr/retention/blinfo.h index e3a6e6b570d7a0..78cd12459bc3b5 100644 --- a/include/zephyr/retention/blinfo.h +++ b/include/zephyr/retention/blinfo.h @@ -33,7 +33,7 @@ extern "C" { * @{ */ -#if IS_ENABLED(CONFIG_RETENTION_BOOTLOADER_INFO_OUTPUT_FUNCTION) || defined(__DOXYGEN__) +#if defined(CONFIG_RETENTION_BOOTLOADER_INFO_OUTPUT_FUNCTION) || defined(__DOXYGEN__) /** * @brief Returns bootinfo information. * diff --git a/include/zephyr/sw_isr_table.h b/include/zephyr/sw_isr_table.h index ea708cba4f7d3a..3636f49591e8e6 100644 --- a/include/zephyr/sw_isr_table.h +++ b/include/zephyr/sw_isr_table.h @@ -183,7 +183,7 @@ extern struct z_shared_isr_table_entry z_shared_sw_isr_table[]; #define __MK_ISR_NAME(x, y) __isr_ ## x ## _irq_ ## y -#if IS_ENABLED(CONFIG_ISR_TABLES_LOCAL_DECLARATION) +#if defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) #define _MK_ISR_ELEMENT_NAME(func, id) __MK_ISR_ELEMENT_NAME(func, id) #define __MK_ISR_ELEMENT_NAME(func, id) __isr_table_entry_ ## func ## _irq_ ## id @@ -264,7 +264,7 @@ extern struct z_shared_isr_table_entry z_shared_sw_isr_table[]; Z_ISR_DECLARE_DIRECT_C(irq, flags, func, __COUNTER__) -#else /* IS_ENABLED(CONFIG_ISR_TABLES_LOCAL_DECLARATION) */ +#else /* defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) */ /* Create an instance of struct _isr_list which gets put in the .intList * section. This gets consumed by gen_isr_tables.py which creates the vector diff --git a/include/zephyr/sys/cbprintf.h b/include/zephyr/sys/cbprintf.h index 43fe4f921e8df9..2055eb6a0475be 100644 --- a/include/zephyr/sys/cbprintf.h +++ b/include/zephyr/sys/cbprintf.h @@ -302,6 +302,12 @@ typedef int (*cbprintf_cb)(int c, void *ctx); typedef int (*cbprintf_cb)(/* int c, void *ctx */); #endif +/* Create local cbprintf_cb type to make calng-based compilers happy when handles + * OUTC() macro (see below). With strict rules (Wincompatible-function-pointer-types-strict) + * it's prohibited to pass arguments with mismatched types. + */ +typedef int (*cbprintf_cb_local)(int c, void *ctx); + /** @brief Signature for a cbprintf multibyte callback function. * * @param buf data. diff --git a/include/zephyr/sys/fdtable.h b/include/zephyr/sys/fdtable.h index 871878eb53e097..785df8d42e0fc7 100644 --- a/include/zephyr/sys/fdtable.h +++ b/include/zephyr/sys/fdtable.h @@ -8,10 +8,9 @@ #include #include - /* FIXME: For native_posix ssize_t, off_t. */ #include -#include +#include #include /* File mode bits */ @@ -28,13 +27,6 @@ #define ZVFS_MODE_IFLNK 0120000 #define ZVFS_MODE_IFSOCK 0140000 -#define ZVFS_POLLIN BIT(0) -#define ZVFS_POLLPRI BIT(1) -#define ZVFS_POLLOUT BIT(2) -#define ZVFS_POLLERR BIT(3) -#define ZVFS_POLLHUP BIT(4) -#define ZVFS_POLLNVAL BIT(5) - #ifdef __cplusplus extern "C" { #endif @@ -200,31 +192,6 @@ static inline int zvfs_fdtable_call_ioctl(const struct fd_op_vtable *vtable, voi return res; } -struct zvfs_pollfd { - int fd; - short events; - short revents; -}; - -__syscall int zvfs_poll(struct zvfs_pollfd *fds, int nfds, int poll_timeout); - -struct zvfs_fd_set { - uint32_t bitset[(CONFIG_ZVFS_OPEN_MAX + 31) / 32]; -}; - -#define ZVFS_FD_SETSIZE (sizeof(((struct zvfs_fd_set *)0)->bitset) * 8) - -void ZVFS_FD_CLR(int fd, struct zvfs_fd_set *fdset); -int ZVFS_FD_ISSET(int fd, struct zvfs_fd_set *fdset); -void ZVFS_FD_SET(int fd, struct zvfs_fd_set *fdset); -void ZVFS_FD_ZERO(struct zvfs_fd_set *fdset); - -struct timespec; -__syscall int zvfs_select(int nfds, struct zvfs_fd_set *ZRESTRICT readfds, - struct zvfs_fd_set *ZRESTRICT writefds, - struct zvfs_fd_set *ZRESTRICT errorfds, - const struct timespec *ZRESTRICT timeout, const void *ZRESTRICT sigmask); - /** * Request codes for fd_op_vtable.ioctl(). * @@ -254,6 +221,4 @@ enum { } #endif -#include - #endif /* ZEPHYR_INCLUDE_SYS_FDTABLE_H_ */ diff --git a/include/zephyr/sys/mpsc_lockfree.h b/include/zephyr/sys/mpsc_lockfree.h index 3e6c89d99a051a..ccf9bc4d5a1c72 100644 --- a/include/zephyr/sys/mpsc_lockfree.h +++ b/include/zephyr/sys/mpsc_lockfree.h @@ -50,7 +50,7 @@ extern "C" { * On SMP atomics *must* be used to ensure the pointers * are updated in the correct order. */ -#if IS_ENABLED(CONFIG_SMP) +#if defined(CONFIG_SMP) typedef atomic_ptr_t mpsc_ptr_t; @@ -58,7 +58,7 @@ typedef atomic_ptr_t mpsc_ptr_t; #define mpsc_ptr_set(ptr, val) atomic_ptr_set(&(ptr), val) #define mpsc_ptr_set_get(ptr, val) atomic_ptr_set(&(ptr), val) -#else /* IS_ENABLED(CONFIG_SMP) */ +#else /* defined(CONFIG_SMP) */ typedef struct mpsc_node *mpsc_ptr_t; @@ -71,7 +71,7 @@ typedef struct mpsc_node *mpsc_ptr_t; tmp; \ }) -#endif /* IS_ENABLED(CONFIG_SMP) */ +#endif /* defined(CONFIG_SMP) */ /** * @brief Queue member diff --git a/include/zephyr/sys/spsc_pbuf.h b/include/zephyr/sys/spsc_pbuf.h index 0e7f018fa63ccc..a65d15cc5c4742 100644 --- a/include/zephyr/sys/spsc_pbuf.h +++ b/include/zephyr/sys/spsc_pbuf.h @@ -25,7 +25,11 @@ extern "C" { * @{ */ -/** @brief Flag indicating that cache shall be handled. */ +/** @brief Flag indicating that cache shall be handled. + * + * It shall be used only when packet buffer is shared between two cores as on a single + * core cache shall not be handled manually because it results in data corruption. + */ #define SPSC_PBUF_CACHE BIT(0) /** @brief Size of the field which stores maximum utilization. */ diff --git a/lib/libc/Kconfig b/lib/libc/Kconfig index 7a509fb06e5944..6607f62c521f07 100644 --- a/lib/libc/Kconfig +++ b/lib/libc/Kconfig @@ -105,7 +105,6 @@ config NEWLIB_LIBC imply POSIX_FD_MGMT_ALIAS_LSEEK imply POSIX_FILE_SYSTEM_ALIAS_FSTAT imply POSIX_MULTI_PROCESS_ALIAS_GETPID - imply POSIX_SIGNALS_ALIAS_KILL help Build with newlib library. The newlib library is expected to be part of the SDK in this case. diff --git a/lib/libc/arcmwdt/include/signal.h b/lib/libc/arcmwdt/include/signal.h new file mode 100644 index 00000000000000..cdd39d1ff18035 --- /dev/null +++ b/lib/libc/arcmwdt/include/signal.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2024 Synopsys + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef LIB_LIBC_ARCMWDT_INCLUDE_SIGNAL_H_ +#define LIB_LIBC_ARCMWDT_INCLUDE_SIGNAL_H_ + +#include + +#endif /* LIB_LIBC_ARCMWDT_INCLUDE_SIGNAL_H_ */ diff --git a/lib/os/CMakeLists.txt b/lib/os/CMakeLists.txt index 80f5f16f5d791a..4ce50ad4182921 100644 --- a/lib/os/CMakeLists.txt +++ b/lib/os/CMakeLists.txt @@ -12,9 +12,6 @@ zephyr_sources( ) zephyr_sources_ifdef(CONFIG_FDTABLE fdtable.c) -zephyr_syscall_header_ifdef(CONFIG_FDTABLE - ${ZEPHYR_BASE}/include/zephyr/sys/fdtable.h -) zephyr_sources_ifdef(CONFIG_CBPRINTF_COMPLETE cbprintf_complete.c) zephyr_sources_ifdef(CONFIG_CBPRINTF_NANO cbprintf_nano.c) diff --git a/lib/os/Kconfig b/lib/os/Kconfig index fa52338e525f10..9ce3be2a66ebfa 100644 --- a/lib/os/Kconfig +++ b/lib/os/Kconfig @@ -60,7 +60,9 @@ config SPSC_PBUF_CACHE_ALWAYS bool "Always handle cache" help Handle cache writeback and invalidation for all instances. Option used - to avoid runtime check and thus reduce memory footprint. + to avoid runtime check and thus reduce memory footprint. Beware! It shall + be used only if all packet buffer instances are used for data sharing + between cores. config SPSC_PBUF_CACHE_NEVER bool "Never handle cache" diff --git a/lib/os/cbprintf_complete.c b/lib/os/cbprintf_complete.c index f9fdca1481f82b..58502da63501ab 100644 --- a/lib/os/cbprintf_complete.c +++ b/lib/os/cbprintf_complete.c @@ -1345,12 +1345,13 @@ static inline void store_count(const struct conversion *conv, } /* Outline function to emit all characters in [sp, ep). */ -static int outs(cbprintf_cb out, +static int outs(cbprintf_cb __out, void *ctx, const char *sp, const char *ep) { size_t count = 0; + cbprintf_cb_local out = __out; while ((sp < ep) || ((ep == NULL) && *sp)) { int rc = out((int)*sp, ctx); @@ -1365,12 +1366,13 @@ static int outs(cbprintf_cb out, return (int)count; } -int z_cbvprintf_impl(cbprintf_cb out, void *ctx, const char *fp, +int z_cbvprintf_impl(cbprintf_cb __out, void *ctx, const char *fp, va_list ap, uint32_t flags) { char buf[CONVERTED_BUFLEN]; size_t count = 0; sint_value_type sint; + cbprintf_cb_local out = __out; const bool tagged_ap = (flags & Z_CBVPRINTF_PROCESS_FLAG_TAGGED_ARGS) == Z_CBVPRINTF_PROCESS_FLAG_TAGGED_ARGS; diff --git a/lib/os/cbprintf_nano.c b/lib/os/cbprintf_nano.c index d719fe8e663588..e4342939a9a5f3 100644 --- a/lib/os/cbprintf_nano.c +++ b/lib/os/cbprintf_nano.c @@ -73,7 +73,7 @@ static inline int convert_value(uint_value_type num, unsigned int base, * * @return printed byte count if CONFIG_CBPRINTF_LIBC_SUBSTS is set */ -int z_cbvprintf_impl(cbprintf_cb out, void *ctx, const char *fmt, +int z_cbvprintf_impl(cbprintf_cb __out, void *ctx, const char *fmt, va_list ap, uint32_t flags) { size_t count = 0; @@ -81,6 +81,7 @@ int z_cbvprintf_impl(cbprintf_cb out, void *ctx, const char *fmt, char *prefix, *data; int min_width, precision, data_len; char padding_mode, length_mod, special; + cbprintf_cb_local out = __out; const bool tagged_ap = (flags & Z_CBVPRINTF_PROCESS_FLAG_TAGGED_ARGS) == Z_CBVPRINTF_PROCESS_FLAG_TAGGED_ARGS; diff --git a/lib/os/fdtable.c b/lib/os/fdtable.c index 52f62f69cd0e9f..9594afdd8cd6c0 100644 --- a/lib/os/fdtable.c +++ b/lib/os/fdtable.c @@ -14,7 +14,6 @@ */ #include -#include #include #include @@ -73,12 +72,6 @@ static struct fd_entry fdtable[CONFIG_ZVFS_OPEN_MAX] = { #endif }; -#ifdef CONFIG_POSIX_DEVICE_IO_STDIN_STDOUT_STDERR -FILE *stdin = &fdtable[0]; -FILE *stdout = &fdtable[1]; -FILE *stderr = &fdtable[2]; -#endif - static K_MUTEX_DEFINE(fdtable_lock); static int z_fd_ref(int fd) @@ -308,160 +301,77 @@ int zvfs_alloc_fd(void *obj, const struct fd_op_vtable *vtable) return fd; } -static bool supports_pread_pwrite(uint32_t mode) +ssize_t zvfs_read(int fd, void *buf, size_t sz) { - switch (mode & ZVFS_MODE_IFMT) { - case ZVFS_MODE_IFSHM: - return true; - default: - return false; - } -} - -static ssize_t zvfs_rw(int fd, void *buf, size_t sz, bool is_write, const size_t *from_offset) -{ - bool prw; ssize_t res; - const size_t *off; if (_check_fd(fd) < 0) { return -1; } (void)k_mutex_lock(&fdtable[fd].lock, K_FOREVER); - - prw = supports_pread_pwrite(fdtable[fd].mode); - if (from_offset != NULL && !prw) { - /* - * Seekable file types should support pread() / pwrite() and per-fd offset passing. - * Otherwise, it's a bug. - */ - errno = ENOTSUP; - res = -1; - goto unlock; - } - - /* If there is no specified from_offset, then use the current offset of the fd */ - off = (from_offset == NULL) ? &fdtable[fd].offset : from_offset; - - if (is_write) { - if (fdtable[fd].vtable->write_offs == NULL) { - res = -1; - errno = EIO; - } else { - res = fdtable[fd].vtable->write_offs(fdtable[fd].obj, buf, sz, *off); - } - } else { - if (fdtable[fd].vtable->read_offs == NULL) { - res = -1; - errno = EIO; - } else { - res = fdtable[fd].vtable->read_offs(fdtable[fd].obj, buf, sz, *off); + res = fdtable[fd].vtable->read_offs(fdtable[fd].obj, buf, sz, fdtable[fd].offset); + if (res > 0) { + switch (fdtable[fd].mode & ZVFS_MODE_IFMT) { + case ZVFS_MODE_IFDIR: + case ZVFS_MODE_IFBLK: + case ZVFS_MODE_IFSHM: + case ZVFS_MODE_IFREG: + fdtable[fd].offset += res; + break; + default: + break; } } - if (res > 0 && prw && from_offset == NULL) { - /* - * only update the fd offset when from_offset is not specified - * See pread() / pwrite() - */ - fdtable[fd].offset += res; - } - -unlock: k_mutex_unlock(&fdtable[fd].lock); return res; } -ssize_t zvfs_read(int fd, void *buf, size_t sz, const size_t *from_offset) +ssize_t zvfs_write(int fd, const void *buf, size_t sz) { - return zvfs_rw(fd, buf, sz, false, from_offset); -} - -ssize_t zvfs_write(int fd, const void *buf, size_t sz, const size_t *from_offset) -{ - return zvfs_rw(fd, (void *)buf, sz, true, from_offset); -} - -int zvfs_close(int fd) -{ - int res = 0; + ssize_t res; if (_check_fd(fd) < 0) { return -1; } (void)k_mutex_lock(&fdtable[fd].lock, K_FOREVER); - if (fdtable[fd].vtable->close != NULL) { - /* close() is optional - e.g. stdinout_fd_op_vtable */ - res = fdtable[fd].vtable->close(fdtable[fd].obj); + res = fdtable[fd].vtable->write_offs(fdtable[fd].obj, buf, sz, fdtable[fd].offset); + if (res > 0) { + switch (fdtable[fd].mode & ZVFS_MODE_IFMT) { + case ZVFS_MODE_IFDIR: + case ZVFS_MODE_IFBLK: + case ZVFS_MODE_IFSHM: + case ZVFS_MODE_IFREG: + fdtable[fd].offset += res; + break; + default: + break; + } } k_mutex_unlock(&fdtable[fd].lock); - zvfs_free_fd(fd); - return res; } -FILE *zvfs_fdopen(int fd, const char *mode) -{ - ARG_UNUSED(mode); - - if (_check_fd(fd) < 0) { - return NULL; - } - - return (FILE *)&fdtable[fd]; -} - -int zvfs_fileno(FILE *file) -{ - if (!IS_ARRAY_ELEMENT(fdtable, file)) { - errno = EBADF; - return -1; - } - - return (struct fd_entry *)file - fdtable; -} - -int zvfs_dup(int fd, int *newfd) +int zvfs_close(int fd) { - int ret; + int res; if (_check_fd(fd) < 0) { return -1; } - (void)k_mutex_lock(&fdtable_lock, K_FOREVER); + (void)k_mutex_lock(&fdtable[fd].lock, K_FOREVER); - if (newfd == NULL) { - /* dup() - just find lowest-numbered fd */ - ret = _find_fd_entry(); - } else { - /* dup2() - check if newfd is valid */ - if (_check_fd(*newfd) < 0) { - ret = -1; - } else { - if (fdtable[fd].vtable->close) { - (void)fdtable[fd].vtable->close(fdtable[fd].obj); - } - ret = *newfd; - } - } + res = fdtable[fd].vtable->close(fdtable[fd].obj); - if (ret >= 0) { - /* Mark entry as used and initialize fields */ - if (newfd == NULL) { - (void)z_fd_ref(ret); - } - fdtable[ret] = fdtable[fd]; - k_mutex_init(&fdtable[ret].lock); - k_condvar_init(&fdtable[ret].cond); - } + k_mutex_unlock(&fdtable[fd].lock); - k_mutex_unlock(&fdtable_lock); + zvfs_free_fd(fd); - return ret; + return res; } int zvfs_fstat(int fd, struct stat *buf) @@ -583,7 +493,7 @@ static ssize_t stdinout_read_vmeth(void *obj, void *buffer, size_t count) static ssize_t stdinout_write_vmeth(void *obj, const void *buffer, size_t count) { #if defined(CONFIG_BOARD_NATIVE_POSIX) - return zvfs_write(1, buffer, count, NULL); + return zvfs_write(1, buffer, count); #elif defined(CONFIG_NEWLIB_LIBC) || defined(CONFIG_ARCMWDT_LIBC) return z_impl_zephyr_write_stdout(buffer, count); #else diff --git a/lib/os/zvfs/CMakeLists.txt b/lib/os/zvfs/CMakeLists.txt index d855d1005efc6c..ca191a4d3ad7af 100644 --- a/lib/os/zvfs/CMakeLists.txt +++ b/lib/os/zvfs/CMakeLists.txt @@ -2,5 +2,3 @@ zephyr_library() zephyr_library_sources_ifdef(CONFIG_ZVFS_EVENTFD zvfs_eventfd.c) -zephyr_library_sources_ifdef(CONFIG_ZVFS_POLL zvfs_poll.c) -zephyr_library_sources_ifdef(CONFIG_ZVFS_SELECT zvfs_select.c) diff --git a/lib/os/zvfs/Kconfig b/lib/os/zvfs/Kconfig index df107c24c626db..7f50ff52befc24 100644 --- a/lib/os/zvfs/Kconfig +++ b/lib/os/zvfs/Kconfig @@ -16,7 +16,7 @@ if ZVFS config ZVFS_EVENTFD bool "ZVFS event file descriptor support" - imply ZVFS_POLL + select POLL help Enable support for ZVFS event file descriptors. An eventfd can be used as an event wait/notify mechanism together with POSIX calls @@ -33,27 +33,4 @@ config ZVFS_EVENTFD_MAX endif # ZVFS_EVENTFD -config ZVFS_POLL - bool "ZVFS poll" - select POLL - help - Enable support for zvfs_poll(). - -if ZVFS_POLL - -config ZVFS_POLL_MAX - int "Max number of supported zvfs_poll() entries" - default 6 if WIFI_NM_WPA_SUPPLICANT - default 4 if SHELL_BACKEND_TELNET - default 3 - help - Maximum number of entries supported for poll() call. - -config ZVFS_SELECT - bool "ZVFS select" - help - Enable support for zvfs_select(). - -endif # ZVFS_POLL - endif # ZVFS diff --git a/lib/os/zvfs/zvfs_poll.c b/lib/os/zvfs/zvfs_poll.c deleted file mode 100644 index 45aec5cfb8d24c..00000000000000 --- a/lib/os/zvfs/zvfs_poll.c +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2017-2018 Linaro Limited - * Copyright (c) 2021 Nordic Semiconductor - * Copyright (c) 2023 Arm Limited (or its affiliates). All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include - -#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS) -bool net_socket_is_tls(void *obj); -#else -#define net_socket_is_tls(obj) false -#endif - -int zvfs_poll_internal(struct zvfs_pollfd *fds, int nfds, k_timeout_t timeout) -{ - bool retry; - int ret = 0; - int i; - struct zvfs_pollfd *pfd; - struct k_poll_event poll_events[CONFIG_ZVFS_POLL_MAX]; - struct k_poll_event *pev; - struct k_poll_event *pev_end = poll_events + ARRAY_SIZE(poll_events); - const struct fd_op_vtable *vtable; - struct k_mutex *lock; - k_timepoint_t end; - bool offload = false; - const struct fd_op_vtable *offl_vtable = NULL; - void *offl_ctx = NULL; - - end = sys_timepoint_calc(timeout); - - pev = poll_events; - for (pfd = fds, i = nfds; i--; pfd++) { - void *ctx; - int result; - - /* Per POSIX, negative fd's are just ignored */ - if (pfd->fd < 0) { - continue; - } - - ctx = zvfs_get_fd_obj_and_vtable(pfd->fd, &vtable, &lock); - if (ctx == NULL) { - /* Will set POLLNVAL in return loop */ - continue; - } - - (void)k_mutex_lock(lock, K_FOREVER); - - result = zvfs_fdtable_call_ioctl(vtable, ctx, ZFD_IOCTL_POLL_PREPARE, pfd, &pev, - pev_end); - if (result == -EALREADY) { - /* If POLL_PREPARE returned with EALREADY, it means - * it already detected that some socket is ready. In - * this case, we still perform a k_poll to pick up - * as many events as possible, but without any wait. - */ - timeout = K_NO_WAIT; - end = sys_timepoint_calc(timeout); - result = 0; - } else if (result == -EXDEV) { - /* If POLL_PREPARE returned EXDEV, it means - * it detected an offloaded socket. - * If offloaded socket is used with native TLS, the TLS - * wrapper for the offloaded poll will be used. - * In case the fds array contains a mixup of offloaded - * and non-offloaded sockets, the offloaded poll handler - * shall return an error. - */ - offload = true; - if (offl_vtable == NULL || net_socket_is_tls(ctx)) { - offl_vtable = vtable; - offl_ctx = ctx; - } - - result = 0; - } - - k_mutex_unlock(lock); - - if (result < 0) { - errno = -result; - return -1; - } - } - - if (offload) { - int poll_timeout; - - if (K_TIMEOUT_EQ(timeout, K_FOREVER)) { - poll_timeout = SYS_FOREVER_MS; - } else { - poll_timeout = k_ticks_to_ms_floor32(timeout.ticks); - } - - return zvfs_fdtable_call_ioctl(offl_vtable, offl_ctx, ZFD_IOCTL_POLL_OFFLOAD, fds, - nfds, poll_timeout); - } - - timeout = sys_timepoint_timeout(end); - - do { - ret = k_poll(poll_events, pev - poll_events, timeout); - /* EAGAIN when timeout expired, EINTR when cancelled (i.e. EOF) */ - if (ret != 0 && ret != -EAGAIN && ret != -EINTR) { - errno = -ret; - return -1; - } - - retry = false; - ret = 0; - - pev = poll_events; - for (pfd = fds, i = nfds; i--; pfd++) { - void *ctx; - int result; - - pfd->revents = 0; - - if (pfd->fd < 0) { - continue; - } - - ctx = zvfs_get_fd_obj_and_vtable(pfd->fd, &vtable, &lock); - if (ctx == NULL) { - pfd->revents = ZVFS_POLLNVAL; - ret++; - continue; - } - - (void)k_mutex_lock(lock, K_FOREVER); - - result = zvfs_fdtable_call_ioctl(vtable, ctx, ZFD_IOCTL_POLL_UPDATE, pfd, - &pev); - k_mutex_unlock(lock); - - if (result == -EAGAIN) { - retry = true; - continue; - } else if (result != 0) { - errno = -result; - return -1; - } - - if (pfd->revents != 0) { - ret++; - } - } - - if (retry) { - if (ret > 0) { - break; - } - - timeout = sys_timepoint_timeout(end); - - if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { - break; - } - } - } while (retry); - - return ret; -} - -int z_impl_zvfs_poll(struct zvfs_pollfd *fds, int nfds, int poll_timeout) -{ - k_timeout_t timeout; - - if (poll_timeout < 0) { - timeout = K_FOREVER; - } else { - timeout = K_MSEC(poll_timeout); - } - - return zvfs_poll_internal(fds, nfds, timeout); -} - -#ifdef CONFIG_USERSPACE -static inline int z_vrfy_zvfs_poll(struct zvfs_pollfd *fds, int nfds, int timeout) -{ - struct zvfs_pollfd *fds_copy; - size_t fds_size; - int ret; - - /* Copy fds array from user mode */ - if (size_mul_overflow(nfds, sizeof(struct zvfs_pollfd), &fds_size)) { - errno = EFAULT; - return -1; - } - fds_copy = k_usermode_alloc_from_copy((void *)fds, fds_size); - if (!fds_copy) { - errno = ENOMEM; - return -1; - } - - ret = z_impl_zvfs_poll(fds_copy, nfds, timeout); - - if (ret >= 0) { - k_usermode_to_copy((void *)fds, fds_copy, fds_size); - } - k_free(fds_copy); - - return ret; -} -#include -#endif diff --git a/lib/posix/options/Kconfig.device_io b/lib/posix/options/Kconfig.device_io index f50165bd330eae..9cfbd453102bcb 100644 --- a/lib/posix/options/Kconfig.device_io +++ b/lib/posix/options/Kconfig.device_io @@ -6,11 +6,8 @@ menu "POSIX device I/O" config POSIX_DEVICE_IO bool "POSIX device I/O [EXPERIMENTAL]" + select FDTABLE select EXPERIMENTAL - select REQUIRES_FULL_LIBC - select ZVFS - select ZVFS_POLL - select ZVFS_SELECT help Select 'y' here and Zephyr will provide an implementation of the POSIX_DEVICE_IO Option Group such as FD_CLR(), FD_ISSET(), FD_SET(), FD_ZERO(), close(), fdopen(), fileno(), open(), @@ -27,30 +24,22 @@ if POSIX_DEVICE_IO config POSIX_DEVICE_IO_ALIAS_CLOSE bool help - When selected via Kconfig, Zephyr will provide an alias for close() as _close(). + Select 'y' here and Zephyr will provide an alias for close() as _close(). config POSIX_DEVICE_IO_ALIAS_OPEN bool help - When selected via Kconfig, Zephyr will provide an alias for open() as _open(). + Select 'y' here and Zephyr will provide an alias for open() as _open(). config POSIX_DEVICE_IO_ALIAS_READ bool help - When selected via Kconfig, Zephyr will provide an alias for read() as _read(). + Select 'y' here and Zephyr will provide an alias for read() as _read(). config POSIX_DEVICE_IO_ALIAS_WRITE bool help - When selected via Kconfig, Zephyr will provide an alias for write() as _write(). - -config POSIX_DEVICE_IO_STDIN_STDOUT_STDERR - bool - help - When selected via Kconfig, Zephyr will provide the stdin, stdout, and stderr variables. - - Some libc's that implement the POSIX API may already have declared these variables. - However, it should be noted that they are a part of POSIX and not a part of ISO C. + Select 'y' here and Zephyr will provide an alias for write() as _write(). endif # POSIX_DEVICE_IO diff --git a/lib/posix/options/Kconfig.fd_mgmt b/lib/posix/options/Kconfig.fd_mgmt index fee6f17848f657..ca165395601482 100644 --- a/lib/posix/options/Kconfig.fd_mgmt +++ b/lib/posix/options/Kconfig.fd_mgmt @@ -5,8 +5,6 @@ menuconfig POSIX_FD_MGMT bool "POSIX file descriptor management [EXPERIMENTAL]" select EXPERIMENTAL - select FDTABLE - select REQUIRES_FULL_LIBC help Select 'y' here and Zephyr will provide implementations for the POSIX_FD_MGMT Option Group. This includes support for dup(), dup2(), fcntl(), fseeko(), ftello(), ftruncate(), @@ -23,16 +21,16 @@ if POSIX_FD_MGMT config POSIX_FD_MGMT_ALIAS_FCNTL bool help - When selected via Kconfig, Zephyr will provide an alias for fcntl() as _fcntl(). + Select 'y' here and Zephyr will provide an alias for fcntl() as _fcntl(). config POSIX_FD_MGMT_ALIAS_FTRUNCATE bool help - When selected via Kconfig, Zephyr will provide an alias for ftruncate() as _ftruncate(). + Select 'y' here and Zephyr will provide an alias for ftruncate() as _ftruncate(). config POSIX_FD_MGMT_ALIAS_LSEEK bool help - When selected via Kconfig, Zephyr will provide an alias for lseek() as _lseek(). + Select 'y' here and Zephyr will provide an alias for lseek() as _lseek(). endif # POSIX_FD_MGMT diff --git a/lib/posix/options/Kconfig.fs b/lib/posix/options/Kconfig.fs index bc492e5dc7a03d..663d706e3fb803 100644 --- a/lib/posix/options/Kconfig.fs +++ b/lib/posix/options/Kconfig.fs @@ -15,6 +15,6 @@ if POSIX_FILE_SYSTEM config POSIX_FILE_SYSTEM_ALIAS_FSTAT bool help - When selected via Kconfig, Zephyr will provide an alias for fstat() as _fstat(). + Select 'y' here and Zephyr will provide an alias for fstat() as _fstat(). endif # POSIX_FILE_SYSTEM diff --git a/lib/posix/options/Kconfig.signal b/lib/posix/options/Kconfig.signal index 1e84a55de598d6..4507302e3f32d0 100644 --- a/lib/posix/options/Kconfig.signal +++ b/lib/posix/options/Kconfig.signal @@ -24,7 +24,6 @@ endif # POSIX_REALTIME_SIGNALS config POSIX_SIGNALS bool "POSIX signals [EXPERIMENTAL]" select EXPERIMENTAL - select POSIX_MULTI_PROCESS help Enable support for POSIX signals. @@ -37,12 +36,6 @@ config POSIX_SIGNAL_STRING_DESC Use full description for the strsignal API. Will use 256 bytes of ROM. -# These options are intended to be used for compatibility with external POSIX -# implementations such as those in Newlib or Picolibc. - -config POSIX_SIGNALS_ALIAS_KILL - bool - endif endmenu # "Signal support" diff --git a/lib/posix/options/clock.c b/lib/posix/options/clock.c index 9ef0375803a173..65cd207b101189 100644 --- a/lib/posix/options/clock.c +++ b/lib/posix/options/clock.c @@ -225,7 +225,7 @@ static int __z_clock_nanosleep(clockid_t clock_id, int flags, const struct times ns = rqtp->tv_sec * NSEC_PER_SEC + rqtp->tv_nsec; } - uptime_ns = k_cyc_to_ns_ceil64(k_cycle_get_32()); + uptime_ns = k_ticks_to_ns_ceil64(sys_clock_tick_get()); if (flags & TIMER_ABSTIME && clock_id == CLOCK_REALTIME) { key = k_spin_lock(&rt_clock_base_lock); diff --git a/lib/posix/options/device_io.c b/lib/posix/options/device_io.c index 6fea22d01545d2..585dc7000c2be7 100644 --- a/lib/posix/options/device_io.c +++ b/lib/posix/options/device_io.c @@ -5,41 +5,18 @@ */ #include -#include #include -#include #include #include #include +#include /* prototypes for external, not-yet-public, functions in fdtable.c or fs.c */ int zvfs_close(int fd); -FILE *zvfs_fdopen(int fd, const char *mode); -int zvfs_fileno(FILE *file); -int zvfs_open(const char *name, int flags, int mode); -ssize_t zvfs_read(int fd, void *buf, size_t sz, size_t *from_offset); -ssize_t zvfs_write(int fd, const void *buf, size_t sz, size_t *from_offset); - -void FD_CLR(int fd, struct zvfs_fd_set *fdset) -{ - return ZVFS_FD_CLR(fd, fdset); -} - -int FD_ISSET(int fd, struct zvfs_fd_set *fdset) -{ - return ZVFS_FD_ISSET(fd, fdset); -} - -void FD_SET(int fd, struct zvfs_fd_set *fdset) -{ - ZVFS_FD_SET(fd, fdset); -} - -void FD_ZERO(fd_set *fdset) -{ - ZVFS_FD_ZERO(fdset); -} +int zvfs_open(const char *name, int flags); +ssize_t zvfs_read(int fd, void *buf, size_t sz); +ssize_t zvfs_write(int fd, const void *buf, size_t sz); int close(int fd) { @@ -49,28 +26,10 @@ int close(int fd) FUNC_ALIAS(close, _close, int); #endif -FILE *fdopen(int fd, const char *mode) -{ - return zvfs_fdopen(fd, mode); -} - -int fileno(FILE *file) -{ - return zvfs_fileno(file); -} - int open(const char *name, int flags, ...) { - int mode = 0; - va_list args; - - if ((flags & O_CREAT) != 0) { - va_start(args, flags); - mode = va_arg(args, int); - va_end(args); - } - - return zvfs_open(name, flags, mode); + /* FIXME: necessarily need to check for O_CREAT and unpack ... if set */ + return zvfs_open(name, flags); } #ifdef CONFIG_POSIX_DEVICE_IO_ALIAS_OPEN FUNC_ALIAS(open, _open, int); @@ -78,42 +37,13 @@ FUNC_ALIAS(open, _open, int); int poll(struct pollfd *fds, int nfds, int timeout) { - return zvfs_poll(fds, nfds, timeout); -} - -ssize_t pread(int fd, void *buf, size_t count, off_t offset) -{ - size_t off = (size_t)offset; - - if (offset < 0) { - errno = EINVAL; - return -1; - } - - return zvfs_read(fd, buf, count, (size_t *)&off); -} - -int pselect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, - const struct timespec *timeout, const void *sigmask) -{ - return zvfs_select(nfds, readfds, writefds, exceptfds, timeout, sigmask); -} - -ssize_t pwrite(int fd, void *buf, size_t count, off_t offset) -{ - size_t off = (size_t)offset; - - if (offset < 0) { - errno = EINVAL; - return -1; - } - - return zvfs_write(fd, buf, count, (size_t *)&off); + /* TODO: create zvfs_poll() and dispatch to subsystems based on file type */ + return zsock_poll(fds, nfds, timeout); } ssize_t read(int fd, void *buf, size_t sz) { - return zvfs_read(fd, buf, sz, NULL); + return zvfs_read(fd, buf, sz); } #ifdef CONFIG_POSIX_DEVICE_IO_ALIAS_READ FUNC_ALIAS(read, _read, ssize_t); @@ -121,17 +51,13 @@ FUNC_ALIAS(read, _read, ssize_t); int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) { - struct timespec to = { - .tv_sec = (timeout == NULL) ? 0 : timeout->tv_sec, - .tv_nsec = (long)((timeout == NULL) ? 0 : timeout->tv_usec * NSEC_PER_USEC)}; - - return zvfs_select(nfds, readfds, writefds, exceptfds, (timeout == NULL) ? NULL : &to, - NULL); + /* TODO: create zvfs_select() and dispatch to subsystems based on file type */ + return zsock_select(nfds, readfds, writefds, exceptfds, (struct zsock_timeval *)timeout); } ssize_t write(int fd, const void *buf, size_t sz) { - return zvfs_write(fd, buf, sz, NULL); + return zvfs_write(fd, buf, sz); } #ifdef CONFIG_POSIX_DEVICE_IO_ALIAS_WRITE FUNC_ALIAS(write, _write, ssize_t); diff --git a/lib/posix/options/fd_mgmt.c b/lib/posix/options/fd_mgmt.c index 923a133cf1f5ac..c1f60aca8e490f 100644 --- a/lib/posix/options/fd_mgmt.c +++ b/lib/posix/options/fd_mgmt.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include @@ -15,22 +14,10 @@ #include /* prototypes for external, not-yet-public, functions in fdtable.c or fs.c */ -int zvfs_dup(int fd, int *newfd); int zvfs_fcntl(int fd, int cmd, va_list arg); -int zvfs_fileno(FILE *file); int zvfs_ftruncate(int fd, off_t length); off_t zvfs_lseek(int fd, off_t offset, int whence); -int dup(int fd) -{ - return zvfs_dup(fd, NULL); -} - -int dup2(int oldfd, int newfd) -{ - return zvfs_dup(oldfd, &newfd); -} - int fcntl(int fd, int cmd, ...) { int ret; @@ -46,30 +33,6 @@ int fcntl(int fd, int cmd, ...) FUNC_ALIAS(fcntl, _fcntl, int); #endif /* CONFIG_POSIX_FD_MGMT_ALIAS_FCNTL */ -int fseeko(FILE *file, off_t offset, int whence) -{ - int fd; - - fd = zvfs_fileno(file); - if (fd < 0) { - return -1; - } - - return zvfs_lseek(fd, offset, whence); -} - -off_t ftello(FILE *file) -{ - int fd; - - fd = zvfs_fileno(file); - if (fd < 0) { - return -1; - } - - return zvfs_lseek(fd, 0, SEEK_CUR); -} - int ftruncate(int fd, off_t length) { return zvfs_ftruncate(fd, length); diff --git a/lib/posix/options/fs.c b/lib/posix/options/fs.c index a9d07b73293b23..a8bf1fb620fcdb 100644 --- a/lib/posix/options/fs.c +++ b/lib/posix/options/fs.c @@ -59,22 +59,37 @@ static inline void posix_fs_free_obj(struct posix_fs_desc *ptr) ptr->used = false; } -int zvfs_open(const char *name, int flags, int mode) +static int posix_mode_to_zephyr(int mf) +{ + int mode = (mf & O_CREAT) ? FS_O_CREATE : 0; + + mode |= (mf & O_APPEND) ? FS_O_APPEND : 0; + + switch (mf & O_ACCMODE) { + case O_RDONLY: + mode |= FS_O_READ; + break; + case O_WRONLY: + mode |= FS_O_WRITE; + break; + case O_RDWR: + mode |= FS_O_RDWR; + break; + default: + break; + } + + return mode; +} + +int zvfs_open(const char *name, int flags) { int rc, fd; struct posix_fs_desc *ptr = NULL; - int zflags = 0; - - if ((flags & O_ACCMODE) == O_RDONLY) { - zflags |= FS_O_READ; - } else if ((flags & O_ACCMODE) == O_WRONLY) { - zflags |= FS_O_WRITE; - } else if ((flags & O_ACCMODE) == O_RDWR) { - zflags |= FS_O_RDWR; - } + int zmode = posix_mode_to_zephyr(flags); - if ((flags & O_APPEND) != 0) { - zflags |= FS_O_APPEND; + if (zmode < 0) { + return zmode; } fd = zvfs_reserve_fd(); @@ -84,44 +99,24 @@ int zvfs_open(const char *name, int flags, int mode) ptr = posix_fs_alloc_obj(false); if (ptr == NULL) { - rc = -EMFILE; - goto out_err; + zvfs_free_fd(fd); + errno = EMFILE; + return -1; } fs_file_t_init(&ptr->file); - if (flags & O_CREAT) { - flags &= ~O_CREAT; + rc = fs_open(&ptr->file, name, zmode); - rc = fs_open(&ptr->file, name, FS_O_CREATE | (mode & O_ACCMODE)); - if (rc < 0) { - goto out_err; - } - rc = fs_close(&ptr->file); - if (rc < 0) { - goto out_err; - } - } - - rc = fs_open(&ptr->file, name, zflags); if (rc < 0) { - goto out_err; - } - - zvfs_finalize_fd(fd, ptr, &fs_fd_op_vtable); - - goto out; - -out_err: - if (ptr != NULL) { posix_fs_free_obj(ptr); + zvfs_free_fd(fd); + errno = -rc; + return -1; } - zvfs_free_fd(fd); - errno = -rc; - return -1; + zvfs_finalize_fd(fd, ptr, &fs_fd_op_vtable); -out: return fd; } diff --git a/lib/posix/options/multi_process.c b/lib/posix/options/multi_process.c index ab697a66c0c728..221dc04ae1ad97 100644 --- a/lib/posix/options/multi_process.c +++ b/lib/posix/options/multi_process.c @@ -21,6 +21,3 @@ pid_t getpid(void) return 42; } -#ifdef CONFIG_POSIX_MULTI_PROCESS_ALIAS_GETPID -FUNC_ALIAS(getpid, _getpid, pid_t); -#endif /* CONFIG_POSIX_MULTI_PROCESS_ALIAS_GETPID */ diff --git a/lib/posix/options/signal.c b/lib/posix/options/signal.c index 84171fde0f07ef..cb282f69bdc86d 100644 --- a/lib/posix/options/signal.c +++ b/lib/posix/options/signal.c @@ -118,62 +118,3 @@ int sigprocmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset errno = ENOSYS; return -1; } - -/* - * The functions below are provided so that conformant POSIX applications and libraries can still - * link. - */ - -unsigned int alarm(unsigned int seconds) -{ - ARG_UNUSED(seconds); - return 0; -} - -int kill(pid_t pid, int sig) -{ - ARG_UNUSED(pid); - ARG_UNUSED(sig); - errno = ENOSYS; - return -1; -} -#ifdef CONFIG_POSIX_SIGNALS_ALIAS_KILL -FUNC_ALIAS(kill, _kill, int); -#endif /* CONFIG_POSIX_SIGNALS_ALIAS_KILL */ - -int pause(void) -{ - errno = ENOSYS; - return -1; -} - -int sigaction(int sig, const struct sigaction *ZRESTRICT act, struct sigaction *ZRESTRICT oact) -{ - ARG_UNUSED(sig); - ARG_UNUSED(act); - ARG_UNUSED(oact); - errno = ENOSYS; - return -1; -} - -int sigpending(sigset_t *set) -{ - ARG_UNUSED(set); - errno = ENOSYS; - return -1; -} - -int sigsuspend(const sigset_t *sigmask) -{ - ARG_UNUSED(sigmask); - errno = ENOSYS; - return -1; -} - -int sigwait(const sigset_t *ZRESTRICT set, int *ZRESTRICT sig) -{ - ARG_UNUSED(set); - ARG_UNUSED(sig); - errno = ENOSYS; - return -1; -} diff --git a/lib/smf/smf.c b/lib/smf/smf.c index 0d7ac258fc1f43..2c050526a5662c 100644 --- a/lib/smf/smf.c +++ b/lib/smf/smf.c @@ -36,7 +36,9 @@ static bool share_paren(const struct smf_state *test_state, const struct smf_sta static const struct smf_state *get_child_of(const struct smf_state *states, const struct smf_state *parent) { - for (const struct smf_state *tmp = states;; tmp = tmp->parent) { + const struct smf_state *tmp = states; + + while (true) { if (tmp->parent == parent) { return tmp; } @@ -44,9 +46,9 @@ static const struct smf_state *get_child_of(const struct smf_state *states, if (tmp->parent == NULL) { return NULL; } - } - return NULL; + tmp = tmp->parent; + } } static const struct smf_state *get_last_of(const struct smf_state *states) diff --git a/modules/cmsis-nn/CMakeLists.txt b/modules/cmsis-nn/CMakeLists.txt index 9393a5ff21e068..ec55bafbcfa7af 100644 --- a/modules/cmsis-nn/CMakeLists.txt +++ b/modules/cmsis-nn/CMakeLists.txt @@ -33,21 +33,24 @@ if(CONFIG_CMSIS_NN) endif() if(CONFIG_CMSIS_NN_CONVOLUTION) - file(GLOB SRC "${CMSIS_NN_DIR}/Source/ConvolutionFunctions/*_s8*.c") + file(GLOB SRC_S4 "${CMSIS_NN_DIR}/Source/ConvolutionFunctions/*_s4*.c") + file(GLOB SRC_S8 "${CMSIS_NN_DIR}/Source/ConvolutionFunctions/*_s8*.c") file(GLOB SRC_S16 "${CMSIS_NN_DIR}/Source/ConvolutionFunctions/*_s16*.c") - zephyr_library_sources(${SRC} ${SRC_S16}) + zephyr_library_sources(${SRC_S4} ${SRC_S8} ${SRC_S16}) endif() if(CONFIG_CMSIS_NN_FULLYCONNECTED) - file(GLOB SRC "${CMSIS_NN_DIR}/Source/FullyConnectedFunctions/*_s8.c") + file(GLOB SRC_S4 "${CMSIS_NN_DIR}/Source/FullyConnectedFunctions/*_s4.c") + file(GLOB SRC_S8 "${CMSIS_NN_DIR}/Source/FullyConnectedFunctions/*_s8.c") file(GLOB SRC_S16 "${CMSIS_NN_DIR}/Source/FullyConnectedFunctions/*_s16*.c") - zephyr_library_sources(${SRC} ${SRC_S16}) + zephyr_library_sources(${SRC_S4} ${SRC_S8} ${SRC_S16}) endif() if(CONFIG_CMSIS_NN_NNSUPPORT) - file(GLOB SRC "${CMSIS_NN_DIR}/Source/NNSupportFunctions/*_s8*.c") + file(GLOB SRC_S4 "${CMSIS_NN_DIR}/Source/NNSupportFunctions/*_s4*.c") + file(GLOB SRC_S8 "${CMSIS_NN_DIR}/Source/NNSupportFunctions/*_s8*.c") file(GLOB SRC_S16 "${CMSIS_NN_DIR}/Source/NNSupportFunctions/*_s16*.c") - zephyr_library_sources(${SRC} ${SRC_S16} + zephyr_library_sources(${SRC_S4} ${SRC_S8} ${SRC_S16} ${CMSIS_NN_DIR}/Source/NNSupportFunctions/arm_nntables.c ${CMSIS_NN_DIR}/Source/NNSupportFunctions/arm_q7_to_q15_with_offset.c ${CMSIS_NN_DIR}/Source/NNSupportFunctions/arm_s8_to_s16_unordered_with_offset.c) diff --git a/modules/hal_nordic/nrfs/backends/nrfs_backend_ipc_service.c b/modules/hal_nordic/nrfs/backends/nrfs_backend_ipc_service.c index 172b5957b23920..7d2e45f19946eb 100644 --- a/modules/hal_nordic/nrfs/backends/nrfs_backend_ipc_service.c +++ b/modules/hal_nordic/nrfs/backends/nrfs_backend_ipc_service.c @@ -95,7 +95,7 @@ __weak void nrfs_backend_error_handler(enum nrfs_backend_error error_id, int err static void ipc_sysctrl_ept_bound(void *priv) { - LOG_INF("Bound to sysctrl."); + LOG_DBG("Bound to sysctrl."); k_event_post(&ipc_connected_event, IPC_INIT_DONE_EVENT); atomic_set(&ipc_cpusys_channel_config.status, CONNECTED); } @@ -150,7 +150,7 @@ static int ipc_channel_init(void) return ret; } - LOG_INF("ipc_service_open_instance() done."); + LOG_DBG("ipc_service_open_instance() done."); ret = ipc_service_register_endpoint(ch_cfg->ipc_instance, &ch_cfg->ipc_ept, @@ -160,7 +160,7 @@ static int ipc_channel_init(void) return ret; } - LOG_INF("ipc_service_register_endpoint() done."); + LOG_DBG("ipc_service_register_endpoint() done."); return ret; } diff --git a/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c b/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c index 883161e9f92361..047d961a59ce66 100644 --- a/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c +++ b/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c @@ -124,7 +124,7 @@ K_TIMER_DEFINE(dvfs_downscale_secure_timer, ld_dvfs_secure_downscale_timeout, NU */ __weak void ld_dvfs_secure_start_increased_power_consumption(void) { - LOG_INF("Start increased power consumption for DVFS sequence and start safety timer."); + LOG_DBG("Start increased power consumption for DVFS sequence and start safety timer."); k_timer_start(&dvfs_downscale_secure_timer, DOWNSCALE_SAFETY_TIMEOUT, K_NO_WAIT); atomic_set(&increased_power_consumption, 1); @@ -147,7 +147,7 @@ __weak void ld_dvfs_secure_start_increased_power_consumption(void) */ __weak void ld_dvfs_secure_stop_increased_power_consumption(void) { - LOG_INF("Stop increased power consumption for DVFS sequence."); + LOG_DBG("Stop increased power consumption for DVFS sequence."); k_timer_stop(&dvfs_downscale_secure_timer); atomic_set(&increased_power_consumption, 0); } diff --git a/modules/hal_nordic/nrfs/dvfs/ld_dvfs_handler.c b/modules/hal_nordic/nrfs/dvfs/ld_dvfs_handler.c index 20e879c4f737ea..6a3a275685605c 100644 --- a/modules/hal_nordic/nrfs/dvfs/ld_dvfs_handler.c +++ b/modules/hal_nordic/nrfs/dvfs/ld_dvfs_handler.c @@ -83,7 +83,7 @@ static bool dvfs_service_handler_freq_setting_allowed(enum dvfs_frequency_settin static enum dvfs_frequency_setting dvfs_service_handler_get_current_oppoint(void) { - LOG_INF("Current LD freq setting: %d", current_freq_setting); + LOG_DBG("Current LD freq setting: %d", current_freq_setting); return current_freq_setting; } @@ -103,12 +103,12 @@ static bool dvfs_service_handler_is_downscaling(enum dvfs_frequency_setting targ /* Function handling steps for scaling preparation. */ static void dvfs_service_handler_prepare_to_scale(enum dvfs_frequency_setting oppoint_freq) { - LOG_INF("Prepare to scale, oppoint freq %d", oppoint_freq); + LOG_DBG("Prepare to scale, oppoint freq %d", oppoint_freq); enum dvfs_frequency_setting new_oppoint = oppoint_freq; enum dvfs_frequency_setting current_oppoint = dvfs_service_handler_get_current_oppoint(); if (new_oppoint == current_oppoint) { - LOG_INF("New oppoint is same as previous, no change"); + LOG_DBG("New oppoint is same as previous, no change"); } else { ld_dvfs_configure_abb_for_transition(current_oppoint, new_oppoint); @@ -125,7 +125,7 @@ static void dvfs_service_handler_prepare_to_scale(enum dvfs_frequency_setting op /* Do background job during scaling process (e.g. increased power consumption during down-scale). */ static void dvfs_service_handler_scaling_background_job(enum dvfs_frequency_setting oppoint_freq) { - LOG_INF("Perform scaling background job if needed."); + LOG_DBG("Perform scaling background job if needed."); if (dvfs_service_handler_is_downscaling(oppoint_freq)) { k_sem_give(&dvfs_service_idle_sem); } @@ -134,7 +134,7 @@ static void dvfs_service_handler_scaling_background_job(enum dvfs_frequency_sett /* Perform scaling finnish procedure. */ static void dvfs_service_handler_scaling_finish(enum dvfs_frequency_setting oppoint_freq) { - LOG_INF("Scaling finnish oppoint freq %d", oppoint_freq); + LOG_DBG("Scaling finnish oppoint freq %d", oppoint_freq); ld_dvfs_scaling_finish(dvfs_service_handler_is_downscaling(oppoint_freq)); if (!dvfs_service_handler_is_downscaling(oppoint_freq)) { int32_t err = ld_dvfs_configure_hsfll(oppoint_freq); @@ -160,33 +160,33 @@ static void dvfs_service_handler_set_initial_hsfll_config(void) /* DVFS event handler callback function.*/ static void nrfs_dvfs_evt_handler(nrfs_dvfs_evt_t const *p_evt, void *context) { - LOG_INF("%s", __func__); + LOG_DBG("%s", __func__); switch (p_evt->type) { case NRFS_DVFS_EVT_INIT_PREPARATION: - LOG_INF("DVFS handler EVT_INIT_PREPARATION"); + LOG_DBG("DVFS handler EVT_INIT_PREPARATION"); #if defined(NRF_SECURE) ld_dvfs_clear_zbb(); dvfs_service_handler_nrfs_error_check( nrfs_dvfs_init_complete_request(get_next_context())); - LOG_INF("DVFS handler EVT_INIT_PREPARATION handled"); + LOG_DBG("DVFS handler EVT_INIT_PREPARATION handled"); #else LOG_ERR("DVFS handler - unexpected EVT_INIT_PREPARATION"); #endif break; case NRFS_DVFS_EVT_INIT_DONE: - LOG_INF("DVFS handler EVT_INIT_DONE"); + LOG_DBG("DVFS handler EVT_INIT_DONE"); dvfs_service_handler_set_initial_hsfll_config(); dvfs_service_handler_set_state_bit(DVFS_SERV_HDL_INIT_DONE_BIT_POS); k_sem_give(&dvfs_service_sync_sem); - LOG_INF("DVFS handler EVT_INIT_DONE handled"); + LOG_DBG("DVFS handler EVT_INIT_DONE handled"); break; case NRFS_DVFS_EVT_OPPOINT_REQ_CONFIRMED: /* Optional confirmation from sysctrl, wait for oppoint.*/ - LOG_INF("DVFS handler EVT_OPPOINT_REQ_CONFIRMED"); + LOG_DBG("DVFS handler EVT_OPPOINT_REQ_CONFIRMED"); break; case NRFS_DVFS_EVT_OPPOINT_SCALING_PREPARE: /*Target oppoint will be received here.*/ - LOG_INF("DVFS handler EVT_OPPOINT_SCALING_PREPARE"); + LOG_DBG("DVFS handler EVT_OPPOINT_SCALING_PREPARE"); #if !defined(NRF_SECURE) if (dvfs_service_handler_is_downscaling(p_evt->freq)) { #endif @@ -194,7 +194,7 @@ static void nrfs_dvfs_evt_handler(nrfs_dvfs_evt_t const *p_evt, void *context) dvfs_service_handler_nrfs_error_check( nrfs_dvfs_ready_to_scale(get_next_context())); dvfs_service_handler_scaling_background_job(p_evt->freq); - LOG_INF("DVFS handler EVT_OPPOINT_SCALING_PREPARE handled"); + LOG_DBG("DVFS handler EVT_OPPOINT_SCALING_PREPARE handled"); #if !defined(NRF_SECURE) current_freq_setting = p_evt->freq; } else { @@ -203,10 +203,10 @@ static void nrfs_dvfs_evt_handler(nrfs_dvfs_evt_t const *p_evt, void *context) #endif break; case NRFS_DVFS_EVT_OPPOINT_SCALING_DONE: - LOG_INF("DVFS handler EVT_OPPOINT_SCALING_DONE"); + LOG_DBG("DVFS handler EVT_OPPOINT_SCALING_DONE"); dvfs_service_handler_clear_state_bit(DVFS_SERV_HDL_FREQ_CHANGE_IN_PROGRESS_BIT_POS); dvfs_service_handler_scaling_finish(p_evt->freq); - LOG_INF("DVFS handler EVT_OPPOINT_SCALING_DONE handled"); + LOG_DBG("DVFS handler EVT_OPPOINT_SCALING_DONE handled"); break; case NRFS_DVFS_EVT_REJECT: LOG_ERR("DVFS handler - request rejected"); @@ -224,30 +224,30 @@ static void dvfs_service_handler_task(void *dummy0, void *dummy1, void *dummy2) ARG_UNUSED(dummy1); ARG_UNUSED(dummy2); - LOG_INF("Trim ABB for default voltage."); + LOG_DBG("Trim ABB for default voltage."); ld_dvfs_init(); - LOG_INF("Waiting for backend init"); + LOG_DBG("Waiting for backend init"); /* Wait for ipc initialization */ nrfs_backend_wait_for_connection(K_FOREVER); nrfs_err_t status; - LOG_INF("nrfs_dvfs_init"); + LOG_DBG("nrfs_dvfs_init"); status = nrfs_dvfs_init(nrfs_dvfs_evt_handler); dvfs_service_handler_nrfs_error_check(status); - LOG_INF("nrfs_dvfs_init_prepare_request"); + LOG_DBG("nrfs_dvfs_init_prepare_request"); status = nrfs_dvfs_init_prepare_request(get_next_context()); dvfs_service_handler_nrfs_error_check(status); /* Wait for init*/ k_sem_take(&dvfs_service_sync_sem, K_FOREVER); - LOG_INF("DVFS init done."); + LOG_DBG("DVFS init done."); #if defined(CONFIG_NRFS_LOCAL_DOMAIN_DVFS_SCALE_DOWN_AFTER_INIT) - LOG_INF("Requesting lowest frequency oppoint."); + LOG_DBG("Requesting lowest frequency oppoint."); dvfs_service_handler_change_freq_setting(DVFS_FREQ_LOW); #endif @@ -271,12 +271,12 @@ K_THREAD_DEFINE(dvfs_service_handler_task_id, int32_t dvfs_service_handler_change_freq_setting(enum dvfs_frequency_setting freq_setting) { if (!dvfs_service_handler_init_done()) { - LOG_INF("Init not done!"); + LOG_WRN("Init not done!"); return -EAGAIN; } if (dvfs_service_handler_freq_change_in_progress()) { - LOG_INF("Frequency change in progress."); + LOG_DBG("Frequency change in progress."); return -EBUSY; } diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index 543f13506fe963..026fcfb08cce95 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -417,7 +417,6 @@ zephyr_library_sources( ${HOSTAP_SRC_BASE}/crypto/crypto_mbedtls-bignum.c ${HOSTAP_SRC_BASE}/crypto/crypto_mbedtls-ec.c ${HOSTAP_SRC_BASE}/crypto/crypto_mbedtls.c - ${HOSTAP_SRC_BASE}/crypto/tls_mbedtls.c ${HOSTAP_SRC_BASE}/crypto/aes-internal.c ${HOSTAP_SRC_BASE}/crypto/aes-wrap.c ${HOSTAP_SRC_BASE}/crypto/aes-unwrap.c @@ -439,6 +438,10 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3 ${HOSTAP_SRC_BASE}/crypto/sha256-kdf.c ) +zephyr_library_sources_ifndef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE + ${HOSTAP_SRC_BASE}/crypto/tls_none.c +) + zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE # common ${HOSTAP_SRC_BASE}/crypto/sha384-tlsprf.c @@ -450,6 +453,7 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE # MD4 removed from MbedTLS ${HOSTAP_SRC_BASE}/crypto/md4-internal.c ${HOSTAP_SRC_BASE}/crypto/aes-encblock.c + ${HOSTAP_SRC_BASE}/crypto/tls_mbedtls.c ) endif() diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 1c8ebede91f3b3..f74ec3510a56f8 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -36,7 +36,7 @@ config WIFI_NM_WPA_SUPPLICANT_THREAD_STACK_SIZE config WIFI_NM_WPA_SUPPLICANT_WQ_STACK_SIZE int "Stack size for wpa_supplicant iface workqueue" - default 4096 + default 6144 config WIFI_NM_WPA_SUPPLICANT_WQ_PRIO int "Thread priority of wpa_supplicant iface workqueue" @@ -113,8 +113,11 @@ choice WIFI_NM_WPA_SUPPLICANT_CRYPTO_BACKEND config WIFI_NM_WPA_SUPPLICANT_CRYPTO bool "Crypto support for WiFi" select MBEDTLS + select MBEDTLS_SHA1 + select MBEDTLS_CIPHER select MBEDTLS_CIPHER_MODE_CTR_ENABLED select MBEDTLS_CIPHER_MODE_CBC_ENABLED + select MBEDTLS_CIPHER_AES_ENABLED select MBEDTLS_ECP_C select MBEDTLS_ECP_ALL_ENABLED select MBEDTLS_CMAC diff --git a/modules/hostap/src/supp_main.c b/modules/hostap/src/supp_main.c index fc5644a615d396..75946793e64caa 100644 --- a/modules/hostap/src/supp_main.c +++ b/modules/hostap/src/supp_main.c @@ -419,7 +419,7 @@ static void iface_cb(struct net_if *iface, void *user_data) return; } - if (!net_if_is_up(iface)) { + if (!net_if_is_admin_up(iface)) { return; } diff --git a/modules/tflite-micro/CMakeLists.txt b/modules/tflite-micro/CMakeLists.txt index ce1cd370c1afd2..50a39355774538 100644 --- a/modules/tflite-micro/CMakeLists.txt +++ b/modules/tflite-micro/CMakeLists.txt @@ -51,13 +51,13 @@ if(CONFIG_TENSORFLOW_LITE_MICRO) ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/test_helper_custom_ops.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/recording_micro_allocator.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_time.cc - ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_string.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_profiler.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_utils.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/flatbuffer_utils.cc - ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_graph.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/mock_micro_graph.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_interpreter.cc + ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_interpreter_context.cc + ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_interpreter_graph.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_allocator.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_context.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_log.cc @@ -83,7 +83,6 @@ if(CONFIG_TENSORFLOW_LITE_MICRO) ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/core/api/flatbuffer_conversions.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/core/api/error_reporter.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/core/api/tensor_utils.cc - ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/core/api/op_resolver.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/schema/schema_utils.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/kernels/activations.cc ${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/kernels/activations_common.cc diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index b3d836490d6186..4b91848639f4b4 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -349,6 +349,13 @@ if (CONFIG_BUILD_WITH_TFM) interface/interface.c ) + # A dependency on tfm_s.hex for zephyr.elf will not cause a Zephyr re-link when + # tfm_s.hex is updated, as the hex is not a direct input on the executable. + # Instead we establish a source file dependency which ensures that tfm_api is + # updated when there are changes in tfm itself, this again will trigger an re-link + # of Zephyr.elf. + set_property(SOURCE interface/interface.c APPEND PROPERTY OBJECT_DEPENDS ${TFM_S_HEX_FILE}) + # Non-Secure interface to request system reboot if (CONFIG_TFM_PARTITION_PLATFORM AND NOT CONFIG_TFM_PARTITION_PLATFORM_CUSTOM_REBOOT) zephyr_library_sources(src/reboot.c) diff --git a/samples/bluetooth/beacon/sample.yaml b/samples/bluetooth/beacon/sample.yaml index d76a16eb566f0c..6c450c27f90f30 100644 --- a/samples/bluetooth/beacon/sample.yaml +++ b/samples/bluetooth/beacon/sample.yaml @@ -9,6 +9,7 @@ tests: - nrf51dk/nrf51822 - nrf52dk/nrf52832 - nrf54l15pdk/nrf54l15/cpuapp + - cyw920829m2evk_02 tags: bluetooth integration_platforms: - qemu_cortex_m3 diff --git a/samples/bluetooth/broadcaster/sample.yaml b/samples/bluetooth/broadcaster/sample.yaml index 7556e2aba7f577..46eeed2e9b148b 100644 --- a/samples/bluetooth/broadcaster/sample.yaml +++ b/samples/bluetooth/broadcaster/sample.yaml @@ -8,6 +8,7 @@ tests: - qemu_x86 - nrf51dk/nrf51822 - nrf52dk/nrf52832 + - cyw920829m2evk_02 tags: bluetooth integration_platforms: - qemu_cortex_m3 diff --git a/samples/bluetooth/central/sample.yaml b/samples/bluetooth/central/sample.yaml index 973b48c7c0bb5d..e108b68a834d60 100644 --- a/samples/bluetooth/central/sample.yaml +++ b/samples/bluetooth/central/sample.yaml @@ -6,6 +6,7 @@ tests: platform_allow: - qemu_cortex_m3 - qemu_x86 + - cyw920829m2evk_02 tags: bluetooth integration_platforms: - qemu_cortex_m3 diff --git a/samples/bluetooth/central_multilink/src/central_multilink.c b/samples/bluetooth/central_multilink/src/central_multilink.c index 197021efe97efe..eb5989587fe46a 100644 --- a/samples/bluetooth/central_multilink/src/central_multilink.c +++ b/samples/bluetooth/central_multilink/src/central_multilink.c @@ -90,7 +90,7 @@ static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, static void start_scan(void) { struct bt_le_scan_param scan_param = { - .type = BT_HCI_LE_SCAN_PASSIVE, + .type = BT_LE_SCAN_TYPE_PASSIVE, .options = BT_LE_SCAN_OPT_NONE, .interval = SCAN_INTERVAL, .window = SCAN_WINDOW, diff --git a/samples/bluetooth/observer/sample.yaml b/samples/bluetooth/observer/sample.yaml index b60ccc9fe8ed38..0b701bec4c686f 100644 --- a/samples/bluetooth/observer/sample.yaml +++ b/samples/bluetooth/observer/sample.yaml @@ -7,6 +7,7 @@ tests: - qemu_cortex_m3 - qemu_x86 - nrf52840dk/nrf52840 + - cyw920829m2evk_02 integration_platforms: - qemu_cortex_m3 tags: bluetooth diff --git a/samples/bluetooth/periodic_adv/sample.yaml b/samples/bluetooth/periodic_adv/sample.yaml index f9018ff09ef32e..7002a4a5fb3384 100644 --- a/samples/bluetooth/periodic_adv/sample.yaml +++ b/samples/bluetooth/periodic_adv/sample.yaml @@ -8,6 +8,7 @@ tests: - qemu_x86 - nrf52_bsim - nrf52dk/nrf52832 + - cyw920829m2evk_02 tags: bluetooth integration_platforms: - qemu_cortex_m3 diff --git a/samples/bluetooth/peripheral_dis/sample.yaml b/samples/bluetooth/peripheral_dis/sample.yaml index 0521956f6e13db..a5853fd52ded2a 100644 --- a/samples/bluetooth/peripheral_dis/sample.yaml +++ b/samples/bluetooth/peripheral_dis/sample.yaml @@ -7,6 +7,7 @@ tests: platform_allow: - qemu_cortex_m3 - qemu_x86 + - cyw920829m2evk_02 tags: bluetooth integration_platforms: - qemu_cortex_m3 diff --git a/samples/bluetooth/scan_adv/sample.yaml b/samples/bluetooth/scan_adv/sample.yaml index 52ec407b0a72e5..c7ef734b4ea1af 100644 --- a/samples/bluetooth/scan_adv/sample.yaml +++ b/samples/bluetooth/scan_adv/sample.yaml @@ -7,6 +7,7 @@ tests: platform_allow: - qemu_cortex_m3 - qemu_x86 + - cyw920829m2evk_02 tags: bluetooth integration_platforms: - qemu_cortex_m3 diff --git a/samples/bluetooth/scan_adv/src/main.c b/samples/bluetooth/scan_adv/src/main.c index 8ec06b81b3664d..ed9d00359ef899 100644 --- a/samples/bluetooth/scan_adv/src/main.c +++ b/samples/bluetooth/scan_adv/src/main.c @@ -12,7 +12,6 @@ #include #include -#include static uint8_t mfg_data[] = { 0xff, 0xff, 0x00 }; @@ -29,7 +28,7 @@ static void scan_cb(const bt_addr_le_t *addr, int8_t rssi, uint8_t adv_type, int main(void) { struct bt_le_scan_param scan_param = { - .type = BT_HCI_LE_SCAN_PASSIVE, + .type = BT_LE_SCAN_TYPE_PASSIVE, .options = BT_LE_SCAN_OPT_NONE, .interval = 0x0010, .window = 0x0010, diff --git a/samples/drivers/ipm/ipm_mcux/sysbuild.cmake b/samples/drivers/ipm/ipm_mcux/sysbuild.cmake index 6ca2faf7d34810..ead989529b3cf0 100644 --- a/samples/drivers/ipm/ipm_mcux/sysbuild.cmake +++ b/samples/drivers/ipm/ipm_mcux/sysbuild.cmake @@ -12,8 +12,8 @@ ExternalZephyrProject_Add( # Add dependencies so that the remote sample will be built first # This is required because some primary cores need information from the # remote core's build, such as the output image's LMA -add_dependencies(ipm_mcux ipm_mcux_remote) -sysbuild_add_dependencies(CONFIGURE ipm_mcux ipm_mcux_remote) +add_dependencies(${DEFAULT_IMAGE} ipm_mcux_remote) +sysbuild_add_dependencies(CONFIGURE ${DEFAULT_IMAGE} ipm_mcux_remote) if(SB_CONFIG_BOOTLOADER_MCUBOOT) # Make sure MCUboot is flashed first diff --git a/samples/drivers/mbox/CMakeLists.txt b/samples/drivers/mbox/CMakeLists.txt index e4fbfb89dee1f3..658a18ac21f665 100644 --- a/samples/drivers/mbox/CMakeLists.txt +++ b/samples/drivers/mbox/CMakeLists.txt @@ -18,6 +18,7 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP OR CONFIG_BOARD_MIMXRT1160_EVK_MIMXRT1166_CM7 OR CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0 OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR + CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD OR CONFIG_BOARD_NRF54L15PDK_NRF54L15_CPUAPP OR CONFIG_BOARD_STM32H747I_DISCO_STM32H747XX_M7) message(STATUS "${BOARD}${BOARD_QUALIFIERS} compile as Main in this sample") diff --git a/samples/drivers/mbox/Kconfig.sysbuild b/samples/drivers/mbox/Kconfig.sysbuild index 080bea5b66577c..077fb85db64564 100644 --- a/samples/drivers/mbox/Kconfig.sysbuild +++ b/samples/drivers/mbox/Kconfig.sysbuild @@ -14,6 +14,7 @@ string default "mimxrt1170_evk/mimxrt1176/cm4" if $(BOARD) = "mimxrt1170_evk" default "mimxrt1160_evk/mimxrt1166/cm4" if $(BOARD) = "mimxrt1160_evk" default "lpcxpresso55s69/lpc55s69/cpu1" if $(BOARD) = "lpcxpresso55s69" - default "nrf54h20dk/nrf54h20/cpuppr" if $(BOARD) = "nrf54h20dk" + default "nrf54h20dk/nrf54h20/cpuppr" if "$(BOARD)${BOARD_QUALIFIERS}" = "nrf54h20dk/nrf54h20/cpuapp" + default "nrf54h20dk/nrf54h20/cpuapp" if "$(BOARD)${BOARD_QUALIFIERS}" = "nrf54h20dk/nrf54h20/cpurad" default "nrf54l15pdk/nrf54l15/cpuflpr" if $(BOARD) = "nrf54l15pdk" default "stm32h747i_disco/stm32h747xx/m4" if $(BOARD) = "stm32h747i_disco" diff --git a/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp_bellboard.overlay b/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp.overlay similarity index 62% rename from samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp_bellboard.overlay rename to samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 3618aab1d168d7..2e5aba6d2f0195 100644 --- a/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp_bellboard.overlay +++ b/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -6,11 +6,15 @@ / { mbox-consumer { compatible = "vnd,mbox-consumer"; - mboxes = <&cpuapp_bellboard 0>; - mbox-names = "rx"; + mboxes = <&cpuppr_vevif 15>, <&cpuapp_bellboard 18>; + mbox-names = "tx", "rx"; }; }; &cpuapp_bellboard { status = "okay"; }; + +&cpuppr_vevif { + status = "okay"; +}; diff --git a/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp_bellboard.conf b/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp_bellboard.conf deleted file mode 100644 index 0b6bc73d6bc165..00000000000000 --- a/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp_bellboard.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_TX_ENABLED=n diff --git a/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp_vevif.conf b/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp_vevif.conf deleted file mode 100644 index 4596bc3a757db0..00000000000000 --- a/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp_vevif.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_RX_ENABLED=n diff --git a/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp_vevif.overlay b/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpurad.overlay similarity index 54% rename from samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp_vevif.overlay rename to samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpurad.overlay index 4e01f9a79d559b..d2230e8ef209c6 100644 --- a/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpuapp_vevif.overlay +++ b/samples/drivers/mbox/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -6,11 +6,15 @@ / { mbox-consumer { compatible = "vnd,mbox-consumer"; - mboxes = <&cpuppr_vevif 4>; - mbox-names = "tx"; + mboxes = <&cpuapp_bellboard 18>, <&cpurad_bellboard 12>; + mbox-names = "tx", "rx"; }; }; -&cpuppr_vevif { +&cpuapp_bellboard { + status = "okay"; +}; + +&cpurad_bellboard { status = "okay"; }; diff --git a/samples/drivers/mbox/remote/CMakeLists.txt b/samples/drivers/mbox/remote/CMakeLists.txt index 08823f7b0fcbf3..efaa24db0ce180 100644 --- a/samples/drivers/mbox/remote/CMakeLists.txt +++ b/samples/drivers/mbox/remote/CMakeLists.txt @@ -16,6 +16,7 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUNET OR CONFIG_BOARD_MIMXRT1160_EVK_MIMXRT1166_CM4 OR CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU1 OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUPPR OR + CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR CONFIG_BOARD_NRF54L15PDK_NRF54L15_CPUFLPR OR CONFIG_BOARD_NRF54L15PDK_NRF54L15_CPUFLPR_XIP OR CONFIG_BOARD_STM32H747I_DISCO_STM32H747XX_M4) diff --git a/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr_vevif.overlay b/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuapp.overlay similarity index 54% rename from samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr_vevif.overlay rename to samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 365469e86bde0f..899a7cb40a7fe4 100644 --- a/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr_vevif.overlay +++ b/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -6,11 +6,15 @@ / { mbox-consumer { compatible = "vnd,mbox-consumer"; - mboxes = <&cpuppr_vevif 4>; - mbox-names = "rx"; + mboxes = <&cpuapp_bellboard 18>, <&cpurad_bellboard 12>; + mbox-names = "rx", "tx"; }; }; -&cpuppr_vevif { +&cpuapp_bellboard { + status = "okay"; +}; + +&cpurad_bellboard { status = "okay"; }; diff --git a/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr_bellboard.overlay b/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr.overlay similarity index 62% rename from samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr_bellboard.overlay rename to samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr.overlay index 53eec7c680cfe0..049f2432695bf3 100644 --- a/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr_bellboard.overlay +++ b/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -6,11 +6,15 @@ / { mbox-consumer { compatible = "vnd,mbox-consumer"; - mboxes = <&cpuapp_bellboard 0>; - mbox-names = "tx"; + mboxes = <&cpuppr_vevif 15>, <&cpuapp_bellboard 18>; + mbox-names = "rx", "tx"; }; }; &cpuapp_bellboard { status = "okay"; }; + +&cpuppr_vevif { + status = "okay"; +}; diff --git a/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr_bellboard.conf b/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr_bellboard.conf deleted file mode 100644 index 4596bc3a757db0..00000000000000 --- a/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr_bellboard.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_RX_ENABLED=n diff --git a/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr_vevif.conf b/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr_vevif.conf deleted file mode 100644 index 0b6bc73d6bc165..00000000000000 --- a/samples/drivers/mbox/remote/boards/nrf54h20dk_nrf54h20_cpuppr_vevif.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_TX_ENABLED=n diff --git a/samples/drivers/mbox/remote/src/main.c b/samples/drivers/mbox/remote/src/main.c index 9fe6c1a79d5663..ee2a26c41c355a 100644 --- a/samples/drivers/mbox/remote/src/main.c +++ b/samples/drivers/mbox/remote/src/main.c @@ -24,11 +24,13 @@ int main(void) { int ret; - printk("Hello from REMOTE\n"); + printk("Hello from REMOTE - %s\n", CONFIG_BOARD_TARGET); #ifdef CONFIG_RX_ENABLED const struct mbox_dt_spec rx_channel = MBOX_DT_SPEC_GET(DT_PATH(mbox_consumer), rx); + printk("Maximum RX channels: %d\n", mbox_max_channels_get_dt(&rx_channel)); + ret = mbox_register_callback_dt(&rx_channel, callback, NULL); if (ret < 0) { printk("Could not register callback (%d)\n", ret); @@ -45,6 +47,9 @@ int main(void) #ifdef CONFIG_TX_ENABLED const struct mbox_dt_spec tx_channel = MBOX_DT_SPEC_GET(DT_PATH(mbox_consumer), tx); + printk("Maximum bytes of data in the TX message: %d\n", mbox_mtu_get_dt(&tx_channel)); + printk("Maximum TX channels: %d\n", mbox_max_channels_get_dt(&tx_channel)); + while (1) { printk("Ping (on channel %d)\n", tx_channel.channel_id); diff --git a/samples/drivers/mbox/sample.yaml b/samples/drivers/mbox/sample.yaml index 8308e5907d8d38..01646f040bca23 100644 --- a/samples/drivers/mbox/sample.yaml +++ b/samples/drivers/mbox/sample.yaml @@ -24,13 +24,12 @@ tests: - "Ping \\(on channel 1\\)" - "Pong \\(on channel 1\\)" - sample.drivers.mbox.nrf54h20_vevif: + sample.drivers.mbox.nrf54h20_app_ppr: platform_allow: - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp extra_args: - FILE_SUFFIX=vevif mbox_SNIPPET=nordic-ppr sysbuild: true harness: console @@ -38,23 +37,22 @@ tests: type: multi_line ordered: false regex: - - "Ping \\(on channel 4\\)" + - "Ping \\(on channel 15\\)" + - "Pong \\(on channel 18\\)" - sample.drivers.mbox.nrf54h20_bellboard: + sample.drivers.mbox.nrf54h20_rad_app: platform_allow: - - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp - extra_args: - FILE_SUFFIX=bellboard - mbox_SNIPPET=nordic-ppr + - nrf54h20dk/nrf54h20/cpurad sysbuild: true harness: console harness_config: type: multi_line ordered: false regex: - - "Pong \\(on channel 0\\)" + - "Ping \\(on channel 18\\)" + - "Pong \\(on channel 12\\)" sample.drivers.mbox.simu: platform_allow: diff --git a/samples/drivers/mbox/src/main.c b/samples/drivers/mbox/src/main.c index 221d7bd474f104..bf9690c868fbd1 100644 --- a/samples/drivers/mbox/src/main.c +++ b/samples/drivers/mbox/src/main.c @@ -20,11 +20,13 @@ int main(void) { int ret; - printk("Hello from APP\n"); + printk("Hello from HOST - %s\n", CONFIG_BOARD_TARGET); #ifdef CONFIG_RX_ENABLED const struct mbox_dt_spec rx_channel = MBOX_DT_SPEC_GET(DT_PATH(mbox_consumer), rx); + printk("Maximum RX channels: %d\n", mbox_max_channels_get_dt(&rx_channel)); + ret = mbox_register_callback_dt(&rx_channel, callback, NULL); if (ret < 0) { printk("Could not register callback (%d)\n", ret); @@ -41,6 +43,9 @@ int main(void) #ifdef CONFIG_TX_ENABLED const struct mbox_dt_spec tx_channel = MBOX_DT_SPEC_GET(DT_PATH(mbox_consumer), tx); + printk("Maximum bytes of data in the TX message: %d\n", mbox_mtu_get_dt(&tx_channel)); + printk("Maximum TX channels: %d\n", mbox_max_channels_get_dt(&tx_channel)); + while (1) { k_sleep(K_MSEC(2000)); diff --git a/samples/drivers/mbox/sysbuild.cmake b/samples/drivers/mbox/sysbuild.cmake index 769d33d3f77660..e2a5a03b87eb68 100644 --- a/samples/drivers/mbox/sysbuild.cmake +++ b/samples/drivers/mbox/sysbuild.cmake @@ -4,7 +4,7 @@ if("${SB_CONFIG_REMOTE_BOARD}" STREQUAL "") message(FATAL_ERROR - "Target ${BOARD} not supported for this sample. " + "Target ${BOARD}${BOARD_QUALIFIERS} not supported for this sample. " "There is no remote board selected in Kconfig.sysbuild") endif() diff --git a/samples/drivers/soc_flash_nrf/src/main.c b/samples/drivers/soc_flash_nrf/src/main.c index d55214afcc515c..0297a17d1f80e9 100644 --- a/samples/drivers/soc_flash_nrf/src/main.c +++ b/samples/drivers/soc_flash_nrf/src/main.c @@ -28,10 +28,10 @@ #define FLASH_TEST_OFFSET2 0x41234 #define FLASH_TEST_PAGE_IDX 37 -#if IS_ENABLED(CONFIG_FLASH_HAS_EXPLICIT_ERASE) && \ - IS_ENABLED(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE) +#if defined(CONFIG_FLASH_HAS_EXPLICIT_ERASE) && \ + defined(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE) #define FLASH_PE_RUNTIME_CHECK(cond) (cond) -#elif IS_ENABLED(CONFIG_FLASH_HAS_EXPLICIT_ERASE) +#elif defined(CONFIG_FLASH_HAS_EXPLICIT_ERASE) #define FLASH_PE_RUNTIME_CHECK(cond) (true) #else /* Assumed IS_ENABLED(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE) */ diff --git a/samples/modules/canopennode/README.rst b/samples/modules/canopennode/README.rst index 4b735f9b5d7b73..8a7a067c0d4c52 100644 --- a/samples/modules/canopennode/README.rst +++ b/samples/modules/canopennode/README.rst @@ -409,7 +409,7 @@ for the FRDM-K64F as follows: :board: frdm_k64f :goals: build :west-args: --sysbuild - :gen-args: -Dcanopennode_CONF_FILE=prj_img_mgmt.conf + :gen-args: -Dcanopennode_CONF_FILE=prj_img_mgmt.conf -DSB_CONFIG_BOOTLOADER_MCUBOOT=y :compact: #. Flash the newly built MCUboot and CANopen sample binaries using west: diff --git a/samples/modules/tflite-micro/hello_world/prj.conf b/samples/modules/tflite-micro/hello_world/prj.conf index c4652d4f7c3942..80c7d592702189 100644 --- a/samples/modules/tflite-micro/hello_world/prj.conf +++ b/samples/modules/tflite-micro/hello_world/prj.conf @@ -16,3 +16,4 @@ CONFIG_CPP=y CONFIG_STD_CPP17=y CONFIG_TENSORFLOW_LITE_MICRO=y CONFIG_MAIN_STACK_SIZE=2048 +CONFIG_REQUIRES_FLOAT_PRINTF=y diff --git a/samples/modules/tflite-micro/tflm_ethosu/prj.conf b/samples/modules/tflite-micro/tflm_ethosu/prj.conf index e4d4947b2981b3..a1961668b0e5d8 100644 --- a/samples/modules/tflite-micro/tflm_ethosu/prj.conf +++ b/samples/modules/tflite-micro/tflm_ethosu/prj.conf @@ -6,3 +6,4 @@ CONFIG_TENSORFLOW_LITE_MICRO=y CONFIG_ARM_ETHOS_U=y CONFIG_HEAP_MEM_POOL_SIZE=16384 CONFIG_LOG=y +CONFIG_REQUIRES_FLOAT_PRINTF=y diff --git a/samples/net/dhcpv4_client/README.rst b/samples/net/dhcpv4_client/README.rst index e8c232a7e94bed..43d95479b9e513 100644 --- a/samples/net/dhcpv4_client/README.rst +++ b/samples/net/dhcpv4_client/README.rst @@ -23,30 +23,51 @@ Running DHCPv4 client in Linux Host =================================== These are instructions for how to use this sample application using -QEMU on a Linux host to negotiate IP address from DHCPv4 server running +QEMU on a Linux host to negotiate IP address from DHCPv4 server (kea) running on Linux host. To use QEMU for testing, follow the :ref:`networking_with_qemu` guide. -Here's a sample server configuration file '/etc/dhcp/dhcpd.conf' +Here's a sample server configuration file '/etc/kea/kea-dhcp4.conf' used to configure the DHCPv4 server: .. code-block:: console - log-facility local7; - default-lease-time 600; - max-lease-time 7200; - - subnet 192.0.2.0 netmask 255.255.255.0 { - range 192.0.2.10 192.0.2.100; - } + { + "Dhcp4": { + "interfaces-config": { + "interfaces": [ "tap0" ], + "dhcp-socket-type": "raw" + }, + + "valid-lifetime": 7200, + + "subnet4": [ + { + "id": 1, + "subnet": "192.0.2.0/24", + "pools": [ { "pool": "192.0.2.10 - 192.0.2.100" } ], + "option-data": [ + { + "name": "routers", + "data": "192.0.2.2" + }, + { + "name": "domain-name-servers", + "data": "8.8.8.8" + } + ] + } + ] + } + } Use another terminal window to start up a DHCPv4 server on the Linux host, using this conf file: .. code-block:: console - $ sudo dhcpd -d -4 -cf /etc/dhcp/dhcpd.conf -lf /var/lib/dhcp/dhcpd.leases tap0 + $ sudo kea-dhcp4 -c /etc/kea/kea-dhcp4.conf Run Zephyr samples/net/dhcpv4_client application in QEMU: @@ -62,12 +83,13 @@ are shown like this: .. code-block:: console - [dhcpv4] [INF] main: In main - [dhcpv4] [INF] main_thread: Run dhcpv4 client - [dhcpv4] [INF] handler: Your address: 192.0.2.10 - [dhcpv4] [INF] handler: Lease time: 600 - [dhcpv4] [INF] handler: Subnet: 255.255.255.0 - [dhcpv4] [INF] handler: Router: 0.0.0.0 + [00:00:00.000,000] net_dhcpv4_client_sample: Run dhcpv4 client + [00:00:00.000,000] net_dhcpv4_client_sample: Start on slip: index=1 + [00:00:07.080,000] net_dhcpv4: Received: 192.0.2.10 + [00:00:07.080,000] net_dhcpv4_client_sample: Address[1]: 192.0.2.10 + [00:00:07.080,000] net_dhcpv4_client_sample: Subnet[1]: 255.255.255.0 + [00:00:07.080,000] net_dhcpv4_client_sample: Router[1]: 192.0.2.2 + [00:00:07.080,000] net_dhcpv4_client_sample: Lease time[1]: 7200 seconds To verify the Zephyr application client is running and has received an ip address by typing: @@ -81,8 +103,8 @@ FRDM_K64F ========= These are instructions for how to use this sample application running on -:ref:`frdm_k64f` board to negotiate IP address from DHCPv4 server running on -Linux host. +:ref:`frdm_k64f` board to negotiate IP address from DHCPv4 server (kea) running +on Linux host. Connect ethernet cable from :ref:`Freedom-K64F board ` to Linux host machine and check for new interfaces: @@ -98,25 +120,46 @@ Add ip address and routing information to interface: $ sudo ip addr add 192.0.2.2 dev eth1 $ sudo ip route add 192.0.2.0/24 dev eth1 -Here's a sample server configuration file '/etc/dhcpd/dhcp.conf' +Here's a sample server configuration file '/etc/kea/kea-dhcp4.conf' used to configure the DHCPv4 server: .. code-block:: console - log-facility local7; - default-lease-time 600; - max-lease-time 7200; - - subnet 192.0.2.0 netmask 255.255.255.0 { - range 192.0.2.10 192.0.2.100; - } + { + "Dhcp4": { + "interfaces-config": { + "interfaces": [ "eth1" ], + "dhcp-socket-type": "raw" + }, + + "valid-lifetime": 7200, + + "subnet4": [ + { + "id": 1, + "subnet": "192.0.2.0/24", + "pools": [ { "pool": "192.0.2.10 - 192.0.2.100" } ], + "option-data": [ + { + "name": "routers", + "data": "192.0.2.2" + }, + { + "name": "domain-name-servers", + "data": "8.8.8.8" + } + ] + } + ] + } + } Use another terminal window to start up a DHCPv4 server on the Linux host, using this conf file: .. code-block:: console - $ sudo dhcpd -d -4 -cf /etc/dhcp/dhcpd.conf -lf /var/lib/dhcp/dhcpd.leases eth1 + $ sudo kea-dhcp4 -c /etc/kea/kea-dhcp4.conf Build Zephyr samples/net/dhcpv4_client application: @@ -133,12 +176,13 @@ are shown like this: .. code-block:: console $ sudo screen /dev/ttyACM0 115200 - [dhcpv4] [INF] main: In main - [dhcpv4] [INF] main_thread: Run dhcpv4 client - [dhcpv4] [INF] handler: Your address: 192.0.2.10 - [dhcpv4] [INF] handler: Lease time: 600 - [dhcpv4] [INF] handler: Subnet: 255.255.255.0 - [dhcpv4] [INF] handler: Router: 0.0.0.0 + [00:00:00.000,000] net_dhcpv4_client_sample: Run dhcpv4 client + [00:00:00.000,000] net_dhcpv4_client_sample: Start on ethernet: index=1 + [00:00:07.080,000] net_dhcpv4: Received: 192.0.2.10 + [00:00:07.080,000] net_dhcpv4_client_sample: Address[1]: 192.0.2.10 + [00:00:07.080,000] net_dhcpv4_client_sample: Subnet[1]: 255.255.255.0 + [00:00:07.080,000] net_dhcpv4_client_sample: Router[1]: 192.0.2.2 + [00:00:07.080,000] net_dhcpv4_client_sample: Lease time[1]: 7200 seconds To verify the Zephyr application client is running and has received an ip address by typing: diff --git a/samples/net/dhcpv4_client/prj.conf b/samples/net/dhcpv4_client/prj.conf index 7f76396d518e39..0b93365f11342f 100644 --- a/samples/net/dhcpv4_client/prj.conf +++ b/samples/net/dhcpv4_client/prj.conf @@ -5,6 +5,7 @@ CONFIG_NET_ARP=y CONFIG_NET_UDP=y CONFIG_NET_DHCPV4=y CONFIG_NET_DHCPV4_OPTION_CALLBACKS=y +CONFIG_DNS_RESOLVER=y CONFIG_TEST_RANDOM_GENERATOR=y diff --git a/samples/net/sockets/txtime/boards/native_sim.conf b/samples/net/sockets/txtime/boards/native_sim.conf new file mode 100644 index 00000000000000..6e1628ae39113a --- /dev/null +++ b/samples/net/sockets/txtime/boards/native_sim.conf @@ -0,0 +1,2 @@ +CONFIG_ETH_NATIVE_POSIX_PTP_CLOCK=y +CONFIG_PTP=y diff --git a/samples/net/sockets/txtime/overlay-e1000.conf b/samples/net/sockets/txtime/overlay-e1000.conf new file mode 100644 index 00000000000000..d2880bd3587a31 --- /dev/null +++ b/samples/net/sockets/txtime/overlay-e1000.conf @@ -0,0 +1,6 @@ +CONFIG_NET_L2_ETHERNET=y +CONFIG_NET_QEMU_ETHERNET=y + +CONFIG_PCIE=y + +#CONFIG_ETHERNET_LOG_LEVEL_DBG=y diff --git a/samples/net/sockets/txtime/sample.yaml b/samples/net/sockets/txtime/sample.yaml index 18613f4b87a3a6..1627302ad5fa07 100644 --- a/samples/net/sockets/txtime/sample.yaml +++ b/samples/net/sockets/txtime/sample.yaml @@ -5,8 +5,6 @@ common: platform_allow: - native_sim - native_sim/native/64 - - qemu_x86 - - qemu_x86_64 integration_platforms: - native_sim sample: diff --git a/samples/net/sockets/txtime/src/main.c b/samples/net/sockets/txtime/src/main.c index 2bd41df40ac4e3..f5f9df96475960 100644 --- a/samples/net/sockets/txtime/src/main.c +++ b/samples/net/sockets/txtime/src/main.c @@ -263,7 +263,7 @@ static int create_socket(struct net_if *iface, struct sockaddr *peer) { struct sockaddr local; socklen_t addrlen; - bool optval; + int optval; uint8_t priority; int sock; int ret; diff --git a/samples/subsys/fs/littlefs/src/main.c b/samples/subsys/fs/littlefs/src/main.c index 7723023013eb7c..b04b998d7d5ae7 100644 --- a/samples/subsys/fs/littlefs/src/main.c +++ b/samples/subsys/fs/littlefs/src/main.c @@ -312,7 +312,7 @@ static int littlefs_mount(struct fs_mount_t *mp) #if defined(CONFIG_DISK_DRIVER_SDMMC) #define DISK_NAME CONFIG_SDMMC_VOLUME_NAME -#elif IS_ENABLED(CONFIG_DISK_DRIVER_MMC) +#elif defined(CONFIG_DISK_DRIVER_MMC) #define DISK_NAME CONFIG_MMC_VOLUME_NAME #else #error "No disk device defined, is your board supported?" diff --git a/samples/subsys/ipc/openamp/sysbuild.cmake b/samples/subsys/ipc/openamp/sysbuild.cmake index 7278a1af4d46e9..467b493a769be1 100644 --- a/samples/subsys/ipc/openamp/sysbuild.cmake +++ b/samples/subsys/ipc/openamp/sysbuild.cmake @@ -12,8 +12,8 @@ ExternalZephyrProject_Add( # Add dependencies so that the remote sample will be built first # This is required because some primary cores need information from the # remote core's build, such as the output image's LMA -add_dependencies(openamp openamp_remote) -sysbuild_add_dependencies(CONFIGURE openamp openamp_remote) +add_dependencies(${DEFAULT_IMAGE} openamp_remote) +sysbuild_add_dependencies(CONFIGURE ${DEFAULT_IMAGE} openamp_remote) if(SB_CONFIG_BOOTLOADER_MCUBOOT) # Make sure MCUboot is flashed first diff --git a/samples/subsys/ipc/rpmsg_service/sysbuild.cmake b/samples/subsys/ipc/rpmsg_service/sysbuild.cmake index 08af67aeb85e0e..6cccae9bef9765 100644 --- a/samples/subsys/ipc/rpmsg_service/sysbuild.cmake +++ b/samples/subsys/ipc/rpmsg_service/sysbuild.cmake @@ -12,4 +12,4 @@ ExternalZephyrProject_Add( BOARD ${SB_CONFIG_RPMSG_REMOTE_BOARD} ) -add_dependencies(rpmsg_service rpmsg_service_remote) +add_dependencies(${DEFAULT_IMAGE} rpmsg_service_remote) diff --git a/samples/subsys/shell/shell_module/sample.yaml b/samples/subsys/shell/shell_module/sample.yaml index 482e4a37875fa0..62f9b30af0f407 100644 --- a/samples/subsys/shell/shell_module/sample.yaml +++ b/samples/subsys/shell/shell_module/sample.yaml @@ -75,4 +75,4 @@ tests: sample.shell.shell_module.robot: harness: robot harness_config: - robot_test_path: shell_module.robot + robot_testsuite: shell_module.robot diff --git a/samples/subsys/usb/cdc_acm/src/main.c b/samples/subsys/usb/cdc_acm/src/main.c index 4dffe7cee6daef..ab1cbdc6a4c0ef 100644 --- a/samples/subsys/usb/cdc_acm/src/main.c +++ b/samples/subsys/usb/cdc_acm/src/main.c @@ -106,7 +106,7 @@ static int enable_usb_device_next(void) return 0; } -#endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK_NEXT) */ +#endif /* defined(CONFIG_USB_DEVICE_STACK_NEXT) */ static void interrupt_handler(const struct device *dev, void *user_data) { diff --git a/samples/subsys/usb/console/src/main.c b/samples/subsys/usb/console/src/main.c index 538e768614a23c..bf2230687e1c97 100644 --- a/samples/subsys/usb/console/src/main.c +++ b/samples/subsys/usb/console/src/main.c @@ -34,7 +34,7 @@ static int enable_usb_device_next(void) return 0; } -#endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK_NEXT) */ +#endif /* defined(CONFIG_USB_DEVICE_STACK_NEXT) */ int main(void) { diff --git a/samples/subsys/usb/hid-mouse/src/main.c b/samples/subsys/usb/hid-mouse/src/main.c index 28b27877acbaf8..382453bbf8ac76 100644 --- a/samples/subsys/usb/hid-mouse/src/main.c +++ b/samples/subsys/usb/hid-mouse/src/main.c @@ -118,7 +118,7 @@ static int enable_usb_device_next(void) return 0; } -#endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK_NEXT) */ +#endif /* defined(CONFIG_USB_DEVICE_STACK_NEXT) */ int main(void) { diff --git a/samples/subsys/usb/mass/src/main.c b/samples/subsys/usb/mass/src/main.c index 733f6f90ea86fb..d95d91ca74a7f6 100644 --- a/samples/subsys/usb/mass/src/main.c +++ b/samples/subsys/usb/mass/src/main.c @@ -70,7 +70,7 @@ static int enable_usb_device_next(void) return 0; } -#endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK_NEXT) */ +#endif /* defined(CONFIG_USB_DEVICE_STACK_NEXT) */ static int setup_flash(struct fs_mount_t *mnt) { diff --git a/samples/subsys/usb/mass/usbd_next_prj.conf b/samples/subsys/usb/mass/usbd_next_prj.conf index 1f7345d25fd315..dd9d784070de5b 100644 --- a/samples/subsys/usb/mass/usbd_next_prj.conf +++ b/samples/subsys/usb/mass/usbd_next_prj.conf @@ -12,4 +12,4 @@ CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y CONFIG_SAMPLE_USBD_PID=0x0008 CONFIG_SAMPLE_USBD_PRODUCT="USBD MSC sample" -CONFIG_MAIN_STACK_SIZE=1536 +CONFIG_MAIN_STACK_SIZE=2048 diff --git a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf53.c b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf53.c index e5f93a846fdfab..7e949d61211793 100644 --- a/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf53.c +++ b/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf53.c @@ -48,7 +48,7 @@ static const nrfx_timer_t feedback_timer_instance = * the 4 least significant bits (does not use the bits for extra precision). */ #define FEEDBACK_K 10 -#if IS_ENABLED(CONFIG_APP_USE_I2S_LRCLK_EDGES_COUNTER) +#if defined(CONFIG_APP_USE_I2S_LRCLK_EDGES_COUNTER) #define FEEDBACK_P 1 #else #define FEEDBACK_P 5 diff --git a/samples/sysbuild/hello_world/sysbuild.cmake b/samples/sysbuild/hello_world/sysbuild.cmake index b59062d881f171..c7c2615c665ace 100644 --- a/samples/sysbuild/hello_world/sysbuild.cmake +++ b/samples/sysbuild/hello_world/sysbuild.cmake @@ -11,5 +11,5 @@ ExternalZephyrProject_Add( BOARD ${SB_CONFIG_REMOTE_BOARD} ) -add_dependencies(hello_world remote) -sysbuild_add_dependencies(FLASH hello_world remote) +add_dependencies(${DEFAULT_IMAGE} remote) +sysbuild_add_dependencies(FLASH ${DEFAULT_IMAGE} remote) diff --git a/scripts/build/tsvbootloader.hex b/scripts/build/tsvbootloader.hex index 1c3cff9c85d1c6..55e84f75168200 100644 --- a/scripts/build/tsvbootloader.hex +++ b/scripts/build/tsvbootloader.hex @@ -1,5 +1,5 @@ 10000000000000000 -0000000c160001100 +0000000c160000068 00000000000000000 00000000000000000 00000000000000000 @@ -23,2027 +23,2027 @@ 0000000c5000000c5 0000000c5000000c5 0000000c5000000c5 -0f7ffbf3047004802 -0000001ad0000bffd -0f804f0008000f3af -0bd10b510bd1fb51f -0f7ff4611f818f000 -0f000f85af000fff7 -0fff2f7ffb403f806 -0b510f80ff000bc03 -046208000f3af4604 -0bff1f7ff4010e8bd -04603460a47702000 -064adf64d00004770 -0bf0464adf6cd2800 -0040df2c9040df249 -01044f240f816f000 -0bf0060040000f2c8 -05014f64e0000e7fe -0f44168010000f2ce -08f4ff3bf60013140 -0000047708f6ff3bf -00001f2ce0000f24e -060010104f0416801 -08f6ff3bf8f4ff3bf -0f64db51000004770 -064adf6cd280064ad -0f2c9040df249bf04 -0f240ffe5f7ff040d -060040000f2c81044 -0f2c60c01f240bd10 -00000f04f47600c00 -04604460346024601 -04680460746064605 -04684468346824681 -0bf182800480b4686 -0bf182800480a4780 -04c09d024f8df4780 -0429abf6ff7ff47a0 -0f8420b04f851bf3c -000004770d3f80b04 -00000000000000000 -06000024160040000 -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff -0ffffffffffffffff +0f7ffbf3047004812 +0f851bf3c429abffd +0d3f80b04f8420b04 +0f4416801480d4770 +0f04f480b60013140 +0490b480a60010100 +06001490b480b6001 +060010104f04f480b +060010105f04f480a +00000013100004770 +0e000ed98e000ed14 +080000003e000ed9c +09ffffff1e000eda0 +0e000ed94e000edc0 +0460246010000f04f +04606460546044603 +04682468146804607 +04808468646844683 +048074780bf182800 +0f8df4780bf182800 +0f7ff47a04c06d018 +08000f3afbf00bfad +00000000000000000 +06000abc160006600 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 +00000000000000000 diff --git a/scripts/ci/twister_ignore.txt b/scripts/ci/twister_ignore.txt index 329a26d4d1e079..52c3f4206183bf 100644 --- a/scripts/ci/twister_ignore.txt +++ b/scripts/ci/twister_ignore.txt @@ -48,3 +48,4 @@ scripts/ci/pylintrc scripts/footprint/* scripts/set_assignees.py scripts/gitlint/zephyr_commit_rules.py +scripts/west_commands/runners/canopen_program.py diff --git a/scripts/get_maintainer.py b/scripts/get_maintainer.py index 8e2a09b21522b0..fdc9cada4f6e68 100755 --- a/scripts/get_maintainer.py +++ b/scripts/get_maintainer.py @@ -509,6 +509,9 @@ def ferr(msg): ferr("either 'files' or 'files-regex' (or both) must be specified " "for area '{}'".format(area_name)) + if not area_dict.get("maintainers") and area_dict.get("status") == "maintained": + ferr("maintained area '{}' with no maintainers".format(area_name)) + for list_name in "maintainers", "collaborators", "inform", "files", \ "files-regex", "labels", "tags", "tests": if list_name in area_dict: diff --git a/scripts/logging/dictionary/dictionary_parser/__init__.py b/scripts/logging/dictionary/dictionary_parser/__init__.py index 16f2f9ec8e9c08..67f70c128cee7a 100644 --- a/scripts/logging/dictionary/dictionary_parser/__init__.py +++ b/scripts/logging/dictionary/dictionary_parser/__init__.py @@ -9,6 +9,7 @@ """ from .log_parser_v1 import LogParserV1 +from .log_parser_v3 import LogParserV3 def get_parser(database): @@ -19,4 +20,8 @@ def get_parser(database): if db_ver in [1, 2]: return LogParserV1(database) + # DB version 3 correspond to v3 parser + if db_ver == 3: + return LogParserV3(database) + return None diff --git a/scripts/logging/dictionary/dictionary_parser/data_types.py b/scripts/logging/dictionary/dictionary_parser/data_types.py new file mode 100644 index 00000000000000..0ff4de7c34fce6 --- /dev/null +++ b/scripts/logging/dictionary/dictionary_parser/data_types.py @@ -0,0 +1,186 @@ +#!/usr/bin/env python3 +# +# Copyright (c) 2024 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +""" +Contains a class to describe data types used for +dictionary logging. +""" + +import struct + +class DataTypes(): + """Class regarding data types, their alignments and sizes""" + INT = 0 + UINT = 1 + LONG = 2 + ULONG = 3 + LONG_LONG = 4 + ULONG_LONG = 5 + PTR = 6 + DOUBLE = 7 + LONG_DOUBLE = 8 + NUM_TYPES = 9 + + def __init__(self, database): + self.database = database + self.data_types = {} + + if database.is_tgt_64bit(): + self.add_data_type(self.LONG, "q") + self.add_data_type(self.LONG_LONG, "q") + self.add_data_type(self.PTR, "Q") + else: + self.add_data_type(self.LONG, "i") + self.add_data_type(self.LONG_LONG, "q") + self.add_data_type(self.PTR, "I") + + self.add_data_type(self.INT, "i") + self.add_data_type(self.DOUBLE, "d") + self.add_data_type(self.LONG_DOUBLE, "d") + + + @staticmethod + def get_stack_min_align(arch, is_tgt_64bit): + ''' + Correspond to the VA_STACK_ALIGN and VA_STACK_MIN_ALIGN + in cbprintf_internal.h. Note that there might be some + variations that is obtained via actually running through + the log parser. + + Return a tuple where the first element is stack alignment + value. The second element is true if alignment needs to + be further refined according to data type, false if not. + ''' + if arch == "arc": + if is_tgt_64bit: + need_further_align = True + stack_min_align = 8 + else: + need_further_align = False + stack_min_align = 1 + + elif arch == "arm64": + need_further_align = True + stack_min_align = 8 + + elif arch == "sparc": + need_further_align = False + stack_min_align = 1 + + elif arch == "x86": + if is_tgt_64bit: + need_further_align = True + stack_min_align = 8 + else: + need_further_align = False + stack_min_align = 1 + + elif arch == "riscv32e": + need_further_align = False + stack_min_align = 1 + + elif arch == "riscv": + need_further_align = True + + if is_tgt_64bit: + stack_min_align = 8 + else: + stack_min_align = 1 + + elif arch == "nios2": + need_further_align = False + stack_min_align = 1 + + else: + need_further_align = True + stack_min_align = 1 + + return (stack_min_align, need_further_align) + + + @staticmethod + def get_data_type_align(data_type, is_tgt_64bit): + ''' + Get the alignment for a particular data type. + ''' + if data_type == DataTypes.LONG_LONG: + align = 8 + elif data_type == DataTypes.LONG: + if is_tgt_64bit: + align = 8 + else: + align = 4 + else: + # va_list alignment is at least a integer + align = 4 + + return align + + + def add_data_type(self, data_type, fmt): + """Add one data type""" + if self.database.is_tgt_little_endian(): + endianness = "<" + else: + endianness = ">" + + formatter = endianness + fmt + + self.data_types[data_type] = {} + self.data_types[data_type]['fmt'] = formatter + + size = struct.calcsize(formatter) + + if data_type == self.LONG_DOUBLE: + # Python doesn't have long double but we still + # need to skip correct number of bytes + size = 16 + + self.data_types[data_type]['sizeof'] = size + + # Might need actual number for different architectures + # but these seem to work fine for now. + if self.database.is_tgt_64bit(): + align = 8 + else: + align = 4 + + # 'align' is used to "jump" over an argument so it has + # to be at least size of the data type. + align = max(align, size) + self.data_types[data_type]['align'] = align + + # 'stack_align' should correspond to VA_STACK_ALIGN + # in cbprintf_internal.h + stack_align, need_more_align = DataTypes.get_stack_min_align( + self.database.get_arch(), + self.database.is_tgt_64bit()) + + if need_more_align: + stack_align = DataTypes.get_data_type_align(data_type, + self.database.is_tgt_64bit()) + + self.data_types[data_type]['stack_align'] = stack_align + + + def get_sizeof(self, data_type): + """Get sizeof() of a data type""" + return self.data_types[data_type]['sizeof'] + + + def get_alignment(self, data_type): + """Get the alignment of a data type""" + return self.data_types[data_type]['align'] + + + def get_stack_alignment(self, data_type): + """Get the stack alignment of a data type""" + return self.data_types[data_type]['stack_align'] + + + def get_formatter(self, data_type): + """Get the formatter for a data type""" + return self.data_types[data_type]['fmt'] diff --git a/scripts/logging/dictionary/dictionary_parser/log_database.py b/scripts/logging/dictionary/dictionary_parser/log_database.py index 3e7b37e396f3aa..83e34e4abebb93 100644 --- a/scripts/logging/dictionary/dictionary_parser/log_database.py +++ b/scripts/logging/dictionary/dictionary_parser/log_database.py @@ -49,6 +49,9 @@ "posix" : { "kconfig": "CONFIG_ARCH_POSIX", }, + "riscv32e" : { + "kconfig": "CONFIG_RISCV_ISA_RV32E", + }, "riscv" : { "kconfig": "CONFIG_RISCV", }, @@ -62,7 +65,7 @@ class LogDatabase(): """Class of log database""" # Update this if database format of dictionary based logging # has changed - ZEPHYR_DICT_LOG_VER = 2 + ZEPHYR_DICT_LOG_VER = 3 LITTLE_ENDIAN = True BIG_ENDIAN = False diff --git a/scripts/logging/dictionary/dictionary_parser/log_parser.py b/scripts/logging/dictionary/dictionary_parser/log_parser.py index 31ca7bb46b8491..07b0419b7d0db6 100644 --- a/scripts/logging/dictionary/dictionary_parser/log_parser.py +++ b/scripts/logging/dictionary/dictionary_parser/log_parser.py @@ -9,6 +9,44 @@ """ import abc +from colorama import Fore + +from .data_types import DataTypes + +LOG_LEVELS = [ + ('none', Fore.WHITE), + ('err', Fore.RED), + ('wrn', Fore.YELLOW), + ('inf', Fore.GREEN), + ('dbg', Fore.BLUE) +] + +def get_log_level_str_color(lvl): + """Convert numeric log level to string""" + if lvl < 0 or lvl >= len(LOG_LEVELS): + return ("unk", Fore.WHITE) + + return LOG_LEVELS[lvl] + + +def formalize_fmt_string(fmt_str): + """Replace unsupported formatter""" + new_str = fmt_str + + for spec in ['d', 'i', 'o', 'u', 'x', 'X']: + # Python doesn't support %ll for integer specifiers, so remove extra 'l' + new_str = new_str.replace("%ll" + spec, "%l" + spec) + + if spec in ['x', 'X']: + new_str = new_str.replace("%#ll" + spec, "%#l" + spec) + + # Python doesn't support %hh for integer specifiers, so remove extra 'h' + new_str = new_str.replace("%hh" + spec, "%h" + spec) + + # No %p for pointer either, so use %x + new_str = new_str.replace("%p", "0x%x") + + return new_str class LogParser(abc.ABC): @@ -16,6 +54,9 @@ class LogParser(abc.ABC): def __init__(self, database): self.database = database + self.data_types = DataTypes(self.database) + + @abc.abstractmethod def parse_log_data(self, logdata, debug=False): """Parse log data""" diff --git a/scripts/logging/dictionary/dictionary_parser/log_parser_v1.py b/scripts/logging/dictionary/dictionary_parser/log_parser_v1.py index e065837781fa6f..124974e93109ca 100644 --- a/scripts/logging/dictionary/dictionary_parser/log_parser_v1.py +++ b/scripts/logging/dictionary/dictionary_parser/log_parser_v1.py @@ -17,19 +17,12 @@ import colorama from colorama import Fore -from .log_parser import LogParser +from .log_parser import (LogParser, get_log_level_str_color, formalize_fmt_string) +from .data_types import DataTypes HEX_BYTES_IN_LINE = 16 -LOG_LEVELS = [ - ('none', Fore.WHITE), - ('err', Fore.RED), - ('wrn', Fore.YELLOW), - ('inf', Fore.GREEN), - ('dbg', Fore.BLUE) -] - # Need to keep sync with struct log_dict_output_msg_hdr in # include/logging/log_output_dict.h. # @@ -67,106 +60,6 @@ logger = logging.getLogger("parser") -def get_log_level_str_color(lvl): - """Convert numeric log level to string""" - if lvl < 0 or lvl >= len(LOG_LEVELS): - return ("unk", Fore.WHITE) - - return LOG_LEVELS[lvl] - - -def formalize_fmt_string(fmt_str): - """Replace unsupported formatter""" - new_str = fmt_str - - for spec in ['d', 'i', 'o', 'u', 'x', 'X']: - # Python doesn't support %ll for integer specifiers, so remove extra 'l' - new_str = new_str.replace("%ll" + spec, "%l" + spec) - - # Python doesn't support %hh for integer specifiers, so remove extra 'h' - new_str = new_str.replace("%hh" + spec, "%h" + spec) - - # No %p for pointer either, so use %x - new_str = new_str.replace("%p", "0x%x") - - return new_str - - -class DataTypes(): - """Class regarding data types, their alignments and sizes""" - INT = 0 - UINT = 1 - LONG = 2 - ULONG = 3 - LONG_LONG = 4 - ULONG_LONG = 5 - PTR = 6 - DOUBLE = 7 - LONG_DOUBLE = 8 - NUM_TYPES = 9 - - def __init__(self, database): - self.database = database - self.data_types = {} - - if database.is_tgt_64bit(): - self.add_data_type(self.LONG, "q") - self.add_data_type(self.LONG_LONG, "q") - self.add_data_type(self.PTR, "Q") - else: - self.add_data_type(self.LONG, "i") - self.add_data_type(self.LONG_LONG, "q") - self.add_data_type(self.PTR, "I") - - self.add_data_type(self.INT, "i") - self.add_data_type(self.DOUBLE, "d") - self.add_data_type(self.LONG_DOUBLE, "d") - - - def add_data_type(self, data_type, fmt): - """Add one data type""" - if self.database.is_tgt_little_endian(): - endianness = "<" - else: - endianness = ">" - - formatter = endianness + fmt - - self.data_types[data_type] = {} - self.data_types[data_type]['fmt'] = formatter - - size = struct.calcsize(formatter) - - if data_type == self.LONG_DOUBLE: - # Python doesn't have long double but we still - # need to skip correct number of bytes - size = 16 - - self.data_types[data_type]['sizeof'] = size - - # Might need actual number for different architectures - # but these seem to work fine for now. - if self.database.is_tgt_64bit(): - self.data_types[data_type]['align'] = 8 - else: - self.data_types[data_type]['align'] = 4 - - - def get_sizeof(self, data_type): - """Get sizeof() of a data type""" - return self.data_types[data_type]['sizeof'] - - - def get_alignment(self, data_type): - """Get the alignment of a data type""" - return self.data_types[data_type]['align'] - - - def get_formatter(self, data_type): - """Get the formatter for a data type""" - return self.data_types[data_type]['fmt'] - - class LogParserV1(LogParser): """Log Parser V1""" def __init__(self, database): @@ -190,8 +83,6 @@ def __init__(self, database): else: self.fmt_msg_timestamp = endian + FMT_MSG_TIMESTAMP_32 - self.data_types = DataTypes(self.database) - def __get_string(self, arg, arg_offset, string_tbl): one_str = self.database.find_string(arg) @@ -219,6 +110,7 @@ def process_one_fmt_str(self, fmt_str, arg_list, string_tbl): Python's string formatting""" idx = 0 arg_offset = 0 + arg_data_type = None is_parsing = False do_extract = False @@ -291,6 +183,11 @@ def process_one_fmt_str(self, fmt_str, arg_list, string_tbl): size = self.data_types.get_sizeof(arg_data_type) unpack_fmt = self.data_types.get_formatter(arg_data_type) + # Align the argument list by rounding up + stack_align = self.data_types.get_stack_alignment(arg_data_type) + if stack_align > 1: + arg_offset = int((arg_offset + (align - 1)) / align) * align + one_arg = struct.unpack_from(unpack_fmt, arg_list, arg_offset)[0] if fmt == 's': @@ -300,7 +197,8 @@ def process_one_fmt_str(self, fmt_str, arg_list, string_tbl): arg_offset += size # Align the offset - arg_offset = int((arg_offset + align - 1) / align) * align + if stack_align > 1: + arg_offset = int((arg_offset + align - 1) / align) * align return tuple(args) diff --git a/scripts/logging/dictionary/dictionary_parser/log_parser_v3.py b/scripts/logging/dictionary/dictionary_parser/log_parser_v3.py new file mode 100644 index 00000000000000..d6b3904e19662e --- /dev/null +++ b/scripts/logging/dictionary/dictionary_parser/log_parser_v3.py @@ -0,0 +1,383 @@ +#!/usr/bin/env python3 +# +# Copyright (c) 2021, 2024 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +# Parsers are gonig to have very similar code. +# So tell pylint not to care. +# pylint: disable=duplicate-code + +""" +Dictionary-based Logging Parser Version 3 + +This contains the implementation of the parser for +version 3 databases. +""" + +import logging +import struct +import colorama +from colorama import Fore + +from .log_parser import (LogParser, get_log_level_str_color, formalize_fmt_string) +from .data_types import DataTypes + + +HEX_BYTES_IN_LINE = 16 + +# Need to keep sync with struct log_dict_output_msg_hdr in +# include/logging/log_output_dict.h. +# +# struct log_dict_output_normal_msg_hdr_t { +# uint8_t type; +# uint32_t domain:4; +# uint32_t level:4; +# uint32_t package_len:16; +# uint32_t data_len:16; +# uintptr_t source; +# log_timestamp_t timestamp; +# } __packed; +# +# Note "type" and "timestamp" are encoded separately below. +FMT_MSG_HDR_32 = "BHHI" +FMT_MSG_HDR_64 = "BHHQ" + +# Message type +# 0: normal message +# 1: number of dropped messages +FMT_MSG_TYPE = "B" + +# Depends on CONFIG_LOG_TIMESTAMP_64BIT +FMT_MSG_TIMESTAMP_32 = "I" +FMT_MSG_TIMESTAMP_64 = "Q" + +# Keep message types in sync with include/logging/log_output_dict.h +MSG_TYPE_NORMAL = 0 +MSG_TYPE_DROPPED = 1 + +# Number of dropped messages +FMT_DROPPED_CNT = "H" + + +logger = logging.getLogger("parser") + + +class LogParserV3(LogParser): + """Log Parser V1""" + def __init__(self, database): + super().__init__(database=database) + + if self.database.is_tgt_little_endian(): + endian = "<" + self.is_big_endian = False + else: + endian = ">" + self.is_big_endian = True + + self.fmt_msg_type = endian + FMT_MSG_TYPE + self.fmt_dropped_cnt = endian + FMT_DROPPED_CNT + + if self.database.is_tgt_64bit(): + self.fmt_msg_hdr = endian + FMT_MSG_HDR_64 + else: + self.fmt_msg_hdr = endian + FMT_MSG_HDR_32 + + if "CONFIG_LOG_TIMESTAMP_64BIT" in self.database.get_kconfigs(): + self.fmt_msg_timestamp = endian + FMT_MSG_TIMESTAMP_64 + else: + self.fmt_msg_timestamp = endian + FMT_MSG_TIMESTAMP_32 + + + def __get_string(self, arg, arg_offset, string_tbl): + one_str = self.database.find_string(arg) + if one_str is not None: + ret = one_str + else: + # The index from the string table is basically + # the order in va_list. Need to add to the index + # to skip the packaged string header and + # the format string. + str_idx = arg_offset + self.data_types.get_sizeof(DataTypes.PTR) * 2 + str_idx /= self.data_types.get_sizeof(DataTypes.INT) + + if int(str_idx) not in string_tbl: + ret = f'' + else: + ret = string_tbl[int(str_idx)] + + return ret + + + def process_one_fmt_str(self, fmt_str, arg_list, string_tbl): + """Parse the format string to extract arguments from + the binary arglist and return a tuple usable with + Python's string formatting""" + idx = 0 + arg_offset = 0 + arg_data_type = None + is_parsing = False + do_extract = False + + args = [] + + # Translated from cbvprintf_package() + for idx, fmt in enumerate(fmt_str): + if not is_parsing: + if fmt == '%': + is_parsing = True + arg_data_type = DataTypes.INT + continue + + elif fmt == '%': + # '%%' -> literal percentage sign + is_parsing = False + continue + + elif fmt == '*': + pass + + elif fmt.isdecimal() or str.lower(fmt) == 'l' \ + or fmt in (' ', '#', '-', '+', '.', 'h'): + # formatting modifiers, just ignore + continue + + elif fmt in ('j', 'z', 't'): + # intmax_t, size_t or ptrdiff_t + arg_data_type = DataTypes.LONG + + elif fmt in ('c', 'd', 'i', 'o', 'u') or str.lower(fmt) == 'x': + if fmt_str[idx - 1] == 'l': + if fmt_str[idx - 2] == 'l': + arg_data_type = DataTypes.LONG_LONG + else: + arg_data_type = DataTypes.LONG + else: + arg_data_type = DataTypes.INT + + is_parsing = False + do_extract = True + + elif fmt in ('s', 'p', 'n'): + arg_data_type = DataTypes.PTR + + is_parsing = False + do_extract = True + + elif str.lower(fmt) in ('a', 'e', 'f', 'g'): + # Python doesn't do"long double". + # + # Parse it as double (probably incorrect), but + # still have to skip enough bytes. + if fmt_str[idx - 1] == 'L': + arg_data_type = DataTypes.LONG_DOUBLE + else: + arg_data_type = DataTypes.DOUBLE + + is_parsing = False + do_extract = True + + else: + is_parsing = False + continue + + if do_extract: + do_extract = False + + align = self.data_types.get_alignment(arg_data_type) + size = self.data_types.get_sizeof(arg_data_type) + unpack_fmt = self.data_types.get_formatter(arg_data_type) + + # Align the argument list by rounding up + stack_align = self.data_types.get_stack_alignment(arg_data_type) + if stack_align > 1: + arg_offset = int((arg_offset + (align - 1)) / align) * align + + one_arg = struct.unpack_from(unpack_fmt, arg_list, arg_offset)[0] + + if fmt == 's': + one_arg = self.__get_string(one_arg, arg_offset, string_tbl) + + args.append(one_arg) + arg_offset += size + + # Align the offset + if stack_align > 1: + arg_offset = int((arg_offset + align - 1) / align) * align + + return tuple(args) + + + @staticmethod + def extract_string_table(str_tbl): + """Extract string table in a packaged log message""" + tbl = {} + + one_str = "" + next_new_string = True + # Translated from cbvprintf_package() + for one_ch in str_tbl: + if next_new_string: + str_idx = one_ch + next_new_string = False + continue + + if one_ch == 0: + tbl[str_idx] = one_str + one_str = "" + next_new_string = True + continue + + one_str += chr(one_ch) + + return tbl + + + @staticmethod + def print_hexdump(hex_data, prefix_len, color): + """Print hex dump""" + hex_vals = "" + chr_vals = "" + chr_done = 0 + + for one_hex in hex_data: + hex_vals += f'{one_hex:02x} ' + chr_vals += chr(one_hex) + chr_done += 1 + + if chr_done == HEX_BYTES_IN_LINE / 2: + hex_vals += " " + chr_vals += " " + + elif chr_done == HEX_BYTES_IN_LINE: + print(f"{color}%s%s|%s{Fore.RESET}" % ((" " * prefix_len), + hex_vals, chr_vals)) + hex_vals = "" + chr_vals = "" + chr_done = 0 + + if len(chr_vals) > 0: + hex_padding = " " * (HEX_BYTES_IN_LINE - chr_done) + print(f"{color}%s%s%s|%s{Fore.RESET}" % ((" " * prefix_len), + hex_vals, hex_padding, chr_vals)) + + + def parse_one_normal_msg(self, logdata, offset): + """Parse one normal log message and print the encoded message""" + # Parse log message header + domain_lvl, pkg_len, data_len, source_id = struct.unpack_from(self.fmt_msg_hdr, + logdata, offset) + offset += struct.calcsize(self.fmt_msg_hdr) + + timestamp = struct.unpack_from(self.fmt_msg_timestamp, logdata, offset)[0] + offset += struct.calcsize(self.fmt_msg_timestamp) + + # domain_id, level + if self.is_big_endian: + level = domain_lvl & 0x0F + domain_id = (domain_lvl >> 4) & 0x0F + else: + domain_id = domain_lvl & 0x0F + level = (domain_lvl >> 4) & 0x0F + + level_str, color = get_log_level_str_color(level) + source_id_str = self.database.get_log_source_string(domain_id, source_id) + + # Skip over data to point to next message (save as return value) + next_msg_offset = offset + pkg_len + data_len + + # Offset from beginning of cbprintf_packaged data to end of va_list arguments + offset_end_of_args = struct.unpack_from("B", logdata, offset)[0] + offset_end_of_args *= self.data_types.get_sizeof(DataTypes.INT) + offset_end_of_args += offset + + # Extra data after packaged log + extra_data = logdata[(offset + pkg_len):next_msg_offset] + + # Number of appended strings in package + num_packed_strings = struct.unpack_from("B", logdata, offset+1)[0] + + # Number of read-only string indexes + num_ro_str_indexes = struct.unpack_from("B", logdata, offset+2)[0] + offset_end_of_args += num_ro_str_indexes + + # Number of read-write string indexes + num_rw_str_indexes = struct.unpack_from("B", logdata, offset+3)[0] + offset_end_of_args += num_rw_str_indexes + + # Extract the string table in the packaged log message + string_tbl = self.extract_string_table(logdata[offset_end_of_args:(offset + pkg_len)]) + + if len(string_tbl) != num_packed_strings: + logger.error("------ Error extracting string table") + return None + + # Skip packaged string header + offset += self.data_types.get_sizeof(DataTypes.PTR) + + # Grab the format string + # + # Note the negative offset to __get_string(). It is because + # the offset begins at 0 for va_list. However, the format string + # itself is before the va_list, so need to go back the width of + # a pointer. + fmt_str_ptr = struct.unpack_from(self.data_types.get_formatter(DataTypes.PTR), + logdata, offset)[0] + fmt_str = self.__get_string(fmt_str_ptr, + -self.data_types.get_sizeof(DataTypes.PTR), + string_tbl) + offset += self.data_types.get_sizeof(DataTypes.PTR) + + if not fmt_str: + logger.error("------ Error getting format string at 0x%x", fmt_str_ptr) + return None + + args = self.process_one_fmt_str(fmt_str, logdata[offset:offset_end_of_args], string_tbl) + + fmt_str = formalize_fmt_string(fmt_str) + log_msg = fmt_str % args + + if level == 0: + print(f"{log_msg}", end='') + log_prefix = "" + else: + log_prefix = f"[{timestamp:>10}] <{level_str}> {source_id_str}: " + print(f"{color}%s%s{Fore.RESET}" % (log_prefix, log_msg)) + + if data_len > 0: + # Has hexdump data + self.print_hexdump(extra_data, len(log_prefix), color) + + # Point to next message + return next_msg_offset + + + def parse_log_data(self, logdata, debug=False): + """Parse binary log data and print the encoded log messages""" + offset = 0 + + while offset < len(logdata): + # Get message type + msg_type = struct.unpack_from(self.fmt_msg_type, logdata, offset)[0] + offset += struct.calcsize(self.fmt_msg_type) + + if msg_type == MSG_TYPE_DROPPED: + num_dropped = struct.unpack_from(self.fmt_dropped_cnt, logdata, offset) + offset += struct.calcsize(self.fmt_dropped_cnt) + + print(f"--- {num_dropped} messages dropped ---") + + elif msg_type == MSG_TYPE_NORMAL: + ret = self.parse_one_normal_msg(logdata, offset) + if ret is None: + return False + + offset = ret + + else: + logger.error("------ Unknown message type: %s", msg_type) + return False + + return True + +colorama.init() diff --git a/scripts/logging/dictionary/log_parser.py b/scripts/logging/dictionary/log_parser.py index eef60c03840fe0..c2b20b0fda952e 100755 --- a/scripts/logging/dictionary/log_parser.py +++ b/scripts/logging/dictionary/log_parser.py @@ -132,6 +132,8 @@ def main(): else: logger.debug("# Endianness: Big") + logger.debug("# Database version: %d", database.get_version()) + ret = log_parser.parse_log_data(logdata, debug=args.debug) if not ret: logger.error("ERROR: there were error(s) parsing log data") diff --git a/scripts/pylib/twister/twisterlib/environment.py b/scripts/pylib/twister/twisterlib/environment.py index 01b415ad820f12..b9c036f08f18a7 100644 --- a/scripts/pylib/twister/twisterlib/environment.py +++ b/scripts/pylib/twister/twisterlib/environment.py @@ -413,7 +413,8 @@ def add_parse_arguments(parser = None): action = "store_true", help="Take ROM/RAM sections footprint summary values from the 'build.log' " "instead of 'objdump' results used otherwise." - "Requires --enable-size-report or one of the baseline comparison modes.") + "Requires --enable-size-report or one of the baseline comparison modes." + "Warning: the feature will not work correctly with sysbuild.") compare_group_option = footprint_group.add_mutually_exclusive_group() @@ -862,9 +863,13 @@ def parse_arguments(parser, args, options = None, on_init=True): sc.size_report() sys.exit(0) - if options.footprint_from_buildlog and not options.enable_size_report: - logger.error("--footprint-from-buildlog requires --enable-size-report") - sys.exit(1) + if options.footprint_from_buildlog: + logger.warning("WARNING: Using --footprint-from-buildlog will give inconsistent results " + "for configurations using sysbuild. It is recommended to not use this flag " + "when building configurations using sysbuild.") + if not options.enable_size_report: + logger.error("--footprint-from-buildlog requires --enable-size-report") + sys.exit(1) if len(options.extra_test_args) > 0: # extra_test_args is a list of CLI args that Twister did not recognize diff --git a/scripts/pylib/twister/twisterlib/handlers.py b/scripts/pylib/twister/twisterlib/handlers.py index f8324252450026..c4d9919de8026b 100755 --- a/scripts/pylib/twister/twisterlib/handlers.py +++ b/scripts/pylib/twister/twisterlib/handlers.py @@ -18,6 +18,7 @@ import threading import time +from pathlib import Path from queue import Queue, Empty from twisterlib.environment import ZEPHYR_BASE, strip_ansi_sequences from twisterlib.error import TwisterException @@ -241,7 +242,11 @@ def _create_command(self, robot_test): # os.path.join cannot be used on a Mock object, so we are # explicitly checking the type if isinstance(self.instance.platform, Platform): - resc = os.path.join(self.options.coverage_basedir, self.instance.platform.resc) + for board_dir in self.options.board_root: + path = os.path.join(Path(board_dir).parent, self.instance.platform.resc) + if os.path.exists(path): + resc = path + break uart = self.instance.platform.uart command = ["renode-test", "--variable", "KEYWORDS:" + keywords, diff --git a/scripts/pylib/twister/twisterlib/harness.py b/scripts/pylib/twister/twisterlib/harness.py index 7af7867b3e30d2..6c132a10d4e95f 100644 --- a/scripts/pylib/twister/twisterlib/harness.py +++ b/scripts/pylib/twister/twisterlib/harness.py @@ -160,7 +160,8 @@ def configure(self, instance): config = instance.testsuite.harness_config if config: - self.path = config.get('robot_test_path', None) + self.path = config.get('robot_testsuite', None) + self.option = config.get('robot_option', None) def handle(self, line): ''' Test cases that make use of this harness care about results given @@ -176,7 +177,24 @@ def run_robot_test(self, command, handler): start_time = time.time() env = os.environ.copy() - command.append(os.path.join(handler.sourcedir, self.path)) + if self.option: + if isinstance(self.option, list): + for option in self.option: + for v in str(option).split(): + command.append(f'{v}') + else: + for v in str(self.option).split(): + command.append(f'{v}') + + if self.path is None: + raise PytestHarnessException(f'The parameter robot_testsuite is mandatory') + + if isinstance(self.path, list): + for suite in self.path: + command.append(os.path.join(handler.sourcedir, suite)) + else: + command.append(os.path.join(handler.sourcedir, self.path)) + with subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self.instance.build_dir, env=env) as renode_test_proc: out, _ = renode_test_proc.communicate() @@ -552,11 +570,11 @@ def _parse_report_file(self, report): class Gtest(Harness): ANSI_ESCAPE = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])') - TEST_START_PATTERN = r".*\[ RUN \] (?P.*)\.(?P.*)$" - TEST_PASS_PATTERN = r".*\[ OK \] (?P.*)\.(?P.*)$" - TEST_SKIP_PATTERN = r".*\[ DISABLED \] (?P.*)\.(?P.*)$" - TEST_FAIL_PATTERN = r".*\[ FAILED \] (?P.*)\.(?P.*)$" - FINISHED_PATTERN = r".*\[==========\] Done running all tests\.$" + TEST_START_PATTERN = r".*\[ RUN \] (?P[a-zA-Z_][a-zA-Z0-9_]*)\.(?P[a-zA-Z_][a-zA-Z0-9_]*)" + TEST_PASS_PATTERN = r".*\[ OK \] (?P[a-zA-Z_][a-zA-Z0-9_]*)\.(?P[a-zA-Z_][a-zA-Z0-9_]*)" + TEST_SKIP_PATTERN = r".*\[ DISABLED \] (?P[a-zA-Z_][a-zA-Z0-9_]*)\.(?P[a-zA-Z_][a-zA-Z0-9_]*)" + TEST_FAIL_PATTERN = r".*\[ FAILED \] (?P[a-zA-Z_][a-zA-Z0-9_]*)\.(?P[a-zA-Z_][a-zA-Z0-9_]*)" + FINISHED_PATTERN = r".*\[==========\] Done running all tests\." def __init__(self): super().__init__() diff --git a/scripts/schemas/twister/testsuite-schema.yaml b/scripts/schemas/twister/testsuite-schema.yaml index 28b7e730edbe5a..4cb81431d86b8c 100644 --- a/scripts/schemas/twister/testsuite-schema.yaml +++ b/scripts/schemas/twister/testsuite-schema.yaml @@ -120,8 +120,11 @@ schema;scenario-schema: required: false sequence: - type: str - "robot_test_path": - type: str + "robot_testsuite": + type: any + required: false + "robot_option": + type: any required: false "record": type: map diff --git a/scripts/tests/twister/test_harness.py b/scripts/tests/twister/test_harness.py index 2e0028b234a9cc..116d4bf50fb3de 100644 --- a/scripts/tests/twister/test_harness.py +++ b/scripts/tests/twister/test_harness.py @@ -33,7 +33,7 @@ SAMPLE_GTEST_START = ( "[00:00:00.000,000]  label: [==========] Running all tests." ) -SAMPLE_GTEST_FMT = "[00:00:00.000,000]  label: [{state}] {suite}.{test}" +SAMPLE_GTEST_FMT = "[00:00:00.000,000]  label: [{state}] {suite}.{test} (0ms)" SAMPLE_GTEST_END = ( "[00:00:00.000,000]  label: [==========] Done running all tests." ) @@ -133,7 +133,8 @@ def test_robot_configure(tmp_path): instance = TestInstance(testsuite=mock_testsuite, platform=mock_platform, outdir=outdir) instance.testsuite.harness_config = { - 'robot_test_path': '/path/to/robot/test' + 'robot_testsuite': '/path/to/robot/test', + 'robot_option': 'test_option' } robot_harness = Robot() @@ -143,6 +144,7 @@ def test_robot_configure(tmp_path): #Assert assert robot_harness.instance == instance assert robot_harness.path == '/path/to/robot/test' + assert robot_harness.option == 'test_option' def test_robot_handle(tmp_path): @@ -190,6 +192,7 @@ def test_robot_run_robot_test(tmp_path, caplog, exp_out, returncode, expected_st handler.log = "handler.log" path = "path" + option = "option" mock_platform = mock.Mock() mock_platform.name = "mock_platform" @@ -209,6 +212,7 @@ def test_robot_run_robot_test(tmp_path, caplog, exp_out, returncode, expected_st robot = Robot() robot.path = path + robot.option = option robot.instance = instance proc_mock = mock.Mock( returncode = returncode, diff --git a/scripts/west_commands/run_common.py b/scripts/west_commands/run_common.py index fd8a85749ea374..581e848b5d3b46 100644 --- a/scripts/west_commands/run_common.py +++ b/scripts/west_commands/run_common.py @@ -514,9 +514,9 @@ def rebuild(command, build_dir, args): def runners_yaml_path(build_dir, board): ret = Path(build_dir) / 'zephyr' / 'runners.yaml' if not ret.is_file(): - log.die(f'either a pristine build is needed, or board {board} ' - "doesn't support west flash/debug/simulate " - '(no ZEPHYR_RUNNERS_YAML in CMake cache)') + log.die(f'no runners.yaml found in {build_dir}/zephyr. ' + f"Either board {board} doesn't support west flash/debug/simulate," + ' or a pristine build is needed.') return ret def load_runners_yaml(path): diff --git a/scripts/west_commands/runners/canopen_program.py b/scripts/west_commands/runners/canopen_program.py index 74fdf38e95ea92..c51f07891a2e3b 100644 --- a/scripts/west_commands/runners/canopen_program.py +++ b/scripts/west_commands/runners/canopen_program.py @@ -31,7 +31,7 @@ # Default timeouts and retries DEFAULT_TIMEOUT = 10.0 # seconds -DEFAULT_SDO_TIMEOUT = 0.3 # seconds +DEFAULT_SDO_TIMEOUT = 1 # seconds DEFAULT_SDO_RETRIES = 1 # Object dictionary indexes diff --git a/scripts/west_commands/runners/renode-robot.py b/scripts/west_commands/runners/renode-robot.py index 3a5c87ad7d0eaf..68fe453b8ac963 100644 --- a/scripts/west_commands/runners/renode-robot.py +++ b/scripts/west_commands/runners/renode-robot.py @@ -28,6 +28,8 @@ def capabilities(cls): @classmethod def do_add_parser(cls, parser): parser.add_argument('--testsuite', + metavar='SUITE', + action='append', help='path to Robot test suite') parser.add_argument('--renode-robot-arg', metavar='ARG', @@ -54,7 +56,8 @@ def run_test(self, **kwargs): for arg in self.renode_robot_arg: cmd.append(arg) if self.testsuite is not None: - cmd.append(self.testsuite) + for suite in self.testsuite: + cmd.append(suite) else: self.logger.error("No Robot testsuite passed to renode-test! Use the `--testsuite` argument to provide one.") subprocess.run(cmd, check=True) diff --git a/soc/common/riscv-privileged/vector.S b/soc/common/riscv-privileged/vector.S index 73e41000f150bb..7230561a340d10 100644 --- a/soc/common/riscv-privileged/vector.S +++ b/soc/common/riscv-privileged/vector.S @@ -103,10 +103,5 @@ SECTION_FUNC(vectors, __start) #endif /* CONFIG_RISCV_VECTORED_MODE */ -#if CONFIG_INCLUDE_RESET_VECTOR /* Jump to __reset */ tail __reset -#else - /* Jump to __initialize */ - tail __initialize -#endif diff --git a/soc/espressif/esp32/default.ld b/soc/espressif/esp32/default.ld index 919e8a9ef0f602..dec0309cb2c372 100644 --- a/soc/espressif/esp32/default.ld +++ b/soc/espressif/esp32/default.ld @@ -47,6 +47,10 @@ user_dram_2_seg_len = SRAM1_USER_SIZE; #undef GROUP_ROM_LINK_IN #define GROUP_ROM_LINK_IN(vregion, lregion) > RODATA_REGION AT > lregion +/* Make sure new sections have consistent alignment between input and output sections */ +#undef SECTION_PROLOGUE +#define SECTION_PROLOGUE SECTION_DATA_PROLOGUE + MEMORY { #ifdef CONFIG_BOOTLOADER_MCUBOOT diff --git a/soc/espressif/esp32c3/default.ld b/soc/espressif/esp32c3/default.ld index cd7308c15935c1..62b161372248d0 100644 --- a/soc/espressif/esp32c3/default.ld +++ b/soc/espressif/esp32c3/default.ld @@ -41,6 +41,10 @@ user_dram_seg_len = user_idram_size; #undef GROUP_ROM_LINK_IN #define GROUP_ROM_LINK_IN(vregion, lregion) > RODATA_REGION AT > lregion +/* Make sure new sections have consistent alignment between input and output sections */ +#undef SECTION_PROLOGUE +#define SECTION_PROLOGUE SECTION_DATA_PROLOGUE + /* Global symbols required for espressif hal build */ MEMORY { diff --git a/soc/espressif/esp32c6/default.ld b/soc/espressif/esp32c6/default.ld index a1ec65aa1df7cf..9d0b5f2ac21e8f 100644 --- a/soc/espressif/esp32c6/default.ld +++ b/soc/espressif/esp32c6/default.ld @@ -34,6 +34,10 @@ user_sram_size = (user_sram_end - user_sram_org); #undef GROUP_ROM_LINK_IN #define GROUP_ROM_LINK_IN(vregion, lregion) > CACHED_REGION AT > lregion +/* Make sure new sections have consistent alignment between input and output sections */ +#undef SECTION_PROLOGUE +#define SECTION_PROLOGUE SECTION_DATA_PROLOGUE + /* TODO: add RTC support */ #define RESERVE_RTC_MEM 0 diff --git a/soc/espressif/esp32s2/default.ld b/soc/espressif/esp32s2/default.ld index 8621e65d2278eb..5eadcd96803eae 100644 --- a/soc/espressif/esp32s2/default.ld +++ b/soc/espressif/esp32s2/default.ld @@ -42,6 +42,10 @@ user_dram_seg_len = user_idram_size; #undef GROUP_ROM_LINK_IN #define GROUP_ROM_LINK_IN(vregion, lregion) > RODATA_REGION AT > lregion +/* Make sure new sections have consistent alignment between input and output sections */ +#undef SECTION_PROLOGUE +#define SECTION_PROLOGUE SECTION_DATA_PROLOGUE + #define RESERVE_RTC_MEM 0 MEMORY diff --git a/soc/espressif/esp32s3/default.ld b/soc/espressif/esp32s3/default.ld index ada1c12b93e3c4..8f002c4b869cb6 100644 --- a/soc/espressif/esp32s3/default.ld +++ b/soc/espressif/esp32s3/default.ld @@ -41,6 +41,10 @@ user_dram_seg_len = user_idram_size; #undef GROUP_ROM_LINK_IN #define GROUP_ROM_LINK_IN(vregion, lregion) > RODATA_REGION AT > lregion +/* Make sure new sections have consistent alignment between input and output sections */ +#undef SECTION_PROLOGUE +#define SECTION_PROLOGUE SECTION_DATA_PROLOGUE + MEMORY { #ifdef CONFIG_BOOTLOADER_MCUBOOT diff --git a/soc/infineon/cat1b/cyw20829/linker.ld b/soc/infineon/cat1b/cyw20829/linker.ld index efe1dffa603fab..bcbf53c63994c0 100644 --- a/soc/infineon/cat1b/cyw20829/linker.ld +++ b/soc/infineon/cat1b/cyw20829/linker.ld @@ -13,6 +13,7 @@ #include #include +#include #include #include diff --git a/soc/intel/intel_adsp/ace/power.c b/soc/intel/intel_adsp/ace/power.c index 20efc8e6f97f41..4d856af4584a91 100644 --- a/soc/intel/intel_adsp/ace/power.c +++ b/soc/intel/intel_adsp/ace/power.c @@ -339,7 +339,8 @@ void pm_state_set(enum pm_state state, uint8_t substate_id) (void *)rom_entry; sys_cache_data_flush_range((void *)imr_layout, sizeof(*imr_layout)); #endif /* CONFIG_ADSP_IMR_CONTEXT_SAVE */ - uint32_t hpsram_mask = 0; + /* This assumes a single HPSRAM segment */ + static uint32_t hpsram_mask; #ifdef CONFIG_ADSP_POWER_DOWN_HPSRAM /* turn off all HPSRAM banks - get a full bitmap */ uint32_t ebb_banks = ace_hpsram_get_bank_count(); diff --git a/soc/intel/intel_adsp/ace/power_down.S b/soc/intel/intel_adsp/ace/power_down.S index 1b9f7792ac815a..c93e56286566fb 100644 --- a/soc/intel/intel_adsp/ace/power_down.S +++ b/soc/intel/intel_adsp/ace/power_down.S @@ -60,6 +60,10 @@ power_down: ipfl pfl_reg, 128 ipfl pfl_reg, 192 + /* + * This assumes a single HPSRAM segment although the code below is + * generic and uses MAX_MEMORY_SEGMENTS for their number + */ mov pfl_reg, pu32_hpsram_mask dpfl pfl_reg, 0 /* move some values to registries before switching off whole memory */ diff --git a/soc/nordic/common/dmm.c b/soc/nordic/common/dmm.c index 85f18dfa7e8e84..4206870d794755 100644 --- a/soc/nordic/common/dmm.c +++ b/soc/nordic/common/dmm.c @@ -23,6 +23,7 @@ {.dt_addr = DT_REG_ADDR(node_id), \ .dt_size = DT_REG_SIZE(node_id), \ .dt_attr = DT_PROP(node_id, zephyr_memory_attr), \ + .dt_align = DMM_ALIGN_SIZE(node_id), \ .dt_allc = &_BUILD_LINKER_END_VAR(node_id)}, /* Generate declarations of linker variables used to determine size of preallocated variables @@ -36,6 +37,7 @@ struct dmm_region { uintptr_t dt_addr; size_t dt_size; uint32_t dt_attr; + uint32_t dt_align; void *dt_allc; }; @@ -91,7 +93,7 @@ static bool is_user_buffer_correctly_preallocated(void const *user_buffer, size_ return true; } - if (IS_ALIGNED(addr, DMM_DCACHE_LINE_SIZE)) { + if (IS_ALIGNED(addr, region->dt_align)) { /* If buffer is in cacheable region it must be aligned to data cache line size. */ return true; } @@ -101,7 +103,7 @@ static bool is_user_buffer_correctly_preallocated(void const *user_buffer, size_ static size_t dmm_heap_start_get(struct dmm_heap *dh) { - return ROUND_UP(dh->region->dt_allc, DMM_DCACHE_LINE_SIZE); + return ROUND_UP(dh->region->dt_allc, dh->region->dt_align); } static size_t dmm_heap_size_get(struct dmm_heap *dh) @@ -111,8 +113,8 @@ static size_t dmm_heap_size_get(struct dmm_heap *dh) static void *dmm_buffer_alloc(struct dmm_heap *dh, size_t length) { - length = ROUND_UP(length, DMM_DCACHE_LINE_SIZE); - return sys_heap_aligned_alloc(&dh->heap, DMM_DCACHE_LINE_SIZE, length); + length = ROUND_UP(length, dh->region->dt_align); + return sys_heap_aligned_alloc(&dh->heap, dh->region->dt_align, length); } static void dmm_buffer_free(struct dmm_heap *dh, void *buffer) diff --git a/soc/nordic/common/dmm.h b/soc/nordic/common/dmm.h index 03780f37239d00..a1a17e599ea8b8 100644 --- a/soc/nordic/common/dmm.h +++ b/soc/nordic/common/dmm.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #ifdef __cplusplus @@ -22,8 +23,18 @@ extern "C" { /** @cond INTERNAL_HIDDEN */ -#define DMM_DCACHE_LINE_SIZE \ - COND_CODE_1(IS_ENABLED(CONFIG_DCACHE), (CONFIG_DCACHE_LINE_SIZE), (sizeof(uint8_t))) +/* Determine if memory region for the peripheral is cacheable. */ +#define DMM_IS_REG_CACHEABLE(node_id) \ + COND_CODE_1(CONFIG_DCACHE, \ + (COND_CODE_1(DT_NODE_HAS_PROP(DT_PHANDLE(node_id, memory_regions), zephyr_memory_attr), \ + (DT_PROP(DT_PHANDLE(node_id, memory_regions), zephyr_memory_attr) & DT_MEM_CACHEABLE), \ + (0))), (0)) + +/* Determine required alignment of the static buffers in memory regions. Cache line alignment is + * required if region is cacheable and data cache is enabled. + */ +#define DMM_ALIGN_SIZE(node_id) \ + (DMM_IS_REG_CACHEABLE(node_id) ? CONFIG_DCACHE_LINE_SIZE : sizeof(uint8_t)) /** * @brief Get reference to memory region associated with the specified device node @@ -35,7 +46,6 @@ extern "C" { #define DMM_DEV_TO_REG(node_id) \ COND_CODE_1(DT_NODE_HAS_PROP(node_id, memory_regions), \ ((void *)DT_REG_ADDR(DT_PHANDLE(node_id, memory_regions))), (NULL)) - /** * @brief Preallocate buffer in memory region associated with the specified device node * @@ -45,7 +55,7 @@ extern "C" { COND_CODE_1(DT_NODE_HAS_PROP(node_id, memory_regions), \ (__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \ DT_PHANDLE(node_id, memory_regions))))) \ - __aligned(DMM_DCACHE_LINE_SIZE)), \ + __aligned(DMM_ALIGN_SIZE(node_id))), \ ()) #ifdef CONFIG_HAS_NORDIC_DMM diff --git a/soc/nordic/common/vpr/Kconfig b/soc/nordic/common/vpr/Kconfig index c2abfbb18b1f03..0c60b8a8b1c86f 100644 --- a/soc/nordic/common/vpr/Kconfig +++ b/soc/nordic/common/vpr/Kconfig @@ -18,5 +18,6 @@ config RISCV_CORE_NORDIC_VPR select RISCV_SOC_CONTEXT_SAVE select HAS_FLASH_LOAD_OFFSET select ARCH_CPU_IDLE_CUSTOM + select INCLUDE_RESET_VECTOR help Enable support for the RISC-V Nordic VPR core. diff --git a/soc/nordic/nrf54h/Kconfig b/soc/nordic/nrf54h/Kconfig index 35017812d695b0..338b51238eeedd 100644 --- a/soc/nordic/nrf54h/Kconfig +++ b/soc/nordic/nrf54h/Kconfig @@ -7,7 +7,6 @@ config SOC_SERIES_NRF54HX select HAS_NRFS select HAS_NRFX select HAS_NORDIC_DRIVERS - select HAS_NORDIC_DMM config SOC_NRF54H20_CPUAPP select ARM @@ -19,6 +18,7 @@ config SOC_NRF54H20_CPUAPP select CPU_HAS_ICACHE select CPU_HAS_FPU select CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS + select HAS_NORDIC_DMM select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE select NRFS_HAS_CLOCK_SERVICE select NRFS_HAS_DVFS_SERVICE @@ -40,6 +40,7 @@ config SOC_NRF54H20_CPURAD select NRFS_HAS_CLOCK_SERVICE select NRFS_HAS_MRAM_SERVICE select NRFS_HAS_TEMP_SERVICE + select HAS_NORDIC_DMM config SOC_NRF54H20_CPUPPR depends on RISCV_CORE_NORDIC_VPR diff --git a/soc/nordic/soc.yml b/soc/nordic/soc.yml index 73e4aea0474b48..0bce815b9dc956 100644 --- a/soc/nordic/soc.yml +++ b/soc/nordic/soc.yml @@ -52,16 +52,37 @@ runners: run: first groups: - qualifiers: - - nrf51([0-9]{3})((.+)?) + - nrf51822 - qualifiers: - - nrf52([0-9]{3})((.+)?) + - nrf52805 + - qualifiers: + - nrf52810 + - qualifiers: + - nrf52811 + - qualifiers: + - nrf52820 + - qualifiers: + - nrf52832 + - qualifiers: + - nrf52833 + - qualifiers: + - nrf52840 - qualifiers: - nrf5340/cpunet - nrf5340/cpuapp - nrf5340/cpuapp/ns + - qualifiers: + - nrf9131 + - nrf9131/ns + - qualifiers: + - nrf9151 + - nrf9151/ns - qualifiers: - nrf9160 - nrf9160/ns + - qualifiers: + - nrf9161 + - nrf9161/ns - qualifiers: - nrf54l15/cpuapp - nrf54l15/cpuflpr @@ -77,17 +98,38 @@ runners: run: first groups: - qualifiers: - - nrf51([0-9]{3})((.+)?) + - nrf51822 + - qualifiers: + - nrf52805 + - qualifiers: + - nrf52810 + - qualifiers: + - nrf52811 + - qualifiers: + - nrf52820 + - qualifiers: + - nrf52832 - qualifiers: - - nrf52([0-9]{3})((.+)?) + - nrf52833 + - qualifiers: + - nrf52840 - qualifiers: - nrf5340/cpunet - qualifiers: - nrf5340/cpuapp - nrf5340/cpuapp/ns + - qualifiers: + - nrf9131 + - nrf9131/ns + - qualifiers: + - nrf9151 + - nrf9151/ns - qualifiers: - nrf9160 - nrf9160/ns + - qualifiers: + - nrf9161 + - nrf9161/ns - qualifiers: - nrf54l15/cpuapp - nrf54l15/cpuflpr @@ -103,17 +145,38 @@ runners: run: last groups: - qualifiers: - - nrf51([0-9]{3})((.+)?) + - nrf51822 + - qualifiers: + - nrf52805 + - qualifiers: + - nrf52810 + - qualifiers: + - nrf52811 - qualifiers: - - nrf52([0-9]{3})((.+)?) + - nrf52820 + - qualifiers: + - nrf52832 + - qualifiers: + - nrf52833 + - qualifiers: + - nrf52840 - qualifiers: - nrf5340/cpunet - qualifiers: - nrf5340/cpuapp - nrf5340/cpuapp/ns + - qualifiers: + - nrf9131 + - nrf9131/ns + - qualifiers: + - nrf9151 + - nrf9151/ns - qualifiers: - nrf9160 - nrf9160/ns + - qualifiers: + - nrf9161 + - nrf9161/ns - qualifiers: - nrf54l15/cpuapp - nrf54l15/cpuflpr diff --git a/soc/nxp/imx/imx8/adsp/linker.ld b/soc/nxp/imx/imx8/adsp/linker.ld index 4843d50e57fd86..a0754d007dfe42 100644 --- a/soc/nxp/imx/imx8/adsp/linker.ld +++ b/soc/nxp/imx/imx8/adsp/linker.ld @@ -522,4 +522,6 @@ SECTIONS KEEP (*(.fw_metadata)) . = ALIGN(_EXT_MAN_ALIGN_); } >fw_metadata_seg :metadata_entries_phdr + + /DISCARD/ : { *(.note.GNU-stack) } } diff --git a/soc/nxp/imx/imx8ulp/adsp/linker.ld b/soc/nxp/imx/imx8ulp/adsp/linker.ld index f832d9c45da2f6..a9f07e825ec3b1 100644 --- a/soc/nxp/imx/imx8ulp/adsp/linker.ld +++ b/soc/nxp/imx/imx8ulp/adsp/linker.ld @@ -522,4 +522,6 @@ SECTIONS KEEP (*(.fw_metadata)) . = ALIGN(_EXT_MAN_ALIGN_); } >fw_metadata_seg :metadata_entries_phdr + + /DISCARD/ : { *(.note.GNU-stack) } } diff --git a/soc/nxp/imx/imx8x/adsp/linker.ld b/soc/nxp/imx/imx8x/adsp/linker.ld index 4843d50e57fd86..a0754d007dfe42 100644 --- a/soc/nxp/imx/imx8x/adsp/linker.ld +++ b/soc/nxp/imx/imx8x/adsp/linker.ld @@ -522,4 +522,6 @@ SECTIONS KEEP (*(.fw_metadata)) . = ALIGN(_EXT_MAN_ALIGN_); } >fw_metadata_seg :metadata_entries_phdr + + /DISCARD/ : { *(.note.GNU-stack) } } diff --git a/soc/openisa/rv32m1/CMakeLists.txt b/soc/openisa/rv32m1/CMakeLists.txt index cd65ea9d62868d..fcfda5f17eda8a 100644 --- a/soc/openisa/rv32m1/CMakeLists.txt +++ b/soc/openisa/rv32m1/CMakeLists.txt @@ -2,14 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_SOC_OPENISA_RV32M1_RI5CY) - if (CONFIG_RISCV_GENERIC_TOOLCHAIN) - zephyr_compile_options(-march=rv32imc_zicsr_zifencei) - else() - zephyr_compile_options(-march=rv32imcxpulpv2) - endif() -elseif(CONFIG_SOC_OPENISA_RV32M1_ZERO_RISCY) - zephyr_compile_options(-march=rv32imc_zicsr_zifencei) +# Let's rely on `-march` being generated by the CMake script based on which `CONFIG_RISCV_ISA_EXT_*` +# options are y-selected; provide full arch string with the custom extension otherwise. +if(CONFIG_SOC_OPENISA_RV32M1_RI5CY AND NOT CONFIG_RISCV_GENERIC_TOOLCHAIN) + zephyr_compile_options(-march=rv32imcxpulpv2) endif() zephyr_sources( diff --git a/soc/openisa/rv32m1/Kconfig b/soc/openisa/rv32m1/Kconfig index 21fe5d9297d942..199d13ba744260 100644 --- a/soc/openisa/rv32m1/Kconfig +++ b/soc/openisa/rv32m1/Kconfig @@ -17,6 +17,6 @@ config SOC_OPENISA_RV32M1 select BUILD_OUTPUT_HEX select RISCV_ISA_RV32I select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_A + select RISCV_ISA_EXT_C select RISCV_ISA_EXT_ZICSR select RISCV_ISA_EXT_ZIFENCEI diff --git a/soc/st/stm32/stm32wbax/Kconfig.defconfig b/soc/st/stm32/stm32wbax/Kconfig.defconfig index b6dfd878afd524..88e41074518df5 100644 --- a/soc/st/stm32/stm32wbax/Kconfig.defconfig +++ b/soc/st/stm32/stm32wbax/Kconfig.defconfig @@ -35,6 +35,9 @@ config ENTROPY_STM32_CLK_CHECK config FPU default y +config SYSTEM_WORKQUEUE_STACK_SIZE + default 2048 + endif if PM_S2RAM diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index a6a9048d17f4e5..1d387e2c304422 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -46,7 +46,7 @@ manifest: groups: - optional - name: tflite-micro - revision: 1a34dcab41e7e0e667db72d6a40999c1ec9c510c + revision: 48613f7ba1ffbda46ad771a77a35408f48f922e9 path: optional/modules/lib/tflite-micro repo-path: tflite-micro remote: upstream diff --git a/subsys/bindesc/bindesc_build_time.c b/subsys/bindesc/bindesc_build_time.c index fde98c0f00503c..e0aeab261d1c78 100644 --- a/subsys/bindesc/bindesc_build_time.c +++ b/subsys/bindesc/bindesc_build_time.c @@ -10,43 +10,43 @@ /* Include generated header */ #include -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_YEAR) +#if defined(CONFIG_BINDESC_BUILD_TIME_YEAR) BINDESC_UINT_DEFINE(build_time_year, BINDESC_ID_BUILD_TIME_YEAR, BUILD_TIME_YEAR); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_YEAR) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_YEAR) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MONTH) +#if defined(CONFIG_BINDESC_BUILD_TIME_MONTH) BINDESC_UINT_DEFINE(build_time_month, BINDESC_ID_BUILD_TIME_MONTH, BUILD_TIME_MONTH); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MONTH) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_MONTH) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_DAY) +#if defined(CONFIG_BINDESC_BUILD_TIME_DAY) BINDESC_UINT_DEFINE(build_time_day, BINDESC_ID_BUILD_TIME_DAY, BUILD_TIME_DAY); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_DAY) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_DAY) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_HOUR) +#if defined(CONFIG_BINDESC_BUILD_TIME_HOUR) BINDESC_UINT_DEFINE(build_time_hour, BINDESC_ID_BUILD_TIME_HOUR, BUILD_TIME_HOUR); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_HOUR) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_HOUR) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MINUTE) +#if defined(CONFIG_BINDESC_BUILD_TIME_MINUTE) BINDESC_UINT_DEFINE(build_time_minute, BINDESC_ID_BUILD_TIME_MINUTE, BUILD_TIME_MINUTE); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MINUTE) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_MINUTE) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_SECOND) +#if defined(CONFIG_BINDESC_BUILD_TIME_SECOND) BINDESC_UINT_DEFINE(build_time_second, BINDESC_ID_BUILD_TIME_SECOND, BUILD_TIME_SECOND); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_SECOND) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_SECOND) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_UNIX) +#if defined(CONFIG_BINDESC_BUILD_TIME_UNIX) BINDESC_UINT_DEFINE(build_time_unix, BINDESC_ID_BUILD_TIME_UNIX, BUILD_TIME_UNIX); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_UNIX) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_UNIX) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_TIME_STRING) +#if defined(CONFIG_BINDESC_BUILD_DATE_TIME_STRING) BINDESC_STR_DEFINE(build_date_time_string, BINDESC_ID_BUILD_DATE_TIME_STRING, BUILD_DATE_TIME_STRING); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_TIME_STRING) */ +#endif /* defined(CONFIG_BINDESC_BUILD_DATE_TIME_STRING) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_STRING) +#if defined(CONFIG_BINDESC_BUILD_DATE_STRING) BINDESC_STR_DEFINE(build_date_string, BINDESC_ID_BUILD_DATE_STRING, BUILD_DATE_STRING); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_STRING) */ +#endif /* defined(CONFIG_BINDESC_BUILD_DATE_STRING) */ -#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_STRING) +#if defined(CONFIG_BINDESC_BUILD_TIME_STRING) BINDESC_STR_DEFINE(build_time_string, BINDESC_ID_BUILD_TIME_STRING, BUILD_TIME_STRING); -#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_STRING) */ +#endif /* defined(CONFIG_BINDESC_BUILD_TIME_STRING) */ diff --git a/subsys/bindesc/bindesc_host_info.c b/subsys/bindesc/bindesc_host_info.c index 6ecc43495d43fb..56611b945230b8 100644 --- a/subsys/bindesc/bindesc_host_info.c +++ b/subsys/bindesc/bindesc_host_info.c @@ -7,23 +7,23 @@ #include #include -#if IS_ENABLED(CONFIG_BINDESC_HOST_NAME) +#if defined(CONFIG_BINDESC_HOST_NAME) BINDESC_STR_DEFINE(host_name, BINDESC_ID_HOST_NAME, HOST_NAME); -#endif /* IS_ENABLED(CONFIG_BINDESC_HOST_NAME) */ +#endif /* defined(CONFIG_BINDESC_HOST_NAME) */ -#if IS_ENABLED(CONFIG_BINDESC_C_COMPILER_NAME) +#if defined(CONFIG_BINDESC_C_COMPILER_NAME) BINDESC_STR_DEFINE(c_compiler_name, BINDESC_ID_C_COMPILER_NAME, C_COMPILER_NAME); -#endif /* IS_ENABLED(CONFIG_BINDESC_C_COMPILER_NAME) */ +#endif /* defined(CONFIG_BINDESC_C_COMPILER_NAME) */ -#if IS_ENABLED(CONFIG_BINDESC_C_COMPILER_VERSION) +#if defined(CONFIG_BINDESC_C_COMPILER_VERSION) BINDESC_STR_DEFINE(c_compiler_version, BINDESC_ID_C_COMPILER_VERSION, C_COMPILER_VERSION); -#endif /* IS_ENABLED(CONFIG_BINDESC_C_COMPILER_VERSION) */ +#endif /* defined(CONFIG_BINDESC_C_COMPILER_VERSION) */ -#if IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_NAME) +#if defined(CONFIG_BINDESC_CXX_COMPILER_NAME) BINDESC_STR_DEFINE(cxx_compiler_name, BINDESC_ID_CXX_COMPILER_NAME, CXX_COMPILER_NAME); -#endif /* IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_NAME) */ +#endif /* defined(CONFIG_BINDESC_CXX_COMPILER_NAME) */ -#if IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_VERSION) +#if defined(CONFIG_BINDESC_CXX_COMPILER_VERSION) BINDESC_STR_DEFINE(cxx_compiler_version, BINDESC_ID_CXX_COMPILER_VERSION, CXX_COMPILER_VERSION); -#endif /* IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_VERSION) */ +#endif /* defined(CONFIG_BINDESC_CXX_COMPILER_VERSION) */ diff --git a/subsys/bindesc/bindesc_version.c b/subsys/bindesc/bindesc_version.c index 76111ca17bb8c3..ff8030585c2996 100644 --- a/subsys/bindesc/bindesc_version.c +++ b/subsys/bindesc/bindesc_version.c @@ -8,57 +8,57 @@ #include #include -#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_STRING) +#if defined(CONFIG_BINDESC_KERNEL_VERSION_STRING) BINDESC_STR_DEFINE(kernel_version_string, BINDESC_ID_KERNEL_VERSION_STRING, KERNEL_VERSION_STRING); -#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_STRING) */ +#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_STRING) */ -#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MAJOR) +#if defined(CONFIG_BINDESC_KERNEL_VERSION_MAJOR) BINDESC_UINT_DEFINE(kernel_version_major, BINDESC_ID_KERNEL_VERSION_MAJOR, KERNEL_VERSION_MAJOR); -#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MAJOR) */ +#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_MAJOR) */ -#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MINOR) +#if defined(CONFIG_BINDESC_KERNEL_VERSION_MINOR) BINDESC_UINT_DEFINE(kernel_version_minor, BINDESC_ID_KERNEL_VERSION_MINOR, KERNEL_VERSION_MINOR); -#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MINOR) */ +#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_MINOR) */ -#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL) +#if defined(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL) BINDESC_UINT_DEFINE(kernel_version_patchlevel, BINDESC_ID_KERNEL_VERSION_PATCHLEVEL, KERNEL_PATCHLEVEL); -#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL) */ +#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL) */ -#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_NUMBER) +#if defined(CONFIG_BINDESC_KERNEL_VERSION_NUMBER) BINDESC_UINT_DEFINE(kernel_version_number, BINDESC_ID_KERNEL_VERSION_NUMBER, KERNEL_VERSION_NUMBER); -#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_NUMBER) */ +#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_NUMBER) */ -#if IS_ENABLED(HAS_APP_VERSION) +#if defined(HAS_APP_VERSION) #include -#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_STRING) +#if defined(CONFIG_BINDESC_APP_VERSION_STRING) BINDESC_STR_DEFINE(app_version_string, BINDESC_ID_APP_VERSION_STRING, APP_VERSION_STRING); -#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_STRING) */ +#endif /* defined(CONFIG_BINDESC_APP_VERSION_STRING) */ -#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MAJOR) +#if defined(CONFIG_BINDESC_APP_VERSION_MAJOR) BINDESC_UINT_DEFINE(app_version_major, BINDESC_ID_APP_VERSION_MAJOR, APP_VERSION_MAJOR); -#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MAJOR) */ +#endif /* defined(CONFIG_BINDESC_APP_VERSION_MAJOR) */ -#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MINOR) +#if defined(CONFIG_BINDESC_APP_VERSION_MINOR) BINDESC_UINT_DEFINE(app_version_minor, BINDESC_ID_APP_VERSION_MINOR, APP_VERSION_MINOR); -#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MINOR) */ +#endif /* defined(CONFIG_BINDESC_APP_VERSION_MINOR) */ -#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL) +#if defined(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL) BINDESC_UINT_DEFINE(app_version_patchlevel, BINDESC_ID_APP_VERSION_PATCHLEVEL, APP_PATCHLEVEL); -#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL) */ +#endif /* defined(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL) */ -#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_NUMBER) +#if defined(CONFIG_BINDESC_APP_VERSION_NUMBER) BINDESC_UINT_DEFINE(app_version_number, BINDESC_ID_APP_VERSION_NUMBER, APP_VERSION_NUMBER); -#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_NUMBER) */ +#endif /* defined(CONFIG_BINDESC_APP_VERSION_NUMBER) */ -#endif /* IS_ENABLED(HAS_APP_VERSION) */ +#endif /* defined(HAS_APP_VERSION) */ diff --git a/subsys/bluetooth/audio/ascs.c b/subsys/bluetooth/audio/ascs.c index 1a10523e494957..17aeda10edb311 100644 --- a/subsys/bluetooth/audio/ascs.c +++ b/subsys/bluetooth/audio/ascs.c @@ -57,6 +57,8 @@ LOG_MODULE_REGISTER(bt_ascs, CONFIG_BT_ASCS_LOG_LEVEL); (CONFIG_BT_ASCS_ASE_SNK_COUNT + \ CONFIG_BT_ASCS_ASE_SRC_COUNT) +#define NTF_HEADER_SIZE (3) /* opcode (1) + handle (2) */ + BUILD_ASSERT(CONFIG_BT_ASCS_MAX_ACTIVE_ASES <= MAX(MAX_ASES_SESSIONS, CONFIG_BT_ISO_MAX_CHAN), "Max active ASEs are set to more than actual number of ASEs or ISOs"); @@ -99,8 +101,9 @@ static struct bt_ascs_ase { * writing */ BUILD_ASSERT( - BT_ATT_BUF_SIZE - 3 >= ASE_BUF_SIZE || - DIV_ROUND_UP(ASE_BUF_SIZE, (BT_ATT_BUF_SIZE - 3)) <= CONFIG_BT_ATT_PREPARE_COUNT, + (BT_ATT_BUF_SIZE - NTF_HEADER_SIZE) >= ASE_BUF_SIZE || + DIV_ROUND_UP(ASE_BUF_SIZE, (BT_ATT_BUF_SIZE - NTF_HEADER_SIZE)) <= + CONFIG_BT_ATT_PREPARE_COUNT, "CONFIG_BT_ATT_PREPARE_COUNT not large enough to cover the maximum supported ASCS value"); /* It is mandatory to support long writes in ASCS unconditionally, and thus @@ -189,9 +192,19 @@ static void ase_free(struct bt_ascs_ase *ase) (void)k_work_cancel_delayable(&ase->state_transition_work); } +static uint16_t get_max_ntf_size(struct bt_conn *conn) +{ + const uint16_t mtu = conn == NULL ? 0 : bt_gatt_get_mtu(conn); + + if (mtu > NTF_HEADER_SIZE) { + return mtu - NTF_HEADER_SIZE; + } + + return 0U; +} + static int ase_state_notify(struct bt_ascs_ase *ase) { - const uint8_t att_ntf_header_size = 3; /* opcode (1) + handle (2) */ struct bt_conn *conn = ase->conn; struct bt_conn_info conn_info; uint16_t max_ntf_size; @@ -217,7 +230,7 @@ static int ase_state_notify(struct bt_ascs_ase *ase) ascs_ep_get_status(&ase->ep, &ase_buf); - max_ntf_size = bt_gatt_get_mtu(conn) - att_ntf_header_size; + max_ntf_size = get_max_ntf_size(conn); ntf_size = MIN(max_ntf_size, ase_buf.len); if (ntf_size < ase_buf.len) { @@ -1094,15 +1107,23 @@ static void ascs_ase_cfg_changed(const struct bt_gatt_attr *attr, LOG_DBG("attr %p value 0x%04x", attr, value); } -NET_BUF_SIMPLE_DEFINE_STATIC(rsp_buf, CONFIG_BT_L2CAP_TX_MTU); +#define CP_RSP_BUF_SIZE \ + (sizeof(struct bt_ascs_cp_rsp) + (ASE_COUNT * sizeof(struct bt_ascs_cp_ase_rsp))) + +/* Ensure that the cp_rsp_buf can fit in any notification + * (sizeof buffer - header for notification) + */ +BUILD_ASSERT(BT_ATT_BUF_SIZE - NTF_HEADER_SIZE >= CP_RSP_BUF_SIZE, + "BT_ATT_BUF_SIZE not large enough to hold responses for all ASEs"); +NET_BUF_SIMPLE_DEFINE_STATIC(cp_rsp_buf, CP_RSP_BUF_SIZE); static void ascs_cp_rsp_init(uint8_t op) { struct bt_ascs_cp_rsp *rsp; - net_buf_simple_reset(&rsp_buf); + net_buf_simple_reset(&cp_rsp_buf); - rsp = net_buf_simple_add(&rsp_buf, sizeof(*rsp)); + rsp = net_buf_simple_add(&cp_rsp_buf, sizeof(*rsp)); rsp->op = op; rsp->num_ase = 0; } @@ -1110,13 +1131,13 @@ static void ascs_cp_rsp_init(uint8_t op) /* Add response to an opcode/ASE ID */ static void ascs_cp_rsp_add(uint8_t id, uint8_t code, uint8_t reason) { - struct bt_ascs_cp_rsp *rsp = (void *)rsp_buf.__buf; + struct bt_ascs_cp_rsp *rsp = (void *)cp_rsp_buf.__buf; struct bt_ascs_cp_ase_rsp *ase_rsp; LOG_DBG("id 0x%02x code %s (0x%02x) reason %s (0x%02x)", id, bt_ascs_rsp_str(code), code, bt_ascs_reason_str(reason), reason); - if (rsp->num_ase == 0xff) { + if (rsp->num_ase == BT_ASCS_UNSUPP_OR_LENGTH_ERR_NUM_ASE) { return; } @@ -1133,7 +1154,7 @@ static void ascs_cp_rsp_add(uint8_t id, uint8_t code, uint8_t reason) break; } - ase_rsp = net_buf_simple_add(&rsp_buf, sizeof(*ase_rsp)); + ase_rsp = net_buf_simple_add(&cp_rsp_buf, sizeof(*ase_rsp)); ase_rsp->id = id; ase_rsp->code = code; ase_rsp->reason = reason; @@ -1742,7 +1763,42 @@ int bt_ascs_config_ase(struct bt_conn *conn, struct bt_bap_stream *stream, return 0; } -static bool is_valid_config_len(struct net_buf_simple *buf) +static uint16_t get_max_ase_rsp_for_conn(struct bt_conn *conn) +{ + const uint16_t max_ntf_size = get_max_ntf_size(conn); + const size_t rsp_hdr_size = sizeof(struct bt_ascs_cp_rsp); + + if (max_ntf_size > rsp_hdr_size) { + return (max_ntf_size - rsp_hdr_size) / sizeof(struct bt_ascs_cp_ase_rsp); + } + + return 0U; +} + +static bool is_valid_num_ases(struct bt_conn *conn, uint8_t num_ases) +{ + const uint16_t max_ase_rsp = get_max_ase_rsp_for_conn(conn); + + if (num_ases < 1U) { + LOG_WRN("Number_of_ASEs parameter value is less than 1"); + return false; + } else if (num_ases > ASE_COUNT) { + /* If the request is for more ASEs than we have, we just reject the request */ + LOG_DBG("Number_of_ASEs parameter value (%u) is greater than %d", num_ases, + ASE_COUNT); + return false; + } else if (num_ases > max_ase_rsp) { + /* If the request is for more ASEs than we can respond to, we reject the request */ + LOG_DBG("Number_of_ASEs parameter value (%u) is greater than what we can respond " + "to (%u) based on the MTU", + num_ases, max_ase_rsp); + return false; + } + + return true; +} + +static bool is_valid_config_len(struct bt_conn *conn, struct net_buf_simple *buf) { const struct bt_ascs_config_op *op; struct net_buf_simple_state state; @@ -1755,8 +1811,7 @@ static bool is_valid_config_len(struct net_buf_simple *buf) } op = net_buf_simple_pull_mem(buf, sizeof(*op)); - if (op->num_ases < 1) { - LOG_WRN("Number_of_ASEs parameter value is less than 1"); + if (!is_valid_num_ases(conn, op->num_ases)) { return false; } @@ -1792,7 +1847,7 @@ static ssize_t ascs_config(struct bt_conn *conn, struct net_buf_simple *buf) const struct bt_ascs_config_op *req; const struct bt_ascs_config *cfg; - if (!is_valid_config_len(buf)) { + if (!is_valid_config_len(conn, buf)) { return BT_GATT_ERR(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN); } @@ -1960,7 +2015,7 @@ static void ase_qos(struct bt_ascs_ase *ase, uint8_t cig_id, uint8_t cis_id, *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_SUCCESS, BT_BAP_ASCS_REASON_NONE); } -static bool is_valid_qos_len(struct net_buf_simple *buf) +static bool is_valid_qos_len(struct bt_conn *conn, struct net_buf_simple *buf) { const struct bt_ascs_qos_op *op; struct net_buf_simple_state state; @@ -1974,8 +2029,7 @@ static bool is_valid_qos_len(struct net_buf_simple *buf) } op = net_buf_simple_pull_mem(buf, sizeof(*op)); - if (op->num_ases < 1) { - LOG_WRN("Number_of_ASEs parameter value is less than 1"); + if (!is_valid_num_ases(conn, op->num_ases)) { return false; } @@ -2001,7 +2055,7 @@ static ssize_t ascs_qos(struct bt_conn *conn, struct net_buf_simple *buf) { const struct bt_ascs_qos_op *req; - if (!is_valid_qos_len(buf)) { + if (!is_valid_qos_len(conn, buf)) { return BT_GATT_ERR(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN); } @@ -2342,7 +2396,7 @@ static int ase_enable(struct bt_ascs_ase *ase, struct bt_ascs_metadata *meta) return 0; } -static bool is_valid_enable_len(struct net_buf_simple *buf) +static bool is_valid_enable_len(struct bt_conn *conn, struct net_buf_simple *buf) { const struct bt_ascs_enable_op *op; struct net_buf_simple_state state; @@ -2355,8 +2409,7 @@ static bool is_valid_enable_len(struct net_buf_simple *buf) } op = net_buf_simple_pull_mem(buf, sizeof(*op)); - if (op->num_ases < 1) { - LOG_WRN("Number_of_ASEs parameter value is less than 1"); + if (!is_valid_num_ases(conn, op->num_ases)) { return false; } @@ -2393,7 +2446,7 @@ static ssize_t ascs_enable(struct bt_conn *conn, struct net_buf_simple *buf) struct bt_ascs_metadata *meta; int i; - if (!is_valid_enable_len(buf)) { + if (!is_valid_enable_len(conn, buf)) { return BT_GATT_ERR(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN); } @@ -2487,7 +2540,7 @@ static void ase_start(struct bt_ascs_ase *ase) ascs_cp_rsp_success(ASE_ID(ase)); } -static bool is_valid_start_len(struct net_buf_simple *buf) +static bool is_valid_start_len(struct bt_conn *conn, struct net_buf_simple *buf) { const struct bt_ascs_start_op *op; struct net_buf_simple_state state; @@ -2500,8 +2553,7 @@ static bool is_valid_start_len(struct net_buf_simple *buf) } op = net_buf_simple_pull_mem(buf, sizeof(*op)); - if (op->num_ases < 1) { - LOG_WRN("Number_of_ASEs parameter value is less than 1"); + if (!is_valid_num_ases(conn, op->num_ases)) { return false; } @@ -2520,7 +2572,7 @@ static ssize_t ascs_start(struct bt_conn *conn, struct net_buf_simple *buf) const struct bt_ascs_start_op *req; int i; - if (!is_valid_start_len(buf)) { + if (!is_valid_start_len(conn, buf)) { return BT_GATT_ERR(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN); } @@ -2570,7 +2622,7 @@ static ssize_t ascs_start(struct bt_conn *conn, struct net_buf_simple *buf) return buf->size; } -static bool is_valid_disable_len(struct net_buf_simple *buf) +static bool is_valid_disable_len(struct bt_conn *conn, struct net_buf_simple *buf) { const struct bt_ascs_disable_op *op; struct net_buf_simple_state state; @@ -2583,8 +2635,7 @@ static bool is_valid_disable_len(struct net_buf_simple *buf) } op = net_buf_simple_pull_mem(buf, sizeof(*op)); - if (op->num_ases < 1) { - LOG_WRN("Number_of_ASEs parameter value is less than 1"); + if (!is_valid_num_ases(conn, op->num_ases)) { return false; } @@ -2602,7 +2653,7 @@ static ssize_t ascs_disable(struct bt_conn *conn, struct net_buf_simple *buf) { const struct bt_ascs_disable_op *req; - if (!is_valid_disable_len(buf)) { + if (!is_valid_disable_len(conn, buf)) { return BT_GATT_ERR(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN); } @@ -2700,7 +2751,7 @@ static void ase_stop(struct bt_ascs_ase *ase) ascs_cp_rsp_success(ASE_ID(ase)); } -static bool is_valid_stop_len(struct net_buf_simple *buf) +static bool is_valid_stop_len(struct bt_conn *conn, struct net_buf_simple *buf) { const struct bt_ascs_stop_op *op; struct net_buf_simple_state state; @@ -2713,7 +2764,7 @@ static bool is_valid_stop_len(struct net_buf_simple *buf) } op = net_buf_simple_pull_mem(buf, sizeof(*op)); - if (op->num_ases < 1) { + if (op->num_ases < 1U) { LOG_WRN("Number_of_ASEs parameter value is less than 1"); return false; } @@ -2733,7 +2784,7 @@ static ssize_t ascs_stop(struct bt_conn *conn, struct net_buf_simple *buf) const struct bt_ascs_start_op *req; int i; - if (!is_valid_stop_len(buf)) { + if (!is_valid_stop_len(conn, buf)) { return BT_GATT_ERR(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN); } @@ -2783,7 +2834,7 @@ static ssize_t ascs_stop(struct bt_conn *conn, struct net_buf_simple *buf) return buf->size; } -static bool is_valid_metadata_len(struct net_buf_simple *buf) +static bool is_valid_metadata_len(struct bt_conn *conn, struct net_buf_simple *buf) { const struct bt_ascs_metadata_op *op; struct net_buf_simple_state state; @@ -2796,8 +2847,7 @@ static bool is_valid_metadata_len(struct net_buf_simple *buf) } op = net_buf_simple_pull_mem(buf, sizeof(*op)); - if (op->num_ases < 1) { - LOG_WRN("Number_of_ASEs parameter value is less than 1"); + if (!is_valid_num_ases(conn, op->num_ases)) { return false; } @@ -2834,7 +2884,7 @@ static ssize_t ascs_metadata(struct bt_conn *conn, struct net_buf_simple *buf) struct bt_ascs_metadata *meta; int i; - if (!is_valid_metadata_len(buf)) { + if (!is_valid_metadata_len(conn, buf)) { return BT_GATT_ERR(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN); } @@ -2877,7 +2927,7 @@ static ssize_t ascs_metadata(struct bt_conn *conn, struct net_buf_simple *buf) return buf->size; } -static bool is_valid_release_len(struct net_buf_simple *buf) +static bool is_valid_release_len(struct bt_conn *conn, struct net_buf_simple *buf) { const struct bt_ascs_release_op *op; struct net_buf_simple_state state; @@ -2890,8 +2940,7 @@ static bool is_valid_release_len(struct net_buf_simple *buf) } op = net_buf_simple_pull_mem(buf, sizeof(*op)); - if (op->num_ases < 1) { - LOG_WRN("Number_of_ASEs parameter value is less than 1"); + if (!is_valid_num_ases(conn, op->num_ases)) { return false; } @@ -2910,7 +2959,7 @@ static ssize_t ascs_release(struct bt_conn *conn, struct net_buf_simple *buf) const struct bt_ascs_release_op *req; int i; - if (!is_valid_release_len(buf)) { + if (!is_valid_release_len(conn, buf)) { return BT_GATT_ERR(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN); } @@ -3018,7 +3067,7 @@ static ssize_t ascs_cp_write(struct bt_conn *conn, } respond: - control_point_notify(conn, rsp_buf.data, rsp_buf.len); + control_point_notify(conn, cp_rsp_buf.data, cp_rsp_buf.len); return len; } diff --git a/subsys/bluetooth/audio/bap_broadcast_sink.c b/subsys/bluetooth/audio/bap_broadcast_sink.c index d554d0f1ef6335..7f2ef7adbeb2ed 100644 --- a/subsys/bluetooth/audio/bap_broadcast_sink.c +++ b/subsys/bluetooth/audio/bap_broadcast_sink.c @@ -299,6 +299,33 @@ static void broadcast_sink_iso_recv(struct bt_iso_chan *chan, } } +/** Gets the "highest" state of all BIS in the broadcast sink */ +static enum bt_bap_ep_state broadcast_sink_get_state(struct bt_bap_broadcast_sink *sink) +{ + enum bt_bap_ep_state state = BT_BAP_EP_STATE_IDLE; + struct bt_bap_stream *stream; + + if (sink == NULL) { + LOG_DBG("sink is NULL"); + + return state; + } + + if (sys_slist_is_empty(&sink->streams)) { + LOG_DBG("Sink does not have any streams"); + + return state; + } + + SYS_SLIST_FOR_EACH_CONTAINER(&sink->streams, stream, _node) { + if (stream->ep != NULL) { + state = MAX(state, stream->ep->status.state); + } + } + + return state; +} + static void broadcast_sink_iso_connected(struct bt_iso_chan *chan) { struct bt_bap_iso *iso = CONTAINER_OF(chan, struct bt_bap_iso, chan); @@ -306,7 +333,6 @@ static void broadcast_sink_iso_connected(struct bt_iso_chan *chan) struct bt_bap_broadcast_sink *sink; struct bt_bap_stream *stream; struct bt_bap_ep *ep = iso->rx.ep; - bool all_connected; if (ep == NULL) { LOG_ERR("iso %p not bound with ep", chan); @@ -340,17 +366,7 @@ static void broadcast_sink_iso_connected(struct bt_iso_chan *chan) LOG_WRN("No callback for started set"); } - all_connected = true; - SYS_SLIST_FOR_EACH_CONTAINER(&sink->streams, stream, _node) { - __ASSERT(stream->ep, "Endpoint is NULL"); - - if (stream->ep->status.state != BT_BAP_EP_STATE_STREAMING) { - all_connected = false; - break; - } - } - - if (all_connected) { + if (broadcast_sink_get_state(sink) != BT_BAP_EP_STATE_STREAMING) { update_recv_state_big_synced(sink); } } @@ -1278,8 +1294,7 @@ int bt_bap_broadcast_sink_sync(struct bt_bap_broadcast_sink *sink, uint32_t inde int bt_bap_broadcast_sink_stop(struct bt_bap_broadcast_sink *sink) { - struct bt_bap_stream *stream; - sys_snode_t *head_node; + enum bt_bap_ep_state state; int err; CHECKIF(sink == NULL) { @@ -1292,21 +1307,9 @@ int bt_bap_broadcast_sink_stop(struct bt_bap_broadcast_sink *sink) return -EALREADY; } - head_node = sys_slist_peek_head(&sink->streams); - stream = CONTAINER_OF(head_node, struct bt_bap_stream, _node); - - /* All streams in a broadcast source is in the same state, - * so we can just check the first stream - */ - if (stream->ep == NULL) { - LOG_DBG("stream->ep is NULL"); - return -EINVAL; - } - - if (stream->ep->status.state != BT_BAP_EP_STATE_STREAMING && - stream->ep->status.state != BT_BAP_EP_STATE_QOS_CONFIGURED) { - LOG_DBG("Broadcast sink stream %p invalid state: %u", stream, - stream->ep->status.state); + state = broadcast_sink_get_state(sink); + if (state != BT_BAP_EP_STATE_STREAMING && state != BT_BAP_EP_STATE_QOS_CONFIGURED) { + LOG_DBG("Broadcast sink %p invalid state: %u", sink, state); return -EBADMSG; } @@ -1324,25 +1327,17 @@ int bt_bap_broadcast_sink_stop(struct bt_bap_broadcast_sink *sink) int bt_bap_broadcast_sink_delete(struct bt_bap_broadcast_sink *sink) { + enum bt_bap_ep_state state; + CHECKIF(sink == NULL) { LOG_DBG("sink is NULL"); return -EINVAL; } - if (!sys_slist_is_empty(&sink->streams)) { - struct bt_bap_stream *stream; - sys_snode_t *head_node; - - head_node = sys_slist_peek_head(&sink->streams); - stream = CONTAINER_OF(head_node, struct bt_bap_stream, _node); - - /* All streams in a broadcast source is in the same state, - * so we can just check the first stream - */ - if (stream->ep != NULL) { - LOG_DBG("Sink is not stopped"); - return -EBADMSG; - } + state = broadcast_sink_get_state(sink); + if (state != BT_BAP_EP_STATE_IDLE) { + LOG_DBG("Broadcast sink %p invalid state: %u", sink, state); + return -EBADMSG; } /* Reset the broadcast sink */ diff --git a/subsys/bluetooth/audio/bap_broadcast_source.c b/subsys/bluetooth/audio/bap_broadcast_source.c index c8547e13ae7112..4f11e247ceb900 100644 --- a/subsys/bluetooth/audio/bap_broadcast_source.c +++ b/subsys/bluetooth/audio/bap_broadcast_source.c @@ -624,38 +624,33 @@ static bool valid_broadcast_source_param(const struct bt_bap_broadcast_source_pa return true; } +/** Gets the "highest" state of all BIS in the broadcast source */ static enum bt_bap_ep_state broadcast_source_get_state(struct bt_bap_broadcast_source *source) { + enum bt_bap_ep_state state = BT_BAP_EP_STATE_IDLE; struct bt_bap_broadcast_subgroup *subgroup; - struct bt_bap_stream *stream; - sys_snode_t *head_node; if (source == NULL) { LOG_DBG("source is NULL"); - return BT_BAP_EP_STATE_IDLE; + return state; } if (sys_slist_is_empty(&source->subgroups)) { LOG_DBG("Source does not have any streams"); - return BT_BAP_EP_STATE_IDLE; + return state; } - /* Get the first stream */ - head_node = sys_slist_peek_head(&source->subgroups); - subgroup = CONTAINER_OF(head_node, struct bt_bap_broadcast_subgroup, _node); - - head_node = sys_slist_peek_head(&subgroup->streams); - stream = CONTAINER_OF(head_node, struct bt_bap_stream, _node); + SYS_SLIST_FOR_EACH_CONTAINER(&source->subgroups, subgroup, _node) { + struct bt_bap_stream *stream; - /* All streams in a broadcast source is in the same state, - * so we can just check the first stream - */ - if (stream->ep == NULL) { - LOG_DBG("stream->ep is NULL"); - return BT_BAP_EP_STATE_IDLE; + SYS_SLIST_FOR_EACH_CONTAINER(&subgroup->streams, stream, _node) { + if (stream->ep != NULL) { + state = MAX(state, stream->ep->status.state); + } + } } - return stream->ep->status.state; + return state; } static bool merge_bis_and_subgroup_data_cb(struct bt_data *data, void *user_data) diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index 6ba46a49c1f50f..f7d50a3f4c3067 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -835,22 +835,26 @@ static int scan_delegator_mod_src(struct bt_conn *conn, } for (int i = 0; i < num_subgroups; i++) { - /* If the metadata len is 0, we shall not overwrite the existing metadata */ - if (subgroups[i].metadata_len == 0) { - continue; - } + const bool metadata_len_changed = + subgroups[i].metadata_len != state->subgroups[i].metadata_len; - if (subgroups[i].metadata_len != state->subgroups[i].metadata_len) { + if (metadata_len_changed) { state->subgroups[i].metadata_len = subgroups[i].metadata_len; state_changed = true; } - if (memcmp(subgroups[i].metadata, state->subgroups[i].metadata, + if (metadata_len_changed || + memcmp(subgroups[i].metadata, state->subgroups[i].metadata, sizeof(subgroups[i].metadata)) != 0) { - (void)memcpy(state->subgroups[i].metadata, - subgroups[i].metadata, - state->subgroups[i].metadata_len); - state->subgroups[i].metadata_len = subgroups[i].metadata_len; + + if (state->subgroups[i].metadata_len == 0U) { + memset(state->subgroups[i].metadata, 0, + state->subgroups[i].metadata_len); + } else { + (void)memcpy(state->subgroups[i].metadata, subgroups[i].metadata, + state->subgroups[i].metadata_len); + } + state_changed = true; } } diff --git a/subsys/bluetooth/audio/tbs.c b/subsys/bluetooth/audio/tbs.c index aa5be134f2de3d..1a33985cf2be55 100644 --- a/subsys/bluetooth/audio/tbs.c +++ b/subsys/bluetooth/audio/tbs.c @@ -84,7 +84,7 @@ struct gtbs_service_inst { #else #define READ_BUF_SIZE (CONFIG_BT_TBS_MAX_CALLS * \ sizeof(struct bt_tbs_current_call_item)) -#endif /* IS_ENABLED(CONFIG_BT_GTBS) */ +#endif /* defined(CONFIG_BT_GTBS) */ NET_BUF_SIMPLE_DEFINE_STATIC(read_buf, READ_BUF_SIZE); static struct tbs_service_inst svc_insts[CONFIG_BT_TBS_BEARER_COUNT]; diff --git a/subsys/bluetooth/audio/tbs_client.c b/subsys/bluetooth/audio/tbs_client.c index 2a291813288708..71c34f781fc3f0 100644 --- a/subsys/bluetooth/audio/tbs_client.c +++ b/subsys/bluetooth/audio/tbs_client.c @@ -63,7 +63,7 @@ struct bt_tbs_server_inst { #endif /* CONFIG_BT_TBS_CLIENT_TBS */ #if defined(CONFIG_BT_TBS_CLIENT_GTBS) struct bt_tbs_instance gtbs_inst; -#endif /* IS_ENABLED(CONFIG_BT_TBS_CLIENT_GTBS) */ +#endif /* defined(CONFIG_BT_TBS_CLIENT_GTBS) */ struct bt_gatt_discover_params discover_params; struct bt_tbs_instance *current_inst; }; @@ -1748,7 +1748,7 @@ static int primary_discover_gtbs(struct bt_conn *conn) return bt_gatt_discover(conn, params); } -#endif /* IS_ENABLED(CONFIG_BT_TBS_CLIENT_GTBS) */ +#endif /* defined(CONFIG_BT_TBS_CLIENT_GTBS) */ /****************************** PUBLIC API ******************************/ diff --git a/subsys/bluetooth/host/classic/rfcomm.c b/subsys/bluetooth/host/classic/rfcomm.c index af67f2851b91df..f7a0c25c044063 100644 --- a/subsys/bluetooth/host/classic/rfcomm.c +++ b/subsys/bluetooth/host/classic/rfcomm.c @@ -1427,6 +1427,10 @@ static void rfcomm_handle_data(struct bt_rfcomm_session *session, } if (pf == BT_RFCOMM_PF_UIH_CREDIT) { + if (buf->len == 0) { + LOG_WRN("Data recvd is invalid"); + return; + } rfcomm_dlc_tx_give_credits(dlc, net_buf_pull_u8(buf)); } diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 419be99fc9f5ea..a5f81fbea2c327 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -773,6 +773,10 @@ static bool should_stop_tx(struct bt_conn *conn) { LOG_DBG("%p", conn); + if (conn->state != BT_CONN_CONNECTED) { + return true; + } + /* TODO: This function should be overridable by the application: they * should be able to provide their own heuristic. */ @@ -804,6 +808,12 @@ void bt_conn_data_ready(struct bt_conn *conn) /* The TX processor will call the `pull_cb` to get the buf */ if (!atomic_set(&conn->_conn_ready_lock, 1)) { + /* Attach a reference to the `bt_dev.le.conn_ready` list. + * + * This reference will be consumed when the conn is popped off + * the list (in `get_conn_ready`). + */ + bt_conn_ref(conn); sys_slist_append(&bt_dev.le.conn_ready, &conn->_conn_ready); LOG_DBG("raised"); @@ -857,6 +867,12 @@ struct bt_conn *get_conn_ready(void) return NULL; } + /* `conn` borrows from the list node. That node is _not_ popped yet. + * + * If we end up not popping that conn off the list, we have to make sure + * to increase the refcount before returning a pointer to that + * connection out of this function. + */ struct bt_conn *conn = CONTAINER_OF(node, struct bt_conn, _conn_ready); if (dont_have_viewbufs()) { @@ -887,6 +903,7 @@ struct bt_conn *get_conn_ready(void) } if (should_stop_tx(conn)) { + /* Move reference off the list and into the `conn` variable. */ __maybe_unused sys_snode_t *s = sys_slist_get(&bt_dev.le.conn_ready); __ASSERT_NO_MSG(s == node); @@ -902,9 +919,11 @@ struct bt_conn *get_conn_ready(void) LOG_DBG("appending %p to back of TX queue", conn); bt_conn_data_ready(conn); } + + return conn; } - return conn; + return bt_conn_ref(conn); } /* Crazy that this file is compiled even if this is not true, but here we are. */ @@ -985,7 +1004,8 @@ void bt_conn_tx_processor(void) LOG_DBG("processing conn %p", conn); if (conn->state != BT_CONN_CONNECTED) { - LOG_ERR("conn %p: not connected", conn); + LOG_WRN("conn %p: not connected", conn); + /* Call the user callbacks & destroy (final-unref) the buffers * we were supposed to send. */ @@ -994,7 +1014,8 @@ void bt_conn_tx_processor(void) destroy_and_callback(conn, buf, cb, ud); buf = conn->tx_data_pull(conn, SIZE_MAX, &buf_len); } - return; + + goto exit; } /* now that we are guaranteed resources, we can pull data from the upper @@ -1008,7 +1029,8 @@ void bt_conn_tx_processor(void) * the upper layer when it has more data. */ LOG_DBG("no buf returned"); - return; + + goto exit; } bool last_buf = conn_mtu(conn) >= buf_len; @@ -1044,13 +1066,17 @@ void bt_conn_tx_processor(void) destroy_and_callback(conn, buf, cb, ud); bt_conn_disconnect(conn, BT_HCI_ERR_REMOTE_USER_TERM_CONN); - return; + goto exit; } /* Always kick the TX work. It will self-suspend if it doesn't get * resources or there is nothing left to send. */ bt_tx_irq_raise(); + +exit: + /* Give back the ref that `get_conn_ready()` gave us */ + bt_conn_unref(conn); } static void process_unack_tx(struct bt_conn *conn) diff --git a/subsys/bluetooth/host/conn_internal.h b/subsys/bluetooth/host/conn_internal.h index 039a252b0c316e..38be652cc71561 100644 --- a/subsys/bluetooth/host/conn_internal.h +++ b/subsys/bluetooth/host/conn_internal.h @@ -547,5 +547,11 @@ void bt_conn_tx_processor(void); /* To be called by upper layers when they want to send something. * Functions just like an IRQ. + * + * Note: This fn will take and hold a reference to `conn` until the IRQ for that + * conn is serviced. + * For the current implementation, that means: + * - ref the conn when putting on an "conn-ready" slist + * - unref the conn when popping the conn from the slist */ void bt_conn_data_ready(struct bt_conn *conn); diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index d92f0e931ad4bd..323b448323bfb3 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -311,6 +311,8 @@ struct bt_dev_le { #endif /* CONFIG_BT_SMP */ /* List of `struct bt_conn` that have either pending data to send, or * something to process (e.g. a disconnection event). + * + * Each element in this list contains a reference to its `conn` object. */ sys_slist_t conn_ready; }; diff --git a/subsys/bluetooth/host/scan.c b/subsys/bluetooth/host/scan.c index ddbbe766813b70..29136cd5041299 100644 --- a/subsys/bluetooth/host/scan.c +++ b/subsys/bluetooth/host/scan.c @@ -1461,8 +1461,8 @@ void bt_hci_le_adv_report(struct net_buf *buf) static bool valid_le_scan_param(const struct bt_le_scan_param *param) { - if (param->type != BT_HCI_LE_SCAN_PASSIVE && - param->type != BT_HCI_LE_SCAN_ACTIVE) { + if (param->type != BT_LE_SCAN_TYPE_PASSIVE && + param->type != BT_LE_SCAN_TYPE_ACTIVE) { return false; } diff --git a/subsys/bluetooth/mesh/access.c b/subsys/bluetooth/mesh/access.c index 6358f1656fb9e4..e095d9babdb9d8 100644 --- a/subsys/bluetooth/mesh/access.c +++ b/subsys/bluetooth/mesh/access.c @@ -111,10 +111,10 @@ static const struct { uint8_t page; } comp_data_pages[] = { { "bt/mesh/cmp/0", 0, }, -#if IS_ENABLED(CONFIG_BT_MESH_COMP_PAGE_1) +#if defined(CONFIG_BT_MESH_COMP_PAGE_1) { "bt/mesh/cmp/1", 1, }, #endif -#if IS_ENABLED(CONFIG_BT_MESH_COMP_PAGE_2) +#if defined(CONFIG_BT_MESH_COMP_PAGE_2) { "bt/mesh/cmp/2", 2, }, #endif }; @@ -2617,7 +2617,7 @@ void bt_mesh_comp_data_clear(void) int bt_mesh_models_metadata_change_prepare(void) { -#if IS_ENABLED(CONFIG_BT_MESH_LARGE_COMP_DATA_SRV) +#if defined(CONFIG_BT_MESH_LARGE_COMP_DATA_SRV) return bt_mesh_models_metadata_store(); #else return -ENOTSUP; diff --git a/subsys/bluetooth/mesh/adv.c b/subsys/bluetooth/mesh/adv.c index d9b191120d1743..afad7d1ac6d106 100644 --- a/subsys/bluetooth/mesh/adv.c +++ b/subsys/bluetooth/mesh/adv.c @@ -378,8 +378,8 @@ int bt_mesh_scan_active_set(bool active) int bt_mesh_scan_enable(void) { struct bt_le_scan_param scan_param = { - .type = active_scanning ? BT_HCI_LE_SCAN_ACTIVE : - BT_HCI_LE_SCAN_PASSIVE, + .type = active_scanning ? BT_LE_SCAN_TYPE_ACTIVE : + BT_LE_SCAN_TYPE_PASSIVE, .interval = MESH_SCAN_INTERVAL, .window = MESH_SCAN_WINDOW }; diff --git a/subsys/bluetooth/mesh/cfg.c b/subsys/bluetooth/mesh/cfg.c index 4fef60d5c8dbaa..155c2e616d5587 100644 --- a/subsys/bluetooth/mesh/cfg.c +++ b/subsys/bluetooth/mesh/cfg.c @@ -137,7 +137,7 @@ uint8_t bt_mesh_priv_beacon_update_interval_get(void) int bt_mesh_od_priv_proxy_get(void) { -#if IS_ENABLED(CONFIG_BT_MESH_OD_PRIV_PROXY_SRV) +#if defined(CONFIG_BT_MESH_OD_PRIV_PROXY_SRV) return bt_mesh.on_demand_state; #else return -ENOTSUP; @@ -146,7 +146,7 @@ int bt_mesh_od_priv_proxy_get(void) int bt_mesh_od_priv_proxy_set(uint8_t on_demand_proxy) { -#if !IS_ENABLED(CONFIG_BT_MESH_OD_PRIV_PROXY_SRV) +#if !defined(CONFIG_BT_MESH_OD_PRIV_PROXY_SRV) return -ENOTSUP; #else diff --git a/subsys/bluetooth/mesh/prov.h b/subsys/bluetooth/mesh/prov.h index a88710639db14e..00bd85952e0e5b 100644 --- a/subsys/bluetooth/mesh/prov.h +++ b/subsys/bluetooth/mesh/prov.h @@ -78,7 +78,7 @@ NET_BUF_SIMPLE_DEFINE(name, PROV_BEARER_BUF_HEADROOM + PDU_OP_LEN + len + \ PROV_BEARER_BUF_TAILROOM) -#if IS_ENABLED(CONFIG_BT_MESH_ECDH_P256_HMAC_SHA256_AES_CCM) +#if defined(CONFIG_BT_MESH_ECDH_P256_HMAC_SHA256_AES_CCM) #define PROV_AUTH_MAX_LEN 32 #else #define PROV_AUTH_MAX_LEN 16 diff --git a/subsys/bluetooth/services/ots/ots_client.c b/subsys/bluetooth/services/ots/ots_client.c index f8f03d7200c99d..3840b5ee34fccf 100644 --- a/subsys/bluetooth/services/ots/ots_client.c +++ b/subsys/bluetooth/services/ots/ots_client.c @@ -6,6 +6,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include #include #include @@ -976,7 +977,9 @@ static uint8_t read_obj_type_cb(struct bt_conn *conn, uint8_t err, struct bt_uuid *uuid = &inst->otc_inst->cur_object.type.uuid; - bt_uuid_create(uuid, data, length); + if (!bt_uuid_create(uuid, data, length)) { + return BT_GATT_ITER_STOP; + } bt_uuid_to_str(uuid, uuid_str, sizeof(uuid_str)); LOG_DBG("UUID type read: %s", uuid_str); @@ -1672,8 +1675,10 @@ static int decode_record(struct net_buf_simple *buf, } uuid = net_buf_simple_pull_mem(buf, BT_UUID_SIZE_128); - bt_uuid_create(&rec->metadata.type.uuid, - uuid, BT_UUID_SIZE_128); + if (!bt_uuid_create(&rec->metadata.type.uuid, uuid, BT_UUID_SIZE_128)) { + LOG_DBG("Failed to create UUID"); + return -EINVAL; + } } else { if ((start_len - buf->len) + BT_UUID_SIZE_16 > rec->len) { LOG_WRN("incorrect DirListing record, reclen %u " diff --git a/subsys/bluetooth/services/ots/ots_l2cap.c b/subsys/bluetooth/services/ots/ots_l2cap.c index ad169c5aee0bbe..aa540361257003 100644 --- a/subsys/bluetooth/services/ots/ots_l2cap.c +++ b/subsys/bluetooth/services/ots/ots_l2cap.c @@ -24,7 +24,7 @@ */ #if defined(CONFIG_BT_OTS) LOG_MODULE_DECLARE(bt_ots, CONFIG_BT_OTS_LOG_LEVEL); -#elif IS_ENABLED(CONFIG_BT_OTS_CLIENT) +#elif defined(CONFIG_BT_OTS_CLIENT) LOG_MODULE_REGISTER(bt_ots, CONFIG_BT_OTS_LOG_LEVEL); #endif diff --git a/subsys/debug/mipi_stp_decoder.c b/subsys/debug/mipi_stp_decoder.c index 39aacbdd4d7665..4f320a75526965 100644 --- a/subsys/debug/mipi_stp_decoder.c +++ b/subsys/debug/mipi_stp_decoder.c @@ -6,7 +6,9 @@ #include #include -#if defined(CONFIG_CPU_CORTEX_M) && !defined(CONFIG_CPU_CORTEX_M0) +#if defined(CONFIG_CPU_CORTEX_M) && \ + !defined(CONFIG_CPU_CORTEX_M0) && \ + !defined(CONFIG_CPU_CORTEX_M0PLUS) #define UNALIGNED_ACCESS_SUPPORTED 1 #else #define UNALIGNED_ACCESS_SUPPORTED 0 diff --git a/subsys/demand_paging/eviction/lru.c b/subsys/demand_paging/eviction/lru.c index 4130fbf19da681..2dd4a328911600 100644 --- a/subsys/demand_paging/eviction/lru.c +++ b/subsys/demand_paging/eviction/lru.c @@ -49,8 +49,9 @@ /* * Number of bits needed to store a page frame index. Rounded up to a byte * boundary for best compromize between code performance and space saving. + * The extra entry is used to store head and tail indexes. */ -#define PF_IDX_BITS ROUND_UP(LOG2CEIL(K_MEM_NUM_PAGE_FRAMES), 8) +#define PF_IDX_BITS ROUND_UP(LOG2CEIL(K_MEM_NUM_PAGE_FRAMES + 1), 8) /* For each page frame, track the previous and next page frame in the queue. */ struct lru_pf_idx { @@ -58,13 +59,23 @@ struct lru_pf_idx { uint32_t prev : PF_IDX_BITS; } __packed; -static struct lru_pf_idx lru_pf_queue[K_MEM_NUM_PAGE_FRAMES]; +static struct lru_pf_idx lru_pf_queue[K_MEM_NUM_PAGE_FRAMES + 1]; static struct k_spinlock lru_lock; -/* Slot 0 is for head and tail indexes (assuming actual PF #0 won't be used) */ +/* Slot 0 is for head and tail indexes (actual indexes are offset by 1) */ #define LRU_PF_HEAD lru_pf_queue[0].next #define LRU_PF_TAIL lru_pf_queue[0].prev +static inline uint32_t pf_to_idx(struct k_mem_page_frame *pf) +{ + return (pf - k_mem_page_frames) + 1; +} + +static inline struct k_mem_page_frame *idx_to_pf(uint32_t idx) +{ + return &k_mem_page_frames[idx - 1]; +} + static inline void lru_pf_append(uint32_t pf_idx) { lru_pf_queue[pf_idx].next = 0; @@ -102,7 +113,7 @@ static void lru_pf_remove(uint32_t pf_idx) if (was_head && (LRU_PF_HEAD != 0)) { /* make new head PF unaccessible */ - struct k_mem_page_frame *pf = &k_mem_page_frames[LRU_PF_HEAD]; + struct k_mem_page_frame *pf = idx_to_pf(LRU_PF_HEAD); uintptr_t flags = arch_page_info_get(k_mem_page_frame_to_virt(pf), NULL, true); /* clearing the accessed flag expected only on loaded pages */ @@ -113,11 +124,10 @@ static void lru_pf_remove(uint32_t pf_idx) void k_mem_paging_eviction_add(struct k_mem_page_frame *pf) { - uint32_t pf_idx = pf - k_mem_page_frames; + uint32_t pf_idx = pf_to_idx(pf); k_spinlock_key_t key = k_spin_lock(&lru_lock); __ASSERT(k_mem_page_frame_is_evictable(pf), ""); - __ASSERT(pf_idx != 0, "page frame 0 not expected to be used here"); __ASSERT(!lru_pf_in_queue(pf_idx), ""); lru_pf_append(pf_idx); k_spin_unlock(&lru_lock, key); @@ -125,10 +135,9 @@ void k_mem_paging_eviction_add(struct k_mem_page_frame *pf) void k_mem_paging_eviction_remove(struct k_mem_page_frame *pf) { - uint32_t pf_idx = pf - k_mem_page_frames; + uint32_t pf_idx = pf_to_idx(pf); k_spinlock_key_t key = k_spin_lock(&lru_lock); - __ASSERT(pf_idx != 0, "page frame 0 not expected to be used here"); __ASSERT(lru_pf_in_queue(pf_idx), ""); lru_pf_remove(pf_idx); k_spin_unlock(&lru_lock, key); @@ -137,10 +146,10 @@ void k_mem_paging_eviction_remove(struct k_mem_page_frame *pf) void k_mem_paging_eviction_accessed(uintptr_t phys) { struct k_mem_page_frame *pf = k_mem_phys_to_page_frame(phys); - uint32_t pf_idx = pf - k_mem_page_frames; + uint32_t pf_idx = pf_to_idx(pf); k_spinlock_key_t key = k_spin_lock(&lru_lock); - if (pf_idx != 0 && lru_pf_in_queue(pf_idx)) { + if (lru_pf_in_queue(pf_idx)) { lru_pf_remove(pf_idx); lru_pf_append(pf_idx); } @@ -155,7 +164,7 @@ struct k_mem_page_frame *k_mem_paging_eviction_select(bool *dirty_ptr) return NULL; } - struct k_mem_page_frame *pf = &k_mem_page_frames[head_pf_idx]; + struct k_mem_page_frame *pf = idx_to_pf(head_pf_idx); uintptr_t flags = arch_page_info_get(k_mem_page_frame_to_virt(pf), NULL, false); __ASSERT(k_mem_page_frame_is_evictable(pf), ""); diff --git a/subsys/fb/cfb.c b/subsys/fb/cfb.c index 379066e3b534c0..e817cb4e1b1634 100644 --- a/subsys/fb/cfb.c +++ b/subsys/fb/cfb.c @@ -7,6 +7,7 @@ #include #include #include +#include #define LOG_LEVEL CONFIG_CFB_LOG_LEVEL #include @@ -15,6 +16,9 @@ LOG_MODULE_REGISTER(cfb); STRUCT_SECTION_START_EXTERN(cfb_font); STRUCT_SECTION_END_EXTERN(cfb_font); +#define LSB_BIT_MASK(x) BIT_MASK(x) +#define MSB_BIT_MASK(x) (BIT_MASK(x) << (8 - x)) + static inline uint8_t byte_reverse(uint8_t b) { b = (b & 0xf0) >> 4 | (b & 0x0f) << 4; @@ -92,8 +96,9 @@ static uint8_t draw_char_vtmono(const struct char_framebuffer *fb, bool draw_bg) { const struct cfb_font *fptr = &(fb->fonts[fb->font_idx]); - const bool need_reverse = (((fb->screen_info & SCREEN_INFO_MONO_MSB_FIRST) != 0) - != ((fptr->caps & CFB_FONT_MSB_FIRST) != 0)); + const bool font_is_msbfirst = ((fptr->caps & CFB_FONT_MSB_FIRST) != 0); + const bool need_reverse = + (((fb->screen_info & SCREEN_INFO_MONO_MSB_FIRST) != 0) != font_is_msbfirst); uint8_t *glyph_ptr; if (c < fptr->first_char || c > fptr->last_char) { @@ -108,7 +113,7 @@ static uint8_t draw_char_vtmono(const struct char_framebuffer *fb, for (size_t g_x = 0; g_x < fptr->width; g_x++) { const int16_t fb_x = x + g_x; - for (size_t g_y = 0; g_y < fptr->height; g_y++) { + for (size_t g_y = 0; g_y < fptr->height;) { /* * Process glyph rendering in the y direction * by separating per 8-line boundaries. @@ -117,66 +122,87 @@ static uint8_t draw_char_vtmono(const struct char_framebuffer *fb, const int16_t fb_y = y + g_y; const size_t fb_index = (fb_y / 8U) * fb->x_res + fb_x; const size_t offset = y % 8; + const uint8_t bottom_lines = ((offset + fptr->height) % 8); uint8_t bg_mask; uint8_t byte; + uint8_t next_byte; if (fb_x < 0 || fb->x_res <= fb_x || fb_y < 0 || fb->y_res <= fb_y) { + g_y++; continue; } - byte = get_glyph_byte(glyph_ptr, fptr, g_x, g_y / 8); - - if (offset == 0) { + if (offset == 0 || g_y == 0) { /* - * The start row is on an 8-line boundary. - * Therefore, it can set the value directly. + * The case of drawing the first line of the glyphs or + * starting to draw with a tile-aligned position case. + * In this case, no character is above it. + * So, we process assume that nothing is drawn above. */ - bg_mask = 0; - g_y += 7; - } else if (g_y == 0) { - /* - * If the starting row is not on the 8-line boundary, - * shift the glyph to the starting line, and create a mask - * from the 8-line boundary to the starting line. - */ - byte = byte << offset; - bg_mask = BIT_MASK(offset); - g_y += (7 - offset); + byte = 0; + next_byte = get_glyph_byte(glyph_ptr, fptr, g_x, g_y / 8); } else { + byte = get_glyph_byte(glyph_ptr, fptr, g_x, g_y / 8); + next_byte = get_glyph_byte(glyph_ptr, fptr, g_x, (g_y + 8) / 8); + } + + if (font_is_msbfirst) { /* - * After the starting row, read and concatenate the next 8-rows - * glyph and clip to the 8-line boundary and write 8-lines - * at the time. - * Create a mask to prevent overwriting the drawing contents - * after the end row. + * Extract the necessary 8 bits from the combined 2 tiles of glyphs. */ - const size_t lines = ((fptr->height - g_y) < 8) ? offset : 8; - - if (lines == 8) { - uint16_t byte2 = byte; + byte = ((byte << 8) | next_byte) >> (offset); - byte2 |= (get_glyph_byte(glyph_ptr, fptr, g_x, - (g_y + 8) / 8)) - << 8; - byte = (byte2 >> (8 - offset)) & BIT_MASK(lines); + if (g_y == 0) { + /* + * Create a mask that does not draw offset white space. + */ + bg_mask = BIT_MASK(8 - offset); } else { - byte = (byte >> (8 - offset)) & BIT_MASK(lines); + /* + * The drawing of the second line onwards + * is aligned with the tile, so it draws all the bits. + */ + bg_mask = 0xFF; + } + } else { + byte = ((next_byte << 8) | byte) >> (8 - offset); + if (g_y == 0) { + bg_mask = BIT_MASK(8 - offset) << offset; + } else { + bg_mask = 0xFF; } - - bg_mask = (BIT_MASK(8 - lines) << (lines)) & 0xFF; - g_y += (lines - 1); } - if (need_reverse) { - byte = byte_reverse(byte); - bg_mask = byte_reverse(bg_mask); + /* + * Clip the bottom margin to protect existing draw contents. + */ + if (((fptr->height - g_y) < 8) && (bottom_lines != 0)) { + const uint8_t clip = font_is_msbfirst ? MSB_BIT_MASK(bottom_lines) + : LSB_BIT_MASK(bottom_lines); + + bg_mask &= clip; + byte &= clip; } if (draw_bg) { - fb->buf[fb_index] &= bg_mask; + if (need_reverse) { + bg_mask = byte_reverse(bg_mask); + } + fb->buf[fb_index] &= ~bg_mask; } + if (need_reverse) { + byte = byte_reverse(byte); + } fb->buf[fb_index] |= byte; + + if (g_y == 0) { + g_y += (8 - offset); + } else if ((fptr->height - g_y) >= 8) { + g_y += 8; + } else { + g_y += bottom_lines; + } } } @@ -567,3 +593,14 @@ int cfb_framebuffer_init(const struct device *dev) return 0; } + +void cfb_framebuffer_deinit(const struct device *dev) +{ + struct char_framebuffer *fb = &char_fb; + + if (fb->buf) { + k_free(fb->buf); + fb->buf = NULL; + } + +} diff --git a/subsys/fs/fcb/fcb_elem_info.c b/subsys/fs/fcb/fcb_elem_info.c index 3bb6031ec21271..1cb9185740d94a 100644 --- a/subsys/fs/fcb/fcb_elem_info.c +++ b/subsys/fs/fcb/fcb_elem_info.c @@ -66,7 +66,7 @@ fcb_elem_crc8(struct fcb *_fcb, struct fcb_entry *loc, uint8_t *c8p) return 0; } -#if IS_ENABLED(CONFIG_FCB_ALLOW_FIXED_ENDMARKER) +#if defined(CONFIG_FCB_ALLOW_FIXED_ENDMARKER) /* Given the offset in flash sector, calculate the FCB entry data offset and size, and set * the fixed endmarker. */ @@ -97,7 +97,7 @@ fcb_elem_endmarker_fixed(struct fcb *_fcb, struct fcb_entry *loc, uint8_t *em) *em = FCB_FIXED_ENDMARKER; return 0; } -#endif /* IS_ENABLED(CONFIG_FCB_ALLOW_FIXED_ENDMARKER) */ +#endif /* defined(CONFIG_FCB_ALLOW_FIXED_ENDMARKER) */ /* Given the offset in flash sector, calculate the FCB entry data offset and size, and calculate * the expected endmarker. @@ -105,11 +105,11 @@ fcb_elem_endmarker_fixed(struct fcb *_fcb, struct fcb_entry *loc, uint8_t *em) int fcb_elem_endmarker(struct fcb *_fcb, struct fcb_entry *loc, uint8_t *em) { -#if IS_ENABLED(CONFIG_FCB_ALLOW_FIXED_ENDMARKER) +#if defined(CONFIG_FCB_ALLOW_FIXED_ENDMARKER) if (_fcb->f_flags & FCB_FLAGS_CRC_DISABLED) { return fcb_elem_endmarker_fixed(_fcb, loc, em); } -#endif /* IS_ENABLED(CONFIG_FCB_ALLOW_FIXED_ENDMARKER) */ +#endif /* defined(CONFIG_FCB_ALLOW_FIXED_ENDMARKER) */ return fcb_elem_crc8(_fcb, loc, em); } diff --git a/subsys/ipc/ipc_service/lib/icmsg.c b/subsys/ipc/ipc_service/lib/icmsg.c index 61fa03689f40f5..37fbc30d89eba2 100644 --- a/subsys/ipc/ipc_service/lib/icmsg.c +++ b/subsys/ipc/ipc_service/lib/icmsg.c @@ -19,7 +19,7 @@ static const uint8_t magic[] = {0x45, 0x6d, 0x31, 0x6c, 0x31, 0x4b, 0x30, 0x72, 0x6e, 0x33, 0x6c, 0x69, 0x34}; -#if IS_ENABLED(CONFIG_IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE) +#if defined(CONFIG_IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE) static K_THREAD_STACK_DEFINE(icmsg_stack, CONFIG_IPC_SERVICE_BACKEND_ICMSG_WQ_STACK_SIZE); static struct k_work_q icmsg_workq; static struct k_work_q *const workq = &icmsg_workq; @@ -301,7 +301,7 @@ int icmsg_send(const struct icmsg_config_t *conf, return sent_bytes; } -#if IS_ENABLED(CONFIG_IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE) +#if defined(CONFIG_IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE) static int work_q_init(void) { diff --git a/subsys/logging/Kconfig.frontends b/subsys/logging/Kconfig.frontends index 7a725421fb9e3f..17e42d341ba2cc 100644 --- a/subsys/logging/Kconfig.frontends +++ b/subsys/logging/Kconfig.frontends @@ -9,7 +9,7 @@ config LOG_FRONTEND_DICT_UART select MPSC_PBUF depends on UART_ASYNC_API || UART_INTERRUPT_DRIVEN imply LOG_FMT_SECTION - imply LOG_FMT_SECTION_STRIP + imply LOG_FMT_SECTION_STRIP if !LOG_ALWAYS_RUNTIME help Frontend sends data in binary dictionary mode. diff --git a/subsys/logging/Kconfig.misc b/subsys/logging/Kconfig.misc index 12ff0c00d0a4b6..a78ab110d851ce 100644 --- a/subsys/logging/Kconfig.misc +++ b/subsys/logging/Kconfig.misc @@ -61,6 +61,7 @@ config LOG_FMT_SECTION_STRIP depends on LOG_DICTIONARY_SUPPORT depends on LOG_FMT_SECTION depends on LINKER_DEVNULL_SUPPORT + depends on !LOG_ALWAYS_RUNTIME imply LINKER_DEVNULL_MEMORY imply LOG_FMT_STRING_VALIDATE diff --git a/subsys/logging/Kconfig.template.log_format_config b/subsys/logging/Kconfig.template.log_format_config index 0b2dbe0d403a92..14e112e4879ef7 100644 --- a/subsys/logging/Kconfig.template.log_format_config +++ b/subsys/logging/Kconfig.template.log_format_config @@ -20,7 +20,7 @@ config LOG_BACKEND_$(backend)_OUTPUT_DICTIONARY bool "Dictionary" select LOG_DICTIONARY_SUPPORT imply LOG_FMT_SECTION - imply LOG_FMT_SECTION_STRIP + imply LOG_FMT_SECTION_STRIP if !LOG_ALWAYS_RUNTIME help Backend is in dictionary-based logging output mode. diff --git a/subsys/logging/log_msg.c b/subsys/logging/log_msg.c index 0d40c5b3155f33..b2b6aee9e21b6d 100644 --- a/subsys/logging/log_msg.c +++ b/subsys/logging/log_msg.c @@ -358,6 +358,12 @@ void z_log_msg_runtime_vcreate(uint8_t domain_id, const void *source, plen = 0; } + if (plen > Z_LOG_MSG_MAX_PACKAGE) { + LOG_WRN("Message dropped because it exceeds size limitation (%u)", + (uint32_t)Z_LOG_MSG_MAX_PACKAGE); + return; + } + size_t msg_wlen = Z_LOG_MSG_ALIGNED_WLEN(plen, dlen); struct log_msg *msg; uint8_t *pkg; diff --git a/subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c b/subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c index 4d87ea997cf011..ad46a538b4afdb 100644 --- a/subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c @@ -423,19 +423,19 @@ os_mgmt_mcumgr_params(struct smp_streamer *ctxt) #if defined(CONFIG_MCUMGR_GRP_OS_BOOTLOADER_INFO) -#if IS_ENABLED(CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP) +#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP) #define BOOTLOADER_MODE MCUBOOT_MODE_SINGLE_SLOT -#elif IS_ENABLED(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_SCRATCH) +#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_SCRATCH) #define BOOTLOADER_MODE MCUBOOT_MODE_SWAP_USING_SCRATCH -#elif IS_ENABLED(CONFIG_MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY) +#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY) #define BOOTLOADER_MODE MCUBOOT_MODE_UPGRADE_ONLY -#elif IS_ENABLED(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_WITHOUT_SCRATCH) +#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_WITHOUT_SCRATCH) #define BOOTLOADER_MODE MCUBOOT_MODE_SWAP_USING_MOVE -#elif IS_ENABLED(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP) +#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP) #define BOOTLOADER_MODE MCUBOOT_MODE_DIRECT_XIP -#elif IS_ENABLED(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT) +#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT) #define BOOTLOADER_MODE MCUBOOT_MODE_DIRECT_XIP_WITH_REVERT -#elif IS_ENABLED(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER) +#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER) #define BOOTLOADER_MODE MCUBOOT_MODE_FIRMWARE_LOADER #else #define BOOTLOADER_MODE -1 diff --git a/subsys/mgmt/mcumgr/mgmt/src/mgmt.c b/subsys/mgmt/mcumgr/mgmt/src/mgmt.c index adb2c8e4bcbeb9..0495d3fb4d42d7 100644 --- a/subsys/mgmt/mcumgr/mgmt/src/mgmt.c +++ b/subsys/mgmt/mcumgr/mgmt/src/mgmt.c @@ -103,7 +103,7 @@ mgmt_get_handler(const struct mgmt_group *group, uint16_t command_id) return &group->mg_handlers[command_id]; } -#if IS_ENABLED(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL) +#if defined(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL) smp_translate_error_fn mgmt_find_error_translation_function(uint16_t group_id) { struct mgmt_group *group = NULL; diff --git a/subsys/net/ip/ipv6_pe.c b/subsys/net/ip/ipv6_pe.c index 77fa2a1424efe3..798a2f26b97379 100644 --- a/subsys/net/ip/ipv6_pe.c +++ b/subsys/net/ip/ipv6_pe.c @@ -216,16 +216,17 @@ static bool ipv6_pe_prefix_update_lifetimes(struct net_if_ipv6 *ipv6, } /* RFC 8981 ch 3.3.2 */ -static void gen_temporary_iid(struct net_if *iface, - const struct in6_addr *prefix, - uint8_t *network_id, size_t network_id_len, - uint8_t dad_counter, - uint8_t *temporary_iid, - size_t temporary_iid_len) +static int gen_temporary_iid(struct net_if *iface, + const struct in6_addr *prefix, + uint8_t *network_id, size_t network_id_len, + uint8_t dad_counter, + uint8_t *temporary_iid, + size_t temporary_iid_len) { const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256); mbedtls_md_context_t ctx; uint8_t digest[32]; + int ret; static bool once; static uint8_t secret_key[16]; /* Min 128 bits, RFC 8981 ch 3.3.2 */ struct { @@ -256,12 +257,30 @@ static void gen_temporary_iid(struct net_if *iface, mbedtls_md_init(&ctx); mbedtls_md_setup(&ctx, md_info, true); - mbedtls_md_hmac_starts(&ctx, secret_key, sizeof(secret_key)); - mbedtls_md_hmac_update(&ctx, (uint8_t *)&buf, sizeof(buf)); - mbedtls_md_hmac_finish(&ctx, digest); - mbedtls_md_free(&ctx); + ret = mbedtls_md_hmac_starts(&ctx, secret_key, sizeof(secret_key)); + if (ret != 0) { + NET_DBG("Cannot %s hmac (%d)", "start", ret); + goto err; + } + + ret = mbedtls_md_hmac_update(&ctx, (uint8_t *)&buf, sizeof(buf)); + if (ret != 0) { + NET_DBG("Cannot %s hmac (%d)", "update", ret); + goto err; + } + + ret = mbedtls_md_hmac_finish(&ctx, digest); + if (ret != 0) { + NET_DBG("Cannot %s hmac (%d)", "finish", ret); + goto err; + } memcpy(temporary_iid, digest, MIN(sizeof(digest), temporary_iid_len)); + +err: + mbedtls_md_free(&ctx); + + return ret; } void net_ipv6_pe_start(struct net_if *iface, const struct in6_addr *prefix, @@ -272,7 +291,7 @@ void net_ipv6_pe_start(struct net_if *iface, const struct in6_addr *prefix, struct in6_addr addr; k_ticks_t remaining; k_timeout_t vlifetimeout; - int i, dad_count = 1; + int i, ret, dad_count = 1; int32_t lifetime; bool valid = false; @@ -328,21 +347,22 @@ void net_ipv6_pe_start(struct net_if *iface, const struct in6_addr *prefix, net_ipaddr_copy(&addr, prefix); do { - gen_temporary_iid(iface, prefix, - COND_CODE_1(CONFIG_NET_INTERFACE_NAME, - (iface->config.name, - sizeof(iface->config.name)), - (net_if_get_device(iface)->name, - strlen(net_if_get_device(iface)->name))), - dad_count, - &addr.s6_addr[8], 8U); - - ifaddr = net_if_ipv6_addr_lookup(&addr, NULL); - if (ifaddr == NULL && !net_ipv6_is_addr_unspecified(&addr) && - memcmp(&addr, &reserved_anycast_subnet, - sizeof(struct in6_addr)) != 0) { - valid = true; - break; + ret = gen_temporary_iid(iface, prefix, + COND_CODE_1(CONFIG_NET_INTERFACE_NAME, + (iface->config.name, + sizeof(iface->config.name)), + (net_if_get_device(iface)->name, + strlen(net_if_get_device(iface)->name))), + dad_count, + &addr.s6_addr[8], 8U); + if (ret == 0) { + ifaddr = net_if_ipv6_addr_lookup(&addr, NULL); + if (ifaddr == NULL && !net_ipv6_is_addr_unspecified(&addr) && + memcmp(&addr, &reserved_anycast_subnet, + sizeof(struct in6_addr)) != 0) { + valid = true; + break; + } } } while (dad_count++ < TEMP_IDGEN_RETRIES); diff --git a/subsys/net/ip/net_if.c b/subsys/net/ip/net_if.c index 94cfdd1633626a..47d73cfa62158e 100644 --- a/subsys/net/ip/net_if.c +++ b/subsys/net/ip/net_if.c @@ -5686,10 +5686,7 @@ struct net_if *net_if_get_first_wifi(void) struct net_if *net_if_get_wifi_sta(void) { - struct ethernet_context *eth_ctx = NULL; - STRUCT_SECTION_FOREACH(net_if, iface) { - eth_ctx = net_if_l2_data(iface); if (net_if_is_wifi(iface) #ifdef CONFIG_WIFI_NM && (wifi_nm_get_type_iface(iface) == (1 << WIFI_TYPE_STA)) @@ -5703,10 +5700,7 @@ struct net_if *net_if_get_wifi_sta(void) struct net_if *net_if_get_wifi_sap(void) { - struct ethernet_context *eth_ctx = NULL; - STRUCT_SECTION_FOREACH(net_if, iface) { - eth_ctx = net_if_l2_data(iface); if (net_if_is_wifi(iface) #ifdef CONFIG_WIFI_NM && (wifi_nm_get_type_iface(iface) == (1 << WIFI_TYPE_SAP)) diff --git a/subsys/net/ip/net_pkt.c b/subsys/net/ip/net_pkt.c index 7bfa4f8a2a74bb..d0ee06487d6d61 100644 --- a/subsys/net/ip/net_pkt.c +++ b/subsys/net/ip/net_pkt.c @@ -1246,7 +1246,7 @@ int net_pkt_alloc_buffer_raw(struct net_pkt *pkt, size_t size, net_pkt_append_buffer(pkt, buf); -#if IS_ENABLED(CONFIG_NET_BUF_FIXED_DATA_SIZE) +#if defined(CONFIG_NET_BUF_FIXED_DATA_SIZE) /* net_buf allocators shrink the buffer size to the requested size. * We don't want this behavior here, so restore the real size of the * last fragment. diff --git a/subsys/net/ip/tcp.c b/subsys/net/ip/tcp.c index c44085bb323adb..d9fff6696a0fd3 100644 --- a/subsys/net/ip/tcp.c +++ b/subsys/net/ip/tcp.c @@ -2695,7 +2695,7 @@ static void tcp_queue_recv_data(struct tcp *conn, struct net_pkt *pkt, } static enum net_verdict tcp_data_received(struct tcp *conn, struct net_pkt *pkt, - size_t *len) + size_t *len, bool psh) { enum net_verdict ret; @@ -2711,7 +2711,7 @@ static enum net_verdict tcp_data_received(struct tcp *conn, struct net_pkt *pkt, /* Delay ACK response in case of small window or missing PSH, * as described in RFC 813. */ - if (tcp_short_window(conn)) { + if (tcp_short_window(conn) || !psh) { k_work_schedule_for_queue(&tcp_work_q, &conn->ack_timer, ACK_DELAY); } else { @@ -3252,7 +3252,9 @@ static enum net_verdict tcp_in(struct tcp *conn, struct net_pkt *pkt) if (th) { if (th_seq(th) == conn->ack) { if (len > 0) { - verdict = tcp_data_received(conn, pkt, &len); + bool psh = FL(&fl, &, PSH); + + verdict = tcp_data_received(conn, pkt, &len, psh); if (verdict == NET_OK) { /* net_pkt owned by the recv fifo now */ pkt = NULL; diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index d450a9d76fe376..82b958c2638408 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -567,10 +567,11 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv params->mfp = atoi(optarg); break; case 'm': - sscanf(optarg, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", - ¶ms->bssid[0], ¶ms->bssid[1], - ¶ms->bssid[2], ¶ms->bssid[3], - ¶ms->bssid[4], ¶ms->bssid[5]); + if (net_bytes_from_str(params->bssid, sizeof(params->bssid), + optarg) < 0) { + PR_WARNING("Invalid MAC address\n"); + return -EINVAL; + } break; case 't': if (iface_mode == WIFI_MODE_INFRA) { diff --git a/subsys/net/lib/dns/dispatcher.c b/subsys/net/lib/dns/dispatcher.c index e4e6a7b569a8f8..0e7e1ac39eb073 100644 --- a/subsys/net/lib/dns/dispatcher.c +++ b/subsys/net/lib/dns/dispatcher.c @@ -161,7 +161,7 @@ void dns_dispatcher_svc_handler(struct k_work *work) int ret; ret = recv_data(pev); - if (ret < 0 && ret != DNS_EAI_ALLDONE) { + if (ret < 0 && ret != DNS_EAI_ALLDONE && ret != -ENOENT) { NET_ERR("DNS recv error (%d)", ret); } } diff --git a/subsys/net/lib/lwm2m/lwm2m_registry.c b/subsys/net/lib/lwm2m/lwm2m_registry.c index bd4906144ac6e1..ce59e488bf20a7 100644 --- a/subsys/net/lib/lwm2m/lwm2m_registry.c +++ b/subsys/net/lib/lwm2m/lwm2m_registry.c @@ -106,7 +106,7 @@ void lwm2m_register_obj(struct lwm2m_engine_obj *obj) k_mutex_lock(®istry_lock, K_FOREVER); #if defined(CONFIG_LWM2M_ACCESS_CONTROL_ENABLE) /* If bootstrap, then bootstrap server should create the ac obj instances */ -#if !IS_ENABLED(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP) +#if !defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP) int server_obj_inst_id = lwm2m_server_short_id_to_inst(CONFIG_LWM2M_SERVER_DEFAULT_SSID); access_control_add_obj(obj->obj_id, server_obj_inst_id); @@ -169,7 +169,7 @@ static void engine_register_obj_inst(struct lwm2m_engine_obj_inst *obj_inst) { #if defined(CONFIG_LWM2M_ACCESS_CONTROL_ENABLE) /* If bootstrap, then bootstrap server should create the ac obj instances */ -#if !IS_ENABLED(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP) +#if !defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP) int server_obj_inst_id = lwm2m_server_short_id_to_inst(CONFIG_LWM2M_SERVER_DEFAULT_SSID); access_control_add(obj_inst->obj->obj_id, obj_inst->obj_inst_id, server_obj_inst_id); diff --git a/subsys/net/lib/ptp/clock.c b/subsys/net/lib/ptp/clock.c index 415c80152ce2d3..180cc6b530fd95 100644 --- a/subsys/net/lib/ptp/clock.c +++ b/subsys/net/lib/ptp/clock.c @@ -521,7 +521,7 @@ void ptp_clock_synchronize(uint64_t ingress, uint64_t egress) offset = ptp_clk.timestamp.t2 - ptp_clk.timestamp.t1 - delay; /* If diff is too big, ptp_clk needs to be set first. */ - if (offset > NSEC_PER_SEC || offset < -NSEC_PER_SEC) { + if ((offset > (int64_t)NSEC_PER_SEC) || (offset < -(int64_t)NSEC_PER_SEC)) { struct net_ptp_time current; LOG_WRN("Clock offset exceeds 1 second."); diff --git a/subsys/net/lib/ptp/port.c b/subsys/net/lib/ptp/port.c index 1c6750a918cd87..29b8d4bc7a3092 100644 --- a/subsys/net/lib/ptp/port.c +++ b/subsys/net/lib/ptp/port.c @@ -187,9 +187,9 @@ static void port_delay_req_timestamp_cb(struct net_pkt *pkt) return; } - req->timestamp.host._sec.high = ntohs(pkt->timestamp._sec.high); - req->timestamp.host._sec.low = ntohl(pkt->timestamp._sec.low); - req->timestamp.host.nanosecond = ntohl(pkt->timestamp.nanosecond); + req->timestamp.host._sec.high = pkt->timestamp._sec.high; + req->timestamp.host._sec.low = pkt->timestamp._sec.low; + req->timestamp.host.nanosecond = pkt->timestamp.nanosecond; LOG_DBG("Port %d registered timestamp for %d Delay_Req", port->port_ds.id.port_number, diff --git a/subsys/net/lib/sockets/CMakeLists.txt b/subsys/net/lib/sockets/CMakeLists.txt index 8e8b156260222f..253cb4a182f8c8 100644 --- a/subsys/net/lib/sockets/CMakeLists.txt +++ b/subsys/net/lib/sockets/CMakeLists.txt @@ -2,6 +2,7 @@ zephyr_syscall_header( ${ZEPHYR_BASE}/include/zephyr/net/socket.h + ${ZEPHYR_BASE}/include/zephyr/net/socket_select.h ) zephyr_library_include_directories(.) @@ -9,6 +10,7 @@ zephyr_library_include_directories(.) zephyr_library_sources( getaddrinfo.c sockets.c + sockets_select.c ) if(NOT CONFIG_NET_SOCKETS_OFFLOAD) diff --git a/subsys/net/lib/sockets/Kconfig b/subsys/net/lib/sockets/Kconfig index 43331d7141390b..2fe534678fa1c7 100644 --- a/subsys/net/lib/sockets/Kconfig +++ b/subsys/net/lib/sockets/Kconfig @@ -5,9 +5,7 @@ menuconfig NET_SOCKETS bool "BSD Sockets compatible API" - select ZVFS - select ZVFS_POLL - select ZVFS_SELECT + select FDTABLE help Provide BSD Sockets like API on top of native Zephyr networking API. @@ -49,7 +47,9 @@ config NET_SOCKETS_POSIX_NAMES config NET_SOCKETS_POLL_MAX int "Max number of supported poll() entries" - default ZVFS_POLL_MAX + default 6 if WIFI_NM_WPA_SUPPLICANT + default 4 if SHELL_BACKEND_TELNET + default 3 help Maximum number of entries supported for poll() call. diff --git a/subsys/net/lib/sockets/sockets.c b/subsys/net/lib/sockets/sockets.c index b78e1479222a20..88d8a3d091706e 100644 --- a/subsys/net/lib/sockets/sockets.c +++ b/subsys/net/lib/sockets/sockets.c @@ -2306,6 +2306,224 @@ static int zsock_poll_update_ctx(struct net_context *ctx, return 0; } +static inline int time_left(uint32_t start, uint32_t timeout) +{ + uint32_t elapsed = k_uptime_get_32() - start; + + return timeout - elapsed; +} + +int zsock_poll_internal(struct zsock_pollfd *fds, int nfds, k_timeout_t timeout) +{ + bool retry; + int ret = 0; + int i; + struct zsock_pollfd *pfd; + struct k_poll_event poll_events[CONFIG_NET_SOCKETS_POLL_MAX]; + struct k_poll_event *pev; + struct k_poll_event *pev_end = poll_events + ARRAY_SIZE(poll_events); + const struct fd_op_vtable *vtable; + struct k_mutex *lock; + k_timepoint_t end; + bool offload = false; + const struct fd_op_vtable *offl_vtable = NULL; + void *offl_ctx = NULL; + + end = sys_timepoint_calc(timeout); + + pev = poll_events; + for (pfd = fds, i = nfds; i--; pfd++) { + void *ctx; + int result; + + /* Per POSIX, negative fd's are just ignored */ + if (pfd->fd < 0) { + continue; + } + + ctx = get_sock_vtable(pfd->fd, + (const struct socket_op_vtable **)&vtable, + &lock); + if (ctx == NULL) { + /* Will set POLLNVAL in return loop */ + continue; + } + + (void)k_mutex_lock(lock, K_FOREVER); + + result = zvfs_fdtable_call_ioctl(vtable, ctx, + ZFD_IOCTL_POLL_PREPARE, + pfd, &pev, pev_end); + if (result == -EALREADY) { + /* If POLL_PREPARE returned with EALREADY, it means + * it already detected that some socket is ready. In + * this case, we still perform a k_poll to pick up + * as many events as possible, but without any wait. + */ + timeout = K_NO_WAIT; + end = sys_timepoint_calc(timeout); + result = 0; + } else if (result == -EXDEV) { + /* If POLL_PREPARE returned EXDEV, it means + * it detected an offloaded socket. + * If offloaded socket is used with native TLS, the TLS + * wrapper for the offloaded poll will be used. + * In case the fds array contains a mixup of offloaded + * and non-offloaded sockets, the offloaded poll handler + * shall return an error. + */ + offload = true; + if (offl_vtable == NULL || net_socket_is_tls(ctx)) { + offl_vtable = vtable; + offl_ctx = ctx; + } + + result = 0; + } + + k_mutex_unlock(lock); + + if (result < 0) { + errno = -result; + return -1; + } + } + + if (offload) { + int poll_timeout; + + if (K_TIMEOUT_EQ(timeout, K_FOREVER)) { + poll_timeout = SYS_FOREVER_MS; + } else { + poll_timeout = k_ticks_to_ms_floor32(timeout.ticks); + } + + return zvfs_fdtable_call_ioctl(offl_vtable, offl_ctx, + ZFD_IOCTL_POLL_OFFLOAD, + fds, nfds, poll_timeout); + } + + timeout = sys_timepoint_timeout(end); + + do { + ret = k_poll(poll_events, pev - poll_events, timeout); + /* EAGAIN when timeout expired, EINTR when cancelled (i.e. EOF) */ + if (ret != 0 && ret != -EAGAIN && ret != -EINTR) { + errno = -ret; + return -1; + } + + retry = false; + ret = 0; + + pev = poll_events; + for (pfd = fds, i = nfds; i--; pfd++) { + void *ctx; + int result; + + pfd->revents = 0; + + if (pfd->fd < 0) { + continue; + } + + ctx = get_sock_vtable( + pfd->fd, + (const struct socket_op_vtable **)&vtable, + &lock); + if (ctx == NULL) { + pfd->revents = ZSOCK_POLLNVAL; + ret++; + continue; + } + + (void)k_mutex_lock(lock, K_FOREVER); + + result = zvfs_fdtable_call_ioctl(vtable, ctx, + ZFD_IOCTL_POLL_UPDATE, + pfd, &pev); + k_mutex_unlock(lock); + + if (result == -EAGAIN) { + retry = true; + continue; + } else if (result != 0) { + errno = -result; + return -1; + } + + if (pfd->revents != 0) { + ret++; + } + } + + if (retry) { + if (ret > 0) { + break; + } + + timeout = sys_timepoint_timeout(end); + + if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { + break; + } + } + } while (retry); + + return ret; +} + +int z_impl_zsock_poll(struct zsock_pollfd *fds, int nfds, int poll_timeout) +{ + k_timeout_t timeout; + int ret; + + SYS_PORT_TRACING_OBJ_FUNC_ENTER(socket, poll, fds, nfds, poll_timeout); + + if (poll_timeout < 0) { + timeout = K_FOREVER; + } else { + timeout = K_MSEC(poll_timeout); + } + + ret = zsock_poll_internal(fds, nfds, timeout); + + SYS_PORT_TRACING_OBJ_FUNC_EXIT(socket, poll, fds, nfds, + ret < 0 ? -errno : ret); + return ret; +} + +#ifdef CONFIG_USERSPACE +static inline int z_vrfy_zsock_poll(struct zsock_pollfd *fds, + int nfds, int timeout) +{ + struct zsock_pollfd *fds_copy; + size_t fds_size; + int ret; + + /* Copy fds array from user mode */ + if (size_mul_overflow(nfds, sizeof(struct zsock_pollfd), &fds_size)) { + errno = EFAULT; + return -1; + } + fds_copy = k_usermode_alloc_from_copy((void *)fds, fds_size); + if (!fds_copy) { + errno = ENOMEM; + return -1; + } + + ret = z_impl_zsock_poll(fds_copy, nfds, timeout); + + if (ret >= 0) { + k_usermode_to_copy((void *)fds, fds_copy, fds_size); + } + k_free(fds_copy); + + return ret; +} +#include +#endif + int z_impl_zsock_inet_pton(sa_family_t family, const char *src, void *dst) { if (net_addr_pton(family, src, dst) == 0) { diff --git a/lib/os/zvfs/zvfs_select.c b/subsys/net/lib/sockets/sockets_select.c similarity index 59% rename from lib/os/zvfs/zvfs_select.c rename to subsys/net/lib/sockets/sockets_select.c index 2788e3c9318ffb..49d61a2d28c659 100644 --- a/lib/os/zvfs/zvfs_select.c +++ b/subsys/net/lib/sockets/sockets_select.c @@ -4,12 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include - #include #include #include #include +#include "sockets_internal.h" /* Get size, in elements, of an array within a struct. */ #define STRUCT_MEMBER_ARRAY_SIZE(type, field) ARRAY_SIZE(((type *)0)->field) @@ -21,12 +20,7 @@ bit_mask = 1 << b_idx; \ } -/** Number of file descriptors which can be added to zsock_fd_set */ -#define ZVFS_FD_SETSIZE (sizeof(((struct zvfs_fd_set *)0)->bitset) * 8) - -int zvfs_poll_internal(struct zvfs_pollfd *fds, int nfds, k_timeout_t timeout); - -void ZVFS_FD_ZERO(struct zvfs_fd_set *set) +void ZSOCK_FD_ZERO(zsock_fd_set *set) { int i; @@ -35,11 +29,11 @@ void ZVFS_FD_ZERO(struct zvfs_fd_set *set) } } -int ZVFS_FD_ISSET(int fd, struct zvfs_fd_set *set) +int ZSOCK_FD_ISSET(int fd, zsock_fd_set *set) { uint32_t word_idx, bit_mask; - if (fd < 0 || fd >= ZVFS_FD_SETSIZE) { + if (fd < 0 || fd >= ZSOCK_FD_SETSIZE) { return 0; } @@ -48,11 +42,11 @@ int ZVFS_FD_ISSET(int fd, struct zvfs_fd_set *set) return (set->bitset[word_idx] & bit_mask) != 0U; } -void ZVFS_FD_CLR(int fd, struct zvfs_fd_set *set) +void ZSOCK_FD_CLR(int fd, zsock_fd_set *set) { uint32_t word_idx, bit_mask; - if (fd < 0 || fd >= ZVFS_FD_SETSIZE) { + if (fd < 0 || fd >= ZSOCK_FD_SETSIZE) { return; } @@ -61,11 +55,11 @@ void ZVFS_FD_CLR(int fd, struct zvfs_fd_set *set) set->bitset[word_idx] &= ~bit_mask; } -void ZVFS_FD_SET(int fd, struct zvfs_fd_set *set) +void ZSOCK_FD_SET(int fd, zsock_fd_set *set) { uint32_t word_idx, bit_mask; - if (fd < 0 || fd >= ZVFS_FD_SETSIZE) { + if (fd < 0 || fd >= ZSOCK_FD_SETSIZE) { return; } @@ -74,19 +68,17 @@ void ZVFS_FD_SET(int fd, struct zvfs_fd_set *set) set->bitset[word_idx] |= bit_mask; } -int z_impl_zvfs_select(int nfds, struct zvfs_fd_set *ZRESTRICT readfds, - struct zvfs_fd_set *ZRESTRICT writefds, - struct zvfs_fd_set *ZRESTRICT exceptfds, - const struct timespec *ZRESTRICT timeout, const void *ZRESTRICT sigmask) +int z_impl_zsock_select(int nfds, zsock_fd_set *readfds, zsock_fd_set *writefds, + zsock_fd_set *exceptfds, struct zsock_timeval *timeout) { - struct zvfs_pollfd pfds[CONFIG_ZVFS_POLL_MAX]; + struct zsock_pollfd pfds[CONFIG_NET_SOCKETS_POLL_MAX]; k_timeout_t poll_timeout; int i, res; int num_pfds = 0; int num_selects = 0; int fd_no = 0; - for (i = 0; i < STRUCT_MEMBER_ARRAY_SIZE(struct zvfs_fd_set, bitset); i++) { + for (i = 0; i < STRUCT_MEMBER_ARRAY_SIZE(zsock_fd_set, bitset); i++) { uint32_t bit_mask = 1U; uint32_t read_mask = 0U, write_mask = 0U, except_mask = 0U; uint32_t ored_mask; @@ -119,15 +111,15 @@ int z_impl_zvfs_select(int nfds, struct zvfs_fd_set *ZRESTRICT readfds, } if (read_mask & bit_mask) { - events |= ZVFS_POLLIN; + events |= ZSOCK_POLLIN; } if (write_mask & bit_mask) { - events |= ZVFS_POLLOUT; + events |= ZSOCK_POLLOUT; } if (except_mask & bit_mask) { - events |= ZVFS_POLLPRI; + events |= ZSOCK_POLLPRI; } pfds[num_pfds].fd = fd_no; @@ -143,24 +135,24 @@ int z_impl_zvfs_select(int nfds, struct zvfs_fd_set *ZRESTRICT readfds, poll_timeout = K_FOREVER; } else { poll_timeout = - K_USEC(timeout->tv_sec * USEC_PER_SEC + timeout->tv_nsec / NSEC_PER_USEC); + K_USEC(timeout->tv_sec * 1000000UL + timeout->tv_usec); } - res = zvfs_poll_internal(pfds, num_pfds, poll_timeout); + res = zsock_poll_internal(pfds, num_pfds, poll_timeout); if (res == -1) { return -1; } if (readfds != NULL) { - ZVFS_FD_ZERO(readfds); + ZSOCK_FD_ZERO(readfds); } if (writefds != NULL) { - ZVFS_FD_ZERO(writefds); + ZSOCK_FD_ZERO(writefds); } if (exceptfds != NULL) { - ZVFS_FD_ZERO(exceptfds); + ZSOCK_FD_ZERO(exceptfds); } for (i = 0; i < num_pfds && res > 0; i++) { @@ -177,21 +169,21 @@ int z_impl_zvfs_select(int nfds, struct zvfs_fd_set *ZRESTRICT readfds, * So, unlike poll(), a single invalid fd aborts the entire * select(). */ - if (revents & ZVFS_POLLNVAL) { + if (revents & ZSOCK_POLLNVAL) { errno = EBADF; return -1; } - if (revents & ZVFS_POLLIN) { + if (revents & ZSOCK_POLLIN) { if (readfds != NULL) { - ZVFS_FD_SET(fd, readfds); + ZSOCK_FD_SET(fd, readfds); num_selects++; } } - if (revents & ZVFS_POLLOUT) { + if (revents & ZSOCK_POLLOUT) { if (writefds != NULL) { - ZVFS_FD_SET(fd, writefds); + ZSOCK_FD_SET(fd, writefds); num_selects++; } } @@ -199,14 +191,14 @@ int z_impl_zvfs_select(int nfds, struct zvfs_fd_set *ZRESTRICT readfds, /* It's unclear if HUP/ERR belong here. At least not ignore * them. Zephyr doesn't use HUP and barely use ERR so far. */ - if (revents & (ZVFS_POLLPRI | ZVFS_POLLHUP | ZVFS_POLLERR)) { + if (revents & (ZSOCK_POLLPRI | ZSOCK_POLLHUP | ZSOCK_POLLERR)) { if (exceptfds != NULL) { - ZVFS_FD_SET(fd, exceptfds); + ZSOCK_FD_SET(fd, exceptfds); num_selects++; } if (writefds != NULL) { - ZVFS_FD_SET(fd, writefds); + ZSOCK_FD_SET(fd, writefds); num_selects++; } } @@ -218,19 +210,19 @@ int z_impl_zvfs_select(int nfds, struct zvfs_fd_set *ZRESTRICT readfds, } #ifdef CONFIG_USERSPACE -static int z_vrfy_zvfs_select(int nfds, struct zvfs_fd_set *ZRESTRICT readfds, - struct zvfs_fd_set *ZRESTRICT writefds, - struct zvfs_fd_set *ZRESTRICT exceptfds, - const struct timespec *ZRESTRICT timeout, - const void *ZRESTRICT sigmask) +static int z_vrfy_zsock_select(int nfds, zsock_fd_set *readfds, + zsock_fd_set *writefds, + zsock_fd_set *exceptfds, + struct zsock_timeval *timeout) { - struct zvfs_fd_set *readfds_copy = NULL, *writefds_copy = NULL, *exceptfds_copy = NULL; - struct timespec *to = NULL; + zsock_fd_set *readfds_copy = NULL, *writefds_copy = NULL, + *exceptfds_copy = NULL; + struct zsock_timeval *timeval = NULL; int ret = -1; if (readfds) { - readfds_copy = - k_usermode_alloc_from_copy((void *)readfds, sizeof(struct zvfs_fd_set)); + readfds_copy = k_usermode_alloc_from_copy((void *)readfds, + sizeof(zsock_fd_set)); if (!readfds_copy) { errno = ENOMEM; goto out; @@ -238,8 +230,8 @@ static int z_vrfy_zvfs_select(int nfds, struct zvfs_fd_set *ZRESTRICT readfds, } if (writefds) { - writefds_copy = - k_usermode_alloc_from_copy((void *)writefds, sizeof(struct zvfs_fd_set)); + writefds_copy = k_usermode_alloc_from_copy((void *)writefds, + sizeof(zsock_fd_set)); if (!writefds_copy) { errno = ENOMEM; goto out; @@ -247,8 +239,8 @@ static int z_vrfy_zvfs_select(int nfds, struct zvfs_fd_set *ZRESTRICT readfds, } if (exceptfds) { - exceptfds_copy = - k_usermode_alloc_from_copy((void *)exceptfds, sizeof(struct zvfs_fd_set)); + exceptfds_copy = k_usermode_alloc_from_copy((void *)exceptfds, + sizeof(zsock_fd_set)); if (!exceptfds_copy) { errno = ENOMEM; goto out; @@ -256,39 +248,41 @@ static int z_vrfy_zvfs_select(int nfds, struct zvfs_fd_set *ZRESTRICT readfds, } if (timeout) { - to = k_usermode_alloc_from_copy((void *)timeout, sizeof(*to)); - if (!to) { + timeval = k_usermode_alloc_from_copy((void *)timeout, + sizeof(struct zsock_timeval)); + if (!timeval) { errno = ENOMEM; goto out; } } - ret = z_impl_zvfs_select(nfds, readfds_copy, writefds_copy, exceptfds_copy, to, sigmask); + ret = z_impl_zsock_select(nfds, readfds_copy, writefds_copy, + exceptfds_copy, timeval); if (ret >= 0) { if (readfds_copy) { k_usermode_to_copy((void *)readfds, readfds_copy, - sizeof(struct zvfs_fd_set)); + sizeof(zsock_fd_set)); } if (writefds_copy) { k_usermode_to_copy((void *)writefds, writefds_copy, - sizeof(struct zvfs_fd_set)); + sizeof(zsock_fd_set)); } if (exceptfds_copy) { k_usermode_to_copy((void *)exceptfds, exceptfds_copy, - sizeof(struct zvfs_fd_set)); + sizeof(zsock_fd_set)); } } out: - k_free(to); + k_free(timeval); k_free(readfds_copy); k_free(writefds_copy); k_free(exceptfds_copy); return ret; } -#include +#include #endif diff --git a/subsys/net/lib/sockets/sockets_service.c b/subsys/net/lib/sockets/sockets_service.c index fc156b4070312f..14d7a011bd9a98 100644 --- a/subsys/net/lib/sockets/sockets_service.c +++ b/subsys/net/lib/sockets/sockets_service.c @@ -13,7 +13,14 @@ LOG_MODULE_REGISTER(net_sock_svc, CONFIG_NET_SOCKETS_LOG_LEVEL); #include static int init_socket_service(void); -static bool init_done; + +enum SOCKET_SERVICE_THREAD_STATUS { + SOCKET_SERVICE_THREAD_UNINITIALIZED = 0, + SOCKET_SERVICE_THREAD_FAILED, + SOCKET_SERVICE_THREAD_STOPPED, + SOCKET_SERVICE_THREAD_RUNNING, +}; +static enum SOCKET_SERVICE_THREAD_STATUS thread_status; static K_MUTEX_DEFINE(lock); static K_CONDVAR_DEFINE(wait_start); @@ -52,8 +59,12 @@ int z_impl_net_socket_service_register(const struct net_socket_service_desc *svc k_mutex_lock(&lock, K_FOREVER); - if (!init_done) { + if (thread_status == SOCKET_SERVICE_THREAD_UNINITIALIZED) { (void)k_condvar_wait(&wait_start, &lock, K_FOREVER); + } else if (thread_status != SOCKET_SERVICE_THREAD_RUNNING) { + NET_ERR("Socket service thread not running, service %p register fails.", svc); + ret = -EIO; + goto out; } if (STRUCT_SECTION_START(net_socket_service_desc) > svc || @@ -219,7 +230,7 @@ static void socket_service_thread(void) goto out; } - init_done = true; + thread_status = SOCKET_SERVICE_THREAD_RUNNING; k_condvar_broadcast(&wait_start); ctx.events[0].fd = fd; @@ -274,11 +285,12 @@ static void socket_service_thread(void) out: NET_DBG("Socket service thread stopped"); - init_done = false; + thread_status = SOCKET_SERVICE_THREAD_STOPPED; return; fail: + thread_status = SOCKET_SERVICE_THREAD_FAILED; k_condvar_broadcast(&wait_start); } diff --git a/subsys/pm/policy.c b/subsys/pm/policy.c index 942fb900bf9536..ecb08233af060d 100644 --- a/subsys/pm/policy.c +++ b/subsys/pm/policy.c @@ -8,11 +8,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include @@ -45,6 +47,87 @@ static struct { #endif +#if defined(CONFIG_PM_POLICY_DEVICE_CONSTRAINTS) + +struct pm_state_device_constraint { + const struct device *const dev; + size_t pm_constraints_size; + struct pm_state_constraint *constraints; +}; + +/** + * @brief Synthesize the name of the object that holds a device pm constraint. + * + * @param dev_id Device identifier. + */ +#define PM_CONSTRAINTS_NAME(node_id) _CONCAT(__devicepmconstraints_, node_id) + +/** + * @brief initialize a device pm constraint with information from devicetree. + * + * @param node_id Node identifier. + */ +#define PM_STATE_CONSTRAINT_INIT(node_id) \ + { \ + .state = PM_STATE_DT_INIT(node_id), \ + .substate_id = DT_PROP_OR(node_id, substate_id, 0), \ + } + +/** + * @brief Helper macro to define a device pm constraints. + */ +#define PM_STATE_CONSTRAINT_DEFINE(i, node_id) \ + COND_CODE_1(DT_NODE_HAS_STATUS(DT_PHANDLE_BY_IDX(node_id, \ + zephyr_disabling_power_states, i), okay), \ + (PM_STATE_CONSTRAINT_INIT(DT_PHANDLE_BY_IDX(node_id, \ + zephyr_disabling_power_states, i)),), ()) + +/** + * @brief Helper macro to generate a list of device pm constraints. + */ +#define PM_STATE_CONSTRAINTS_DEFINE(node_id) \ + { \ + LISTIFY(DT_PROP_LEN_OR(node_id, zephyr_disabling_power_states, 0), \ + PM_STATE_CONSTRAINT_DEFINE, (), node_id) \ + } + +/** + * @brief Helper macro to define an array of device pm constraints. + */ +#define CONSTRAINTS_DEFINE(node_id) \ + Z_DECL_ALIGN(struct pm_state_constraint) \ + PM_CONSTRAINTS_NAME(node_id)[] = \ + PM_STATE_CONSTRAINTS_DEFINE(node_id); + +#define DEVICE_CONSTRAINTS_DEFINE(node_id) \ + COND_CODE_0(DT_NODE_HAS_PROP(node_id, zephyr_disabling_power_states), (), \ + (CONSTRAINTS_DEFINE(node_id))) + +DT_FOREACH_STATUS_OKAY_NODE(DEVICE_CONSTRAINTS_DEFINE) + +/** + * @brief Helper macro to initialize a pm state device constraint + */ +#define PM_STATE_DEVICE_CONSTRAINT_INIT(node_id) \ + { \ + .dev = DEVICE_DT_GET(node_id), \ + .pm_constraints_size = DT_PROP_LEN(node_id, zephyr_disabling_power_states), \ + .constraints = PM_CONSTRAINTS_NAME(node_id), \ + }, + +/** + * @brief Helper macro to initialize a pm state device constraint + */ +#define PM_STATE_DEVICE_CONSTRAINT_DEFINE(node_id) \ + COND_CODE_0(DT_NODE_HAS_PROP(node_id, zephyr_disabling_power_states), (), \ + (PM_STATE_DEVICE_CONSTRAINT_INIT(node_id))) + +static struct pm_state_device_constraint _devices_constraints[] = { + DT_FOREACH_STATUS_OKAY_NODE(PM_STATE_DEVICE_CONSTRAINT_DEFINE) +}; + +#endif /* CONFIG_PM_POLICY_DEVICE_CONSTRAINTS */ + /** Lock to synchronize access to the latency request list. */ static struct k_spinlock latency_lock; /** List of maximum latency requests. */ @@ -333,9 +416,15 @@ void pm_policy_event_unregister(struct pm_policy_event *evt) void pm_policy_device_power_lock_get(const struct device *dev) { #if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state) && defined(CONFIG_PM_POLICY_DEVICE_CONSTRAINTS) - for (size_t i = 0; i < dev->pm_constraints_size; i++) { - pm_policy_state_lock_get(dev->pm_constraints[i].state, - dev->pm_constraints[i].substate_id); + for (size_t i = 0; i < ARRAY_SIZE(_devices_constraints); i++) { + if (_devices_constraints[i].dev == dev) { + for (size_t j = 0; j < _devices_constraints[i].pm_constraints_size; j++) { + pm_policy_state_lock_get( + _devices_constraints[i].constraints[j].state, + _devices_constraints[i].constraints[j].substate_id); + } + break; + } } #endif } @@ -343,9 +432,15 @@ void pm_policy_device_power_lock_get(const struct device *dev) void pm_policy_device_power_lock_put(const struct device *dev) { #if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state) && defined(CONFIG_PM_POLICY_DEVICE_CONSTRAINTS) - for (size_t i = 0; i < dev->pm_constraints_size; i++) { - pm_policy_state_lock_put(dev->pm_constraints[i].state, - dev->pm_constraints[i].substate_id); + for (size_t i = 0; i < ARRAY_SIZE(_devices_constraints); i++) { + if (_devices_constraints[i].dev == dev) { + for (size_t j = 0; j < _devices_constraints[i].pm_constraints_size; j++) { + pm_policy_state_lock_put( + _devices_constraints[i].constraints[j].state, + _devices_constraints[i].constraints[j].substate_id); + } + break; + } } #endif } diff --git a/subsys/shell/backends/shell_rtt.c b/subsys/shell/backends/shell_rtt.c index 4a874ba9ce84ac..c8b10cb2567ead 100644 --- a/subsys/shell/backends/shell_rtt.c +++ b/subsys/shell/backends/shell_rtt.c @@ -15,7 +15,7 @@ #define RTT_UNLOCK() \ COND_CODE_0(CONFIG_SHELL_BACKEND_RTT_BUFFER, (SEGGER_RTT_UNLOCK()), ()) -#if IS_ENABLED(CONFIG_LOG_BACKEND_RTT) +#if defined(CONFIG_LOG_BACKEND_RTT) BUILD_ASSERT(!(CONFIG_SHELL_BACKEND_RTT_BUFFER == CONFIG_LOG_BACKEND_RTT_BUFFER), "Conflicting log RTT backend enabled on the same channel"); #endif diff --git a/subsys/storage/stream/stream_flash.c b/subsys/storage/stream/stream_flash.c index b9bd63df411bed..0ff0c4578ff86f 100644 --- a/subsys/storage/stream/stream_flash.c +++ b/subsys/storage/stream/stream_flash.c @@ -76,10 +76,10 @@ static int settings_direct_loader(const char *key, size_t len, int stream_flash_erase_page(struct stream_flash_ctx *ctx, off_t off) { -#if IS_ENABLED(CONFIG_FLASH_HAS_EXPLICIT_ERASE) +#if defined(CONFIG_FLASH_HAS_EXPLICIT_ERASE) int rc; struct flash_pages_info page; -#if IS_ENABLED(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE) +#if defined(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE) /* There are both types of devices */ const struct flash_parameters *fparams = flash_get_parameters(ctx->fdev); diff --git a/subsys/tracing/ctf/tracing_ctf.h b/subsys/tracing/ctf/tracing_ctf.h index 53eb097d07921e..2756e6e8f5d1bd 100644 --- a/subsys/tracing/ctf/tracing_ctf.h +++ b/subsys/tracing/ctf/tracing_ctf.h @@ -521,7 +521,7 @@ void sys_trace_k_event_init(struct k_event *event); */ struct sockaddr; struct msghdr; -struct zvfs_pollfd; +struct zsock_pollfd; void sys_trace_socket_init(int sock, int family, int type, int proto); void sys_trace_socket_close_enter(int sock); @@ -552,8 +552,8 @@ void sys_trace_socket_fcntl_enter(int sock, int cmd, int flags); void sys_trace_socket_fcntl_exit(int sock, int ret); void sys_trace_socket_ioctl_enter(int sock, int req); void sys_trace_socket_ioctl_exit(int sock, int ret); -void sys_trace_socket_poll_enter(const struct zvfs_pollfd *fds, int nfds, int timeout); -void sys_trace_socket_poll_exit(const struct zvfs_pollfd *fds, int nfds, int ret); +void sys_trace_socket_poll_enter(const struct zsock_pollfd *fds, int nfds, int timeout); +void sys_trace_socket_poll_exit(const struct zsock_pollfd *fds, int nfds, int ret); void sys_trace_socket_getsockopt_enter(int sock, int level, int optname); void sys_trace_socket_getsockopt_exit(int sock, int level, int optname, void *optval, size_t optlen, int ret); diff --git a/tests/arch/arm/arm_irq_vector_table/src/arm_irq_vector_table.c b/tests/arch/arm/arm_irq_vector_table/src/arm_irq_vector_table.c index eaf9ddd2a6d44b..c8da69982a9618 100644 --- a/tests/arch/arm/arm_irq_vector_table/src/arm_irq_vector_table.c +++ b/tests/arch/arm/arm_irq_vector_table/src/arm_irq_vector_table.c @@ -184,7 +184,8 @@ vth __irq_vector_table _irq_vector_table[] = { isr0, isr1, isr2, 0, rtc_isr }; -#elif defined(CONFIG_SOC_SERIES_IMXRT6XX) || defined(CONFIG_SOC_SERIES_IMXRT5XX) && \ +#elif (defined(CONFIG_SOC_SERIES_IMXRT6XX) || defined(CONFIG_SOC_SERIES_IMXRT5XX) || \ + defined(CONFIG_SOC_SERIES_RW6XX)) && \ defined(CONFIG_MCUX_OS_TIMER) /* MXRT685 employs a OS Event timer to implement the Kernel system * timer, instead of the ARM Cortex-M SysTick. Therefore, a pointer to diff --git a/tests/bluetooth/audio/ascs/src/test_ase_control_params.c b/tests/bluetooth/audio/ascs/src/test_ase_control_params.c index b2bbf82fd8ae4a..a89af5bf170d97 100644 --- a/tests/bluetooth/audio/ascs/src/test_ase_control_params.c +++ b/tests/bluetooth/audio/ascs/src/test_ase_control_params.c @@ -6,6 +6,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include #include #include #include @@ -24,6 +25,7 @@ #include "iso.h" #include "test_common.h" +#include "ztest_assert.h" struct test_ase_control_params_fixture { struct bt_conn conn; @@ -167,6 +169,30 @@ ZTEST_F(test_ase_control_params, test_codec_configure_number_of_ases_0x00) test_codec_configure_expect_invalid_length(fixture, buf, sizeof(buf)); } +ZTEST_F(test_ase_control_params, test_codec_configure_number_of_ases_above_max) +{ + const uint16_t ase_cnt = CONFIG_BT_ASCS_ASE_SNK_COUNT + CONFIG_BT_ASCS_ASE_SRC_COUNT + 1; + + /* Skip if number of ASEs configured is high enough to support any value in the write req */ + if (ase_cnt > UINT8_MAX) { + ztest_test_skip(); + } + + const uint8_t buf[] = { + 0x01, /* Opcode = Config Codec */ + (uint8_t)ase_cnt, /* Number_of_ASEs */ + 0x01, /* ASE_ID[0] */ + 0x01, /* Target_Latency[0] = Target low latency */ + 0x02, /* Target_PHY[0] = LE 2M PHY */ + 0x06, /* Codec_ID[0].Coding_Format = LC3 */ + 0x00, 0x00, /* Codec_ID[0].Company_ID */ + 0x00, 0x00, /* Codec_ID[0].Vendor_Specific_Codec_ID */ + 0x00, /* Codec_Specific_Configuration_Length[0] */ + }; + + test_codec_configure_expect_invalid_length(fixture, buf, sizeof(buf)); +} + /* * Test correctly formatted ASE Control Point 'Invalid Length' notification is sent * @@ -340,6 +366,11 @@ static int unicast_server_cb_config_custom_fake(struct bt_conn *conn, const stru ZTEST_F(test_ase_control_params, test_codec_configure_invalid_ase_id_unavailable) { + /* Test requires support for at least 2 ASEs */ + if (CONFIG_BT_ASCS_ASE_SNK_COUNT + CONFIG_BT_ASCS_ASE_SRC_COUNT < 2) { + ztest_test_skip(); + } + const uint8_t ase_id_valid = 0x01; const uint8_t ase_id_invalid = CONFIG_BT_ASCS_ASE_SNK_COUNT + CONFIG_BT_ASCS_ASE_SRC_COUNT + 1; @@ -513,6 +544,35 @@ ZTEST_F(test_ase_control_params, test_config_qos_number_of_ases_0x00) &fixture->stream, buf, sizeof(buf)); } +ZTEST_F(test_ase_control_params, test_config_qos_number_of_ases_above_max) +{ + const uint16_t ase_cnt = CONFIG_BT_ASCS_ASE_SNK_COUNT + CONFIG_BT_ASCS_ASE_SRC_COUNT + 1; + + /* Skip if number of ASEs configured is high enough to support any value in the write req */ + if (ase_cnt > UINT8_MAX) { + ztest_test_skip(); + } + + const uint8_t ase_id = test_ase_id_get(fixture->ase); + const uint8_t buf[] = { + 0x02, /* Opcode = Config QoS */ + (uint8_t)ase_cnt, /* Number_of_ASEs */ + ase_id, /* ASE_ID[0] */ + 0x01, /* CIG_ID[0] */ + 0x01, /* CIS_ID[0] */ + 0xFF, 0x00, 0x00, /* SDU_Interval[0] */ + 0x00, /* Framing[0] */ + 0x02, /* PHY[0] */ + 0x64, 0x00, /* Max_SDU[0] */ + 0x02, /* Retransmission_Number[0] */ + 0x0A, 0x00, /* Max_Transport_Latency[0] */ + 0x40, 0x9C, 0x00, /* Presentation_Delay[0] */ + }; + + test_config_qos_expect_invalid_length(&fixture->conn, ase_id, fixture->ase_cp, + &fixture->stream, buf, sizeof(buf)); +} + ZTEST_F(test_ase_control_params, test_config_qos_too_short) { const uint8_t ase_id = test_ase_id_get(fixture->ase); @@ -593,6 +653,27 @@ ZTEST_F(test_ase_control_params, test_enable_number_of_ases_0x00) buf, sizeof(buf)); } +ZTEST_F(test_ase_control_params, test_enable_number_of_ases_above_max) +{ + const uint16_t ase_cnt = CONFIG_BT_ASCS_ASE_SNK_COUNT + CONFIG_BT_ASCS_ASE_SRC_COUNT + 1; + + /* Skip if number of ASEs configured is high enough to support any value in the write req */ + if (ase_cnt > UINT8_MAX) { + ztest_test_skip(); + } + + const uint8_t ase_id = test_ase_id_get(fixture->ase); + const uint8_t buf[] = { + 0x03, /* Opcode = Enable */ + (uint8_t)ase_cnt, /* Number_of_ASEs */ + ase_id, /* ASE_ID[0] */ + 0x00, /* Metadata_Length[0] */ + }; + + test_enable_expect_invalid_length(&fixture->conn, ase_id, fixture->ase_cp, &fixture->stream, + buf, sizeof(buf)); +} + ZTEST_F(test_ase_control_params, test_enable_too_long) { const uint8_t ase_id = test_ase_id_get(fixture->ase); @@ -638,6 +719,11 @@ ZTEST_F(test_ase_control_params, test_enable_metadata_too_short) ZTEST_F(test_ase_control_params, test_enable_invalid_ase_id) { + /* Test requires support for at least 2 ASEs */ + if (CONFIG_BT_ASCS_ASE_SNK_COUNT + CONFIG_BT_ASCS_ASE_SRC_COUNT < 2) { + ztest_test_skip(); + } + const uint8_t ase_id_valid = 0x01; const uint8_t ase_id_invalid = CONFIG_BT_ASCS_ASE_SNK_COUNT + CONFIG_BT_ASCS_ASE_SRC_COUNT + 1; @@ -731,7 +817,7 @@ ZTEST_F(test_ase_control_params, test_receiver_start_ready_number_of_ases_0x00) test_ase_src_get(1, &ase); zassume_not_null(ase); - ase_id = test_ase_id_get(fixture->ase); + ase_id = test_ase_id_get(ase); const uint8_t buf[] = { 0x04, /* Opcode = Receiver Start Ready */ @@ -743,6 +829,32 @@ ZTEST_F(test_ase_control_params, test_receiver_start_ready_number_of_ases_0x00) &fixture->stream, buf, sizeof(buf)); } +ZTEST_F(test_ase_control_params, test_receiver_start_ready_number_of_ases_above_max) +{ + const uint16_t ase_cnt = CONFIG_BT_ASCS_ASE_SRC_COUNT + 1; + const struct bt_gatt_attr *ase; + + Z_TEST_SKIP_IFNDEF(CONFIG_BT_ASCS_ASE_SRC); + + /* Skip if number of ASEs configured is high enough to support any value in the write req */ + if (ase_cnt > UINT8_MAX) { + ztest_test_skip(); + } + + test_ase_src_get(1, &ase); + zassume_not_null(ase); + const uint8_t ase_id = test_ase_id_get(ase); + + const uint8_t buf[] = { + 0x04, /* Opcode = Receiver Start Ready */ + (uint8_t)ase_cnt, /* Number_of_ASEs */ + ase_id, /* ASE_ID[0] */ + }; + + test_receiver_start_ready_expect_invalid_length(&fixture->conn, ase_id, fixture->ase_cp, + &fixture->stream, buf, sizeof(buf)); +} + ZTEST_F(test_ase_control_params, test_receiver_start_ready_too_long) { const struct bt_gatt_attr *ase; @@ -818,6 +930,26 @@ ZTEST_F(test_ase_control_params, test_disable_number_of_ases_0x00) &fixture->stream, buf, sizeof(buf)); } +ZTEST_F(test_ase_control_params, test_disable_number_of_ases_above_max) +{ + const uint16_t ase_cnt = CONFIG_BT_ASCS_ASE_SNK_COUNT + CONFIG_BT_ASCS_ASE_SRC_COUNT + 1; + + /* Skip if number of ASEs configured is high enough to support any value in the write req */ + if (ase_cnt > UINT8_MAX) { + ztest_test_skip(); + } + + const uint8_t ase_id = test_ase_id_get(fixture->ase); + const uint8_t buf[] = { + 0x05, /* Opcode = Disable */ + (uint8_t)ase_cnt, /* Number_of_ASEs */ + ase_id, /* ASE_ID[0] */ + }; + + test_disable_expect_invalid_length(&fixture->conn, ase_id, fixture->ase_cp, + &fixture->stream, buf, sizeof(buf)); +} + ZTEST_F(test_ase_control_params, test_disable_too_long) { const uint8_t ase_id = test_ase_id_get(fixture->ase); @@ -875,7 +1007,7 @@ ZTEST_F(test_ase_control_params, test_receiver_stop_ready_number_of_ases_0x00) test_ase_src_get(1, &ase); zassume_not_null(ase); - ase_id = test_ase_id_get(fixture->ase); + ase_id = test_ase_id_get(ase); const uint8_t buf[] = { 0x06, /* Opcode = Receiver Stop Ready */ @@ -887,6 +1019,32 @@ ZTEST_F(test_ase_control_params, test_receiver_stop_ready_number_of_ases_0x00) &fixture->stream, buf, sizeof(buf)); } +ZTEST_F(test_ase_control_params, test_receiver_stop_ready_number_of_ases_above_max) +{ + const uint16_t ase_cnt = CONFIG_BT_ASCS_ASE_SRC_COUNT + 1; + const struct bt_gatt_attr *ase; + + Z_TEST_SKIP_IFNDEF(CONFIG_BT_ASCS_ASE_SRC); + + /* Skip if number of ASEs configured is high enough to support any value in the write req */ + if (ase_cnt > UINT8_MAX) { + ztest_test_skip(); + } + + test_ase_src_get(1, &ase); + zassume_not_null(ase); + const uint8_t ase_id = test_ase_id_get(ase); + + const uint8_t buf[] = { + 0x06, /* Opcode = Receiver Stop Ready */ + (uint8_t)ase_cnt, /* Number_of_ASEs */ + ase_id, /* ASE_ID[0] */ + }; + + test_receiver_stop_ready_expect_invalid_length(&fixture->conn, ase_id, fixture->ase_cp, + &fixture->stream, buf, sizeof(buf)); +} + ZTEST_F(test_ase_control_params, test_receiver_stop_ready_too_long) { const struct bt_gatt_attr *ase; @@ -963,6 +1121,27 @@ ZTEST_F(test_ase_control_params, test_update_metadata_number_of_ases_0x00) &fixture->stream, buf, sizeof(buf)); } +ZTEST_F(test_ase_control_params, test_update_metadata_number_of_ases_above_max) +{ + const uint16_t ase_cnt = CONFIG_BT_ASCS_ASE_SNK_COUNT + CONFIG_BT_ASCS_ASE_SRC_COUNT + 1; + + /* Skip if number of ASEs configured is high enough to support any value in the write req */ + if (ase_cnt > UINT8_MAX) { + ztest_test_skip(); + } + + const uint8_t ase_id = test_ase_id_get(fixture->ase); + const uint8_t buf[] = { + 0x07, /* Opcode = Update Metadata */ + (uint8_t)ase_cnt, /* Number_of_ASEs */ + ase_id, /* ASE_ID[0] */ + 0x00, /* Metadata_Length[0] */ + }; + + test_update_metadata_expect_invalid_length(&fixture->conn, ase_id, fixture->ase_cp, + &fixture->stream, buf, sizeof(buf)); +} + ZTEST_F(test_ase_control_params, test_update_metadata_too_long) { const uint8_t ase_id = test_ase_id_get(fixture->ase); @@ -1008,6 +1187,11 @@ ZTEST_F(test_ase_control_params, test_update_metadata_metadata_too_short) ZTEST_F(test_ase_control_params, test_update_metadata_invalid_ase_id) { + /* Test requires support for at least 2 ASEs */ + if (CONFIG_BT_ASCS_ASE_SNK_COUNT + CONFIG_BT_ASCS_ASE_SRC_COUNT < 2) { + ztest_test_skip(); + } + const uint8_t ase_id_valid = 0x01; const uint8_t ase_id_invalid = CONFIG_BT_ASCS_ASE_SNK_COUNT + CONFIG_BT_ASCS_ASE_SRC_COUNT + 1; @@ -1074,6 +1258,26 @@ ZTEST_F(test_ase_control_params, test_release_number_of_ases_0x00) &fixture->stream, buf, sizeof(buf)); } +ZTEST_F(test_ase_control_params, test_release_number_of_ases_above_max) +{ + const uint16_t ase_cnt = CONFIG_BT_ASCS_ASE_SNK_COUNT + CONFIG_BT_ASCS_ASE_SRC_COUNT + 1; + + /* Skip if number of ASEs configured is high enough to support any value in the write req */ + if (ase_cnt > UINT8_MAX) { + ztest_test_skip(); + } + + const uint8_t ase_id = test_ase_id_get(fixture->ase); + const uint8_t buf[] = { + 0x08, /* Opcode = Release */ + (uint8_t)ase_cnt, /* Number_of_ASEs */ + ase_id, /* ASE_ID[0] */ + }; + + test_release_expect_invalid_length(&fixture->conn, ase_id, fixture->ase_cp, + &fixture->stream, buf, sizeof(buf)); +} + ZTEST_F(test_ase_control_params, test_release_too_long) { const uint8_t ase_id = test_ase_id_get(fixture->ase); diff --git a/tests/bluetooth/shell/boards/cyw920829m2evk_02.overlay b/tests/bluetooth/shell/boards/cyw920829m2evk_02.overlay new file mode 100644 index 00000000000000..0622b29e2a6584 --- /dev/null +++ b/tests/bluetooth/shell/boards/cyw920829m2evk_02.overlay @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +uart2: &scb2 { + hw-flow-control; + pinctrl-0 = <&p3_3_scb2_uart_tx &p3_2_scb2_uart_rx &p3_1_scb2_uart_rts &p3_0_scb2_uart_cts>; +}; diff --git a/tests/boards/nrf/dmm/src/main.c b/tests/boards/nrf/dmm/src/main.c index 5ddbebfb838234..b21eeb97e02e1a 100644 --- a/tests/boards/nrf/dmm/src/main.c +++ b/tests/boards/nrf/dmm/src/main.c @@ -74,7 +74,7 @@ static bool dmm_buffer_in_region_check(struct dmm_test_region *dtr, void *buf, s } static void dmm_check_output_buffer(struct dmm_test_region *dtr, uint32_t *fill_value, - void *data, size_t size, bool was_prealloc) + void *data, size_t size, bool was_prealloc, bool is_cached) { void *buf; int retval; @@ -82,7 +82,9 @@ static void dmm_check_output_buffer(struct dmm_test_region *dtr, uint32_t *fill_ memset(data, (*fill_value)++, size); retval = dmm_buffer_out_prepare(dtr->mem_reg, data, size, &buf); zassert_ok(retval); - zassert_true(IS_ALIGNED(buf, DMM_DCACHE_LINE_SIZE)); + if (IS_ENABLED(CONFIG_DCACHE) && is_cached) { + zassert_true(IS_ALIGNED(buf, CONFIG_DCACHE_LINE_SIZE)); + } if (IS_ENABLED(CONFIG_HAS_NORDIC_DMM)) { if (was_prealloc) { @@ -112,7 +114,9 @@ static void dmm_check_input_buffer(struct dmm_test_region *dtr, uint32_t *fill_v retval = dmm_buffer_in_prepare(dtr->mem_reg, data, size, &buf); zassert_ok(retval); - zassert_true(IS_ALIGNED(buf, DMM_DCACHE_LINE_SIZE)); + if (IS_ENABLED(CONFIG_DCACHE) && is_cached) { + zassert_true(IS_ALIGNED(buf, CONFIG_DCACHE_LINE_SIZE)); + } if (IS_ENABLED(CONFIG_HAS_NORDIC_DMM)) { if (was_prealloc) { @@ -162,7 +166,7 @@ ZTEST_USER_F(dmm, test_check_dev_cache_out_allocate) uint8_t user_data[16]; dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, sizeof(user_data), false); + user_data, sizeof(user_data), false, true); } ZTEST_USER_F(dmm, test_check_dev_cache_out_preallocate) @@ -170,7 +174,7 @@ ZTEST_USER_F(dmm, test_check_dev_cache_out_preallocate) static uint8_t user_data[16] DMM_MEMORY_SECTION(DUT_CACHE); dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_CACHE], &fixture->fill_value, - user_data, sizeof(user_data), true); + user_data, sizeof(user_data), true, true); } ZTEST_USER_F(dmm, test_check_dev_nocache_in_allocate) @@ -194,7 +198,7 @@ ZTEST_USER_F(dmm, test_check_dev_nocache_out_allocate) uint8_t user_data[16]; dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, sizeof(user_data), false); + user_data, sizeof(user_data), false, false); } ZTEST_USER_F(dmm, test_check_dev_nocache_out_preallocate) @@ -202,7 +206,7 @@ ZTEST_USER_F(dmm, test_check_dev_nocache_out_preallocate) static uint8_t user_data[16] DMM_MEMORY_SECTION(DUT_NOCACHE); dmm_check_output_buffer(&fixture->regions[DMM_TEST_REGION_NOCACHE], &fixture->fill_value, - user_data, sizeof(user_data), true); + user_data, sizeof(user_data), true, false); } ZTEST_SUITE(dmm, NULL, test_setup, NULL, test_cleanup, NULL); diff --git a/tests/bsim/bluetooth/host/privacy/peripheral/src/tester_rpa_expired.c b/tests/bsim/bluetooth/host/privacy/peripheral/src/tester_rpa_expired.c index 85153ac8eddce8..0b939985a46cdd 100644 --- a/tests/bsim/bluetooth/host/privacy/peripheral/src/tester_rpa_expired.c +++ b/tests/bsim/bluetooth/host/privacy/peripheral/src/tester_rpa_expired.c @@ -108,7 +108,7 @@ void start_rpa_scanning(void) { /* Start passive scanning */ struct bt_le_scan_param scan_param = { - .type = BT_HCI_LE_SCAN_PASSIVE, + .type = BT_LE_SCAN_TYPE_PASSIVE, .options = BT_LE_SCAN_OPT_FILTER_DUPLICATE, .interval = 0x0040, .window = 0x0020, diff --git a/tests/bsim/bluetooth/host/privacy/peripheral/src/tester_rpa_rotation.c b/tests/bsim/bluetooth/host/privacy/peripheral/src/tester_rpa_rotation.c index db363cd6ea032e..f0e68785e32b53 100644 --- a/tests/bsim/bluetooth/host/privacy/peripheral/src/tester_rpa_rotation.c +++ b/tests/bsim/bluetooth/host/privacy/peripheral/src/tester_rpa_rotation.c @@ -122,7 +122,7 @@ void start_scanning(void) { /* Start passive scanning */ struct bt_le_scan_param scan_param = { - .type = BT_HCI_LE_SCAN_PASSIVE, + .type = BT_LE_SCAN_TYPE_PASSIVE, .options = BT_LE_SCAN_OPT_FILTER_DUPLICATE, .interval = 0x0040, .window = 0x0020, diff --git a/tests/bsim/bluetooth/ll/advx/src/main.c b/tests/bsim/bluetooth/ll/advx/src/main.c index 9035650f2e1373..cdc71c90691ef2 100644 --- a/tests/bsim/bluetooth/ll/advx/src/main.c +++ b/tests/bsim/bluetooth/ll/advx/src/main.c @@ -1300,7 +1300,7 @@ static struct bt_le_per_adv_sync_cb sync_cb = { static void test_scanx_main(void) { struct bt_le_scan_param scan_param = { - .type = BT_HCI_LE_SCAN_ACTIVE, + .type = BT_LE_SCAN_TYPE_ACTIVE, .options = BT_LE_SCAN_OPT_NONE, .interval = 0x0004, .window = 0x0004, diff --git a/tests/bsim/bluetooth/ll/bis/src/main.c b/tests/bsim/bluetooth/ll/bis/src/main.c index 3689bf8ca79025..5fe2635565a8dc 100644 --- a/tests/bsim/bluetooth/ll/bis/src/main.c +++ b/tests/bsim/bluetooth/ll/bis/src/main.c @@ -753,7 +753,7 @@ static struct bt_le_scan_cb scan_callbacks = { static void test_iso_recv_main(void) { struct bt_le_scan_param scan_param = { - .type = BT_HCI_LE_SCAN_ACTIVE, + .type = BT_LE_SCAN_TYPE_ACTIVE, .options = BT_LE_SCAN_OPT_NONE, .interval = 0x0004, .window = 0x0004, @@ -1028,7 +1028,7 @@ static void test_iso_recv_main(void) static void test_iso_recv_vs_dp_main(void) { struct bt_le_scan_param scan_param = { - .type = BT_HCI_LE_SCAN_ACTIVE, + .type = BT_LE_SCAN_TYPE_ACTIVE, .options = BT_LE_SCAN_OPT_NONE, .interval = 0x0004, .window = 0x0004, diff --git a/tests/bsim/bluetooth/mesh/src/mesh_test.c b/tests/bsim/bluetooth/mesh/src/mesh_test.c index 6865e5202ba4dc..1edafd657c342d 100644 --- a/tests/bsim/bluetooth/mesh/src/mesh_test.c +++ b/tests/bsim/bluetooth/mesh/src/mesh_test.c @@ -569,7 +569,7 @@ void bt_mesh_test_send_over_adv(void *data, size_t len) int bt_mesh_test_wait_for_packet(bt_le_scan_cb_t scan_cb, struct k_sem *observer_sem, uint16_t wait) { struct bt_le_scan_param scan_param = { - .type = BT_HCI_LE_SCAN_PASSIVE, + .type = BT_LE_SCAN_TYPE_PASSIVE, .options = BT_LE_SCAN_OPT_NONE, .interval = BT_MESH_ADV_SCAN_UNIT(1000), .window = BT_MESH_ADV_SCAN_UNIT(1000) diff --git a/tests/bsim/bluetooth/mesh/src/test_beacon.c b/tests/bsim/bluetooth/mesh/src/test_beacon.c index 04e89671a5f7ce..e4b77fcbb75b73 100644 --- a/tests/bsim/bluetooth/mesh/src/test_beacon.c +++ b/tests/bsim/bluetooth/mesh/src/test_beacon.c @@ -1532,7 +1532,7 @@ static void test_tx_priv_beacon_cache(void) PASS(); } -#if IS_ENABLED(CONFIG_BT_MESH_GATT_PROXY) +#if defined(CONFIG_BT_MESH_GATT_PROXY) static uint8_t test_net_key_3[16] = {0x12, 0x54, 0xab, 0x1e}; diff --git a/tests/drivers/can/api/src/canfd.c b/tests/drivers/can/api/src/canfd.c index 6941c42e775b79..80703655d1fb9e 100644 --- a/tests/drivers/can/api/src/canfd.c +++ b/tests/drivers/can/api/src/canfd.c @@ -388,6 +388,9 @@ ZTEST_USER(canfd, test_set_timing_data_min) err = can_set_timing_data(can_dev, can_get_timing_data_min(can_dev)); zassert_equal(err, 0, "failed to set minimum timing data parameters (err %d)", err); + err = can_set_bitrate_data(can_dev, CONFIG_CAN_DEFAULT_BITRATE_DATA); + zassert_equal(err, 0, "failed to restore default data bitrate"); + err = can_start(can_dev); zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); } @@ -435,6 +438,9 @@ ZTEST_USER(canfd, test_set_timing_data_max) err = can_set_timing_data(can_dev, can_get_timing_data_max(can_dev)); zassert_equal(err, 0, "failed to set maximum timing data parameters (err %d)", err); + err = can_set_bitrate_data(can_dev, CONFIG_CAN_DEFAULT_BITRATE_DATA); + zassert_equal(err, 0, "failed to restore default data bitrate"); + err = can_start(can_dev); zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); } diff --git a/tests/drivers/can/api/src/classic.c b/tests/drivers/can/api/src/classic.c index 077f547cad1023..b762137f8cd274 100644 --- a/tests/drivers/can/api/src/classic.c +++ b/tests/drivers/can/api/src/classic.c @@ -529,6 +529,9 @@ ZTEST_USER(can_classic, test_set_bitrate) err = can_set_bitrate(can_dev, TEST_BITRATE_1); zassert_equal(err, 0, "failed to set bitrate"); + err = can_set_bitrate(can_dev, CONFIG_CAN_DEFAULT_BITRATE); + zassert_equal(err, 0, "failed to restore default bitrate"); + err = can_start(can_dev); zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); } @@ -546,6 +549,9 @@ ZTEST_USER(can_classic, test_set_timing_min) err = can_set_timing(can_dev, can_get_timing_min(can_dev)); zassert_equal(err, 0, "failed to set minimum timing parameters (err %d)", err); + err = can_set_bitrate(can_dev, CONFIG_CAN_DEFAULT_BITRATE); + zassert_equal(err, 0, "failed to restore default bitrate"); + err = can_start(can_dev); zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); } @@ -563,6 +569,9 @@ ZTEST_USER(can_classic, test_set_timing_max) err = can_set_timing(can_dev, can_get_timing_max(can_dev)); zassert_equal(err, 0, "failed to set maximum timing parameters (err %d)", err); + err = can_set_bitrate(can_dev, CONFIG_CAN_DEFAULT_BITRATE); + zassert_equal(err, 0, "failed to restore default bitrate"); + err = can_start(can_dev); zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); } @@ -1180,10 +1189,13 @@ ZTEST_USER(can_classic, test_filters_preserved_through_bitrate_change) zassert_equal(state, CAN_STATE_STOPPED, "CAN controller not stopped"); err = can_set_bitrate(can_dev, TEST_BITRATE_2); - zassert_equal(err, 0, "failed to set bitrate"); + zassert_equal(err, 0, "failed to set bitrate 2"); err = can_set_bitrate(can_dev, TEST_BITRATE_1); - zassert_equal(err, 0, "failed to set bitrate"); + zassert_equal(err, 0, "failed to set bitrate 1"); + + err = can_set_bitrate(can_dev, CONFIG_CAN_DEFAULT_BITRATE); + zassert_equal(err, 0, "failed to restore default bitrate"); err = can_start(can_dev); zassert_equal(err, 0, "failed to start CAN controller (err %d)", err); diff --git a/tests/drivers/console/line_splitting/testcase.yaml b/tests/drivers/console/line_splitting/testcase.yaml index a7c0f1b8e67716..05567a76c344be 100644 --- a/tests/drivers/console/line_splitting/testcase.yaml +++ b/tests/drivers/console/line_splitting/testcase.yaml @@ -8,4 +8,8 @@ common: tests: drivers.console.line_splitting: harness_config: - robot_test_path: line_splitting.robot + robot_testsuite: line_splitting.robot + drivers.console.line_splitting.plus.some_option: + harness_config: + robot_testsuite: line_splitting.robot + robot_option: --exclude some_flag diff --git a/tests/drivers/disk/disk_access/src/main.c b/tests/drivers/disk/disk_access/src/main.c index 4e0348c0a0d80d..8e26cc0356eafc 100644 --- a/tests/drivers/disk/disk_access/src/main.c +++ b/tests/drivers/disk/disk_access/src/main.c @@ -22,13 +22,13 @@ #if defined(CONFIG_DISK_DRIVER_SDMMC) #define DISK_NAME_PHYS CONFIG_SDMMC_VOLUME_NAME -#elif IS_ENABLED(CONFIG_DISK_DRIVER_MMC) +#elif defined(CONFIG_DISK_DRIVER_MMC) #define DISK_NAME_PHYS CONFIG_MMC_VOLUME_NAME -#elif IS_ENABLED(CONFIG_DISK_DRIVER_FLASH) +#elif defined(CONFIG_DISK_DRIVER_FLASH) #define DISK_NAME_PHYS "NAND" -#elif IS_ENABLED(CONFIG_NVME) +#elif defined(CONFIG_NVME) #define DISK_NAME_PHYS "nvme0n0" -#elif IS_ENABLED(CONFIG_DISK_DRIVER_RAM) +#elif defined(CONFIG_DISK_DRIVER_RAM) /* Since ramdisk is enabled by default on e.g. qemu boards, it needs to be checked last to not * override other backends. */ diff --git a/tests/drivers/disk/disk_performance/src/main.c b/tests/drivers/disk/disk_performance/src/main.c index 7d3a67b7a519b6..0042cde68ee66a 100644 --- a/tests/drivers/disk/disk_performance/src/main.c +++ b/tests/drivers/disk/disk_performance/src/main.c @@ -14,9 +14,9 @@ #if defined(CONFIG_DISK_DRIVER_SDMMC) #define DISK_NAME CONFIG_SDMMC_VOLUME_NAME -#elif IS_ENABLED(CONFIG_DISK_DRIVER_MMC) +#elif defined(CONFIG_DISK_DRIVER_MMC) #define DISK_NAME CONFIG_MMC_VOLUME_NAME -#elif IS_ENABLED(CONFIG_NVME) +#elif defined(CONFIG_NVME) #define DISK_NAME "nvme0n0" #else #error "No disk device defined, is your board supported?" diff --git a/tests/drivers/dma/chan_blen_transfer/src/test_dma.c b/tests/drivers/dma/chan_blen_transfer/src/test_dma.c index 2b7f83d5fb1e89..054bb6b89b9e9c 100644 --- a/tests/drivers/dma/chan_blen_transfer/src/test_dma.c +++ b/tests/drivers/dma/chan_blen_transfer/src/test_dma.c @@ -22,7 +22,7 @@ #define RX_BUFF_SIZE (48) -static __aligned(32) const char tx_data[] = "It is harder to be kind than to be wise........"; +static __aligned(32) char tx_data[] = "It is harder to be kind than to be wise........"; static __aligned(32) char rx_data[RX_BUFF_SIZE] = { 0 }; static void test_done(const struct device *dma_dev, void *arg, diff --git a/tests/drivers/flash/common/src/main.c b/tests/drivers/flash/common/src/main.c index 4eeb4920993724..048542bf31b6d4 100644 --- a/tests/drivers/flash/common/src/main.c +++ b/tests/drivers/flash/common/src/main.c @@ -44,8 +44,8 @@ #define EXPECTED_SIZE 512 -#if !IS_ENABLED(CONFIG_FLASH_HAS_EXPLICIT_ERASE) && \ - !IS_ENABLED(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE) +#if !defined(CONFIG_FLASH_HAS_EXPLICIT_ERASE) && \ + !defined(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE) #error There is no flash device enabled or it is missing Kconfig options #endif diff --git a/tests/drivers/i2c/i2c_target_api/boards/max32690evkit_max32690_m4.overlay b/tests/drivers/i2c/i2c_target_api/boards/max32690evkit_max32690_m4.overlay index dc62f0be0d217a..ac616bf26a2df7 100644 --- a/tests/drivers/i2c/i2c_target_api/boards/max32690evkit_max32690_m4.overlay +++ b/tests/drivers/i2c/i2c_target_api/boards/max32690evkit_max32690_m4.overlay @@ -12,6 +12,7 @@ eeprom0: eeprom@54 { compatible = "zephyr,i2c-target-eeprom"; reg = <0x54>; + address-width = <16>; size = <1024>; }; }; @@ -24,6 +25,7 @@ eeprom1: eeprom@56 { compatible = "zephyr,i2c-target-eeprom"; reg = <0x56>; + address-width = <16>; size = <1024>; }; }; diff --git a/tests/drivers/i2c/i2c_target_api/boards/mec1501modular_assy6885.overlay b/tests/drivers/i2c/i2c_target_api/boards/mec1501modular_assy6885.overlay index f9a8aca95cffad..17ae7f879a65f2 100644 --- a/tests/drivers/i2c/i2c_target_api/boards/mec1501modular_assy6885.overlay +++ b/tests/drivers/i2c/i2c_target_api/boards/mec1501modular_assy6885.overlay @@ -8,6 +8,7 @@ eeprom0: eeprom@54 { compatible = "zephyr,i2c-target-eeprom"; reg = <0x54>; + address-width = <16>; size = <1024>; }; }; @@ -17,6 +18,7 @@ eeprom1: eeprom@56 { compatible = "zephyr,i2c-target-eeprom"; reg = <0x56>; + address-width = <16>; size = <1024>; }; }; diff --git a/tests/drivers/i2c/i2c_target_api/boards/npcx9m6f_evb.overlay b/tests/drivers/i2c/i2c_target_api/boards/npcx9m6f_evb.overlay index c0ecd39418f5fc..b870b6eae2ee63 100644 --- a/tests/drivers/i2c/i2c_target_api/boards/npcx9m6f_evb.overlay +++ b/tests/drivers/i2c/i2c_target_api/boards/npcx9m6f_evb.overlay @@ -10,6 +10,7 @@ eeprom0: eeprom@54 { compatible = "zephyr,i2c-target-eeprom"; reg = <0x54>; + address-width = <16>; size = <1024>; }; }; @@ -23,6 +24,7 @@ eeprom1: eeprom@56 { compatible = "zephyr,i2c-target-eeprom"; reg = <0x56>; + address-width = <16>; size = <1024>; }; }; diff --git a/tests/drivers/i2c/i2c_target_api/boards/nucleo_h563zi.overlay b/tests/drivers/i2c/i2c_target_api/boards/nucleo_h563zi.overlay index 02574be9b3e1ff..bbb37fc8935f60 100644 --- a/tests/drivers/i2c/i2c_target_api/boards/nucleo_h563zi.overlay +++ b/tests/drivers/i2c/i2c_target_api/boards/nucleo_h563zi.overlay @@ -20,6 +20,7 @@ eeprom0: eeprom@54 { compatible = "zephyr,i2c-target-eeprom"; reg = <0x54>; + address-width = <16>; size = <1024>; }; }; @@ -31,6 +32,7 @@ eeprom1: eeprom@56 { compatible = "zephyr,i2c-target-eeprom"; reg = <0x56>; + address-width = <16>; size = <1024>; }; }; diff --git a/tests/drivers/i2c/i2c_target_api/boards/nucleo_l476rg.overlay b/tests/drivers/i2c/i2c_target_api/boards/nucleo_l476rg.overlay index 98cd20632b596b..e21e19aeeb462d 100644 --- a/tests/drivers/i2c/i2c_target_api/boards/nucleo_l476rg.overlay +++ b/tests/drivers/i2c/i2c_target_api/boards/nucleo_l476rg.overlay @@ -17,6 +17,7 @@ eeprom0: eeprom@54 { compatible = "zephyr,i2c-target-eeprom"; reg = <0x54>; + address-width = <16>; size = <1024>; }; }; @@ -25,6 +26,7 @@ eeprom1: eeprom@56 { compatible = "zephyr,i2c-target-eeprom"; reg = <0x56>; + address-width = <16>; size = <1024>; }; }; diff --git a/tests/drivers/i2c/i2c_target_api/boards/numaker_m2l31ki.overlay b/tests/drivers/i2c/i2c_target_api/boards/numaker_m2l31ki.overlay index 2b621b51a2ff79..f0d07272d3a1f4 100644 --- a/tests/drivers/i2c/i2c_target_api/boards/numaker_m2l31ki.overlay +++ b/tests/drivers/i2c/i2c_target_api/boards/numaker_m2l31ki.overlay @@ -24,6 +24,7 @@ eeprom0: eeprom@54 { compatible = "zephyr,i2c-target-eeprom"; reg = <0x54>; + address-width = <16>; size = <1024>; }; }; @@ -36,6 +37,7 @@ eeprom1: eeprom@56 { compatible = "zephyr,i2c-target-eeprom"; reg = <0x56>; + address-width = <16>; size = <1024>; }; }; diff --git a/tests/drivers/i2c/i2c_target_api/boards/numaker_pfm_m467.overlay b/tests/drivers/i2c/i2c_target_api/boards/numaker_pfm_m467.overlay index a5cd026c7ebae1..bcf3c2ca0c3d44 100644 --- a/tests/drivers/i2c/i2c_target_api/boards/numaker_pfm_m467.overlay +++ b/tests/drivers/i2c/i2c_target_api/boards/numaker_pfm_m467.overlay @@ -24,6 +24,7 @@ eeprom0: eeprom@54 { compatible = "zephyr,i2c-target-eeprom"; reg = <0x54>; + address-width = <16>; size = <1024>; }; }; @@ -36,6 +37,7 @@ eeprom1: eeprom@56 { compatible = "zephyr,i2c-target-eeprom"; reg = <0x56>; + address-width = <16>; size = <1024>; }; }; diff --git a/tests/drivers/i2c/i2c_target_api/src/main.c b/tests/drivers/i2c/i2c_target_api/src/main.c index e07ab6d33db6cc..5c1540e3e79ae2 100644 --- a/tests/drivers/i2c/i2c_target_api/src/main.c +++ b/tests/drivers/i2c/i2c_target_api/src/main.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -43,15 +44,17 @@ static void to_display_format(const uint8_t *src, size_t size, char *dst) } static int run_full_read(const struct device *i2c, uint8_t addr, - const uint8_t *comp_buffer) + uint8_t addr_width, const uint8_t *comp_buffer) { int ret; + uint8_t start_addr[2]; TC_PRINT("Testing full read: Master: %s, address: 0x%x\n", i2c->name, addr); /* Read EEPROM from I2C Master requests, then compare */ - ret = i2c_burst_read(i2c, addr, 0, i2c_buffer, TEST_DATA_SIZE); + memset(start_addr, 0, sizeof(start_addr)); + ret = i2c_write_read(i2c, addr, start_addr, (addr_width >> 3), i2c_buffer, TEST_DATA_SIZE); zassert_equal(ret, 0, "Failed to read EEPROM"); if (memcmp(i2c_buffer, comp_buffer, TEST_DATA_SIZE)) { @@ -70,15 +73,27 @@ static int run_full_read(const struct device *i2c, uint8_t addr, } static int run_partial_read(const struct device *i2c, uint8_t addr, - const uint8_t *comp_buffer, unsigned int offset) + uint8_t addr_width, const uint8_t *comp_buffer, unsigned int offset) { int ret; + uint8_t start_addr[2]; TC_PRINT("Testing partial read. Master: %s, address: 0x%x, off=%d\n", i2c->name, addr, offset); - ret = i2c_burst_read(i2c, addr, - offset, i2c_buffer, TEST_DATA_SIZE-offset); + switch (addr_width) { + case 8: + start_addr[0] = (uint8_t) (offset & 0xFF); + break; + case 16: + sys_put_be16((uint16_t)(offset & 0xFFFF), start_addr); + break; + default: + return -EINVAL; + } + + ret = i2c_write_read(i2c, addr, + start_addr, (addr_width >> 3), i2c_buffer, TEST_DATA_SIZE-offset); zassert_equal(ret, 0, "Failed to read EEPROM"); if (memcmp(i2c_buffer, &comp_buffer[offset], TEST_DATA_SIZE-offset)) { @@ -97,9 +112,11 @@ static int run_partial_read(const struct device *i2c, uint8_t addr, } static int run_program_read(const struct device *i2c, uint8_t addr, - unsigned int offset) + uint8_t addr_width, unsigned int offset) { int ret, i; + uint8_t start_addr[2]; + struct i2c_msg msg[2]; TC_PRINT("Testing program. Master: %s, address: 0x%x, off=%d\n", i2c->name, addr, offset); @@ -108,15 +125,32 @@ static int run_program_read(const struct device *i2c, uint8_t addr, i2c_buffer[i] = i; } - ret = i2c_burst_write(i2c, addr, - offset, i2c_buffer, TEST_DATA_SIZE-offset); + switch (addr_width) { + case 8: + start_addr[0] = (uint8_t) (offset & 0xFF); + break; + case 16: + sys_put_be16((uint16_t)(offset & 0xFFFF), start_addr); + break; + default: + return -EINVAL; + } + + msg[0].buf = start_addr; + msg[0].len = (addr_width >> 3); + msg[0].flags = I2C_MSG_WRITE; + msg[1].buf = &i2c_buffer[0]; + msg[1].len = TEST_DATA_SIZE; + msg[1].flags = I2C_MSG_WRITE | I2C_MSG_STOP; + + ret = i2c_transfer(i2c, &msg[0], 2, addr); zassert_equal(ret, 0, "Failed to write EEPROM"); (void)memset(i2c_buffer, 0xFF, TEST_DATA_SIZE); /* Read back EEPROM from I2C Master requests, then compare */ - ret = i2c_burst_read(i2c, addr, - offset, i2c_buffer, TEST_DATA_SIZE-offset); + ret = i2c_write_read(i2c, addr, + start_addr, (addr_width >> 3), i2c_buffer, TEST_DATA_SIZE-offset); zassert_equal(ret, 0, "Failed to read EEPROM"); for (i = 0 ; i < TEST_DATA_SIZE-offset ; ++i) { @@ -137,9 +171,11 @@ ZTEST(i2c_eeprom_target, test_eeprom_target) const struct device *const eeprom_0 = DEVICE_DT_GET(NODE_EP0); const struct device *const i2c_0 = DEVICE_DT_GET(DT_BUS(NODE_EP0)); int addr_0 = DT_REG_ADDR(NODE_EP0); + uint8_t addr_0_width = DT_PROP_OR(NODE_EP0, address_width, 8); const struct device *const eeprom_1 = DEVICE_DT_GET(NODE_EP1); const struct device *const i2c_1 = DEVICE_DT_GET(DT_BUS(NODE_EP1)); int addr_1 = DT_REG_ADDR(NODE_EP1); + uint8_t addr_1_width = DT_PROP_OR(NODE_EP1, address_width, 8); int ret, offset; zassert_not_null(i2c_0, "EEPROM 0 - I2C bus not found"); @@ -194,21 +230,22 @@ ZTEST(i2c_eeprom_target, test_eeprom_target) * Similarly validation of EP1 uses i2c_0 as a master with addr_1 and * eeprom_1_data for validation. */ - ret = run_full_read(i2c_1, addr_0, eeprom_0_data); + ret = run_full_read(i2c_1, addr_0, addr_0_width, eeprom_0_data); zassert_equal(ret, 0, "Full I2C read from EP0 failed"); if (IS_ENABLED(CONFIG_APP_DUAL_ROLE_I2C)) { - ret = run_full_read(i2c_0, addr_1, eeprom_1_data); + ret = run_full_read(i2c_0, addr_1, addr_1_width, eeprom_1_data); zassert_equal(ret, 0, "Full I2C read from EP1 failed"); } for (offset = 0 ; offset < TEST_DATA_SIZE-1 ; ++offset) { zassert_equal(0, run_partial_read(i2c_1, addr_0, - eeprom_0_data, offset), + addr_0_width, eeprom_0_data, offset), "Partial I2C read EP0 failed"); if (IS_ENABLED(CONFIG_APP_DUAL_ROLE_I2C)) { zassert_equal(0, run_partial_read(i2c_0, addr_1, + addr_1_width, eeprom_1_data, offset), "Partial I2C read EP1 failed"); @@ -216,11 +253,12 @@ ZTEST(i2c_eeprom_target, test_eeprom_target) } for (offset = 0 ; offset < TEST_DATA_SIZE-1 ; ++offset) { - zassert_equal(0, run_program_read(i2c_1, addr_0, offset), + zassert_equal(0, run_program_read(i2c_1, addr_0, + addr_0_width, offset), "Program I2C read EP0 failed"); if (IS_ENABLED(CONFIG_APP_DUAL_ROLE_I2C)) { zassert_equal(0, run_program_read(i2c_0, addr_1, - offset), + addr_1_width, offset), "Program I2C read EP1 failed"); } } diff --git a/tests/drivers/rtc/rtc_api/Kconfig b/tests/drivers/rtc/rtc_api/Kconfig new file mode 100644 index 00000000000000..4881a68005094e --- /dev/null +++ b/tests/drivers/rtc/rtc_api/Kconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2024 Bjarki Arge Andreasen +# SPDX-License-Identifier: Apache-2.0 + +source "Kconfig.zephyr" + +if RTC_ALARM + +config TEST_RTC_ALARM_TIME_MASK + int "Alarm fields to set" + default 6 + range 1 511 + help + Set the RTC_ALARM_TIME_MASK_ bitmask to use when setting + RTC alarms during testing. + +endif # RTC_ALARM diff --git a/tests/drivers/rtc/rtc_api/src/test_alarm.c b/tests/drivers/rtc/rtc_api/src/test_alarm.c index 5f81d05c87b42c..4970ddf7b17200 100644 --- a/tests/drivers/rtc/rtc_api/src/test_alarm.c +++ b/tests/drivers/rtc/rtc_api/src/test_alarm.c @@ -9,29 +9,67 @@ #include #include #include -#include #include -#include - -/* Fri Jan 01 2021 13:29:50 GMT+0000 */ -#define RTC_TEST_ALARM_SET_TIME (1609507790) #define RTC_TEST_ALARM_TEST_NOT_PENDING_DELAY (3) #define RTC_TEST_ALARM_TEST_PENDING_DELAY (10) -#define RTC_TEST_ALARM_TIME_MINUTE (30) -#define RTC_TEST_ALARM_TIME_HOUR (13) static const struct device *rtc = DEVICE_DT_GET(DT_ALIAS(rtc)); static const uint16_t alarms_count = DT_PROP(DT_ALIAS(rtc), alarms_count); +static const uint16_t test_alarm_time_mask_set = CONFIG_TEST_RTC_ALARM_TIME_MASK; + +/* Fri Jan 01 2021 13:29:50 GMT+0000 */ +static const struct rtc_time test_rtc_time_set = { + .tm_sec = 50, + .tm_min = 29, + .tm_hour = 13, + .tm_mday = 1, + .tm_mon = 0, + .tm_year = 121, + .tm_wday = 5, + .tm_yday = 1, + .tm_isdst = -1, + .tm_nsec = 0, +}; + +/* Fri Jan 01 2021 13:30:00 GMT+0000 */ +static const struct rtc_time test_alarm_time_set = { + .tm_sec = 0, + .tm_min = 30, + .tm_hour = 13, + .tm_mday = 1, + .tm_mon = 0, + .tm_year = 121, + .tm_wday = 5, + .tm_yday = 1, + .tm_isdst = -1, + .tm_nsec = 0, +}; + +static const struct rtc_time test_alarm_time_invalid = { + .tm_sec = 70, + .tm_min = 70, + .tm_hour = 25, + .tm_mday = 35, + .tm_mon = 15, + .tm_year = 8000, + .tm_wday = 8, + .tm_yday = 370, + .tm_nsec = INT32_MAX, +}; + +static const uint16_t test_alarm_time_masks[] = { + RTC_ALARM_TIME_MASK_SECOND, RTC_ALARM_TIME_MASK_MINUTE, + RTC_ALARM_TIME_MASK_HOUR, RTC_ALARM_TIME_MASK_MONTHDAY, + RTC_ALARM_TIME_MASK_MONTH, RTC_ALARM_TIME_MASK_YEAR, + RTC_ALARM_TIME_MASK_WEEKDAY, RTC_ALARM_TIME_MASK_YEARDAY, + RTC_ALARM_TIME_MASK_NSEC +}; ZTEST(rtc_api, test_alarm) { int ret; - time_t timer_set; - struct rtc_time time_set; - struct rtc_time alarm_time_set; uint16_t alarm_time_mask_supported; - uint16_t alarm_time_mask_set; struct rtc_time alarm_time_get; uint16_t alarm_time_mask_get; @@ -53,29 +91,13 @@ ZTEST(rtc_api, test_alarm) /* Every supported alarm field should reject invalid values. */ for (uint16_t i = 0; i < alarms_count; i++) { ret = rtc_alarm_get_supported_fields(rtc, i, &alarm_time_mask_supported); - zassert_ok(ret, "Failed to get supported alarm %d fields", i); - alarm_time_set = (struct rtc_time) { - .tm_sec = 70, - .tm_min = 70, - .tm_hour = 25, - .tm_mday = 35, - .tm_mon = 15, - .tm_year = 8000, - .tm_wday = 8, - .tm_yday = 370, - .tm_nsec = INT32_MAX, - }; - uint16_t masks[] = {RTC_ALARM_TIME_MASK_SECOND, RTC_ALARM_TIME_MASK_MINUTE, - RTC_ALARM_TIME_MASK_HOUR, RTC_ALARM_TIME_MASK_MONTHDAY, - RTC_ALARM_TIME_MASK_MONTH, RTC_ALARM_TIME_MASK_YEAR, - RTC_ALARM_TIME_MASK_WEEKDAY, RTC_ALARM_TIME_MASK_YEARDAY, - RTC_ALARM_TIME_MASK_NSEC}; - ARRAY_FOR_EACH(masks, j) + ARRAY_FOR_EACH(test_alarm_time_masks, j) { - if (masks[j] & alarm_time_mask_supported) { - ret = rtc_alarm_set_time(rtc, i, masks[j], &alarm_time_set); + if (test_alarm_time_masks[j] & alarm_time_mask_supported) { + ret = rtc_alarm_set_time(rtc, i, test_alarm_time_masks[j], + &test_alarm_time_invalid); zassert_equal( -EINVAL, ret, "%s: RTC should reject invalid alarm %d time in field %zu.", @@ -87,61 +109,79 @@ ZTEST(rtc_api, test_alarm) /* Validate alarms supported fields */ for (uint16_t i = 0; i < alarms_count; i++) { ret = rtc_alarm_get_supported_fields(rtc, i, &alarm_time_mask_supported); - zassert_ok(ret, "Failed to get supported alarm %d fields", i); - /* Skip test if alarm does not support the minute and hour fields */ - if (((RTC_ALARM_TIME_MASK_MINUTE & alarm_time_mask_supported) == 0) || - ((RTC_TEST_ALARM_TIME_HOUR & alarm_time_mask_supported) == 0)) { - ztest_test_skip(); - } + ret = (test_alarm_time_mask_set & (~alarm_time_mask_supported)) ? -EINVAL : 0; + zassert_ok(ret, "Configured alarm time fields to set are not supported"); } - /* Set alarm time */ - alarm_time_set.tm_min = RTC_TEST_ALARM_TIME_MINUTE; - alarm_time_set.tm_hour = RTC_TEST_ALARM_TIME_HOUR; - alarm_time_mask_set = (RTC_ALARM_TIME_MASK_MINUTE | RTC_ALARM_TIME_MASK_HOUR); - for (uint16_t i = 0; i < alarms_count; i++) { - ret = rtc_alarm_set_time(rtc, i, alarm_time_mask_set, &alarm_time_set); - + ret = rtc_alarm_set_time(rtc, i, test_alarm_time_mask_set, &test_alarm_time_set); zassert_ok(ret, "Failed to set alarm %d time", i); } /* Validate alarm time */ for (uint16_t i = 0; i < alarms_count; i++) { ret = rtc_alarm_get_time(rtc, i, &alarm_time_mask_get, &alarm_time_get); - zassert_ok(ret, "Failed to set alarm %d time", i); - zassert_equal(alarm_time_mask_get, alarm_time_mask_set, + zassert_equal(alarm_time_mask_get, test_alarm_time_mask_set, "Incorrect alarm %d time mask", i); - zassert_equal(alarm_time_get.tm_min, alarm_time_set.tm_min, - "Incorrect alarm %d time minute field", i); + if (test_alarm_time_mask_set & RTC_ALARM_TIME_MASK_SECOND) { + zassert_equal(alarm_time_get.tm_sec, test_alarm_time_set.tm_sec, + "Incorrect alarm %d tm_sec field", i); + } - zassert_equal(alarm_time_get.tm_hour, alarm_time_set.tm_hour, - "Incorrect alarm %d time hour field", i); - } + if (test_alarm_time_mask_set & RTC_ALARM_TIME_MASK_MINUTE) { + zassert_equal(alarm_time_get.tm_min, test_alarm_time_set.tm_min, + "Incorrect alarm %d tm_min field", i); + } - /* Initialize RTC time to set */ - timer_set = RTC_TEST_ALARM_SET_TIME; + if (test_alarm_time_mask_set & RTC_ALARM_TIME_MASK_HOUR) { + zassert_equal(alarm_time_get.tm_hour, test_alarm_time_set.tm_hour, + "Incorrect alarm %d tm_hour field", i); + } - gmtime_r(&timer_set, (struct tm *)(&time_set)); + if (test_alarm_time_mask_set & RTC_ALARM_TIME_MASK_MONTHDAY) { + zassert_equal(alarm_time_get.tm_mday, test_alarm_time_set.tm_mday, + "Incorrect alarm %d tm_mday field", i); + } - time_set.tm_isdst = -1; - time_set.tm_nsec = 0; + if (test_alarm_time_mask_set & RTC_ALARM_TIME_MASK_MONTH) { + zassert_equal(alarm_time_get.tm_mon, test_alarm_time_set.tm_mon, + "Incorrect alarm %d tm_mon field", i); + } + + if (test_alarm_time_mask_set & RTC_ALARM_TIME_MASK_YEAR) { + zassert_equal(alarm_time_get.tm_year, test_alarm_time_set.tm_year, + "Incorrect alarm %d tm_year field", i); + } + + if (test_alarm_time_mask_set & RTC_ALARM_TIME_MASK_WEEKDAY) { + zassert_equal(alarm_time_get.tm_wday, test_alarm_time_set.tm_wday, + "Incorrect alarm %d tm_wday field", i); + } + + if (test_alarm_time_mask_set & RTC_ALARM_TIME_MASK_YEARDAY) { + zassert_equal(alarm_time_get.tm_yday, test_alarm_time_set.tm_yday, + "Incorrect alarm %d tm_yday field", i); + } + + if (test_alarm_time_mask_set & RTC_ALARM_TIME_MASK_NSEC) { + zassert_equal(alarm_time_get.tm_nsec, test_alarm_time_set.tm_nsec, + "Incorrect alarm %d tm_nsec field", i); + } + } for (uint8_t k = 0; k < 2; k++) { /* Set RTC time */ - ret = rtc_set_time(rtc, &time_set); - + ret = rtc_set_time(rtc, &test_rtc_time_set); zassert_ok(ret, "Failed to set time"); /* Clear alarm pending status */ for (uint16_t i = 0; i < alarms_count; i++) { ret = rtc_alarm_is_pending(rtc, i); - zassert_true(ret > -1, "Failed to clear alarm %d pending status", i); } @@ -151,7 +191,6 @@ ZTEST(rtc_api, test_alarm) /* Validate alarm are not pending */ for (uint16_t i = 0; i < alarms_count; i++) { ret = rtc_alarm_is_pending(rtc, i); - zassert_ok(ret, "Alarm %d should not be pending", i); } @@ -161,7 +200,6 @@ ZTEST(rtc_api, test_alarm) /* Validate alarm is pending */ for (uint16_t i = 0; i < alarms_count; i++) { ret = rtc_alarm_is_pending(rtc, i); - zassert_equal(ret, 1, "Alarm %d should be pending", i); } } @@ -169,11 +207,9 @@ ZTEST(rtc_api, test_alarm) /* Disable and clear alarms */ for (uint16_t i = 0; i < alarms_count; i++) { ret = rtc_alarm_set_time(rtc, i, 0, NULL); - zassert_ok(ret, "Failed to disable alarm %d", i); ret = rtc_alarm_is_pending(rtc, i); - zassert_true(ret > -1, "Failed to clear alarm %d pending state", i); } } diff --git a/tests/drivers/rtc/rtc_api/src/test_alarm_callback.c b/tests/drivers/rtc/rtc_api/src/test_alarm_callback.c index f09cc351b7b432..106dfe236669c9 100644 --- a/tests/drivers/rtc/rtc_api/src/test_alarm_callback.c +++ b/tests/drivers/rtc/rtc_api/src/test_alarm_callback.c @@ -9,16 +9,9 @@ #include #include #include -#include -#include - -/* Fri Jan 01 2021 13:29:50 GMT+0000 */ -#define RTC_TEST_ALARM_SET_TIME (1609507790) #define RTC_TEST_ALARM_TEST_NOT_CALLED_DELAY (3) #define RTC_TEST_ALARM_TEST_CALLED_DELAY (10) -#define RTC_TEST_ALARM_TIME_MINUTE (30) -#define RTC_TEST_ALARM_TIME_HOUR (13) static const struct device *rtc = DEVICE_DT_GET(DT_ALIAS(rtc)); static const uint16_t alarms_count = DT_PROP(DT_ALIAS(rtc), alarms_count); @@ -27,6 +20,36 @@ static uint32_t callback_user_data_even = 0x1234; static atomic_t callback_called_mask_odd; static atomic_t callback_called_mask_even; +static const uint16_t test_alarm_time_mask_set = CONFIG_TEST_RTC_ALARM_TIME_MASK; + +/* Fri Jan 01 2021 13:29:50 GMT+0000 */ +static const struct rtc_time test_rtc_time_set = { + .tm_sec = 50, + .tm_min = 29, + .tm_hour = 13, + .tm_mday = 1, + .tm_mon = 0, + .tm_year = 121, + .tm_wday = 5, + .tm_yday = 1, + .tm_isdst = -1, + .tm_nsec = 0, +}; + +/* Fri Jan 01 2021 13:30:00 GMT+0000 */ +static const struct rtc_time test_alarm_time_set = { + .tm_sec = 0, + .tm_min = 30, + .tm_hour = 13, + .tm_mday = 1, + .tm_mon = 0, + .tm_year = 121, + .tm_wday = 5, + .tm_yday = 1, + .tm_isdst = -1, + .tm_nsec = 0, +}; + static void test_rtc_alarm_callback_handler_odd(const struct device *dev, uint16_t id, void *user_data) { @@ -42,11 +65,6 @@ static void test_rtc_alarm_callback_handler_even(const struct device *dev, uint1 ZTEST(rtc_api, test_alarm_callback) { int ret; - time_t timer_set; - struct rtc_time time_set; - struct rtc_time alarm_time_set; - uint16_t alarm_time_mask_supported; - uint16_t alarm_time_mask_set; atomic_val_t callback_called_mask_status_odd; atomic_val_t callback_called_mask_status_even; bool callback_called_status; @@ -63,47 +81,18 @@ ZTEST(rtc_api, test_alarm_callback) } } - /* Validate alarms supported fields */ for (uint16_t i = 0; i < alarms_count; i++) { - ret = rtc_alarm_get_supported_fields(rtc, i, &alarm_time_mask_supported); - - zassert_ok(ret, "Failed to get supported alarm %d fields", i); - - /* Skip test if alarm does not support the minute and hour fields */ - if (((RTC_ALARM_TIME_MASK_MINUTE & alarm_time_mask_supported) == 0) || - ((RTC_TEST_ALARM_TIME_HOUR & alarm_time_mask_supported) == 0)) { - ztest_test_skip(); - } - } - - /* Set alarm time */ - alarm_time_set.tm_min = RTC_TEST_ALARM_TIME_MINUTE; - alarm_time_set.tm_hour = RTC_TEST_ALARM_TIME_HOUR; - alarm_time_mask_set = (RTC_ALARM_TIME_MASK_MINUTE | RTC_ALARM_TIME_MASK_HOUR); - - for (uint16_t i = 0; i < alarms_count; i++) { - ret = rtc_alarm_set_time(rtc, i, alarm_time_mask_set, &alarm_time_set); - + ret = rtc_alarm_set_time(rtc, i, test_alarm_time_mask_set, &test_alarm_time_set); zassert_ok(ret, "Failed to set alarm %d time", i); } - /* Initialize RTC time to set */ - timer_set = RTC_TEST_ALARM_SET_TIME; - - gmtime_r(&timer_set, (struct tm *)(&time_set)); - - time_set.tm_isdst = -1; - time_set.tm_nsec = 0; - /* Set RTC time */ - ret = rtc_set_time(rtc, &time_set); - + ret = rtc_set_time(rtc, &test_rtc_time_set); zassert_ok(ret, "Failed to set time"); /* Clear alarm pending status */ for (uint16_t i = 0; i < alarms_count; i++) { ret = rtc_alarm_is_pending(rtc, i); - zassert_true(ret > -1, "Failed to clear alarm %d pending status", i); } @@ -153,23 +142,19 @@ ZTEST(rtc_api, test_alarm_callback) } /* Reset RTC time */ - ret = rtc_set_time(rtc, &time_set); - + ret = rtc_set_time(rtc, &test_rtc_time_set); zassert_ok(ret, "Failed to set time"); } /* Disable and clear alarms */ for (uint16_t i = 0; i < alarms_count; i++) { ret = rtc_alarm_set_callback(rtc, i, NULL, NULL); - zassert_ok(ret, "Failed to disable alarm %d callback", i); ret = rtc_alarm_set_time(rtc, i, 0, NULL); - zassert_ok(ret, "Failed to disable alarm %d", i); ret = rtc_alarm_is_pending(rtc, i); - zassert_true(ret > -1, "Failed to clear alarm %d pending state", i); } } diff --git a/tests/drivers/uart/uart_elementary/boards/nrf54h20dk_nrf54h20_cpuapp_dual_uart.overlay b/tests/drivers/uart/uart_elementary/boards/nrf54h20dk_nrf54h20_cpuapp_dual_uart.overlay index 23c36ee897442e..f544d609adacde 100644 --- a/tests/drivers/uart/uart_elementary/boards/nrf54h20dk_nrf54h20_cpuapp_dual_uart.overlay +++ b/tests/drivers/uart/uart_elementary/boards/nrf54h20dk_nrf54h20_cpuapp_dual_uart.overlay @@ -6,8 +6,11 @@ &pinctrl { uart135_default_alt: uart135_default_alt { group1 { - psels = , - ; + psels = ; + bias-pull-up; + }; + group2 { + psels = ; }; }; @@ -32,8 +35,11 @@ dut: &uart135 { &pinctrl { uart137_default_alt: uart137_default_alt { group1 { - psels = , - ; + psels = ; + bias-pull-up; + }; + group2 { + psels = ; }; }; diff --git a/tests/drivers/udc/prj.conf b/tests/drivers/udc/prj.conf index e57264e1a24d4a..380d5e74b99632 100644 --- a/tests/drivers/udc/prj.conf +++ b/tests/drivers/udc/prj.conf @@ -5,6 +5,6 @@ CONFIG_LOG=y CONFIG_ZTEST=y CONFIG_UDC_DRIVER=y -CONFIG_UDC_BUF_COUNT=32 -CONFIG_UDC_BUF_POOL_SIZE=8192 +CONFIG_UDC_BUF_COUNT=16 +CONFIG_UDC_BUF_POOL_SIZE=16384 CONFIG_UDC_DRIVER_LOG_LEVEL_INF=y diff --git a/tests/drivers/udc/src/main.c b/tests/drivers/udc/src/main.c index 24e1eb4d1f2a54..97abbbd7448007 100644 --- a/tests/drivers/udc/src/main.c +++ b/tests/drivers/udc/src/main.c @@ -212,11 +212,10 @@ static void test_udc_ep_halt(const struct device *dev, struct usb_ep_descriptor *ed) { /* Possible return values 0, -ENODEV, -ENOTSUP, -EPERM. */ - int err1, err2, err3; + int err1, err2; err1 = udc_ep_set_halt(dev, ed->bEndpointAddress); err2 = udc_ep_set_halt(dev, FALSE_EP_ADDR); - err3 = udc_ep_set_halt(dev, USB_CONTROL_EP_OUT); if (udc_is_enabled(dev)) { if (ed->bmAttributes == USB_EP_TYPE_ISO) { @@ -226,16 +225,13 @@ static void test_udc_ep_halt(const struct device *dev, } zassert_equal(err2, -ENODEV, "Not failed to set halt"); - zassert_equal(err3, 0, "Failed to set halt"); } else { zassert_equal(err1, -EPERM, "Not failed to set halt"); zassert_equal(err2, -EPERM, "Not failed to set halt"); - zassert_equal(err3, -EPERM, "Not failed to set halt"); } err1 = udc_ep_clear_halt(dev, ed->bEndpointAddress); err2 = udc_ep_clear_halt(dev, FALSE_EP_ADDR); - err3 = udc_ep_clear_halt(dev, USB_CONTROL_EP_OUT); if (udc_is_enabled(dev)) { if (ed->bmAttributes == USB_EP_TYPE_ISO) { @@ -245,11 +241,9 @@ static void test_udc_ep_halt(const struct device *dev, } zassert_equal(err2, -ENODEV, "Not failed to clear halt"); - zassert_equal(err3, 0, "Failed to clear halt"); } else { zassert_equal(err1, -EPERM, "Not failed to clear halt"); zassert_equal(err2, -EPERM, "Not failed to clear halt"); - zassert_equal(err3, -EPERM, "Not failed to clear halt"); } } @@ -332,7 +326,7 @@ static void test_udc_ep_api(const struct device *dev, zassert_ok(err, "Failed to enable endpoint"); /* It needs a little reserve for memory management overhead. */ - for (int n = 0; n < (CONFIG_UDC_BUF_COUNT - 2); n++) { + for (int n = 0; n < (CONFIG_UDC_BUF_COUNT - 4); n++) { buf = udc_ep_buf_alloc(dev, ed->bEndpointAddress, ed->wMaxPacketSize); zassert_not_null(buf, @@ -342,6 +336,7 @@ static void test_udc_ep_api(const struct device *dev, udc_ep_buf_set_zlp(buf); err = udc_ep_enqueue(dev, buf); zassert_ok(err, "Failed to queue request"); + k_yield(); } err = udc_ep_disable(dev, ed->bEndpointAddress); diff --git a/tests/drivers/udc/testcase.yaml b/tests/drivers/udc/testcase.yaml index 9f71f11907b14b..9427a1a97c971f 100644 --- a/tests/drivers/udc/testcase.yaml +++ b/tests/drivers/udc/testcase.yaml @@ -7,6 +7,15 @@ tests: depends_on: usbd integration_platforms: - nrf52840dk/nrf52840 + platform_exclude: + - nrf54h20dk/nrf54h20/cpuapp + drivers.usb.udc.build_only: + build_only: true + # Platform excluded above, only to build, with justification. + platform_allow: + # The controller cannot be enabled without VBUS, but the device should + # not be connected to the host during testing. + - nrf54h20dk/nrf54h20/cpuapp drivers.usb.udc.skeleton: extra_args: - EXTRA_DTC_OVERLAY_FILE="udc_skeleton.overlay" diff --git a/tests/lib/cmsis_nn/src/main.c b/tests/lib/cmsis_nn/src/main.c index 3eb7c200590f36..c7dbe3bc58ed48 100644 --- a/tests/lib/cmsis_nn/src/main.c +++ b/tests/lib/cmsis_nn/src/main.c @@ -170,6 +170,7 @@ ZTEST(cmsis_nn, test_convolve) input_dims.c = CONV_4_IN_CH; filter_dims.w = CONV_4_FILTER_X; filter_dims.h = CONV_4_FILTER_Y; + filter_dims.c = CONV_4_IN_CH; output_dims.w = CONV_4_OUTPUT_W; output_dims.h = CONV_4_OUTPUT_H; output_dims.c = CONV_4_OUT_CH; diff --git a/tests/lib/gui/lvgl/src/main.c b/tests/lib/gui/lvgl/src/main.c index 6475e63ddd0088..8ee495d936aed2 100644 --- a/tests/lib/gui/lvgl/src/main.c +++ b/tests/lib/gui/lvgl/src/main.c @@ -19,7 +19,7 @@ #ifdef CONFIG_DISK_DRIVER_SDMMC #define DISK_NAME CONFIG_SDMMC_VOLUME_NAME -#elif IS_ENABLED(CONFIG_DISK_DRIVER_MMC) +#elif defined(CONFIG_DISK_DRIVER_MMC) #define DISK_NAME CONFIG_MMC_VOLUME_NAME #else #error "No disk device defined, is your board supported?" diff --git a/tests/lib/spsc_pbuf/testcase.yaml b/tests/lib/spsc_pbuf/testcase.yaml index be39414e73ecf7..98557fd2b4cf68 100644 --- a/tests/lib/spsc_pbuf/testcase.yaml +++ b/tests/lib/spsc_pbuf/testcase.yaml @@ -9,9 +9,10 @@ tests: libraries.spsc_pbuf.cache: integration_platforms: - native_sim - # Exclude platform which does not link with cache functions - platform_exclude: ast1030_evb - timeout: 120 + # This configuration only make sense for interprocessor data sharing so + # configuration can only be verified against compilation errors on a single core. + platform_allow: native_sim + build_only: true extra_configs: - CONFIG_SPSC_PBUF_CACHE_ALWAYS=y diff --git a/tests/net/lib/coap_client/src/stubs.c b/tests/net/lib/coap_client/src/stubs.c index 8fd41ef7e72583..13effd8f91b911 100644 --- a/tests/net/lib/coap_client/src/stubs.c +++ b/tests/net/lib/coap_client/src/stubs.c @@ -16,7 +16,7 @@ DEFINE_FAKE_VALUE_FUNC(ssize_t, z_impl_zsock_recvfrom, int, void *, size_t, int, DEFINE_FAKE_VALUE_FUNC(ssize_t, z_impl_zsock_sendto, int, void*, size_t, int, const struct sockaddr *, socklen_t); -struct zvfs_pollfd { +struct zsock_pollfd { int fd; short events; short revents; @@ -39,7 +39,7 @@ int z_impl_zsock_socket(int family, int type, int proto) return 0; } -int z_impl_zvfs_poll(struct zvfs_pollfd *fds, int nfds, int poll_timeout) +int z_impl_zsock_poll(struct zsock_pollfd *fds, int nfds, int poll_timeout) { LOG_INF("Polling, events %d", my_events); k_sleep(K_MSEC(10)); diff --git a/tests/net/lib/lwm2m/lwm2m_engine/prj.conf b/tests/net/lib/lwm2m/lwm2m_engine/prj.conf index 4dd0a80c1f2d24..5d331d20c3312c 100644 --- a/tests/net/lib/lwm2m/lwm2m_engine/prj.conf +++ b/tests/net/lib/lwm2m/lwm2m_engine/prj.conf @@ -1,5 +1,3 @@ CONFIG_ZTEST=y CONFIG_ZTEST_STACK_SIZE=5120 CONFIG_MP_MAX_NUM_CPUS=1 - -CONFIG_ZVFS=y diff --git a/tests/net/lib/lwm2m/lwm2m_engine/src/stubs.c b/tests/net/lib/lwm2m/lwm2m_engine/src/stubs.c index 953d4b72f2577a..13b0e38e8e6e02 100644 --- a/tests/net/lib/lwm2m/lwm2m_engine/src/stubs.c +++ b/tests/net/lib/lwm2m/lwm2m_engine/src/stubs.c @@ -54,7 +54,7 @@ sys_slist_t *lwm2m_obs_obj_path_list(void) static sys_slist_t engine_obj_inst_list = SYS_SLIST_STATIC_INIT(&engine_obj_inst_list); sys_slist_t *lwm2m_engine_obj_inst_list(void) { return &engine_obj_inst_list; } -struct zvfs_pollfd { +struct zsock_pollfd { int fd; short events; short revents; @@ -123,7 +123,7 @@ ssize_t z_impl_zsock_recvfrom(int sock, void *buf, size_t max_len, int flags, return -1; } -int z_impl_zvfs_poll(struct zvfs_pollfd *fds, int nfds, int poll_timeout) +int z_impl_zsock_poll(struct zsock_pollfd *fds, int nfds, int poll_timeout) { k_sleep(K_MSEC(1)); fds->revents = my_events; diff --git a/tests/posix/fs/src/test_fs_dir.c b/tests/posix/fs/src/test_fs_dir.c index dd3a89c6dc5779..b0908cb1586cb1 100644 --- a/tests/posix/fs/src/test_fs_dir.c +++ b/tests/posix/fs/src/test_fs_dir.c @@ -27,7 +27,7 @@ static int test_mkdir(void) return res; } - res = open(TEST_DIR_FILE, O_CREAT | O_RDWR, 0770); + res = open(TEST_DIR_FILE, O_CREAT | O_RDWR); if (res < 0) { TC_PRINT("Failed opening file [%d]\n", res); diff --git a/tests/posix/fs/src/test_fs_file.c b/tests/posix/fs/src/test_fs_file.c index c6f2edd66895cc..9614412a07a582 100644 --- a/tests/posix/fs/src/test_fs_file.c +++ b/tests/posix/fs/src/test_fs_file.c @@ -16,7 +16,7 @@ static int test_file_open(void) { int res; - res = open(TEST_FILE, O_CREAT | O_RDWR, 0660); + res = open(TEST_FILE, O_CREAT | O_RDWR); if (res < 0) { TC_ERROR("Failed opening file: %d, errno=%d\n", res, errno); /* FIXME: restructure tests as per #46897 */ diff --git a/tests/posix/fs/src/test_fs_open_flags.c b/tests/posix/fs/src/test_fs_open_flags.c index 7c35145343b759..1187b1c3e57573 100644 --- a/tests/posix/fs/src/test_fs_open_flags.c +++ b/tests/posix/fs/src/test_fs_open_flags.c @@ -60,7 +60,7 @@ static int test_file_open_flags(void) /* 2 Create file for read only, attempt to read, attempt to write */ TC_PRINT("Open on non-existent file, flags = O_CREAT | O_WRONLY\n"); - fd = open(THE_FILE, O_CREAT | O_WRONLY, 0440); + fd = open(THE_FILE, O_CREAT | O_WRONLY); if (fd < 0) { TC_PRINT("Expected success; fd = %d, errno = %d\n", fd, errno); return TC_FAIL; @@ -236,7 +236,7 @@ static int test_file_open_flags(void) TC_PRINT("Attempt write to file opened with O_APPEND | O_RDWR\n"); /* Clean start */ unlink(THE_FILE); - fd = open(THE_FILE, O_CREAT | O_WRONLY, 0440); + fd = open(THE_FILE, O_CREAT | O_WRONLY); if (fd < 0) { TC_PRINT("Expected success, fd = %d, errno = %d\n", fd, errno); return TC_FAIL; diff --git a/tests/posix/fs/src/test_fs_stat.c b/tests/posix/fs/src/test_fs_stat.c index 0031596dcef157..14167d3f7756c0 100644 --- a/tests/posix/fs/src/test_fs_stat.c +++ b/tests/posix/fs/src/test_fs_stat.c @@ -21,7 +21,7 @@ static void create_file(const char *filename, uint32_t size) { int fh; - fh = open(filename, O_CREAT | O_WRONLY, 0440); + fh = open(filename, O_CREAT | O_WRONLY); zassert(fh >= 0, "Failed creating test file"); uint8_t filling[FILL_SIZE]; diff --git a/tests/posix/headers/prj.conf b/tests/posix/headers/prj.conf index e5c34983aeaf26..374baf4cbdfa69 100644 --- a/tests/posix/headers/prj.conf +++ b/tests/posix/headers/prj.conf @@ -22,4 +22,3 @@ CONFIG_POSIX_TIMERS=y CONFIG_POSIX_MESSAGE_PASSING=y CONFIG_EVENTFD=y CONFIG_POSIX_C_LIB_EXT=y -CONFIG_POSIX_DEVICE_IO=y diff --git a/tests/posix/headers/src/signal_h.c b/tests/posix/headers/src/signal_h.c index 76cde3e592d917..35616e4a29e545 100644 --- a/tests/posix/headers/src/signal_h.c +++ b/tests/posix/headers/src/signal_h.c @@ -6,8 +6,6 @@ #include "_common.h" -#include - #ifdef CONFIG_POSIX_API #include #else @@ -21,17 +19,13 @@ */ ZTEST(posix_headers, test_signal_h) { - typedef void *(*my_sig_handler_t)(int signo); - - my_sig_handler_t handler; - - handler = SIG_DFL; - handler = SIG_ERR; - handler = SIG_IGN; + /* zassert_not_equal(-1, SIG_DFL); */ /* not implemented */ + /* zassert_not_equal(-1, SIG_ERR); */ /* not implemented */ /* zassert_not_equal(-1, SIG_HOLD); */ /* not implemented */ + /* zassert_not_equal(-1, SIG_IGN); */ /* not implemented */ zassert_not_equal((sig_atomic_t)-1, (sig_atomic_t)0); - zassert_not_equal((pid_t)-1, (pid_t)0); + /* zassert_not_equal((pid_t)-1, (pid_t)0); */ /* not implemented */ zassert_not_equal(-1, offsetof(struct sigevent, sigev_notify)); zassert_not_equal(-1, offsetof(struct sigevent, sigev_signo)); @@ -53,15 +47,6 @@ ZTEST(posix_headers, test_signal_h) zassert_not_equal(-1, SIG_UNBLOCK); zassert_not_equal(-1, SIG_SETMASK); - zassert_not_equal(-1, offsetof(struct sigaction, sa_handler)); - zassert_not_equal(-1, offsetof(struct sigaction, sa_mask)); - zassert_not_equal(-1, offsetof(struct sigaction, sa_flags)); - zassert_not_equal(-1, offsetof(struct sigaction, sa_sigaction)); - - zassert_not_equal(-1, offsetof(siginfo_t, si_signo)); - zassert_not_equal(-1, offsetof(siginfo_t, si_code)); - zassert_not_equal(-1, offsetof(siginfo_t, si_value)); - /* zassert_not_equal(-1, SA_NOCLDSTOP); */ /* not implemented */ /* zassert_not_equal(-1, SA_ONSTACK); */ /* not implemented */ /* zassert_not_equal(-1, SA_RESETHAND); */ /* not implemented */ @@ -132,11 +117,18 @@ ZTEST(posix_headers, test_signal_h) /* zassert_not_equal(-1, CLD_STOPPED); */ /* not implemented */ /* zassert_not_equal(-1, CLD_CONTINUED); */ /* not implemented */ - zassert_not_equal(-1, SI_USER); - zassert_not_equal(-1, SI_QUEUE); - zassert_not_equal(-1, SI_TIMER); - zassert_not_equal(-1, SI_ASYNCIO); - zassert_not_equal(-1, SI_MESGQ); + /* zassert_not_equal(-1, POLL_IN); */ /* not implemented */ + /* zassert_not_equal(-1, POLL_OUT); */ /* not implemented */ + /* zassert_not_equal(-1, POLL_MSG); */ /* not implemented */ + /* zassert_not_equal(-1, POLL_ERR); */ /* not implemented */ + /* zassert_not_equal(-1, POLL_PRI); */ /* not implemented */ + /* zassert_not_equal(-1, POLL_HUP); */ /* not implemented */ + + /* zassert_not_equal(-1, SI_USER); */ /* not implemented */ + /* zassert_not_equal(-1, SI_QUEUE); */ /* not implemented */ + /* zassert_not_equal(-1, SI_TIMER); */ /* not implemented */ + /* zassert_not_equal(-1, SI_ASYNCIO); */ /* not implemented */ + /* zassert_not_equal(-1, SI_MESGQ); */ /* not implemented */ #ifdef CONFIG_POSIX_SIGNALS zassert_true(SIGRTMIN >= 0); @@ -166,40 +158,37 @@ ZTEST(posix_headers, test_signal_h) zassert_not_equal(-1, SIGXCPU); zassert_not_equal(-1, SIGXFSZ); zassert_not_equal(((sigset_t){.sig[0] = 0}).sig[0], ((sigset_t){.sig[0] = -1}).sig[0]); - zassert_not_null(abort); - zassert_not_null(alarm); - zassert_not_null(kill); - zassert_not_null(pause); - zassert_not_null(pthread_sigmask); - zassert_not_null(raise); - zassert_not_null(sigaction); - zassert_not_null(sigaddset); - zassert_not_null(sigdelset); zassert_not_null(sigemptyset); zassert_not_null(sigfillset); + zassert_not_null(sigaddset); + zassert_not_null(sigdelset); zassert_not_null(sigismember); - zassert_not_null(signal); - zassert_not_null(sigpending); - zassert_not_null(sigprocmask); - zassert_not_null(sigsuspend); - zassert_not_null(sigwait); zassert_not_null(strsignal); + zassert_not_null(sigprocmask); + zassert_not_null(pthread_sigmask); #endif /* CONFIG_POSIX_SIGNALS */ if (IS_ENABLED(CONFIG_POSIX_API)) { + /* zassert_not_null(kill); */ /* not implemented */ /* zassert_not_null(killpg); */ /* not implemented */ /* zassert_not_null(psiginfo); */ /* not implemented */ /* zassert_not_null(psignal); */ /* not implemented */ /* zassert_not_null(pthread_kill); */ /* not implemented */ + /* zassert_not_null(raise); */ /* not implemented */ + /* zassert_not_null(sigaction); */ /* not implemented */ /* zassert_not_null(sigaltstack); */ /* not implemented */ /* zassert_not_null(sighold); */ /* not implemented */ /* zassert_not_null(sigignore); */ /* not implemented */ /* zassert_not_null(siginterrupt); */ /* not implemented */ + /* zassert_not_null(signal); */ /* not implemented */ /* zassert_not_null(sigpause); */ /* not implemented */ + /* zassert_not_null(sigpending); */ /* not implemented */ /* zassert_not_null(sigqueue); */ /* not implemented */ /* zassert_not_null(sigrelse); */ /* not implemented */ /* zassert_not_null(sigset); */ /* not implemented */ + /* zassert_not_null(sigsuspend); */ /* not implemented */ /* zassert_not_null(sigtimedwait); */ /* not implemented */ + /* zassert_not_null(sigwait); */ /* not implemented */ /* zassert_not_null(sigwaitinfo); */ /* not implemented */ } } diff --git a/tests/posix/headers/src/sys_select_h.c b/tests/posix/headers/src/sys_select_h.c index ad1014c5b446d4..5cca45419712dd 100644 --- a/tests/posix/headers/src/sys_select_h.c +++ b/tests/posix/headers/src/sys_select_h.c @@ -22,15 +22,13 @@ ZTEST(posix_headers, test_sys_select_h) fd_set fds = {0}; zassert_not_equal(-1, FD_SETSIZE); + FD_CLR(0, &fds); + FD_ISSET(0, &fds); + FD_SET(0, &fds); + FD_ZERO(&fds); if (IS_ENABLED(CONFIG_POSIX_DEVICE_IO)) { - - FD_CLR(0, &fds); - FD_ISSET(0, &fds); - FD_SET(0, &fds); - FD_ZERO(&fds); - - zassert_not_null(pselect); + /* zassert_not_null(pselect); */ /* not implemented */ zassert_not_null(select); } } diff --git a/tests/subsys/display/cfb/basic/CMakeLists.txt b/tests/subsys/display/cfb/basic/CMakeLists.txt new file mode 100644 index 00000000000000..5126b0ec6aab8d --- /dev/null +++ b/tests/subsys/display/cfb/basic/CMakeLists.txt @@ -0,0 +1,34 @@ +# Copyright (c) 2024 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) + +project(cfb_basic) + +if(CONFIG_TEST_MSB_FIRST_FONT) + target_sources(app PRIVATE src/testdata.c + src/utils.c + src/clear.c + src/draw_point.c + src/draw_line.c + src/draw_rect.c + src/draw_text_rectspace1016.c + src/invert.c + src/invert_area.c + src/print_rectspace1016.c + src/cfb_font_rectspace1016_msb.c) +else() + target_sources(app PRIVATE src/testdata.c + src/utils.c + src/clear.c + src/draw_point.c + src/draw_line.c + src/draw_rect.c + src/draw_text_rectspace1016.c + src/invert.c + src/invert_area.c + src/print_rectspace1016.c + src/cfb_font_rectspace1016.c) +endif() diff --git a/tests/subsys/display/cfb/basic/Kconfig b/tests/subsys/display/cfb/basic/Kconfig new file mode 100644 index 00000000000000..b64e9572e355e0 --- /dev/null +++ b/tests/subsys/display/cfb/basic/Kconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2024 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +menu "Zephyr" +source "Kconfig.zephyr" +endmenu + +config TEST_MSB_FIRST_FONT + bool "Use MSB_FIRST font" diff --git a/tests/subsys/display/cfb/basic/prj.conf b/tests/subsys/display/cfb/basic/prj.conf new file mode 100644 index 00000000000000..37c9eb19e57387 --- /dev/null +++ b/tests/subsys/display/cfb/basic/prj.conf @@ -0,0 +1,11 @@ +# Copyright (c) 2024 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_ZTEST=y +CONFIG_DISPLAY=y +CONFIG_CHARACTER_FRAMEBUFFER=y +CONFIG_CHARACTER_FRAMEBUFFER_USE_DEFAULT_FONTS=n + +CONFIG_HEAP_MEM_POOL_SIZE=16384 + +CONFIG_LOG=y diff --git a/tests/subsys/display/cfb/basic/src/cfb_font_rectspace1016.c b/tests/subsys/display/cfb/basic/src/cfb_font_rectspace1016.c new file mode 100644 index 00000000000000..dc4b95d4c3e444 --- /dev/null +++ b/tests/subsys/display/cfb/basic/src/cfb_font_rectspace1016.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +const uint8_t cfb_font_1016_rectspace[1][20] = { + /* */ + { + 0xFF, 0xFF, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, + 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0xFF, 0xFF, + }, +}; + +FONT_ENTRY_DEFINE(font1016_rectspace, 10, 16, CFB_FONT_MONO_VPACKED, cfb_font_1016_rectspace, 32, + 33); diff --git a/tests/subsys/display/cfb/basic/src/cfb_font_rectspace1016_msb.c b/tests/subsys/display/cfb/basic/src/cfb_font_rectspace1016_msb.c new file mode 100644 index 00000000000000..460cea0202bce9 --- /dev/null +++ b/tests/subsys/display/cfb/basic/src/cfb_font_rectspace1016_msb.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +const uint8_t cfb_font_1016_rectspace[1][20] = { + /* */ + { + 0xFF, 0xFF, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, + 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xFF, 0xFF, + }, +}; + +FONT_ENTRY_DEFINE(font1016_rectspace, 10, 16, CFB_FONT_MONO_VPACKED | CFB_FONT_MSB_FIRST, + cfb_font_1016_rectspace, 32, 33); diff --git a/tests/subsys/display/cfb/basic/src/clear.c b/tests/subsys/display/cfb/basic/src/clear.c new file mode 100644 index 00000000000000..b0359564de8002 --- /dev/null +++ b/tests/subsys/display/cfb/basic/src/clear.c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include + +#include "testdata.h" +#include "utils.h" + +LOG_MODULE_REGISTER(clear, CONFIG_DISPLAY_LOG_LEVEL); + +static const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_display)); +static const uint32_t display_width = DT_PROP(DT_CHOSEN(zephyr_display), width); +static const uint32_t display_height = DT_PROP(DT_CHOSEN(zephyr_display), height); + +/** + * Fill the buffer with 0xAA before running tests. + */ +static void cfb_test_before(void *text_fixture) +{ + struct display_buffer_descriptor desc = { + .height = display_height, + .pitch = display_width, + .width = display_width, + .buf_size = display_height * display_width / 8, + }; + + memset(read_buffer, 0xAA, sizeof(read_buffer)); + zassert_ok(display_write(dev, 0, 0, &desc, read_buffer)); + + zassert_ok(display_blanking_off(dev)); + + zassert_ok(cfb_framebuffer_init(dev)); +} + +static void cfb_test_after(void *test_fixture) +{ + cfb_framebuffer_deinit(dev); +} + +ZTEST(clear, test_clear_false) +{ + zassert_ok(cfb_framebuffer_clear(dev, false)); + + /* checking memory not updated */ + zassert_false(verify_color_inside_rect(0, 0, 320, 240, 0x0)); +} + +ZTEST(clear, test_clear_true) +{ + zassert_ok(cfb_framebuffer_clear(dev, true)); + + zassert_true(verify_color_inside_rect(0, 0, 320, 240, 0x0)); +} + +ZTEST_SUITE(clear, NULL, NULL, cfb_test_before, cfb_test_after, NULL); diff --git a/tests/subsys/display/cfb/basic/src/draw_line.c b/tests/subsys/display/cfb/basic/src/draw_line.c new file mode 100644 index 00000000000000..1b2c3d5118abf5 --- /dev/null +++ b/tests/subsys/display/cfb/basic/src/draw_line.c @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include + +#include "testdata.h" +#include "utils.h" + +LOG_MODULE_REGISTER(draw_line, CONFIG_DISPLAY_LOG_LEVEL); + +static const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_display)); +static const uint32_t display_width = DT_PROP(DT_CHOSEN(zephyr_display), width); +static const uint32_t display_height = DT_PROP(DT_CHOSEN(zephyr_display), height); + +/** + * Fill the buffer with 0 before running tests. + */ +static void cfb_test_before(void *text_fixture) +{ + struct display_buffer_descriptor desc = { + .height = display_height, + .pitch = display_width, + .width = display_width, + .buf_size = display_height * display_width / 8, + }; + + memset(read_buffer, 0, sizeof(read_buffer)); + zassert_ok(display_write(dev, 0, 0, &desc, read_buffer)); + + zassert_ok(display_blanking_off(dev)); + + zassert_ok(cfb_framebuffer_init(dev)); +} + +static void cfb_test_after(void *test_fixture) +{ + cfb_framebuffer_deinit(dev); +} + +ZTEST(draw_line, test_draw_line_top_end) +{ + struct cfb_position start = {0, 0}; + struct cfb_position end = {display_width, 0}; + + zassert_ok(cfb_draw_line(dev, &start, &end)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_color_inside_rect(0, 0, display_width, 1, 0xFFFFFF)); +} + +ZTEST(draw_line, test_draw_line_left_end) +{ + struct cfb_position start = {0, 0}; + struct cfb_position end = {0, display_height}; + + zassert_ok(cfb_draw_line(dev, &start, &end)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_color_inside_rect(0, 0, 1, display_height, 0xFFFFFF)); +} + +ZTEST(draw_line, test_draw_right_end) +{ + struct cfb_position start = {display_width - 1, 0}; + struct cfb_position end = {display_width - 1, display_height}; + + zassert_ok(cfb_draw_line(dev, &start, &end)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_color_inside_rect(display_width - 1, 0, 1, display_height, 0xFFFFFF)); +} + +ZTEST(draw_line, test_draw_line_bottom_end) +{ + struct cfb_position start = {0, 239}; + struct cfb_position end = {display_width, 239}; + + zassert_ok(cfb_draw_line(dev, &start, &end)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_color_inside_rect(0, display_height - 1, display_width, 1, 0xFFFFFF)); +} + +ZTEST(draw_line, test_render_twice_on_same_tile) +{ + struct cfb_position start = {0, 0}; + struct cfb_position end = {display_width, 0}; + + zassert_ok(cfb_draw_line(dev, &start, &end)); + start.y = 7; + end.y = 7; + zassert_ok(cfb_draw_line(dev, &start, &end)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_color_inside_rect(0, 0, display_width, 1, 0xFFFFFF)); + zassert_true(verify_color_inside_rect(0, 1, display_width, 6, 0x0)); + zassert_true(verify_color_inside_rect(0, 7, display_width, 1, 0xFFFFFF)); + zassert_true(verify_color_inside_rect(0, 8, display_width, 232, 0x0)); +} + +ZTEST(draw_line, test_crossing_diagonally_end_to_end) +{ + struct cfb_position start = {0, 0}; + struct cfb_position end = {320, 240}; + + zassert_ok(cfb_draw_line(dev, &start, &end)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + for (size_t i = 0; i < 10; i++) { + zassert_true(verify_image(32 * i, 24 * i, diagonal3224, 32, 24)); + } +} + +ZTEST(draw_line, test_crossing_diagonally_from_outside_area) +{ + struct cfb_position start = {-32, -48}; + struct cfb_position end = {384, 264}; + + zassert_ok(cfb_draw_line(dev, &start, &end)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + for (size_t i = 0; i < 9; i++) { + zassert_true(verify_image(32 + 32 * i, 24 * i, diagonal3224, 32, 24)); + } +} + +ZTEST_SUITE(draw_line, NULL, NULL, cfb_test_before, cfb_test_after, NULL); diff --git a/tests/subsys/display/cfb/basic/src/draw_point.c b/tests/subsys/display/cfb/basic/src/draw_point.c new file mode 100644 index 00000000000000..ef78f212dc6d52 --- /dev/null +++ b/tests/subsys/display/cfb/basic/src/draw_point.c @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include + +#include "testdata.h" +#include "utils.h" + +LOG_MODULE_REGISTER(draw_point, CONFIG_DISPLAY_LOG_LEVEL); + +static const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_display)); +static const uint32_t display_width = DT_PROP(DT_CHOSEN(zephyr_display), width); +static const uint32_t display_height = DT_PROP(DT_CHOSEN(zephyr_display), height); + +/** + * Fill the buffer with 0 before running tests. + */ +static void cfb_test_before(void *text_fixture) +{ + struct display_buffer_descriptor desc = { + .height = display_height, + .pitch = display_width, + .width = display_width, + .buf_size = display_height * display_width / 8, + }; + + memset(read_buffer, 0, sizeof(read_buffer)); + zassert_ok(display_write(dev, 0, 0, &desc, read_buffer)); + + zassert_ok(display_blanking_off(dev)); + + zassert_ok(cfb_framebuffer_init(dev)); +} + +static void cfb_test_after(void *test_fixture) +{ + cfb_framebuffer_deinit(dev); +} + +/* + * normal rendering + */ +ZTEST(draw_point, test_draw_point_at_0_0) +{ + struct cfb_position pos = {0, 0}; + + zassert_ok(cfb_draw_point(dev, &pos)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_pixel_and_bg(0, 0, 1, 0)); +} + +ZTEST(draw_point, test_draw_point_at_1_1) +{ + struct cfb_position pos = {1, 1}; + + zassert_ok(cfb_draw_point(dev, &pos)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_pixel_and_bg(1, 1, 1, 0)); +} + +/* + * around tile border + */ +ZTEST(draw_point, test_draw_pont_at_9_15) +{ + struct cfb_position pos = {9, 15}; + + zassert_ok(cfb_draw_point(dev, &pos)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_pixel_and_bg(9, 15, 1, 0)); +} + +ZTEST(draw_point, test_draw_point_at_10_16) +{ + struct cfb_position pos = {10, 16}; + + zassert_ok(cfb_draw_point(dev, &pos)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_pixel_and_bg(10, 16, 1, 0)); +} + +ZTEST(draw_point, test_draw_point_at_11_17) +{ + struct cfb_position pos = {11, 17}; + + zassert_ok(cfb_draw_point(dev, &pos)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_pixel_and_bg(11, 17, 1, 0)); +} + +ZTEST(draw_point, test_draw_point_twice_on_same_tile) +{ + struct cfb_position pos = {10, 0}; + + pos.y = 7; + zassert_ok(cfb_draw_point(dev, &pos)); + + pos.y = 8; + zassert_ok(cfb_draw_point(dev, &pos)); + + pos.y = 9; + zassert_ok(cfb_draw_point(dev, &pos)); + + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_color_inside_rect(10, 7, 1, 3, 0xFFFFFF)); + zassert_true(verify_color_outside_rect(10, 7, 1, 3, 0x0)); +} + +ZTEST(draw_point, test_draw_point_outside_top_left) +{ + struct cfb_position pos = {0, -1}; + + zassert_ok(cfb_draw_point(dev, &pos)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_color_inside_rect(0, 0, display_width, display_height, 0)); +} + +ZTEST(draw_point, test_draw_point_outside_top_right) +{ + struct cfb_position pos = {display_width, 0}; + + zassert_ok(cfb_draw_point(dev, &pos)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_color_inside_rect(0, 0, display_width, display_height, 0)); +} + +ZTEST(draw_point, test_draw_point_outside_bottom_right) +{ + struct cfb_position pos = {0, display_height}; + + zassert_ok(cfb_draw_point(dev, &pos)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_color_inside_rect(0, 0, display_width, display_height, 0)); +} + +ZTEST(draw_point, test_draw_point_outside_bottom_left) +{ + struct cfb_position pos = {-1, display_height}; + + zassert_ok(cfb_draw_point(dev, &pos)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_color_inside_rect(0, 0, display_width, display_height, 0)); +} + +ZTEST_SUITE(draw_point, NULL, NULL, cfb_test_before, cfb_test_after, NULL); diff --git a/tests/subsys/display/cfb/basic/src/draw_rect.c b/tests/subsys/display/cfb/basic/src/draw_rect.c new file mode 100644 index 00000000000000..2c6b81d5d8b4fc --- /dev/null +++ b/tests/subsys/display/cfb/basic/src/draw_rect.c @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include + +#include "testdata.h" +#include "utils.h" + +LOG_MODULE_REGISTER(draw_rect, CONFIG_DISPLAY_LOG_LEVEL); + +static const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_display)); +static const uint32_t display_width = DT_PROP(DT_CHOSEN(zephyr_display), width); +static const uint32_t display_height = DT_PROP(DT_CHOSEN(zephyr_display), height); + +/** + * Fill the buffer with 0 before running tests. + */ +static void cfb_test_before(void *text_fixture) +{ + struct display_buffer_descriptor desc = { + .height = display_height, + .pitch = display_width, + .width = display_width, + .buf_size = display_height * display_width / 8, + }; + + memset(read_buffer, 0, sizeof(read_buffer)); + zassert_ok(display_write(dev, 0, 0, &desc, read_buffer)); + + zassert_ok(display_blanking_off(dev)); + + zassert_ok(cfb_framebuffer_init(dev)); +} + +static void cfb_test_after(void *test_fixture) +{ + cfb_framebuffer_deinit(dev); +} + +/* + * normal rendering + */ +ZTEST(draw_rect, test_draw_rect_1123_at_0_0) +{ + struct cfb_position start = {0, 0}; + struct cfb_position end = {start.x + 10, start.y + 22}; + + zassert_ok(cfb_draw_rect(dev, &start, &end), ""); + zassert_ok(cfb_framebuffer_finalize(dev), ""); + + zassert_true(verify_image_and_bg(0, 0, rectspace1123, 11, 23, 0), ""); +} + +ZTEST(draw_rect, test_draw_rect_1123_at_1_1) +{ + struct cfb_position start = {1, 1}; + struct cfb_position end = {start.x + 10, start.y + 22}; + + zassert_ok(cfb_draw_rect(dev, &start, &end), ""); + zassert_ok(cfb_framebuffer_finalize(dev), ""); + + zassert_true(verify_image_and_bg(1, 1, rectspace1123, 11, 23, 0), ""); +} + +/* tile border case */ +ZTEST(draw_rect, test_draw_rect_1123_at_9_15) +{ + struct cfb_position start = {9, 15}; + struct cfb_position end = {start.x + 10, start.y + 22}; + + zassert_ok(cfb_draw_rect(dev, &start, &end), ""); + zassert_ok(cfb_framebuffer_finalize(dev), ""); + + zassert_true(verify_image_and_bg(9, 15, rectspace1123, 11, 23, 0), ""); +} + +ZTEST(draw_rect, test_draw_rect_1123_at_10_16) +{ + struct cfb_position start = {10, 16}; + struct cfb_position end = {start.x + 10, start.y + 22}; + + zassert_ok(cfb_draw_rect(dev, &start, &end), ""); + zassert_ok(cfb_framebuffer_finalize(dev), ""); + + zassert_true(verify_image_and_bg(10, 16, rectspace1123, 11, 23, 0), ""); +} + +ZTEST(draw_rect, test_draw_rect_1123_at_11_17) +{ + struct cfb_position start = {11, 17}; + struct cfb_position end = {start.x + 10, start.y + 22}; + + zassert_ok(cfb_draw_rect(dev, &start, &end), ""); + zassert_ok(cfb_framebuffer_finalize(dev), ""); + + zassert_true(verify_image_and_bg(11, 17, rectspace1123, 11, 23, 0), ""); +} + +/* + * Case of including coordinates outside the area + */ +ZTEST(draw_rect, test_draw_rect_1123_outside_top_left) +{ + struct cfb_position start = {-(11 - 3), -(23 - 4)}; + struct cfb_position end = {start.x + 10, start.y + 22}; + + zassert_ok(cfb_draw_rect(dev, &start, &end), ""); + zassert_ok(cfb_framebuffer_finalize(dev), ""); + + zassert_true(verify_image_and_bg(0, 0, outside_top_left, 3, 4, 0), ""); +} + +ZTEST(draw_rect, test_draw_rect_1123_outside_top_right) +{ + struct cfb_position start = {display_width - 5, -(23 - 8)}; + struct cfb_position end = {start.x + 10, start.y + 22}; + + zassert_ok(cfb_draw_rect(dev, &start, &end), ""); + zassert_ok(cfb_framebuffer_finalize(dev), ""); + + zassert_true(verify_image(display_width - 5, 0, outside_top_right, 5, 8), ""); +} + +ZTEST(draw_rect, test_draw_rect_1123_outside_bottom_right) +{ + struct cfb_position start = {display_width - 3, display_height - 5}; + struct cfb_position end = {start.x + 10, start.y + 22}; + + zassert_ok(cfb_draw_rect(dev, &start, &end), ""); + zassert_ok(cfb_framebuffer_finalize(dev), ""); + + zassert_true( + verify_image(display_width - 3, display_height - 5, outside_bottom_right, 3, 5), + ""); +} + +ZTEST(draw_rect, test_draw_rect_1123_outside_bottom_left) +{ + struct cfb_position start = {-(11 - 3), display_height - 14}; + struct cfb_position end = {start.x + 10, start.y + 22}; + + zassert_ok(cfb_draw_rect(dev, &start, &end), ""); + zassert_ok(cfb_framebuffer_finalize(dev), ""); + + zassert_true(verify_image(0, display_height - 14, outside_bottom_left, 3, 14), ""); +} + +ZTEST_SUITE(draw_rect, NULL, NULL, cfb_test_before, cfb_test_after, NULL); diff --git a/tests/subsys/display/cfb/basic/src/draw_text_rectspace1016.c b/tests/subsys/display/cfb/basic/src/draw_text_rectspace1016.c new file mode 100644 index 00000000000000..faee4885601ace --- /dev/null +++ b/tests/subsys/display/cfb/basic/src/draw_text_rectspace1016.c @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include + +#include "testdata.h" +#include "utils.h" + +LOG_MODULE_REGISTER(draw_text_rectspace1016, CONFIG_DISPLAY_LOG_LEVEL); + +static const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_display)); +static const uint32_t display_width = DT_PROP(DT_CHOSEN(zephyr_display), width); +static const uint32_t display_height = DT_PROP(DT_CHOSEN(zephyr_display), height); + +/** + * Fill the buffer with 0 before running tests. + */ +static void cfb_test_before(void *text_fixture) +{ + struct display_buffer_descriptor desc = { + .height = display_height, + .pitch = display_width, + .width = display_width, + .buf_size = display_height * display_width / 8, + }; + uint8_t font_width; + uint8_t font_height; + bool font_found = false; + + memset(read_buffer, 0, sizeof(read_buffer)); + zassert_ok(display_write(dev, 0, 0, &desc, read_buffer)); + + zassert_ok(display_blanking_off(dev)); + + zassert_ok(cfb_framebuffer_init(dev)); + + for (int idx = 0; idx < cfb_get_numof_fonts(dev); idx++) { + if (cfb_get_font_size(dev, idx, &font_width, &font_height)) { + break; + } + + if (font_width == 10 && font_height == 16) { + cfb_framebuffer_set_font(dev, idx); + font_found = true; + break; + } + } + + zassert_true(font_found); +} + +static void cfb_test_after(void *test_fixture) +{ + cfb_framebuffer_deinit(dev); +} + +/* + * normal rendering + */ +ZTEST(draw_text_rectspace1016, test_draw_text_at_0_0) +{ + zassert_ok(cfb_draw_text(dev, " ", 0, 0)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(0, 0, rectspace1016, 10, 16, 0)); +} + +ZTEST(draw_text_rectspace1016, test_draw_text_at_1_1) +{ + zassert_ok(cfb_draw_text(dev, " ", 1, 1)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(1, 1, rectspace1016, 10, 16, 0)); +} + +/* + * around tile border + */ +ZTEST(draw_text_rectspace1016, test_draw_text_at_9_15) +{ + zassert_ok(cfb_draw_text(dev, " ", 9, 15)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(9, 15, rectspace1016, 10, 16, 0)); +} + +ZTEST(draw_text_rectspace1016, test_draw_text_at_10_16) +{ + zassert_ok(cfb_draw_text(dev, " ", 10, 16)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(10, 16, rectspace1016, 10, 16, 0)); +} + +ZTEST(draw_text_rectspace1016, test_draw_text_at_11_17) +{ + zassert_ok(cfb_draw_text(dev, " ", 11, 17)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(11, 17, rectspace1016, 10, 16, 0)); +} + +/* + * with kerning + */ +ZTEST(draw_text_rectspace1016, test_draw_text_at_0_0_kerning_3) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_draw_text(dev, " ", 0, 0)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(0, 0, kerning_3_2rectspace1016, 23, 16, 0)); +} + +ZTEST(draw_text_rectspace1016, test_draw_text_at_1_1_kerning_3) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_draw_text(dev, " ", 1, 1)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(1, 1, kerning_3_2rectspace1016, 23, 16, 0)); +} + +ZTEST(draw_text_rectspace1016, test_draw_text_at_9_15_kerning_3) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_draw_text(dev, " ", 9, 15)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(9, 15, kerning_3_2rectspace1016, 23, 16, 0)); +} + +ZTEST(draw_text_rectspace1016, test_draw_text_at_10_16_kerning_3) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_draw_text(dev, " ", 10, 16)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(10, 16, kerning_3_2rectspace1016, 23, 16, 0)); +} + +ZTEST(draw_text_rectspace1016, test_draw_text_at_11_17_kerning_3) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_draw_text(dev, " ", 11, 17)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(11, 17, kerning_3_2rectspace1016, 23, 16, 0)); +} + +ZTEST(draw_text_rectspace1016, test_draw_text_kerning_3_within_right_border) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_draw_text(dev, " ", display_width - 23, 17)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image(display_width - 23, 17, kerning_3_2rectspace1016, 23, 16)); +} + +ZTEST(draw_text_rectspace1016, test_draw_text_kerning_3_over_right_border) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_draw_text(dev, " ", display_width - 22, 17)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true( + verify_image(display_width - 22, 17, kerning_3_rightclip_1_2rectspace1016, 22, 16)); +} + +ZTEST(draw_text_rectspace1016, test_draw_text_outside_top_left) +{ + zassert_ok(cfb_draw_text(dev, " ", -(10 - 3), -(16 - 4))); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(0, 0, outside_top_left, 3, 4, 0)); +} + +ZTEST(draw_text_rectspace1016, test_draw_text_outside_top_right) +{ + zassert_ok(cfb_draw_text(dev, " ", display_width - 5, -(16 - 8))); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image(display_width - 5, 0, outside_top_right, 5, 8)); +} + +ZTEST(draw_text_rectspace1016, test_draw_text_outside_bottom_right) +{ + zassert_ok(cfb_draw_text(dev, " ", display_width - 3, display_height - 5)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true( + verify_image(display_width - 3, display_height - 5, outside_bottom_right, 3, 5)); +} + +ZTEST(draw_text_rectspace1016, test_draw_text_outside_bottom_left) +{ + zassert_ok(cfb_draw_text(dev, " ", -(10 - 3), display_height - 14)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image(0, display_height - 14, outside_bottom_left, 3, 14)); +} + +ZTEST_SUITE(draw_text_rectspace1016, NULL, NULL, cfb_test_before, cfb_test_after, NULL); diff --git a/tests/subsys/display/cfb/basic/src/invert.c b/tests/subsys/display/cfb/basic/src/invert.c new file mode 100644 index 00000000000000..fb13c6bc9e6219 --- /dev/null +++ b/tests/subsys/display/cfb/basic/src/invert.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include + +#include "testdata.h" +#include "utils.h" + +LOG_MODULE_REGISTER(invert, CONFIG_DISPLAY_LOG_LEVEL); + +static const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_display)); +static const uint32_t display_width = DT_PROP(DT_CHOSEN(zephyr_display), width); +static const uint32_t display_height = DT_PROP(DT_CHOSEN(zephyr_display), height); + +/** + * Fill the buffer with 0 before running tests. + */ +static void cfb_test_before(void *text_fixture) +{ + struct display_buffer_descriptor desc = { + .height = display_height, + .pitch = display_width, + .width = display_width, + .buf_size = display_height * display_width / 8, + }; + + memset(read_buffer, 0, sizeof(read_buffer)); + zassert_ok(display_write(dev, 0, 0, &desc, read_buffer)); + + zassert_ok(display_blanking_off(dev)); + + zassert_ok(cfb_framebuffer_init(dev)); +} + +static void cfb_test_after(void *test_fixture) +{ + cfb_framebuffer_deinit(dev); +} + +ZTEST(invert, test_invert) +{ + zassert_ok(cfb_framebuffer_invert(dev)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_color_inside_rect(0, 0, 320, 240, 0xFFFFFF)); +} + +ZTEST(invert, test_invert_contents) +{ + zassert_ok(cfb_invert_area(dev, 10, 10, 10, 10)); + zassert_ok(cfb_framebuffer_finalize(dev)); + zassert_true(verify_color_outside_rect(10, 10, 10, 10, 0)); + zassert_true(verify_color_inside_rect(10, 10, 10, 10, 0xFFFFFF)); + + zassert_ok(cfb_framebuffer_invert(dev)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_color_outside_rect(10, 10, 10, 10, 0xFFFFFF)); +} + +ZTEST_SUITE(invert, NULL, NULL, cfb_test_before, cfb_test_after, NULL); diff --git a/tests/subsys/display/cfb/basic/src/invert_area.c b/tests/subsys/display/cfb/basic/src/invert_area.c new file mode 100644 index 00000000000000..98b86559ff161a --- /dev/null +++ b/tests/subsys/display/cfb/basic/src/invert_area.c @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include + +#include "testdata.h" +#include "utils.h" + +LOG_MODULE_REGISTER(invert_area, CONFIG_DISPLAY_LOG_LEVEL); + +static const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_display)); +static const uint32_t display_width = DT_PROP(DT_CHOSEN(zephyr_display), width); +static const uint32_t display_height = DT_PROP(DT_CHOSEN(zephyr_display), height); + +/** + * Fill the buffer with 0 before running tests. + */ +static void cfb_test_before(void *text_fixture) +{ + struct display_buffer_descriptor desc = { + .height = display_height, + .pitch = display_width, + .width = display_width, + .buf_size = display_height * display_width / 8, + }; + + memset(read_buffer, 0, sizeof(read_buffer)); + zassert_ok(display_write(dev, 0, 0, &desc, read_buffer)); + + zassert_ok(display_blanking_off(dev)); + + zassert_ok(cfb_framebuffer_init(dev)); +} + +static void cfb_test_after(void *test_fixture) +{ + cfb_framebuffer_deinit(dev); +} + +ZTEST(invert_area, test_invert_area_whole_screen) +{ + zassert_ok(cfb_invert_area(dev, 0, 0, 320, 240)); + zassert_ok(cfb_framebuffer_finalize(dev), "cfb_framebuffer_finalize failed"); + + zassert_true(verify_color_inside_rect(0, 0, 320, 240, 0xFFFFFF)); +} + +ZTEST(invert_area, test_invert_area_overlapped_2times) +{ + zassert_ok(cfb_invert_area(dev, 33, 37, 79, 77)); + zassert_ok(cfb_invert_area(dev, 100, 37, 53, 77)); + zassert_ok(cfb_framebuffer_finalize(dev), "cfb_framebuffer_finalize failed"); + + zassert_true(verify_color_inside_rect(33, 37, 67, 77, 0xFFFFFF)); + zassert_true(verify_color_inside_rect(100, 37, 12, 77, 0x0)); + zassert_true(verify_color_inside_rect(112, 37, 41, 77, 0xFFFFFF)); + zassert_true(verify_color_outside_rect(33, 37, 120, 77, 0x0)); +} + +ZTEST(invert_area, test_invert_area_overlap_top_left) +{ + int err; + + err = cfb_invert_area(dev, -10, -10, 20, 20); + zassert_not_ok(err, "out of rect"); +} + +ZTEST(invert_area, test_invert_area_overlap_top_right) +{ + int err; + + err = cfb_invert_area(dev, 230, -10, 20, 20); + zassert_not_ok(err, "out of rect"); +} + +ZTEST(invert_area, test_invert_area_overlap_bottom_left) +{ + int err; + + err = cfb_invert_area(dev, -10, display_height - 10, 20, 20); + zassert_not_ok(err, "out of rect"); +} + +ZTEST(invert_area, test_invert_area_overlap_bottom_right) +{ + zassert_ok(cfb_invert_area(dev, display_width - 10, display_height - 10, 20, 20)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_color_inside_rect(display_width - 10, display_height - 10, 10, 10, + 0xFFFFFF)); + zassert_true( + verify_color_outside_rect(display_width - 10, display_height - 10, 10, 10, 0x0)); +} + +ZTEST(invert_area, test_invert_area_outside_top_left) +{ + zassert_not_ok(cfb_invert_area(dev, -10, -10, 10, 10), "out of rect"); +} + +ZTEST(invert_area, test_invert_area_outside_bottom_right) +{ + zassert_not_ok(cfb_invert_area(dev, display_width, display_height, 20, 20), "out of rect"); +} + +ZTEST_SUITE(invert_area, NULL, NULL, cfb_test_before, cfb_test_after, NULL); diff --git a/tests/subsys/display/cfb/basic/src/print_rectspace1016.c b/tests/subsys/display/cfb/basic/src/print_rectspace1016.c new file mode 100644 index 00000000000000..f1cf9dddfe4ab9 --- /dev/null +++ b/tests/subsys/display/cfb/basic/src/print_rectspace1016.c @@ -0,0 +1,222 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include + +#include "testdata.h" +#include "utils.h" + +LOG_MODULE_REGISTER(print_rectspace1016, CONFIG_DISPLAY_LOG_LEVEL); + +static const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_display)); +static const uint32_t display_width = DT_PROP(DT_CHOSEN(zephyr_display), width); +static const uint32_t display_height = DT_PROP(DT_CHOSEN(zephyr_display), height); + +/** + * Fill the buffer with 0 before running tests. + */ +static void cfb_test_before(void *text_fixture) +{ + struct display_buffer_descriptor desc = { + .height = display_height, + .pitch = display_width, + .width = display_width, + .buf_size = display_height * display_width / 8, + }; + uint8_t font_width; + uint8_t font_height; + bool font_found = false; + + memset(read_buffer, 0, sizeof(read_buffer)); + zassert_ok(display_write(dev, 0, 0, &desc, read_buffer)); + + zassert_ok(display_blanking_off(dev)); + + zassert_ok(cfb_framebuffer_init(dev)); + + for (int idx = 0; idx < cfb_get_numof_fonts(dev); idx++) { + if (cfb_get_font_size(dev, idx, &font_width, &font_height)) { + break; + } + + if (font_width == 10 && font_height == 16) { + cfb_framebuffer_set_font(dev, idx); + font_found = true; + break; + } + } + + zassert_true(font_found); +} + +static void cfb_test_after(void *test_fixture) +{ + cfb_framebuffer_deinit(dev); +} + +/* + * normal rendering + */ +ZTEST(print_rectspace1016, test_print_at_0_0) +{ + zassert_ok(cfb_print(dev, " ", 0, 0)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(0, 0, rectspace1016, 10, 16, 0)); +} + +ZTEST(print_rectspace1016, test_print_at_1_1) +{ + zassert_ok(cfb_print(dev, " ", 1, 1)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(1, 1, rectspace1016, 10, 16, 0)); +} + +/* + * around tile border + */ +ZTEST(print_rectspace1016, test_print_at_9_15) +{ + zassert_ok(cfb_print(dev, " ", 9, 15)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(9, 15, rectspace1016, 10, 16, 0)); +} + +ZTEST(print_rectspace1016, test_print_at_10_16) +{ + zassert_ok(cfb_print(dev, " ", 10, 16)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(10, 16, rectspace1016, 10, 16, 0)); +} + +ZTEST(print_rectspace1016, test_print_at_11_17) +{ + zassert_ok(cfb_print(dev, " ", 11, 17)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(11, 17, rectspace1016, 10, 16, 0)); +} + +/* + * kerning + */ +ZTEST(print_rectspace1016, test_print_at_0_0_kerning_3) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_print(dev, " ", 0, 0)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(0, 0, kerning_3_2rectspace1016, 23, 16, 0)); +} + +ZTEST(print_rectspace1016, test_print_at_1_1_kerning_3) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_print(dev, " ", 1, 1)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(1, 1, kerning_3_2rectspace1016, 23, 16, 0)); +} + +ZTEST(print_rectspace1016, test_print_at_9_15_kerning_3) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_print(dev, " ", 9, 15)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(9, 15, kerning_3_2rectspace1016, 23, 16, 0)); +} + +ZTEST(print_rectspace1016, test_print_at_10_16_kerning_3) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_print(dev, " ", 10, 16)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(10, 16, kerning_3_2rectspace1016, 23, 16, 0)); +} + +ZTEST(print_rectspace1016, test_print_at_11_17_kerning_3) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_print(dev, " ", 11, 17)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(11, 17, kerning_3_2rectspace1016, 23, 16, 0)); +} + +ZTEST(print_rectspace1016, test_print_kerning_3_within_right_border) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_print(dev, " ", display_width - 23, 17)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image(display_width - 23, 17, kerning_3_2rectspace1016, 23, 16)); +} + +ZTEST(print_rectspace1016, test_print_kerning_3_text_wrap) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_print(dev, " ", display_width - 22, 17)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image(display_width - 22, 17, rectspace1016, 10, 16)); + zassert_true(verify_image(0, 33, rectspace1016, 10, 16)); +} + +ZTEST(print_rectspace1016, test_print_outside_top_left) +{ + zassert_ok(cfb_print(dev, " ", -(10 - 3), -(16 - 4))); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(0, 0, outside_top_left, 3, 4, 0)); +} + +ZTEST(print_rectspace1016, test_print_outside_top_right) +{ + zassert_ok(cfb_print(dev, " ", display_width - 5, -8)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image_and_bg(0, 8, rectspace1016, 10, 16, 0)); +} + +ZTEST(print_rectspace1016, test_print_outside_bottom_right) +{ + zassert_ok(cfb_print(dev, " ", display_width - 3, display_height - 5)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_color_inside_rect(0, 0, display_width, display_height, 0)); +} + +ZTEST(print_rectspace1016, test_print_outside_bottom_left) +{ + zassert_ok(cfb_print(dev, " ", -(10 - 3), display_height - 14)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image(0, display_height - 14, outside_bottom_left, 3, 14)); +} + +ZTEST(print_rectspace1016, test_print_wrap_to_3_lines) +{ + cfb_set_kerning(dev, 3); + zassert_ok(cfb_print(dev, " ", 160, 17)); + zassert_ok(cfb_framebuffer_finalize(dev)); + + zassert_true(verify_image(160, 17, kerning_3_12rectspace1016, 153, 16)); + zassert_true(verify_image(0, 33, kerning_3_12rectspace1016, 153, 16)); + zassert_true(verify_image(156, 33, kerning_3_12rectspace1016, 153, 16)); + zassert_true(verify_image(0, 49, kerning_3_12rectspace1016, 153, 16)); + zassert_true(verify_image(13, 49, kerning_3_12rectspace1016, 153, 16)); +} + +ZTEST_SUITE(print_rectspace1016, NULL, NULL, cfb_test_before, cfb_test_after, NULL); diff --git a/tests/subsys/display/cfb/basic/src/testdata.c b/tests/subsys/display/cfb/basic/src/testdata.c new file mode 100644 index 00000000000000..b15b6918ae2ca5 --- /dev/null +++ b/tests/subsys/display/cfb/basic/src/testdata.c @@ -0,0 +1,726 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +uint32_t diagonal3224[] = { + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, +}; + +uint32_t kerning_3_12rectspace1016[] = { + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +}; + +uint32_t kerning_3_2rectspace1016[] = { + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +}; + +uint32_t kerning_3_rightclip_1_2rectspace1016[] = { + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, +}; + +uint32_t outside_bottom_left[] = { + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, +}; + +uint32_t outside_bottom_right[] = { + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, +}; + +uint32_t outside_top_left[] = { + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +}; + +uint32_t outside_top_right[] = { + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +}; + +uint32_t rectspace1016[] = { + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, +}; + +uint32_t rectspace1123[] = { + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, +}; + +#ifdef MAIN + +#include +#include + +/* + * Code to export embedded data as ppm + */ + +int to_ppm(const char *filename, uint32_t *buf, size_t w, size_t h) +{ + FILE *f = fopen(filename, "w"); + + fprintf(f, "P3\n"); + fprintf(f, "# %s\n", filename); + fprintf(f, "%lu %lu\n", w, h); + fprintf(f, "255\n"); + + for (size_t i = 0; i < (w * h); i++) { + fprintf(f, "%3d ", (buf[i] & 0xFF0000) >> 16); + fprintf(f, "%3d ", (buf[i] & 0x00FF00) >> 8); + fprintf(f, "%3d\n", (buf[i] & 0x0000FF) >> 0); + } + + fclose(f); + + return 0; +} + +int main(int argc, char *argv[]) +{ + to_ppm("diagonal3224.ppm", diagonal3224, 32, 24); + to_ppm("kerning_3_12rectspace1016.ppm", kerning_3_12rectspace1016, 153, 16); + to_ppm("kerning_3_2rectspace1016.ppm", kerning_3_2rectspace1016, 23, 16); + to_ppm("kerning_3_rightclip_1_2rectspace1016.ppm", kerning_3_rightclip_1_2rectspace1016, 22, + 16); + to_ppm("outside_bottom_left.ppm", outside_bottom_left, 3, 14); + to_ppm("outside_bottom_right.ppm", outside_bottom_right, 3, 5); + to_ppm("outside_top_left.ppm", outside_top_left, 3, 4); + to_ppm("outside_top_right.ppm", outside_top_right, 5, 8); + to_ppm("rectspace1016.ppm", rectspace1016, 10, 16); + to_ppm("rectspace1123.ppm", rectspace1123, 11, 23); + + return 0; +} + +#endif diff --git a/tests/subsys/display/cfb/basic/src/testdata.h b/tests/subsys/display/cfb/basic/src/testdata.h new file mode 100644 index 00000000000000..4a4db8de2fa3eb --- /dev/null +++ b/tests/subsys/display/cfb/basic/src/testdata.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef TESTS_SUBSYS_DISPLAY_CFB_DRAW_TEXT_AND_PRINT_SRC_TESTDATA_H__ +#define TESTS_SUBSYS_DISPLAY_CFB_DRAW_TEXT_AND_PRINT_SRC_TESTDATA_H__ + +#include + +extern uint32_t diagonal3224[]; +extern uint32_t kerning_3_12rectspace1016[]; +extern uint32_t kerning_3_2rectspace1016[]; +extern uint32_t kerning_3_rightclip_1_2rectspace1016[]; +extern uint32_t outside_bottom_left[]; +extern uint32_t outside_bottom_right[]; +extern uint32_t outside_top_left[]; +extern uint32_t outside_top_right[]; +extern uint32_t rectspace1016[]; +extern uint32_t rectspace1123[]; + +#endif /* TESTS_SUBSYS_DISPLAY_CFB_DRAW_TEXT_AND_PRINT_SRC_TESTDATA_H__ */ diff --git a/tests/subsys/display/cfb/basic/src/utils.c b/tests/subsys/display/cfb/basic/src/utils.c new file mode 100644 index 00000000000000..c96c367c9a37c0 --- /dev/null +++ b/tests/subsys/display/cfb/basic/src/utils.c @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "utils.h" + +#include +#include +#include +#include + +LOG_MODULE_REGISTER(cfb_test_draw_text_and_print_utils, CONFIG_CFB_LOG_LEVEL); + +static const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_display)); +static const uint32_t display_width = DT_PROP(DT_CHOSEN(zephyr_display), width); +static const uint32_t display_height = DT_PROP(DT_CHOSEN(zephyr_display), height); +uint8_t read_buffer[DT_PROP(DT_CHOSEN(zephyr_display), width) * + DT_PROP(DT_CHOSEN(zephyr_display), height) * 4]; + +inline uint32_t mono_pixel_order(uint32_t order) +{ + if (IS_ENABLED(CONFIG_SDL_DISPLAY_MONO_MSB_FIRST)) { + return BIT(7 - order); + } else { + return BIT(order); + } +} + +uint32_t display_pixel(int x, int y) +{ + const uint8_t *ptr = read_buffer + (display_width * (y / 8) + x); + struct display_capabilities display_caps; + + display_get_capabilities(dev, &display_caps); + + if (display_caps.current_pixel_format == PIXEL_FORMAT_MONO10) { + return !(*ptr & mono_pixel_order(y % 8)); + } + + return !!(*ptr & mono_pixel_order(y % 8)); +} + +uint32_t image_pixel(const uint32_t *img, size_t width, int x, int y) +{ + const uint32_t *ptr = img + (width * y + x); + + return !!(*ptr & 0xFFFFFF); +} + +bool verify_pixel(int x, int y, uint32_t color) +{ + struct display_buffer_descriptor desc = { + .height = display_height, + .pitch = display_width, + .width = display_width, + .buf_size = display_height * display_width / 8, + }; + + zassert_ok(display_read(dev, 0, 0, &desc, read_buffer), "display_read failed"); + + return ((!!display_pixel(x, y)) == (!!color)); +} + +bool verify_image(int cmp_x, int cmp_y, const uint32_t *img, size_t width, size_t height) +{ + struct display_buffer_descriptor desc = { + .height = display_height, + .pitch = display_width, + .width = display_width, + .buf_size = display_height * display_width / 8, + }; + + zassert_ok(display_read(dev, 0, 0, &desc, read_buffer), "display_read failed"); + + for (size_t y = 0; y < height; y++) { + for (size_t x = 0; x < width; x++) { + uint32_t disp_pix = display_pixel(cmp_x + x, cmp_y + y); + uint32_t img_pix = image_pixel(img, width, x, y); + + if (disp_pix != img_pix) { + LOG_INF("get_pixel(%d, %d) = %lu", x, y, disp_pix); + LOG_INF("pixel_color(%d, %d) = %lu", x, y, img_pix); + LOG_INF("disp@(0, %d) %p", y, read_buffer + (y * width / 8)); + LOG_HEXDUMP_INF(read_buffer + (y * width / 8), 64, ""); + LOG_INF("img@(0, %d) %p", y, (uint32_t *)img + (y * width)); + LOG_HEXDUMP_INF((uint32_t *)img + (y * width), 64, ""); + return false; + } + } + } + + return true; +} + +bool verify_color_inside_rect(int x, int y, size_t width, size_t height, uint32_t color) +{ + struct display_buffer_descriptor desc = { + .height = display_height, + .pitch = display_width, + .width = display_width, + .buf_size = display_height * display_width / 8, + }; + + zassert_ok(display_read(dev, 0, 0, &desc, read_buffer), "display_read failed"); + + for (size_t y_ = 0; y_ < height; y_++) { + for (size_t x_ = 0; x_ < width; x_++) { + uint32_t disp_pix = display_pixel(x + x_, y + y_); + + if (!!disp_pix != !!color) { + return false; + } + } + } + + return true; +} + +bool verify_color_outside_rect(int x, int y, size_t width, size_t height, uint32_t color) +{ + bool ret = true; + + if (x > 0) { + ret = verify_color_inside_rect(0, 0, x, y + height, color); + if (!ret) { + return false; + } + } + + if ((y + height) <= display_height) { + ret = verify_color_inside_rect(0, y + height, x + width, + display_height - (y + height), color); + if (!ret) { + return false; + } + } + + if ((x + width) <= display_width) { + ret = verify_color_inside_rect(x + width, y, display_width - (x + width), + display_height - y, color); + if (!ret) { + return false; + } + } + + if (y > 0) { + ret = verify_color_inside_rect(x, 0, display_width - x, y, color); + if (!ret) { + return false; + } + } + + return true; +} + +bool verify_image_and_bg(int x, int y, const uint32_t *img, size_t width, size_t height, + uint32_t color) +{ + bool ret = true; + + ret = verify_image(x, y, img, width, height); + if (!ret) { + return false; + } + + ret = verify_color_outside_rect(x, y, width, height, color); + + return ret; +} + +bool verify_pixel_and_bg(int x, int y, uint32_t pixcolor, uint32_t bgcolor) +{ + bool ret = true; + + ret = verify_pixel(x, y, pixcolor); + if (!ret) { + return false; + } + + ret = verify_color_outside_rect(x, y, 1, 1, bgcolor); + + return ret; +} diff --git a/tests/subsys/display/cfb/basic/src/utils.h b/tests/subsys/display/cfb/basic/src/utils.h new file mode 100644 index 00000000000000..c91375e93ce5a4 --- /dev/null +++ b/tests/subsys/display/cfb/basic/src/utils.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2024 TOKITA Hiroshi + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef TESTS_SUBSYS_DISPLAY_CFB_DRAW_TEXT_AND_PRINT_SRC_UTILS_H__ +#define TESTS_SUBSYS_DISPLAY_CFB_DRAW_TEXT_AND_PRINT_SRC_UTILS_H__ + +#include +#include +#include + +extern uint8_t read_buffer[DT_PROP(DT_CHOSEN(zephyr_display), width) * + DT_PROP(DT_CHOSEN(zephyr_display), height) * 4]; + +uint32_t display_pixel(int x, int y); +uint32_t image_pixel(const uint32_t *img, size_t width, int x, int y); +bool verify_pixel(int x, int y, uint32_t color); +bool verify_image(int x, int y, const uint32_t *img, size_t width, size_t height); +bool verify_color_inside_rect(int x, int y, size_t width, size_t height, uint32_t color); +bool verify_color_outside_rect(int x, int y, size_t width, size_t height, uint32_t color); +bool verify_image_and_bg(int x, int y, const uint32_t *img, size_t width, size_t height, + uint32_t color); +bool verify_pixel_and_bg(int x, int y, uint32_t pixcolor, uint32_t bgcolor); + +#endif /* TESTS_SUBSYS_DISPLAY_CFB_DRAW_TEXT_AND_PRINT_SRC_UTILS_H__ */ diff --git a/tests/subsys/display/cfb/basic/testcase.yaml b/tests/subsys/display/cfb/basic/testcase.yaml new file mode 100644 index 00000000000000..e0c997101d1600 --- /dev/null +++ b/tests/subsys/display/cfb/basic/testcase.yaml @@ -0,0 +1,58 @@ +# Copyright (c) 2024 TOKITA Hiroshi +# SPDX-License-Identifier: Apache-2.0 + +common: + tags: + - subsys + - cfb + filter: dt_chosen_enabled("zephyr,display") + build_only: true # The CI environment has no display device +tests: + cfb.basic.mono01: + filter: dt_compat_enabled("zephyr,sdl-dc") + extra_configs: + - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_MONO01=y + - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n + cfb.basic.mono10: + filter: dt_compat_enabled("zephyr,sdl-dc") + extra_configs: + - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_MONO10=y + - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n + cfb.basic.mono01.lsbfirst: + filter: dt_compat_enabled("zephyr,sdl-dc") + extra_configs: + - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_MONO01=y + - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n + - CONFIG_SDL_DISPLAY_MONO_MSB_FIRST=n + cfb.basic.mono10.lsbfirst: + filter: dt_compat_enabled("zephyr,sdl-dc") + extra_configs: + - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_MONO10=y + - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n + - CONFIG_SDL_DISPLAY_MONO_MSB_FIRST=n + cfb.basic.mono01.msbfirst_font: + filter: dt_compat_enabled("zephyr,sdl-dc") + extra_configs: + - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_MONO01=y + - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n + - CONFIG_TEST_MSB_FIRST_FONT=y + cfb.basic.mono10.msbfirst_font: + filter: dt_compat_enabled("zephyr,sdl-dc") + extra_configs: + - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_MONO10=y + - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n + - CONFIG_TEST_MSB_FIRST_FONT=y + cfb.basic.mono01.lsbfirst.msbfirst_font: + filter: dt_compat_enabled("zephyr,sdl-dc") + extra_configs: + - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_MONO01=y + - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n + - CONFIG_SDL_DISPLAY_MONO_MSB_FIRST=n + - CONFIG_TEST_MSB_FIRST_FONT=y + cfb.basic.mono10.lsbfirst.msbfirst_font: + filter: dt_compat_enabled("zephyr,sdl-dc") + extra_configs: + - CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_MONO10=y + - CONFIG_SDL_DISPLAY_USE_HARDWARE_ACCELERATOR=n + - CONFIG_SDL_DISPLAY_MONO_MSB_FIRST=n + - CONFIG_TEST_MSB_FIRST_FONT=y diff --git a/tests/subsys/logging/dictionary/CMakeLists.txt b/tests/subsys/logging/dictionary/CMakeLists.txt new file mode 100644 index 00000000000000..163d0c3ee51ec6 --- /dev/null +++ b/tests/subsys/logging/dictionary/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(logging_dictionary) + +target_sources(app PRIVATE src/main.c) diff --git a/tests/subsys/logging/dictionary/prj.conf b/tests/subsys/logging/dictionary/prj.conf new file mode 100644 index 00000000000000..2465b6cdd08a70 --- /dev/null +++ b/tests/subsys/logging/dictionary/prj.conf @@ -0,0 +1,9 @@ +CONFIG_LOG=y +CONFIG_LOG_PRINTK=y +CONFIG_LOG_BACKEND_UART_OUTPUT_DICTIONARY_HEX=y +CONFIG_LOG_BACKEND_UART_OUTPUT_DICTIONARY=y +CONFIG_LOG_BACKEND_UART=y + +# Immediate mode needed for twister/pytest +# to capture output without delays. +CONFIG_LOG_MODE_IMMEDIATE=y diff --git a/tests/subsys/logging/dictionary/pytest/conftest.py b/tests/subsys/logging/dictionary/pytest/conftest.py new file mode 100644 index 00000000000000..29d3de55d10bf6 --- /dev/null +++ b/tests/subsys/logging/dictionary/pytest/conftest.py @@ -0,0 +1,14 @@ +# +# Copyright (c) 2024 Intel Corporation. +# +# SPDX-License-Identifier: Apache-2.0 +# + +import pytest + +def pytest_addoption(parser): + parser.addoption('--fpu', action="store_true") + +@pytest.fixture() +def is_fpu_build(request): + return request.config.getoption('--fpu') diff --git a/tests/subsys/logging/dictionary/pytest/test_logging_dictionary.py b/tests/subsys/logging/dictionary/pytest/test_logging_dictionary.py new file mode 100644 index 00000000000000..68548ce47677db --- /dev/null +++ b/tests/subsys/logging/dictionary/pytest/test_logging_dictionary.py @@ -0,0 +1,159 @@ +# +# Copyright (c) 2024 Intel Corporation. +# +# SPDX-License-Identifier: Apache-2.0 +# + +''' +Pytest harness to test the output of the dictionary logging. +''' + +import logging +import os +import shlex +import subprocess +import re + +from twister_harness import DeviceAdapter + +ZEPHYR_BASE = os.getenv("ZEPHYR_BASE") + +logger = logging.getLogger(__name__) + +def process_logs(dut: DeviceAdapter, build_dir): + ''' + This grabs the encoded log from console and parse the log + through the dictionary logging parser. + + Returns the decoded log lines. + ''' + # Make sure the log parser script is there... + parser_script = os.path.join(ZEPHYR_BASE, "scripts", "logging", "dictionary", "log_parser.py") + assert os.path.isfile(parser_script) + logger.info(f'Log parser script: {parser_script}') + + # And also the dictionary JSON file is there... + dictionary_json = os.path.join(build_dir, "zephyr", "log_dictionary.json") + assert os.path.isfile(dictionary_json) + logger.info(f'Dictionary JSON: {dictionary_json}') + + # Read the encoded logs and save them to a file + # as the log parser requires file as input + handler_output = dut.readlines_until(regex = '^##ZLOGV1##[0-9]+', timeout = 10.0) + + encoded_logs = handler_output[-1] + + encoded_log_file = os.path.join(build_dir, "encoded.log") + with open(encoded_log_file, 'w', encoding='utf-8') as fp: + fp.write(encoded_logs) + + # Run the log parser + cmd = [parser_script, '--hex', dictionary_json, encoded_log_file] + logger.info(f'Running parser script: {shlex.join(cmd)}') + result = subprocess.run(cmd, capture_output=True, text=True, check=True) + assert result.returncode == 0 + + # Grab the decoded log lines from stdout, print a copy and return it + decoded_logs = result.stdout + logger.info(f'Decoded logs: {decoded_logs}') + + return decoded_logs + + +def expected_regex_common(): + ''' + Return an array of compiled regular expression for matching + the decoded log lines. + ''' + return [ + # *** Booting Zephyr OS build *** + re.compile(r'^[*][*][*] Booting Zephyr OS build [0-9a-z.-]+'), + # Hello World! + re.compile(r'[\s]+Hello World! [\w-]+'), + # [ 10] hello_world: error string + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: error string'), + # [ 10] hello_world: main: debug string + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: main: debug string'), + # [ 10] hello_world: info string + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: info string'), + # [ 10] hello_world: main: int8_t 1, uint8_t 2 + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: main: int8_t 1, uint8_t 2'), + # [ 10] hello_world: main: int16_t 16, uint16_t 17 + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: main: int16_t 16, uint16_t 17'), + # [ 10] hello_world: main: int32_t 32, uint32_t 33 + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: main: int32_t 32, uint32_t 33'), + # [ 10] hello_world: main: int64_t 64, uint64_t 65 + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: main: int64_t 64, uint64_t 65'), + # [ 10] hello_world: main: char ! + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: main: char !'), + # [ 10] hello_world: main: s str static str c str + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: main: s str static str c str'), + # [ 10] hello_world: main: d str dynamic str + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: main: d str dynamic str'), + # [ 10] hello_world: main: mixed str dynamic str --- dynamic str \ + # --- another dynamic str --- another dynamic str + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: main: mixed str dynamic str ' + '--- dynamic str --- another dynamic str --- another dynamic str'), + # [ 10] hello_world: main: mixed c/s ! static str dynamic str static str ! + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: main: mixed c/s ! static str ' + 'dynamic str static str !'), + # [ 10] hello_world: main: pointer 0x1085f9 + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: main: pointer 0x[0-9a-f]+'), + # [ 10] hello_world: main: For HeXdUmP! + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: main: For HeXdUmP!'), + # 48 45 58 44 55 4d 50 21 20 48 45 58 44 55 4d 50 |HEXDUMP! HEXDUMP + re.compile(r'[\s]+[ ]+[0-9a-f ]{48,52}[|]HEXDUMP! HEXDUMP'), + # 40 20 48 45 58 44 55 4d 50 23 |@ HEXDUM P# + re.compile(r'[\s]+[ ]+[0-9a-f ]{48,52}[|]@ HEXDUM P#'), + ] + + +def expected_regex_fpu(): + ''' + Return an array of additional compiled regular expression for matching + the decoded log lines for FPU builds. + ''' + return [ + # [ 10] hello_world: main: float 66.669998, double 68.690000 + re.compile(r'[\s]+[\[][0-9,:\. ]+[\]] hello_world: main: ' + r'float 66[\.][0-9-\.]+, double 68[\.][0-9-\.]+'), + ] + + +def regex_matching(decoded_logs, expected_regex): + ''' + Given the decoded log lines and an array of compiled regular expression, + match all of them and display whether a line is found or not. + + Return True if all regular expressions have corresponding matches, + False otherwise. + ''' + regex_results = [ex_re.search(decoded_logs) for ex_re in expected_regex] + + # Using 1:1 mapping between regex_results and expected_regex, so + # cannot use enumeration. + # + # pylint: disable=consider-using-enumerate + for idx in range(len(regex_results)): + if regex_results[idx]: + logger.info(f'Found: {regex_results[idx].group(0).strip()}') + else: + logger.info(f'NOT FOUND: {expected_regex[idx]}') + + return all(regex_results) + + +def test_logging_dictionary(dut: DeviceAdapter, is_fpu_build): + ''' + Main entrance to setup test result validation. + ''' + build_dir = dut.device_config.build_dir + + logger.info(f'FPU build? {is_fpu_build}') + + decoded_logs = process_logs(dut, build_dir) + + assert regex_matching(decoded_logs, expected_regex_common()) + + if is_fpu_build: + assert regex_matching(decoded_logs, expected_regex_fpu()) diff --git a/tests/subsys/logging/dictionary/src/main.c b/tests/subsys/logging/dictionary/src/main.c new file mode 100644 index 00000000000000..1e4b5f3fecf0ec --- /dev/null +++ b/tests/subsys/logging/dictionary/src/main.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2012-2014 Wind River Systems, Inc. + * Copyright (c) 2021 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(hello_world, LOG_LEVEL_DBG); + +static const char *hexdump_msg = "HEXDUMP! HEXDUMP@ HEXDUMP#"; + +int main(void) +{ + int8_t i8 = 1; + uint8_t u8 = 2; + int16_t i16 = 16; + uint16_t u16 = 17; + int32_t i32 = 32; + uint32_t u32 = 33; + int64_t i64 = 64; + uint64_t u64 = 65; + char c = '!'; + char *s = "static str"; + char *s1 = "c str"; + char vs0[32]; + char vs1[32]; + void *p = s; + + printk("Hello World! %s\n", CONFIG_BOARD); + + LOG_ERR("error string"); + LOG_DBG("debug string"); + LOG_INF("info string"); + + LOG_DBG("int8_t %" PRId8 ", uint8_t %" PRIu8, i8, u8); + LOG_DBG("int16_t %" PRId16 ", uint16_t %" PRIu16, i16, u16); + LOG_DBG("int32_t %" PRId32 ", uint32_t %" PRIu32, i32, u32); + LOG_DBG("int64_t %" PRId64 ", uint64_t %" PRIu64, i64, u64); + + memset(vs0, 0, sizeof(vs0)); + snprintk(&vs0[0], sizeof(vs0), "%s", "dynamic str"); + + memset(vs1, 0, sizeof(vs1)); + snprintk(&vs1[0], sizeof(vs1), "%s", "another dynamic str"); + + LOG_DBG("char %c", c); + LOG_DBG("s str %s %s", s, s1); + LOG_DBG("d str %s", vs0); + LOG_DBG("mixed str %s %s %s %s %s %s %s", vs0, "---", vs0, "---", vs1, "---", vs1); + LOG_DBG("mixed c/s %c %s %s %s %c", c, s, vs0, s, c); + + LOG_DBG("pointer %p", p); + + LOG_HEXDUMP_DBG(hexdump_msg, strlen(hexdump_msg), "For HeXdUmP!"); + +#ifdef CONFIG_FPU + float f = 66.67; + double d = 68.69; + + LOG_DBG("float %f, double %f", (double)f, d); +#ifdef CONFIG_CBPRINTF_PACKAGE_LONGDOUBLE + long double ld = 70.71L; + + LOG_DBG("long double %Lf", ld); +#endif +#endif + +#if defined(CONFIG_STDOUT_CONSOLE) + /* + * When running through twister with pytest, we need to add a newline + * at the end of logging output for the output to be registered via + * pipe or FIFO in the pytest harness as reading is on a line-by-line + * basis. So send newline characters to flush the output. + */ + fputc('\r', stdout); + fputc('\n', stdout); +#endif + + return 0; +} + +static int rt_demo_cmd(const struct shell *sh, size_t argc, char **argv) +{ + ARG_UNUSED(sh); + LOG_ERR("demo %s", argc > 1 ? argv[1] : ""); + LOG_WRN("demo %s", argc > 1 ? argv[1] : ""); + LOG_INF("demo %s", argc > 1 ? argv[1] : ""); + LOG_DBG("demo %s", argc > 1 ? argv[1] : ""); + + return 0; +} + +SHELL_CMD_REGISTER(log_rt_demo, NULL, "Command can be used to test runtime filtering", rt_demo_cmd); diff --git a/tests/subsys/logging/dictionary/testcase.yaml b/tests/subsys/logging/dictionary/testcase.yaml new file mode 100644 index 00000000000000..91f00946d7745f --- /dev/null +++ b/tests/subsys/logging/dictionary/testcase.yaml @@ -0,0 +1,34 @@ +common: + # For twister runs, the following arch/platforms use logging backends + # which do not output dictionary logging in hexidecimal format, + # and thus cannot be used for testing. Currently, only UART + # logging backend does that. + arch_exclude: + - posix + platform_exclude: + - qemu_xtensa + - qemu_xtensa/dc233c/mmu +tests: + logging.dictionary: + tags: logging + integration_platforms: + - qemu_x86 + - qemu_x86_64 + harness: pytest + harness_config: + pytest_root: + - "pytest/test_logging_dictionary.py" + logging.dictionary.fpu: + tags: logging + filter: CONFIG_CPU_HAS_FPU + extra_configs: + - CONFIG_FPU=y + harness: pytest + harness_config: + pytest_root: + - "pytest/test_logging_dictionary.py" + pytest_args: + - "--fpu" + integration_platforms: + - qemu_x86 + - qemu_x86_64 diff --git a/tests/subsys/pm/device_driver_init/src/main.c b/tests/subsys/pm/device_driver_init/src/main.c index d01a83d3ca68dc..014e02a59409b4 100644 --- a/tests/subsys/pm/device_driver_init/src/main.c +++ b/tests/subsys/pm/device_driver_init/src/main.c @@ -29,7 +29,7 @@ ZTEST(device_driver_init, test_device_driver_init) { -#if IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME) +#if defined(CONFIG_PM_DEVICE_RUNTIME) enum pm_device_state state; int rc; state = -1; diff --git a/tests/subsys/settings/functional/src/settings_basic_test.c b/tests/subsys/settings/functional/src/settings_basic_test.c index 5798605a5a709e..f77c87db71d73c 100644 --- a/tests/subsys/settings/functional/src/settings_basic_test.c +++ b/tests/subsys/settings/functional/src/settings_basic_test.c @@ -21,7 +21,7 @@ LOG_MODULE_REGISTER(settings_basic_test); #if DT_HAS_CHOSEN(zephyr_settings_partition) #define TEST_FLASH_AREA_ID DT_FIXED_PARTITION_ID(DT_CHOSEN(zephyr_settings_partition)) #endif -#elif IS_ENABLED(CONFIG_SETTINGS_FILE) +#elif defined(CONFIG_SETTINGS_FILE) #include #include #else @@ -38,7 +38,7 @@ LOG_MODULE_REGISTER(settings_basic_test); */ ZTEST(settings_functional, test_clear_settings) { -#if !IS_ENABLED(CONFIG_SETTINGS_FILE) +#if !defined(CONFIG_SETTINGS_FILE) const struct flash_area *fap; int rc; diff --git a/tests/subsys/storage/stream/stream_flash/src/main.c b/tests/subsys/storage/stream/stream_flash/src/main.c index 7b4627101c236c..58fbb6e35bbb21 100644 --- a/tests/subsys/storage/stream/stream_flash/src/main.c +++ b/tests/subsys/storage/stream/stream_flash/src/main.c @@ -72,9 +72,9 @@ int stream_flash_callback(uint8_t *buf, size_t len, size_t offset) static void erase_flash(void) { -#if IS_ENABLED(CONFIG_FLASH_HAS_EXPLICIT_ERASE) +#if defined(CONFIG_FLASH_HAS_EXPLICIT_ERASE) int rc; -#if IS_ENABLED(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE) +#if defined(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE) const struct flash_parameters *fparam = flash_get_parameters(fdev); if (!(flash_params_get_erase_cap(fparam) & FLASH_ERASE_C_EXPLICIT)) { diff --git a/west.yml b/west.yml index 386efbe778bb2b..5f96e1de784560 100644 --- a/west.yml +++ b/west.yml @@ -124,7 +124,7 @@ manifest: revision: 6489e771e9c405f1763b52d64a3f17a1ec488ace path: modules/lib/cmsis-dsp - name: cmsis-nn - revision: 0c8669d81381ccf3b1a01d699f3b68b50134a99f + revision: ea987c1ca661be723de83bd159aed815d6cbd430 path: modules/lib/cmsis-nn - name: edtt revision: 8d7b543d4d2f2be0f78481e4e1d8d73a88024803 @@ -157,7 +157,7 @@ manifest: groups: - hal - name: hal_espressif - revision: 826077a9d9c762ea7033f137b992b1b36b4aeacb + revision: 61b977fd2b033c656b1b2fa07b3137872236f710 path: modules/hal/espressif west-commands: west/west-commands.yml groups: @@ -234,7 +234,7 @@ manifest: groups: - hal - name: hal_stm32 - revision: 855f195793df094644ce8b8617c01275408bbf58 + revision: 2d9f67657064e91865fa6a08ac17868572ff2e3d path: modules/hal/stm32 groups: - hal @@ -327,7 +327,7 @@ manifest: groups: - crypto - name: trusted-firmware-m - revision: 8df9cc8baf46252fd188bba1d87333a8daa9a5e8 + revision: f8d3a903578192d226ac1552f383d95b94ee8780 path: modules/tee/tf-m/trusted-firmware-m groups: - tee