Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling POSIX_API leads to SSL handshake error #35401

Closed
mglettig opened this issue May 18, 2021 · 6 comments · Fixed by #35461
Closed

Enabling POSIX_API leads to SSL handshake error #35401

mglettig opened this issue May 18, 2021 · 6 comments · Fixed by #35461
Labels
area: POSIX POSIX API Library bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@mglettig
Copy link

Describe the bug
As soon as CONFIG_POSIX_API=y is set SSL handshake no longer works:
net_sock_tls: TLS handshake error: -2700

To Reproduce
Steps to reproduce the behavior:

  1. Build http_client sample with overlay-tls.conf for QEMU.
  2. Everthing works given that networking is configured correctly
  3. Rebuild http_client with CONFIG_POSIX_API=y. Make sure to resolve compile issues by creating libc_extensions where needed.
  4. See error

Expected behavior
I would expect that CONFIG_POSIX_API would not affect SSL handshake. I need a system with civetweb and https client at the same time. Unfortunately civetweb needs CONFIG_POSIX_API.

Impact
Showstopper.

Logs and console output
[00:00:03.250,000] <err> net_sock_tls: TLS handshake error: -2700

Environment (please complete the following information):

  • OS: Linux
  • Toolchain: Zephyr SDK
  • Zephyr Version 2.6.0-rc1

Additional context
Add any other context about the problem here.

@mglettig mglettig added the bug The issue is a bug, or the PR is fixing a bug label May 18, 2021
@galak galak added priority: low Low impact/importance bug area: POSIX POSIX API Library labels May 18, 2021
@rlubos
Copy link
Contributor

rlubos commented May 19, 2021

The issue seems to be MBEDTLS_HAVE_DATE_TIME option, which is enforced by the CONFIG_POSIX_API (https:/zephyrproject-rtos/zephyr/blob/main/modules/mbedtls/configs/config-tls-generic.h#L29). After enabling this option, mbedTLS expects to have a valid time in the system, and since there's no valid time on QEMU, the certificate validity check fails (either expired or not yet valid).

IMO we should rather provide an option in mbedTLS' Kconfig that would allow the user to select whether to use date/time validation in mbedTLS instead of depending on the POSIX_API option, what do you think @jukkar?

@jukkar
Copy link
Member

jukkar commented May 19, 2021

IMO we should rather provide an option in mbedTLS' Kconfig that would allow the user to select whether to use date/time validation in mbedTLS instead of depending on the POSIX_API option

I agree, using Posix API to decide that sounds error prone as we have seen.

@rlubos
Copy link
Contributor

rlubos commented May 19, 2021

Ok, I'll send a PR then, thanks.

Make sure to resolve compile issues by creating libc_extensions where needed.

BTW, you don't need to create anything on your own, just include appropiate POSIX headers in the sample/lib. For me the following set of headers was enough:

#include <posix/arpa/inet.h>
#include <posix/sys/socket.h>
#include <posix/unistd.h>

We should probably switch to the zsock_ API in the library so that we're not dependent on the POSIX configuration in the system.

@mglettig
Copy link
Author

@rlubos Thanks for finding out what is causing this issue and thanks for providing a PR. I think it's a great sugestion to decouple the civetweb lib from the POSIX API. Do you thank those change would get accepted by civetweb project or would it be necessary to maintain a Zephyr specific version of civetweb?

@rlubos
Copy link
Contributor

rlubos commented May 19, 2021

I think it's a great sugestion to decouple the civetweb lib from the POSIX API. Do you thank those change would get accepted by civetweb project or would it be necessary to maintain a Zephyr specific version of civetweb?

Oh, I think you've misunderstood me - I've meant the http_client library from Zephyr, used by the sample referenced in this issue. As for the civetweb, I'm not able to comment unfortunately, as I don't know the details of the library, but given that it seems to rely not only on the socket API but also other APIs provided by POSIX, I don't think it'd be a trivial task.

And actually, if the civetweb intends to be a truly portable library, there's nothing wrong in using standard POSIX APIs IMO (that's not the case for the Zephyr's native http library since it's intended for Zephyr only). It's rather Zephyr who should provide missing POSIX pieces needed for the library (but again, I know too little about the library in order to comment on how much is missing).

rlubos added a commit to rlubos/zephyr that referenced this issue May 20, 2021
Currently the MBEDTLS_HAVE_TIME_DATE mbedTLS option is enabled based on
the CONFIG_POSIX_API option. This doesn't seem right, since the enabling
the POSIX API does not guarantee that there is a valid time source in
the system. This was the case for the qemu_x86 platform, where enabling
POSIX_API caused TLS handshake failures due to certificate validation
errors caused by no valid time avaialble in the system.

Fix this by adding a specific KConfig entry for date/time configuration
in mbedTLS. Applications that need to enforce date verification in
mbedTLS should enable it explicitly instead of relying on the
non-obvious implicit configuration.

Fixes zephyrproject-rtos#35401

Signed-off-by: Robert Lubos <[email protected]>
@mglettig
Copy link
Author

@rlubos Ok I unterstand. You are of course right. I think refactoring http_client library to use the zsock_ functions makes sense.

Regarding the actual issue and your PR. I verified on my setup that this solves the issue by manually disabling both compile switches: #define MBEDTLS_HAVE_TIME and #define MBEDTLS_HAVE_TIME_DATE. Thanks again. Looking forward to see that this PR gets applied to mainline and hopefully soon to the Nordic fork of Zephyr (which will be the one I'm going to use).

galak pushed a commit that referenced this issue Jun 1, 2021
Currently the MBEDTLS_HAVE_TIME_DATE mbedTLS option is enabled based on
the CONFIG_POSIX_API option. This doesn't seem right, since the enabling
the POSIX API does not guarantee that there is a valid time source in
the system. This was the case for the qemu_x86 platform, where enabling
POSIX_API caused TLS handshake failures due to certificate validation
errors caused by no valid time avaialble in the system.

Fix this by adding a specific KConfig entry for date/time configuration
in mbedTLS. Applications that need to enforce date verification in
mbedTLS should enable it explicitly instead of relying on the
non-obvious implicit configuration.

Fixes #35401

Signed-off-by: Robert Lubos <[email protected]>
sabhiram added a commit to recogni/zephyr that referenced this issue Sep 16, 2021
* arm: shrink names for null-pointer exception detection Kconfigs

Reduce the length of the Kconfig defines related to
null-pointed dereference detection in Cortex-M.

Signed-off-by: Ioannis Glaropoulos <[email protected]>

* arm: cortex-m: shrink hidden option for null-pointer detection

Shrink the name of the hidden cortex-m option for the
null-pointer dereference detection feature.

Signed-off-by: Ioannis Glaropoulos <[email protected]>

* boards: arm: Update frdm_k64f and mimxrt10{60,64}_evk board docs

Updates board documentation for several NXP boards to reflect currently
supported features, NXP documentation links, clarifications on debug
probes, additional troubleshooting tips, and some minor editorial
changes.

Signed-off-by: Derek Snell <[email protected]>
Signed-off-by: Maureen Helm <[email protected]>

* MAINTAINERS.yml: Add myself as ARM collaborator

Currently the Cortex-R platform has no one watching over it.  Submitting
myself to help with the Cortex-R parts of the ARM architecture.

Signed-off-by: Bradley Bolen <[email protected]>

* tests: ztest: Use #if defined()

This compile test should be checking if a symbol has been defined,
otherwise it is using the kconfig value directly.  This fixes a warning

../src/main.c:115:37: warning: "CONFIG_SOC_QEMU_ARC" is not defined,
evaluates to 0 [-Wundef]

when using the -Wundef flag.

Signed-off-by: Bradley Bolen <[email protected]>

* nios2: max10: fix uart0 base register

Fix register for uart0.

Signed-off-by: Anas Nashif <[email protected]>

* boards: max10: fix function name in debug section

_Cstart was renamed, fix the docs to reflect that.

Signed-off-by: Anas Nashif <[email protected]>

* nios2: revert back to builtin sys_io functions

Some time ago we did a cleanup of sys_io function and left nios2 broken,
especially on the MAX10 board. Revert back to the original
implementation for this architecture.

Fixes #35694

Signed-off-by: Anas Nashif <[email protected]>

* kernel: k_sleep: fix return value for absolute timeout

Fixes calculation of remaining ticks returned from z_tick_sleep
so that it takes absolute timeouts into account.

Fixes #32506

Signed-off-by: Lauren Murphy <[email protected]>

* dts: same70: use lower case letter in tc0 reg address

The change removes the following warning:
Warning: /soc/tc@4000C000: simple-bus unit address format error,
         expected "4000c000"

Signed-off-by: Piotr Mienkowski <[email protected]>

* sensor: qdec_sam: use compatible atmel,sam-tc-qdec

Change the drivers's compatible from atmel,sam-tc to atmel,sam-tc-qdec.
The atmel,sam-tc should be reserved for the future counter driver.

Signed-off-by: Piotr Mienkowski <[email protected]>

* ARC: gcc-m-cpu: use -mcpu=archs as a default for ARCv2 HS

Due to the fact that we use -mcpu=hs as a default for ARCv2 HS
the compiler doesn't generate multiply/divide/mac/64bit memory
operations instructions.

Fix that by using -mcpu=archs as a default for ARCv2 HS which is
fits for all existing boards with ARCv2 HS CPU.

Signed-off-by: Eugeniy Paltsev <[email protected]>
Signed-off-by: Evgeniy Paltsev <[email protected]>

* soc: arm: nxp: kinetis: k2x: remove MPU support

Remove (disabled) MPU support for the NXP Kinetis K2x. At least the
MK22F51212, which is the only K2x supported by Zephyr so far, does not
contain an MPU.

Signed-off-by: Henrik Brix Andersen <[email protected]>

* arch: arm: cortex-m: add support for clearing NXP MPU regions at boot

Clear NXP MPU regions at boot if CONFIG_INIT_ARCH_HW_AT_BOOT is
enabled.

Fixes: #34045

Signed-off-by: Henrik Brix Andersen <[email protected]>

* cmake: arm64: Bail out if the old SDK is used

After the ARM/ARM64 split the SDK 0.12.4 is needed to be able to compile
the ARM64 arch code. Bail out if an old SDK is detected at compile time.

Also change the minimal supported Zephyr SDK to v0.12, as agreed in
Toolchain WG.  Main reason is added compiler architectures and important
inclusion of fixes, for example qemu and arm fixes for veneers (TFM)

Signed-off-by: Carlo Caione <[email protected]>

* manifest: update TF-M with latest upstream

The TF-M update brings in the latest PSA crypto headers,
after TF-M switched formally to MBedTLS 2.26.0. It also
brings in some important fixes for cache enabling in nRF
platforms.

Signed-off-by: Ioannis Glaropoulos <[email protected]>

* samples: tfm_integration: tfm_ipc: Remove regression dependency

Removes the dependency on the external test service from the
CONFIG_TFM_REGRESSION_S test suite, instead
demonstrating how to make direct IPC calls to the CRYPTO
service that is available as a part of standard TF-M builds.

Signed-off-by: Kevin Townsend <[email protected]>

* boards: lpcxpresso55s69: fix TFM offset for builds without MCUboot

The flash layout definition has changed in upstream TF-M for the
LCPXPRESSO55S69 platform, for builds without bootloader. Fix the
layout in the boards' configuration, as well.

Signed-off-by: Ioannis Glaropoulos <[email protected]>

* samples: tfm_ipc: update DT overlay for nucleo_l552ze_q_ns

Update overlay file for nucleo_l552ze_q_ns board,
since now the sample does not enable REGRESSION,
and thus regular TF-M flash layout for the board
is used.

Signed-off-by: Ioannis Glaropoulos <[email protected]>

* samples: tfm_integration: DT overlay doc fixes for stm32l562e_dk_ns

Minor documentation fixes for the DT overlay files for
stm32l562e_dk_ns board.

Signed-off-by: Ioannis Glaropoulos <[email protected]>

* doc/releases: v2.6.0: Update for SoCs and ARM boards

Add list of new SoCs and ARM boards added in this release.  (Folded the
STM32 board section into the ARM board section).

Signed-off-by: Kumar Gala <[email protected]>

* drivers: pinmux: mchp: Update pinmux based on latest HAL

Microchip HAL 1.2.0 fixed a bug in the define of GPIO
control register MUX field. The incorrect MUX defined
cleared by GPIO input pad disable field by accident.
After the MUX definition was corrected the pinmux driver
must be modified to mask off the input pad disable for
the pin to be operational.

Signed-off-by: Scott Worley <[email protected]>

* release: Zephyr 2.6.0-rc2

Set version to 2.6.0-rc2

Signed-off-by: Kumar Gala <[email protected]>

* Bluetooth: ISO: Speed up BT ISO data processing

For the native posix build the sleep calls used in tasks will stall
the zephyr instance which sets an upper limit on the data processing
interval to once every 20-30 millisecond.
This change reduces the duration of the sleep calls and increases the
TICKS_PER_SECOND to allow for shorter sleeps. This is needed to
support the data rates needed for LE Audio streaming. The rate is
tuned to support up to bidirectional 5ms ISO-intervals.
This change also increases the ISO buffer count from 1 to 5 to
allow for some buffering in the controller, which is needed for
gapless playback and/or use of burst number larger than 1.

Signed-off-by: Casper Bonde <[email protected]>

* Bluetooth: ISO: Add sequence number to ISO data packets

The sequence number is needed in the appliaction layer to detect lost
packets in the ISO stream in cases where the timestamp is not included.
(Sequence number is mandatory to include where timestamp is optional).
The API for the public metadata have been moved to a public header file.

As the size of the ISO meta data exceeds the default 4 octets net_buf
user_data the public ISO metadata have been moved into a seperate array.
The internal metadata is still stored in net_buf user_data.

This also fixed the user_data overflow on 32 bit systems, caused by
writing the ts into user_data on index 4 to 7, which is outside the 4
allocated bytes.

Signed-off-by: Casper Bonde <[email protected]>

* Bluetooth: ISO: Make it possible to setup unidirectional CIS

The current iso commands in the shell only supports setting up
a bidirectional stream or unidirectional for central role.
Adding rx/tx/rxtx option to iso listen command to allow for
peripheral side configuration of an iso connection.

Signed-off-by: Casper Bonde <[email protected]>

* drivers: console: rtt: Add no multithreading support

Avoid calling k_sleep when multithreading is disabled.

Signed-off-by: Krzysztof Chruscinski <[email protected]>

* manifest: update segger

Update segger with RTT version that support no multithreading.

Signed-off-by: Krzysztof Chruscinski <[email protected]>

* logging: backend_rtt: Align to changes in RTT_LOCK/UNLOCK

RTT_LOCK/UNLOCK in certain configuration creates code block (curly
braces). In that case variables declared inside are local to that
block. Moved declaration of ret variable before the block. Updated
code to ensure that RTT_LOCK/UNLOCK are in the same code block.

Signed-off-by: Krzysztof Chruscinski <[email protected]>

* drivers: can: can_set_bitrate is not a syscall

There was a verification function for can_set_bitrate calling a syscall
implementation. But, can_set_bitrate is not a syscall and does not need
to be because it is accessing the driver through other syscalls.

Fixes #34734

Signed-off-by: Flavio Ceolin <[email protected]>

* drivers: can: Fix compilation issue

Remove extra (and syntactically wrong) semicolon.

Signed-off-by: Flavio Ceolin <[email protected]>

* doc/releases: v2.6.0: Update drivers section

* Remove driver categories that didn't have any major updates
* Add a first pass on new drivers that got added

Signed-off-by: Kumar Gala <[email protected]>

* cmake: c++ exceptions linking support

Fixes part of: #32448

This commit updates the CMake CMAKE_CXX_LINK_EXECUTABLE to include
crtbegin.o and crtend.o at the right locations when linking with gcc.

It also updates linker scripts to ensure proper location of the
exception header frame sections.

This ensure proper handling of exceptions for those architectures
- x86
- xtensa
- riscv32

Signed-off-by: Kumar Gala <[email protected]>
Signed-off-by: Torsten Rasmussen <[email protected]>

* tests: libcxx: increase ZTEST_STACKSIZE and added platforms for testing

Increasing ZTEST_STACKSIZE to 4096.
This ensures that the riscv32 platforms can succesfully execute the
C++ exception test cases.

Also add the following platforms to allow list:
- qemu_arc_em
- qemu_arc_hs
- qemu_cortex_m0
- qemu_cortex_m3
- qemu_cortex_r5
- qemu_riscv32
- qemu_x86
- qemu_xtensa

Signed-off-by: Torsten Rasmussen <[email protected]>

* drivers: wifi: esp32: fix reconnect issue

Device won't reconnect automatically even if
AP station is available. This fix adds the carrier event, indicating
that network is present again enabling DHCP bound event.
Also, internal wifi event callback was added into wifi
driver to enable proper event handling.

Update west.yml to bring exposed wifi event callback.

Signed-off-by: Sylvio Alves <[email protected]>

Fixes #33843

* scripts: size_report: fix pylint docstrings and import issues

This fixes the issues on import statements identified by pylint.
Also add docstrings for method and classes. Most of them are
already there as comments, so simply move them as docstrings.

Signed-off-by: Daniel Leung <[email protected]>

* scripts: size_report: recognize C++ file extensions

This adds some common C++ file extensions so the script
can recognize those as source file, and display them in
different color.

Signed-off-by: Daniel Leung <[email protected]>

* scripts: size_report: keep full path until inserting into tree

This changes how paths are stored in intermediate structures
so that full paths are stored. This makes it more consistent
with those structures to avoid an issue where some paths are
full paths, some are relateive to ZEPHYR_BASE.

Signed-off-by: Daniel Leung <[email protected]>

* scripts: size_report: alter how nodes are grouped together

This changes how the tree is generated. Symbols with no paths
are now grouped together instead of scattering throughout
the tree. If paths in ELF file are not all under ZEPHYR_BASE,
it will create additional node groups as 2nd level. This is
useful when not all source files are under ZEPHYR_BASE, and
provides a better indications of where they are.

Signed-off-by: Daniel Leung <[email protected]>

* scripts: size_report: add tree node for hidden symbols

The list of symbols only contain visible symbols that can be
obtained through ELF file. There are code and data where
the toolchain never emits symbols for them and thus are not
visible in the list. So add a "(hidden)" node to the tree
to show they are there.

Signed-off-by: Daniel Leung <[email protected]>

* scripts: size_report: add tree node for WORKSPACE

Add a tree node to group files under WORKSPACE so that
they won't be shown with full path. The WORKSPACE is
usually the same as WEST_TOPDIR unless ZEPHYR_WORKSPACE
is defined during build.

Signed-off-by: Daniel Leung <[email protected]>

* net: sockets: tls: check return code from fcntl

Not checking return code in fcntl can result in interpreting -1 as
flags, and cause unexpected behaviour.

Fixes #35541

Signed-off-by: Emil Lindqvist <[email protected]>

* drivers: modem: ublox-sara-r4: implement F_GETFL in ioctl

Zephyr sees fnctl as an alias of ioctl, and so the F_GETFL
request should be handled here as well.

Signed-off-by: Emil Lindqvist <[email protected]>

* posix: pthread_exit: check for null before dereferencing

In a primitive SYS_SLIST_FOR_EACH_NODE check for null was
after dereferencing. Place check for null of the "thread_spec_data"
before its dereferencing.

Found as a coding guideline violation (MISRA R4.1) by static
coding scanning tool.

Signed-off-by: Maksim Masalski <[email protected]>

* doc: improve installing dependencies

A few language fixes to the install dependencies section.
Also adding IDs to be able to link directly.

Signed-off-by: Ruth Fuchss <[email protected]>

* doc: improve doc processor installation

A few language fixes to the "Installing the documentation
processors" section.
Also adding comments to be able to include this section in
other locations.

Signed-off-by: Ruth Fuchss <[email protected]>

* soc: mchp: Deep sleep exit sequence update

Zephyr kernel masks interrupts before calling the SoC PM
sleep entry point. On the Cortex-Mx family this prevents
wake from peripheral interrupts. The SoC PM layer requires
interrupts to wake the SoC and must prevent the CPU from
vectoring to an interrup until PM exit. The SoC does this
by setting ARM NVIC PRIMASK to 1 and BASEPRI to 0. On
return to the kernel SoC sets PRIMASK to 0 allowing ISR's
to fire. In addition the MEC HW only clears its peripheral
sleep enables if the CPU vectors to an ISR. On wake we
clear the MEC PCR sleep control register which clears all
the peripheral sleep enables so peripherals will be active
before exiting the SoC PM layer.

Signed-off-by: Scott Worley <[email protected]>

* ci: labeler: add Power Management

Add support for Power Management automatic labeling.

Signed-off-by: Gerard Marull-Paretas <[email protected]>

* drivers: ieee802154: fix ACK length handling

OpenThread expects the FCS field at the end of the ACK frame to be
passed with `otPlatRadioTxDone`.

Signed-off-by: Eduardo Montoya <[email protected]>

* pm: device: Get rid of z_pm_core_devices

z_pm_core_devices was hack to set some priority between devices. It
was doing it hardcoding some devices that were the first to bring up
and the last to power down. Remove it and use the same list used to
initialize devices.

Fixes #34214

Signed-off-by: Flavio Ceolin <[email protected]>

* pm: device: Get rid of device_idx_t

It was just making the code hard to read. Also it was not following
the code guideline because the type was not telling us the sign
and size.

Signed-off-by: Flavio Ceolin <[email protected]>

* linker: cpp: Disable sorting of C++ exception handling info sections

The `CONFIG_LINKER_SORT_BY_ALIGNMENT` config, which is enabled by
default, causes the sections containing C++ exception handling
information to be re-ordered for certain targets (in particular, the
64-bit arch targets). This effectively breaks the required "crtbegin.o
-> others -> crtend.o" order and causes the address of the
__EH_FRAME_BEGIN__ symbol to be invalid; thereby, causing C++
exception unwinding to fail.

This commit adds SORT_NONE property to these sections in order to
ensure that the linking order specified in the linker command line is
maintained.

Signed-off-by: Stephanos Ioannidis <[email protected]>

* tests: cpp: libcxx: Update C++ exceptions testing filter

This commit updates the filter for cpp.libcxx.exceptions test to allow
testing on all architectures except the ones that are known to be
broken (see #32448).

Signed-off-by: Stephanos Ioannidis <[email protected]>

* cpp: Restrict C++ exceptions usage to supported archs

This commit makes CONFIG_EXCEPTIONS un-selectable for the architectures
that are known to have broken C++ exception handling support
(see #32448).

Signed-off-by: Stephanos Ioannidis <[email protected]>

* doc: release-notes-2.6: Add entries for ADC and PWM drivers

Add release notes related to ADC and PWM.

Signed-off-by: Andrzej Głąbek <[email protected]>

* Tracing: TRACING_NONE Compilation Fix

Fixed several compilation errors that resulted from selecting
TRACING without specifying a tracing system (Tracerecorder,
CTF, Systemview). In this case (TRACING_NONE), some default trace hooks
(in tracing.h) were incorrectly named resulting in compilation errors.
The legacy sys_trace_isr_enter, sys_trace_isr_exit, and sys_trace_idle
also caused problems since these were only given as defines, resulting
in undefined reference errors since they are required by the assembly
files calling these. To solve this issue I've added a stub file
"tracing_none.c" (only compiled if TRACING_NONE) and declared the
functions in tracing.h if no tracing system is selected.

Signed-off-by: Torbjörn Leksell <[email protected]>

* samples: tensorflow: Fix sample path

Otherwise documentation mentions wrong path in the "west" options.

Signed-off-by: Alexey Brodkin <[email protected]>

* drivers: can: init timing.sjw also in canfd mode

This commit resolves the undefined behviour caused by missing timing.sjw
initialization.

Signed-off-by: Thomas Stranger <[email protected]>

* drivers/ADC: STM32: This solves coverity reported in ADC driver.

This commit it to resolve following bugs:
* Operands don't affect result.
* Logical dead code in stm32_adc driver.
Above mentioned bugs were solved by adding parenthesis and
changed the method of comparing. Since comparison of ADC
channel_id with the channel may cause loss of value.
So instead of direct comparison, introduced a mechanism to
convert channel constant to a decimal using
__LL_ADC_CHANNEL_TO_DECIMAL_NB() and strips away
the INTERNAL_CH bit and then compare with channel_id.

fix:
* zephyrproject-rtos/zephyr#35130
* zephyrproject-rtos/zephyr#35136

Signed-off-by: Affrin Pinhero <[email protected]>

* scripts: series-push-hook: Use main as base comparison branch

Following master branch renaming to "main", update this script
to use $remote/main as base comparison branch

Signed-off-by: Erwan Gouriou <[email protected]>

* tests: posix: common: clock.c: rephrase comment on tick alignment

This k_usleep(1) is a tick alignment, not a workaround. Simple
reword to avoid confusion.

Signed-off-by: Jennifer Williams <[email protected]>

* Kconfig: `ROM_START_OFFSET` fix for samd5x

Set `ROM_START_OFFSET` for SAMD5X series to match the value
calculated in the linker file after forced alignments in
`vector_table.ld`.

Signed-off-by: Arvin Farahmand <[email protected]>

* scripts: gen_syscall: ignore Coverity overrun check

Coverity does not understand syscall mechanism and will already
complain when any function argument is not of exact size as
uintptr_t. So tell Coverity to ignore this particular rule here.

Signed-off-by: Daniel Leung <[email protected]>

* board: set chosen zephyr,shell-uart in LEON boards DTS

This associates the SHELL UART backend with the DTS uart0. It solves
an issue with unresponsive shell.

Signed-off-by: Martin Åberg <[email protected]>

* SPARC: add the Flush windows software trap

This commit implements the SPARC V8 ABI "Flush windows" software trap.
It enables support for C++ exceptions and longjmp().

Signed-off-by: Martin Åberg <[email protected]>

* tests: libcxx: added qemu_leon3 to C++ exception test

This exercises the SPARC support for C++ exceptions.

Signed-off-by: Martin Åberg <[email protected]>

* cpp: Update list of archs supporting C++ exceptions

C++ exceptions are supported on SPARC.

Signed-off-by: Martin Åberg <[email protected]>

* net: mgmt: Initialize the event callbacks statically

This commit allows to add callbacks to NET_EVENT_IF_UP events before
the network initialization.

Signed-off-by: Pieter De Gendt <[email protected]>

* doc: zephyr.doxyfile.in: remove obsolete variable

From Doxygen 1.9.1 when running 'make htmldocs':

warning: Tag 'COLS_IN_ALPHA_INDEX' at line 1028 of file
'/tmp/tmpkbj62jo0' has become obsolete.

Signed-off-by: Martí Bolívar <[email protected]>

* doc: mainpage.md: fix for new doxygen

I'm getting the following error on doxygen 1.9.1:

.../zephyr/doc/custom-doxygen/mainpage.md:1:
error: multiple use of section label 'index' for main page,
(first occurrence:
.../zephyr/doc/custom-doxygen/mainpage.md, line 1)
(warning treated as error, aborting now)

Extension error (zephyr.doxyrunner):
Handler <function doxygen_build at 0x7f1abf9e30d0>
for event 'builder-inited' threw an exception
(exception: Doxygen process returned non-zero (1))

This fixes it for me without breaking anything in
_build/doxygen/html/index.html that I can see.

Signed-off-by: Martí Bolívar <[email protected]>

* doc: external_content: fix for Unix

Path.rename() uses os.rename() internally. Per the Python docs:

     The operation may fail on some Unix flavors if src and dst are on
     different filesystems.

Since 'src_adjusted' is in a temporary directory, on my flavor of
Unix, that's in /tmp, which is indeed on a different filesystem than
'dst', a destination in the doc build directory on my root filesystem.

This is causing the following error when I build the docs:

Handler <function sync_contents at 0x7f9b8fca9c10> for event
'builder-inited' threw an exception (exception: [Errno 18] Invalid
cross-device link: '/tmp/tmpfscfo20o/index.rst' ->
'/home/mbolivar/zp/zephyr/doc/_build/src/reference/drivers/index.rst')

Fix this by using shutil.move() instead of Path.rename(). The shutil
function handles cross-filesystem moves correctly. It did not take a
path-like object for both its src and dst arguments until Python 3.9,
though, so we need to convert to strings for portability on earlier
but still supported versions.

Signed-off-by: Martí Bolívar <[email protected]>

* Bluetooth: ISO: Simplify reference handling

This makes bt_conn_cleanup to be automatically called when the last
reference to a connection of BT_CONN_TYPE_ISO is dropped.

Signed-off-by: Luiz Augusto von Dentz <[email protected]>

* Bluetooth: ISO: Fix not assigning CIG and CIS IDs

When handling CIS Requested event CIG and CIS IDs must be set in order
for the channel to be properly accepted.

Signed-off-by: Luiz Augusto von Dentz <[email protected]>

* Bluetooth: ISO: Fix call order of connected callback

The state shall be set before calling the callback as it could be check
code behind would expect the channel to be in connected state.

Signed-off-by: Luiz Augusto von Dentz <[email protected]>

* Bluetooth: conn: Add support for ISO connections to bt_conn_get_info

This enables bt_conn_get_info to be used with connection of type
BT_CONN_TYPE_ISO.

Signed-off-by: Luiz Augusto von Dentz <[email protected]>

* Bluetooth: shell: Add connection type information to connections command

This prints information about the role and id along with connection
parameters in case the connection is of LE type.

Signed-off-by: Luiz Augusto von Dentz <[email protected]>

* Bluetooth: conn: Align cleanup for ISO connections

This makes connections of type BT_CONN_TYPE_ISO use BT_CONN_CLEANUP to
cleanup so the TX and RX queues are properly cleanup.

Signed-off-by: Luiz Augusto von Dentz <[email protected]>

* drivers: flash: nrf_qspi_nor: Fix no multithreading compilation

Fixing error introduced in 951e72b94769f55b0c2f2cf70f81d063ec81d11e
where ifdef was converted to IS_ENABLED. Ifdef was required because
element in the struct does not exist when multithreading is disabled.

Signed-off-by: Krzysztof Chruscinski <[email protected]>

* doc/releases: v2.6.0: Updated Major enhancements section

Added bullets for ARC64, ARM32/64 split, TCP legacy removal, and
ARM v8.1-m support.

Signed-off-by: Kumar Gala <[email protected]>

* soc: xtensa: linker: Update linker scripts for C++ build

When we link in crtbegin.o for C++ exception support we end up pulling
in the .tm_clone_table section.  We need to update the linker scripts
to handle this.  soc/xtensa/sample_controller/linker.ld was already
updated, this fixes the others.

Signed-off-by: Kumar Gala <[email protected]>

* drivers: serial: nrf_uarte: Fix async/int TX api in inactive state

Currently zephyr has no means to control access to the uart
driver when it is inactive, e.g. shell is not aware of uart
being in idle state and calls asynchronous api. Add early
return to TX starting procedure if device is idle.

Signed-off-by: Krzysztof Chruscinski <[email protected]>

* doc: security: Change 'master' to 'main'

Fix up a handful of references to 'master' in the security documentation
to refer to the new 'main' branch.

Signed-off-by: David Brown <[email protected]>

* kernel: mmu: add doxygen group for demand paging APIs

This adds the doxygen group for demand paging APIs in
sys/mem_manage.h header file.

Signed-off-by: Daniel Leung <[email protected]>

* kernel: mmu: rename z_eviction* to k_mem_paging_eviction*

These functions and data structures are those that need
to be implemented by eviction algorithm and application
outside kernel. Promote them from z_* so these can be
included in documentation.

Signed-off-by: Daniel Leung <[email protected]>

* kernel: mmu: z_backing_store* to k_mem_paging_backing_store*

These functions are those that need be implemented by backing
store outside kernel. Promote them from z_* so these can be
included in documentation.

Signed-off-by: Daniel Leung <[email protected]>

* doc: add some bits about demand paging

This adds some information about demand paging in Zephyr.

Signed-off-by: Daniel Leung <[email protected]>

* doc: release: Add Bluetooth release notes for 2.6

Document the most important changes in the Bluetooth subsystem for the
2.6 release.

Signed-off-by: Carles Cufi <[email protected]>

* net: capture: Fix the function documentation

The net_capture_pkt() does not return anything so remove the
return description from the function documentation.

Signed-off-by: Jukka Rissanen <[email protected]>

* net: capture: Fix the return value of net_capture_is_enabled()

The net_capture_is_enabled() function returns boolean value
so fix the function prototype.

Signed-off-by: Jukka Rissanen <[email protected]>

* kernel: stack_sentinel: disable in single-threaded builds

Add a dependency on MULTITHREADING for the
STACK_SENTINEL feature, so it may not get
enabled in single-thread Zephyr builds.

Signed-off-by: Ioannis Glaropoulos <[email protected]>

* tests: arm: fix name for arm_irq_vector_table test suite

Minor fix to the name for the arm_irq_vector_table
test suite, removing the 'interrupt' from the name.

Signed-off-by: Ioannis Glaropoulos <[email protected]>

* net: l2: bluetooth: Handle error if failed to register server

Return error code if init code failed to register the L2CAP server.

Signed-off-by: Joakim Andersson <[email protected]>

* docs: Change a number of 'master' branch refers to 'main'

Now that we use 'main' for git development, update the docs to reflect
or point there instead of 'master'.

Signed-off-by: Kumar Gala <[email protected]>

* Bluetooth: host:l2cap: fix sending error in le_ecred_reconf_req

Result to send was overwritten by BT_L2CAP_RECONF_SUCCESS just after
exiting while loop. This caused to send success response even if
reconfiguration failed. Now, result is initialized to success value,
and if reconfiguration fails, this value will be overwritten with
appropriate one. Added BT_L2CAP_RECONF_INVALID_CID (0x0003) for invalid
cid in request. Added BT_L2CAP_RECONF_OTHER_UNACCEPT (0x0004) to return
if MPS is to small. Reordered checks for mps/mtu as
BT_L2CAP_RECONF_OTHER_UNACCEPT is expected to be returned if both mps
and mtu are to small.

This was affecting L2CAP/ECFC/BI-05-C and L2CAP/ECFC/BI-05-C

Signed-off-by: Krzysztof Kopyściński <[email protected]>

* doc: release: add documentation changes

Add a list of most relevant documentation changes.

Signed-off-by: Gerard Marull-Paretas <[email protected]>

* doc: toolchains: move description of alternative install method on mac

On macOS there exists an alternative install method for gnuarmemb.

Unfortunately this information was located with the Intel oneApi
toolchain description and not the GNU arm Embedded toolchain.

Move the description to its correct location.

Signed-off-by: Torsten Rasmussen <[email protected]>

* doc: release-notes-2.6: Added and refined some testcases of kernel

1.Added or refined some testcases, most of them are neagtive tests, to
  improve the test code coverage.

2.Provide test excution time per ztest testcase.

3.Add a feature which handles pytest script in twister and provide an
  example.

Signed-off-by: Enjia Mai <[email protected]>

* docs: Fix doxygen errors in include/sys/mem_manage.h

Various params didn't match between docs and functions.

Signed-off-by: Kumar Gala <[email protected]>

* doc: release notes: added oneApi toolchain to release notes

Adding Intel oneApi as new toolchain supported in Zephyr.

Signed-off-by: Torsten Rasmussen <[email protected]>

* doc: release: v2.6: add note for UART console input expired options

Add note for UART console input expired mechanism Kconfig options.

Signed-off-by: Mulin Chao <[email protected]>

* doc: release notes: update tracing section

Update tracing section for the v2.6 release.

Signed-off-by: Anas Nashif <[email protected]>

* lib: newlib: fix _gettimeofday hook

The time() function works correctly with the minimal libc, but always
returns -1 with the newlib libc. This is due to the _gettimeofday hook
being implemented that way.

Fix that by calling gettimeofday in the _gettimeofday hook instead of
returning -1.

Signed-off-by: Aurelien Jarno <[email protected]>

* tests: error_hook skipping div-by-0 test on cortex M0 M0+

On the Cortex M0+, M0, M23 the div-by-zero is not mapped
as an hardware exception but triggers a HardFault.
The test case is skipped for any ARMV6_M_ARMV8_M_BASELINE.

Signed-off-by: Francois Ramu <[email protected]>

* nios2: Fix C++ exception handling info linking

The NIOS2 architecture linker script was including `cplusplus-ram.ld`
linker script after `__data_ram_end`, and this caused the content of
`.gcc_except_table` section to be not copied to the RAM by the
`z_data_copy` function; leading to the C++ exception handling
malfunction.

This commit relocates the `cplusplus-ram.ld` linker script inclusion
such that the contents of the relevant sections are properly copied by
the `z_data_copy` function.

Signed-off-by: Stephanos Ioannidis <[email protected]>

* cpp: Remove C++ exception handling arch restriction

The C++ exception handling feature is now supported on all
architectures.

Signed-off-by: Stephanos Ioannidis <[email protected]>

* tests: cpp: libcxx: Test C++ exception handling on all archs

The C++ exception handling feature is now supported on all
architectures.

Signed-off-by: Stephanos Ioannidis <[email protected]>

* doc: release: final release notes for cortex-m

Finalize v2.6.0 release notes for ARM Cortex-M.

Signed-off-by: Ioannis Glaropoulos <[email protected]>

* doc: release: release notes for Cortex-R

v2.6.0 release notes for Cortex-R.

Signed-off-by: Ioannis Glaropoulos <[email protected]>

* doc: release notes: remove blank lines

Remove blank lines between bullet points.

Signed-off-by: Ioannis Glaropoulos <[email protected]>

* pm: device: remove CONFIG_PM_MAX_DEVICES

When a device is defined a new pointer to a device will be created in
the "z_pm_device_slots" region, effectively creating a device array with
the same size as the number of system devices. This array is then used
by the device PM subsystem to keep track of suspended devices during
power transitions.

Signed-off-by: Gerard Marull-Paretas <[email protected]>

* sensor: use function properties to document the context

We now have function properties which can replace the confusing message
in the doxygen docs.

Fixes #10499

Signed-off-by: Anas Nashif <[email protected]>

* Bluetooth: host: Notify application about prepare write error

Notify application about prepare write error when continueing the write
procedure fails when RX thread is processing responses. It is possible
that this operation fails, either because of disconnection or ATT
timeout on the ATT bearer. Notify the application in case it needs to
clear up resources, e.g. the write parameters.

Signed-off-by: Joakim Andersson <[email protected]>

* Bluetooth: host: Reject remote public key on same X coordinate.

Reject remote public key when this has the same X coordinate.

Signed-off-by: Joakim Andersson <[email protected]>

* Bluetooth: host: Log failure to initiatie security for bonded peer

Log failure to initiatet security for bonded peer when GATT wants to
initiate security for CCCs for the remote.

Signed-off-by: Joakim Andersson <[email protected]>

* Bluetooth: samples: Fix peripheral sample handling of string values

Fix peripheral sample handling of string values. The read callback
uses strlen to get the length of the current string value. Make sure
that the string value is always zero-byte terminated.

Fix multiple characteristics using the same storage for its value.

Signed-off-by: Joakim Andersson <[email protected]>

* Bluetooth: hci: Add response structure for HCI CTE sampling enable cmd

Add missing response structure for HCI_LE_Set_Connectionless_IQ_-
Sampling_Enable command.

Signed-off-by: Piotr Pryga <[email protected]>

* Bluetooth: controller: hci: Set correct return params for CTE sampl enable

Fix bug of missing sync_handle parameter in return data in
HCI_LE_Set_Connectionless_IQ_Sampling_Enable commnad
handling function.

Signed-off-by: Piotr Pryga <[email protected]>

* Bluetooth: host: Check sync_handle return value when CTE sampl enable

Check correctness of returned sync_handle value while requesting
HCI_LE_Set_Connectionless_IQ_Sampling_Enable in controller.

Signed-off-by: Piotr Pryga <[email protected]>

* dts: arm: nxp: Add port property to nxp,lpc-gpio nodes

Add a port property to describe which hardware port a GPIO device node
is describing since we can't tell from the registers (as the registers
are interleaved in the same MMIO space).

Signed-off-by: Kumar Gala <[email protected]>

* drivers: gpio: mcux_lpc: Convert driver to use devicetree port prop

Move to using port property for a few cases in which we need to know
which specific hardware port a device is for.  This allows us to
remove the PORT0/1 Kconfig options.  This also fixes the issue that
assumed pio0 would map to DT_INST(0) and pio1 would map to DT_INST(1)

Fixes #35693

Signed-off-by: Kumar Gala <[email protected]>

* workflows: backport: Switch to using main

The  workflow was pointing to `master` instead of `main`, which
prevented it from running after the branch was renamed.

Signed-off-by: Carles Cufi <[email protected]>

* Bluetooth: Host: add missing zero CIDs in ecred_conn_req

Fix missing 0x0000 CIDs in response for ecred_conn_req. Previously,
when one of "All connections refused" error i variable was set to 0,
thus no CIDs were copied to response.

Signed-off-by: Krzysztof Kopyściński <[email protected]>

* Bluetooth: Host: do not overwrite result in  le_ecred_conn_req

For more than one requested channels in le_ecred_conn_req only result is
overwritten in every iteration. This causes an issues if after failed
l2cap_chan_accept occures successful one: returned result will be
BT_L2CAP_LE_SUCCESS, where in reality should be returned error
and non-zero Destination CIDs will signal "Some connections refused".
Now, overwrite error only if the last one failed. If no errors occur,
result will remain BT_L2CAP_LE_SUCCESS.

This was affecting test cases L2CAP/ECFC/BV-20-C

Signed-off-by: Krzysztof Kopyściński <[email protected]>

* Bluetooth: Host: change error returned when ecred_conn_req

BT_L2CAP_LE_ERR_INVALID_PARAMS shall be returned instead of
BT_L2CAP_LE_ERR_UNACCEPT_PARAMS.

This was affecting test case L2CAP/ECFC/BV-26-C

Signed-off-by: Krzysztof Kopyściński <[email protected]>

* Bluetooth: ISO: Fix BIG cleanup

Fix a regression for cleaning up BIGs added by
80c824f18ee80caa5bd162b9d2957dde1639add6 where the way
ISO connections were unref'ed was changed.

bt_iso_cleanup has been changed to only effect CIS
(as the unref from that has been removed), so instead
of calling bt_iso_cleanup we just call
bt_conn_unref directly.

This also removes some unref's from the BIG complete
and BIG Sync complete event handlers as the BIS bt_conns as
they don't increase the ref counter before anymore.

Signed-off-by: Emil Gydesen <[email protected]>

* doc/releases: v2.6.0: Update for logging subsystem

Update release notes with logging v2 info.

Signed-off-by: Krzysztof Chruscinski <[email protected]>

* doc: add docs for west spdx

These are based on the commit log in
fd31b9b4acb5d48f83ef8cf0f3afe3e48b7844c0.

Signed-off-by: Martí Bolívar <[email protected]>

* doc: release-notes-2.6: west extensions

Just the extensions changes for Zephyr 2.6, since west has its own
release notes page as it's developed on its own pace.

Signed-off-by: Martí Bolívar <[email protected]>

* drivers: i2c: gpio: fix compilation

Fix the compilation of i2c_gpio.c after the gpio_config() syscall was
removed.

Fixes: 3632815e2e124c0c4b1ed09cd91f60ecbd2fda83

Signed-off-by: Henrik Brix Andersen <[email protected]>

* boards: arm: arty: fix compilation with v2c_daplink shield enabled

Fix the compilation of board.c when the DAPlink QSPI MUX devicetree
node is enabled.

Fixes: 3632815e2e124c0c4b1ed09cd91f60ecbd2fda83

Signed-off-by: Henrik Brix Andersen <[email protected]>

* drivers: can: sjw == 0 in can_set_timing should not change sjw

If the supplied sjw in the timing parameters is zero,
the sjw parameter should not be changed.
This fixes the uninitialized swj in can_set_bitrate.

Signed-off-by: Alexander Wachter <[email protected]>

* modules: mbedTLS: Add separate Kconfig entry for MBEDTLS_HAVE_TIME_DATE

Currently the MBEDTLS_HAVE_TIME_DATE mbedTLS option is enabled based on
the CONFIG_POSIX_API option. This doesn't seem right, since the enabling
the POSIX API does not guarantee that there is a valid time source in
the system. This was the case for the qemu_x86 platform, where enabling
POSIX_API caused TLS handshake failures due to certificate validation
errors caused by no valid time avaialble in the system.

Fix this by adding a specific KConfig entry for date/time configuration
in mbedTLS. Applications that need to enforce date verification in
mbedTLS should enable it explicitly instead of relying on the
non-obvious implicit configuration.

Fixes #35401

Signed-off-by: Robert Lubos <[email protected]>

* Bluetooth: Host: Add status check BIG sync/create events

Add a status check for the BIG sync established and
BIG sync created events such that we don't log a warning
of invalid BIS count when it is an error event.

Signed-off-by: Emil Gydesen <[email protected]>

* tests: bluetooth: bsim: Updated advx test to verify sync data

Updated advx test to verify sync data when no extended
header flags are set in the PDU.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* Bluetooth: controller: Fix incorrect ext header flag access

Fix Periodic Advertising data population from corrupting
the PDU by populating fields when there is no flags in the
common extended advertising header.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* tests: bluetooth: bsim: Updated advx test to verify previous sync data

Updated advx test to verify previous sync data when no
extended header flags are set in the PDU.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* Bluetooth: controller: Fix incorrect prev periodic header flag access

Fix Periodic Advertising PDU population from incorrectly
populating new PDU when there is no common extended header
flags being set in the previous PDU and or the new PDU.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* Bluetooth: controller: Fix incorrect prev aux header flag access

Fix Extended Advertising PDU population from incorrectly
populating new PDU when there is no common extended header
flags being set in the previous PDU and or the new PDU.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* Bluetooth: controller: Minor improvements to ext header population

Minor refactor and improvement to common extended header
population.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* thread analyzer: fix formatting for unsigned int

On 64bit systems, this was issuing warnings due to wrong formatting.

Signed-off-by: Anas Nashif <[email protected]>

* boards: up_squared: remove 32bit variant

This board was created for the transition to all 64bit, it is not needed
anymore.

Signed-off-by: Anas Nashif <[email protected]>

* boards: qemu_x86_coverage: remove board testing coverage

This board was added to test coverage feature when coverage was
introduced. This is now being testing with other boards and
configurations on a regular basis, so no need for this extra overhead in
CI.

Signed-off-by: Anas Nashif <[email protected]>

* boards: minnowboard: remove untested and old board

Remove minnowboard configuration which is very basic and can be brought
back by just taking another X86 configuration. We have not tested this
board for a while and it is not being used actively, so remove it.

Signed-off-by: Anas Nashif <[email protected]>

* release notes: document removed x86 boards

Document removed boards.

Signed-off-by: Anas Nashif <[email protected]>

* boards: acrn: do not run net/bt tests

Do not run those tests, the features are not enabled in ACRN.

Signed-off-by: Anas Nashif <[email protected]>

* docs: release notes: PM API changes

Add information about API changes in device runtime PM.

Signed-off-by: Flavio Ceolin <[email protected]>

* docs: release notes: PM release notes

Add notes about PM changes during this release cycle.

Signed-off-by: Flavio Ceolin <[email protected]>

* docs: release notes: Simple tags fixes

Fix some wrong tags usage.

Signed-off-by: Flavio Ceolin <[email protected]>

* soc: arm: Fix condition to set lpc55xxx flash wait states

Commit f5c6afeccb53e4121ba5e97294cf589a752623d9 attempted to avoid
accessing lpc55xxx flash registers in nonsecure mode by conditionalizing
part of the SoC clock initialization routine on whether the flash driver
was enabled. This caused secure applications without the flash driver
enabled (e.g., hello_world on lpcxpresso55s69_cpu0) to not boot or show
any console output. Fix this by changing the condition to depend on
whether we are building a nonsecure image.

Signed-off-by: Maureen Helm <[email protected]>

* release: Zephyr 2.6.0-rc3

Set version to 2.6.0-rc3

Signed-off-by: Kumar Gala <[email protected]>

* doc/releases: v2.6.0 Add new R-Car platform drivers

Add to the v2.6 release note all Renesas R-Car drivers
that have been merged during this period.

Signed-off-by: Aymeric Aillet <[email protected]>

* boards: arm: bl5340: Fix LIS3DH IRQ levels

Levels were wrongly assigned to being active low instead of active high

Signed-off-by: Jamie McCrae <[email protected]>

* logging: Eclipse CDT parser workaround

Recent rework in logging api brings complicated macros which can
overhelm Eclipse CDT parser.
This workaround disables expansion of LOG_xxx macros in Eclipse.

Signed-off-by: Jan Pohanka <[email protected]>

* doc/releases: v2.6.0: Updates and cleanups

* Add high level bullets about tracing & power mgmt
* Removed duplicated bluetooth section
* Remvoed RISC-V section, to changes of note for this release

Signed-off-by: Kumar Gala <[email protected]>

* doc: colibri board: Add missing empty lines

Two code-blocks were not correctly rendered, due to missing
empty lines before them. This commit fixes this.

Signed-off-by: Christian Taedcke <[email protected]>

* boards: doc: Update H3ULCB documentation

Update documentation for H3ULCB board following the
addition of new features during v2.6 windows.

Signed-off-by: Aymeric Aillet <[email protected]>

* tests: posix: common: clock: exclude ehl_crb from test posix realtime

The ehl_crb board has hardware issue that prevents this test from
being able to pass this otherwise-correct test. So exclude ehl_crb
from the testcase.yaml.

Fixes #33544.

Signed-off-by: Jennifer Williams <[email protected]>

* doc/releases: v2.6.0: Update to MCUmgr and Shell section

Short update to list of changes to MCUmgr that impact Zephyr.
Note to Shell on changes that affect mcumgr.

Signed-off-by: Dominik Ermel <[email protected]>

* lib: newlib: Add minimum required heap size config

This commit adds a new `CONFIG_NEWLIB_MIN_REQUIRED_HEAP_SIZE` config
that allows user to specify the minimum required heap size for the
newlib heap, and makes `malloc_prepare` validate that the memory space
available for the newlib heap is greater than this value.

The default minimum required heap size values were empiricially
determined, so as to allow the basic standard C functions such as
`printf` and `scanf` to work properly.

Signed-off-by: Stephanos Ioannidis <[email protected]>

* tests: mem_alloc: Increase heap size for newlib nano test

This commit increases the heap size for the newlib nano test to 2048,
which is the recommended minimum required to ensure proper operation
(see #35799).

Signed-off-by: Stephanos Ioannidis <[email protected]>

* tests: net: getaddrinfo: Increase newlib heap size

This commit increases the newlib heap size to 2048, which is the
recommended minimum required to ensure proper operation of the newlib
nano used by test (see #35799).

Signed-off-by: Stephanos Ioannidis <[email protected]>

* drivers/sensor: lis2dh: use gpio_dt_spec oriented macros

Use gpio_dt_spec structure and related macros for both drdy
and AnyMotion interrupts, to have a more compat, readable and
safe code. Moreover, skip setting DRDY or AnyMotion trigger
from application if the corresponding irq-gpios has not been set.

(This commit also fixes #34794)

Signed-off-by: Armando Visconti <[email protected]>

* samples: net: sockets: big_http_download: Update certificate

The Let's Encrypt X3 certificate is no longer in use, replace it with an
up-to-date certificate.

Signed-off-by: Robert Lubos <[email protected]>

* doc: scripts: gen_devicetree_rest: add workaround for page width

Since Zephyr docs switched to fixed-width, the binding pages are not
displayed correctly. We should move to another data representation
format that works better for fixed-width documents. Until this decision
is made, add a workaround that forces the template to expand page width
to the maximum on binding pages.

Signed-off-by: Gerard Marull-Paretas <[email protected]>

* doc/releases: v2.6.0: Updates

* Removed ARCH POSIX, driver/pinmux, updatehub, settings, random, POSIX
  subsystem, and LGVL sections as no significant changes this release
* Add new drivers for eeprom, timer and watchdog sections
* Added bullet item about shared interrupt support being devicetree
  based
* Added bullet about moving of CMSIS portability headers

Signed-off-by: Kumar Gala <[email protected]>

* samples/boards/stm32: PM Blinky: Rework README

Rework README to provide a correct and understandable status.

Signed-off-by: Erwan Gouriou <[email protected]>

* Bluetooth: host: Fix CCC store on write for multiple connections

Fix CCC store on write feature for multiple connections. CCCs are only
enqueued for storing when going from no connections subscribed to any
connection subscribed.
The CCC should be stored when its value is changed for the specific
connection.

Signed-off-by: Joakim Andersson <[email protected]>

* doc: intro: Add a reference to ARMv8-R

Specify that 64-bit Cortex-R, ARMv8-R, is now supported in Zephyr.

Signed-off-by: Carles Cufi <[email protected]>

* doc: gs: Clearly state the main dependencies min version

Introduce a table with the minimum version required for the three main
dependencies (CMake, Python and DTC). At the same time remove the CMake
help code from the GSG, since it's just a duplicate of the instructions
that Kitware provides.

Signed-off-by: Carles Cufi <[email protected]>
Co-authored-by: Ruth Fuchss <[email protected]>

* Tracing: Incorrect Unlock Mutex Trace Hook Fix

Changed location of the last k_mutex_unlock trace hook since it was
being called after k_sched_unlock, which could result in tracing
scenarios (other thread waiting for lock) where it appeared that a
mutex was being locked again before becoming unlocked.

Signed-off-by: Torbjörn Leksell <[email protected]>

* cmake: warn the user if a Zephyr library is created in app-mode

Fixes: #19582

When `find_package(Zephyr)` completes then all boilerplate code has been
processed and all Zephyr libraries has been placed inside the
whole archive flags.

Also all libs dependencies has been processed.

This is indicated by the presence of the zephyr_prebuilt target.

Thus, warn the user if `zephyr_library()` / `zephyr_library_named()`
is called in app-mode.

Signed-off-by: Torsten Rasmussen <[email protected]>

* doc: release-notes-2.6: add release notes for disk drivers

Add release notes for disk drivers.

Signed-off-by: Johann Fischer <[email protected]>

* doc: release-notes-2.6: add release notes for USB

Add release notes for USB.

Signed-off-by: Johann Fischer <[email protected]>

* drivers/sensor: lps22hh: Fix the raw to kPa sample conversion

The lps22hh 24 bit raw sample is left aligned, which means that
it needs to be right-shifted by 8 before applying conversion.
Moreover the conversion has been simplified for clarity.

Fix #35871

Signed-off-by: Armando Visconti <[email protected]>

* nxp: rt series eth timer clock enable

enable ethernet timer clock when enabling ptp

Signed-off-by: Hake Huang <[email protected]>

* drivers/sensor: lis2mdl: Fix temperature sample handling

The lis2mdl temperature samples work with a level of 25 Celsius.
When temperature goes below that level the samples become negative
and there was an issue in properly propagating the sign.

Fix #35910

Signed-off-by: Armando Visconti <[email protected]>

* boards: arm: 96b_aerocore2: fix table rendering

J1 header table was not rendered correctly.

Signed-off-by: Gerard Marull-Paretas <[email protected]>

* doc: release: Add sensor changes to v2.6.0 release notes

Fills in the sensor drivers section of the v2.6.0 release notes.

Signed-off-by: Maureen Helm <[email protected]>

* doc: release: Add NXP-related changes to v2.6.0 release notes

Adds v2.6.0 release notes for NXP boards.

Signed-off-by: Maureen Helm <[email protected]>

* doc/releases: v2.6.0: add resolved issues

Add list of all resolved issues since 2.5.0.

Signed-off-by: Kumar Gala <[email protected]>

* boards: rt600: Add information to connect an external debug probe

Update documentation to include information on how to connect
an external debug probe

Signed-off-by: Mahesh Mahadevan <[email protected]>

* docs: pm: System power management diagram

Add a diagram for system power management.

Signed-off-by: Flavio Ceolin <[email protected]>

* tests: i2s_speed: Increase the RX buffer count

The NXP I2S driver queues 2 receive buffers to avoid receive overflows.
Allocate an extra block so we do not see test failures due to allocate
failures

Signed-off-by: Mahesh Mahadevan <[email protected]>

* logging: log_core.c: fix coding guideline 15.7 missing comment

The final else {} in the if...else if is missing required
comment (non-empty, ';' is not sufficient). This adds a comment
to comply with CG 15.7.

Signed-off-by: Jennifer Williams <[email protected]>

* logging: log_msg.c: fix coding guideline 15.7 missing comment

The final else {} in the if...else if is missing required
comment (non-empty, ';' is not sufficient). This adds a comment
to comply with CG 15.7.

Signed-off-by: Jennifer Williams <[email protected]>

* arch/x86_64: Terrible, awful hackery to bootstrap entry

Because of a historical misunderstanding, by default the ACRN
hypervisor wants to load Zephyr at address 0x1000 and enter the binary
at that same address.  This entry point corresponds to the __start
symbol of the build they were given, which is a 1-cpu non-SMP
configuration.  Unfortunately, when we build with
CONFIG_MP_NUM_CPUS=1, the code in locore.S #if's out the 16 bit entry
point for the auxiliary CPUs at the start of the section.  So in the
build ACRN received, the start address happened to be 0x7000, the same
address we need to launch the AP processors from.

That's right: under ACRN, the SAME ADDRESS used to enter the OS in 32
bit mode needs to be used later to boot CPUs running in 16 bit real
mode!

The solution, such as it is, is to put a 32 bit jump at the entry
address which hops to the 32 bit OS entry code, and then scribble NOP
instructions over that jump once we get there so that the next time we
reach that address (in real mode) we fall through to the correct
entry.

This patch should be considered a temporary workaround.  While it
works on all x86 hardware, it's not really needed.  A much better
solution would be to eliminate the locore linker region entirely
(which causes other headaches) and enter the Zephyr binary in a 32 bit
address somewhere in the contiguous high memory area.  All that locore
is needed for is the 16 bit bootstrap code for SMP processors, which
is ~6 instructions and can be copied in from the kernel at runtime.

Signed-off-by: Andy Ross <[email protected]>

* arch/x86_64: Use modern CR0 assembly

The 16 bit bootstrap code for SMP CPUs was using the 286-era "lmsw"
instruction (load machine status word) to set the protected bit in CR0
(which is the modern evolution of the same register), presumably
because this is 16 bit code and we can't move a dword into CR0.

But that's wrong, because the full instruction set *is* available in
real mode on a 386, you just have to use a operand size prefix to get
to it, which the assembler emits for you automatically when you use
the .code16 directive.

Write this conventionally and use modern (e.g. 1986-era) instructions.
It also has the advantage of not confusing much more modern
hypervisors like ACRN by issuing instructions they (and I!) never knew
existed.

Fixes #35076

Signed-off-by: Andy Ross <[email protected]>

* boards/x86/acrn: Add APIC IDs

The ACRN hypervisor uses 0, 2, 4, 6 as its local APIC IDs for
virtualized CPUs and not the 0, 1, 2, 3 defaults we have.

(I hate this feature, having to manually (!) probe and code these
things in C isn't scaling.  Zephyr needs to do the probing on its own
somehow, even if it's an offline tool in Linux or something.)

Signed-off-by: Andy Ross <[email protected]>

* boards/x86/acrn_ehl_crb: Enable SMP by default

SMP is working now, make a 2-cpu configuration default for this
device.

Note that this requires changes to the default ACRN build
configuration!  In hybrid.xml, you need to specify multiple physical
CPUs for the VM to uses, e.g.:

    <vm id="0">
        ...
        <cpu_affinity>
            <pcpu_id>0</pcpu_id>
            <pcpu_id>1</pcpu_id>
        </cpu_affinity>
    </vm>

Failing to build with this change will result in the system hanging at
boot trying to start up a CPU that won't run.

Signed-off-by: Andy Ross <[email protected]>

* boards/x86/acrn: Rework board documentation

ACRN build and configuration is non-trivially complicated, and so far
integration documentation has been mostly missing, and users have had
to get by via copying from existing integration efforts with minor
changes, leading to repeated mistakes and persistent confusion.  This
is an attempt to document the process from first principles, with an
eye toward informing integrators (not me!) who might come by later to
better automate things.  Some of the content is going to look remedial
to someone already familiar with e.g. ACRN configuration or EFI boot.

This simply replaces the pre-existing docs, which were for earlier
versions of ACRN where Zephyr was launched from the service OS instead
of the now-standard pre-launch VM mode.

Signed-off-by: Andy Ross <[email protected]>

* boards/x86/acrn: Use APIC_TSC_DEADLINE_TIMER

This board got forgotten when we migrated the older APIC_TIMER users.
Now the platform is SMP by default and the older driver refuses to
build.

Signed-off-by: Andy Ross <[email protected]>

* size_report: give root node a unique identifier

Call the root node 'root', otherwise we end up with two nodes with the
same identifier ':'.

Signed-off-by: Anas Nashif <[email protected]>

* boards: arm: Clarify J-Link OpenSDA firmware usage for frdm_k64f

Updates the frdm_k64f board documentation to clarify that the J-Link
OpenSDA firmware version depends on the DAPLink bootloader version.

Signed-off-by: Derek Snell <[email protected]>
Signed-off-by: Maureen Helm <[email protected]>

* Bluetooth: controller: Check length field of scan response data

Check the length field of the scan response data.

Signed-off-by: Joakim Andersson <[email protected]>

* drivers: can: mcan: Fix DBTP sjw register writes

The data-sjw value was incorrectly written to the NBTP register when it
should be written to the DBTP register.

This fixes a regression introduced by
5e0ca9b41e5cd4d1d84ceef919510f3f2a22ecfe.

Signed-off-by: Christoph Steiger <[email protected]>

* drivers: fix pm callback signature

For some reason a few drivers were not converted to the new device PM
callback signature. The reason may be because the device PM part is
compiled only when CONFIG_PM_DEVICE=y, a condition not enabled in CI by
default.

Signed-off-by: Gerard Marull-Paretas <[email protected]>

* shell: Add missing dependency to shell log backend

Shell log backend depends on logging being enabled. Lack of this
dependency leads to compilation failure when logging is disabled.

Signed-off-by: Krzysztof Chruscinski <[email protected]>

* manifest: segger: zephyr kconfig options

Update segger module version to revision that re-introduces zephyr
Kconfig options

Signed-off-by: Pieter De Gendt <[email protected]>

* drivers: cc13xx_cc26xx: fix pm.h not included

Fixes #35916.

Signed-off-by: Stancu Florin <[email protected]>

* tfm: interface: Fix bug where FPU registers were not restored correctly

The caller saved registers were restored both as caller saved and
callee saved registers, i.e. register 0-15 were restored into
both register 0-15 and 15-31.

Signed-off-by: Øyvind Rønningstad <[email protected]>

* Bluetooth: controller: Fix conn setup regression

Fix incorrect and redundant use of ticker user id ULL_LOW
instead of ULL_HIGH when setting up a connection using a
mayfly to disable LLL context. Also, the LLL context pointer
is invalid, where node rx is passed instead of LLL context.

Use the ULL disabled callback when done event has not yet
been processed, or a direct connection setup in ULL_HIGH
context when ULL is already disabled (reference count is
zero) is sufficient.

Regression introduced in commit 30f260dfaaf7 ("Bluetooth:
controller: Fix adv/scan context access post release").

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>

* pm: do not use deprecate Kconfig

CONFIG_DEVICE_POWER_MANAGEMENT is deprecated, use CONFIG_PM_DEVICE
instead.

Signed-off-by: Anas Nashif <[email protected]>

* shell: fix tab for dynamic commands

The tabulator handler creates a single structure if it is handling
dynamic commands. If the currently processed dynamic command has a
dynamic subcommand they both share the same structure.
As a result tabulation operation may result in undefined behaviour.

As a solution, a new structure was introduced to keep subcommand
information.

Fixes #35926.

Signed-off-by: Jakub Rzeszutko <[email protected]>

* doc/releases: v2.6.0: minor updates

* Added a bullet about new storage subsystem feature
* Moved disk subsystem changes into disk section

Signed-off-by: Kumar Gala <[email protected]>

* cmake: support ZephyrBuildConfiguration_ROOT for package location

Fixes: #35890

The current implementation of Zephyr build configuration CMake package
only allows the build configuration package to be placed inside a
Zephyr workspace.

This commit extends the usability by allowing users to locate the
Zephyr build configuration CMake package outside the Zephyr workspace
and then refer to the package using
`-DZephyrBuildConfiguration_ROOT=<path>`
`set(ZephyrBuildConfiguration_ROOT <path>)`

This allows users greater flexibility in their workspace layouts.

Signed-off-by: Torsten Rasmussen <[email protected]>

* doc: Zephyr build configuration CMake package freestanding

Update to the Zephyr build configuration CMake package documentation
with description on how a Zephyr build configuration CMake package can
be located outside a Zephyr workspace.

Signed-off-by: Torsten Rasmussen <[email protected]>

* doc: application: add details on example-application

Mention example-application as a reference application.

Signed-off-by: Gerard Marull-Paretas <[email protected]>

* doc: add example application to the release notes

Mention the example application as a major enhancement and provide a
link to its repository.

Signed-…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: POSIX POSIX API Library bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants