Compare commits

...

186 Commits

Author SHA1 Message Date
Anas Nashif
321e39a457 release: bump version to 3.7.1-rc1
Bump version to 3.7.1-rc1

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 14:56:52 -05:00
Anas Nashif
7be15c0bd9 doc: releases: update release notes for 3.7.1
Add list of fixed bugs in the 3.7.1 release section.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 14:56:52 -05:00
Krzysztof Chruściński
f7e9a609ed kernel: fatal: Fix NO_OPTIMIZATIONS build
When logging is on and optimization and multithreading is off then
build fails to link because unoptimized compiler/linker seems to not
look beyond the function and it fails trying to link k_thread_name_get.
Reworking the code to make it known to the compiler without optimization
that k_thread_name_get is not needed and not logging current thread
name in that case.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
(cherry picked from commit 28b4bab01c)
2024-11-11 10:06:03 -05:00
Simon Moser
c480aa3e96 doc: fix body length in SMP UART transport
In the description of the partial-final frame of the SMP UART transport
specification was a typo in the maximum allowed raw body size. The size
must not be larger than MTU - 5 because there are 5 bytes occupied by
total length (2), frame termination (1) and crc (2).

Signed-off-by: Simon Moser <simon.github@mailbox.org>
(cherry picked from commit a77d499e2d)
2024-11-11 10:04:43 -05:00
Declan Snyder
713d8c8a62 drivers: nxp_enet: Fix tx error handling
The code path for error handling and timestamping in tx path
was meant to be identical in function to old eth_mcux driver,
but there is actually a discrepancy causing no error handling
for timestamped frames, fix it.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
(cherry picked from commit b29190c314)
2024-11-11 10:04:14 -05:00
Declan Snyder
4c806352bd drivers: ethernet: ksz8081: RMII override RNB part
I for the life of me do not know what is going on here with the RNB chip
but it seems this override must be set in order for the chip to work,
regardless of strap-in configuration, and if not set explicitly, the
value after a reset for these two bits will be seemingly random and
inconsistent. And it was working before by luck before removing a second
redundant reset in a recent commit, because apparently the register
was getting the opposite of the reset value according to the datasheet
which makes it work. The result of these bits after reset seem to vary
depending on host mcu, board, debugger, number of times reset, type of
reset, and with a pinch of random chance after keeping all variables
seemingly the same, so let's just set it to the value that works
explicitly, even if it doesn't make sense. The bit here doesn't have
clear documentation but it seems it's for using RMII regardless of the
strap in option, which is what we want to do anyways if we know the
interface type from DT, so I think it's fine, considering it is making
this driver work again.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
(cherry picked from commit 495a374a0d)
2024-11-11 10:03:51 -05:00
Declan Snyder
efb8a1d030 drivers: ethernet: ksz8081: Fix reset times
500 ms reset time is only for software reset and comes from IEEE spec.
Datasheet mentions for hardware reset the assertion of the signal should
only need to be 500 us, and 100 us after deassert to wait to access
programming interface.

Also remove an unused macro.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
(cherry picked from commit 96877736e4)
2024-11-11 10:03:51 -05:00
Declan Snyder
7098b56481 drivers: mdio_nxp_enet: Don't disable IRQ
No real need to be enabling and disabling IRQs, this logic has been
reported to be causing spurious interrupts and strange behavior, we can
just enable the interrupt and switch to interrupt based logic one time
and keep the interrupt enabled at that point.

Also, fix a W1C bug where |= was used instead of = to clear a flag.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
(cherry picked from commit 2ab104625e)
2024-11-11 10:03:28 -05:00
Zak Portnoy
1aa25cc633 mgmt: smp: shell: Respond on uart shell device when changed at runtime
Responses are currently set to the shell device that was configured
in the device tree.

The shell_uart driver allows for changing it's device during runtime
which leads to a situation where we recieve packets on one device
and respond on another.

This patch causes smp_shell_tx_raw to use the shell_uart device

Signed-off-by: Zak Portnoy <zakportnoy@gmail.com>
(cherry picked from commit 32b1140066)
2024-11-11 09:54:19 -05:00
Dominik Ermel
30af4b2696 tests/storage/stream_flash: Add erase range check test
The commit adds test for stream_flash_erase_page range check.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
(cherry picked from commit 23805301b0)
2024-11-08 12:26:20 -05:00
Dominik Ermel
219d0343fa storage/stream_flash: Fix range check in stream_flash_erase_page
Added check where stream_flash_erase_page checks if requested
offset is actually within stream flash designated area.

Fixes #79800

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
(cherry picked from commit 8714c172ed)
2024-11-08 12:26:20 -05:00
Anas Nashif
064fcfca6b arm: cortex_m: restore fix for loading z_arm_int_exit
This change was in the same commit previously reverted and seem to be
unrelated and should not be reverted.

Fixes the problem:

..... /swap_helper.S:432:(.text.z_arm_svc+0x26):
relocation truncated to fit: R_ARM_THM_JUMP11 against symbol
`z_arm_int_exit' defined in .text._HandlerModeExit section in
....core/cortex_m/libarch__arm__core__cortex_m.a(exc_exit.c.obj)

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit d9bc0b60b9)
2024-11-05 21:07:46 -05:00
Anas Nashif
3993287ce4 Revert "arch: arm: cortex_m: move part of swap_helper to C"
This reverts commit 773739a52a.

Fixes #80701

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit e646b7f3bb)
2024-11-05 18:58:59 -05:00
Anas Nashif
c6635808de Revert "arch: arm: cortex_m: restore comment lost in translation"
This reverts commit 7d7616214b.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit 7aa4032ac6)
2024-11-05 18:58:59 -05:00
Mathieu Choplain
0b41a2713e tests: dma/chan_blen_transfer: move buffer to DMA-accessible memory
This commit moves the test buffer from ITCM (not accessible by DMA) to DTCM
on several NXP boards, to make the test successful.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
(cherry picked from commit eaa799a9b5)
2024-11-05 10:53:37 -05:00
Mathieu Choplain
a23758dbb1 tests: dma/chan_blen_transfer: relocate TX and RX buffers
This commit places the chan_blen_transfer DMA test's TX and RX buffers
in a separate file that gets entirely relocated. This ensures that the
buffers reside in the correct memory, without breaking other things
due to relocation of test data/code.

Fixes #75676.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
(cherry picked from commit 3099491f3e)
2024-11-05 10:53:37 -05:00
Yong Cong Sin
422657bc7f shell: shell_help: fix width for subcommands help text
The terminal offset for subcommands' help text isn't
computed correctly, fix it.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit fd1be9849c)
2024-11-05 10:53:22 -05:00
Yong Cong Sin
480fa71ca5 shell: devmem: minor optimizations
- Use `SHELL_CMD_ARG_REGISTER` for the main cmd to state the
  required number of arguments, this helps to remove the
  runtime check from the command, and also print the help
  message to the terminal when the argument count is
  unexpected.
- Some changes to the help text that hopefully makes the
  mandatory and optional arguments more obvious to the user

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit 276ccd04e7)
2024-11-05 10:53:22 -05:00
David Leach
05acdcfbe4 soc: nxp: lpc55s69: Fix part number typo
There is a typo in the part number list for LPC55S69. The
LPC55S69JET98 should be LPC55S69JEV98.

Fixes #80541

Signed-off-by: David Leach <david.leach@nxp.com>
(cherry picked from commit 46042f73cf)
2024-11-05 10:52:34 -05:00
Abderrahmane Jarmouni
6fc41c1cce drivers: display: stm32_ltdc: fix return value
Blanking On/Off calls should not return 0 when there is no panel
controller to forward them to, instead they should return ENOSYS to
signal to the application that they were not actually executed.

"device_is_ready" does check for null, but also for
"dev->state->initialized == false", so we need to isolate the
"dev == NULL" case.

Signed-off-by: Abderrahmane Jarmouni <git@jarmouni.me>
(cherry picked from commit f7de44dfaf)
2024-11-05 10:52:08 -05:00
Andrej Butok
b258fb0230 samples: smp_svr: fix overlay-udp.conf build
- fixes overlay-udp.conf build for platforms without TRNG.
- adds TEST_RANDOM_GENERATOR, as for most network samples.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
(cherry picked from commit 5c376ad24c)
2024-11-05 10:51:34 -05:00
Henrik Brix Andersen
c125e3b80f drivers: can: sam: fix sys_write32() arguments order
Fix the order of the arguments to sys_write32().

Fixes: #80750

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
(cherry picked from commit 0bb5270f7b)
2024-11-05 10:51:16 -05:00
Fin Maaß
aa18fb8d1f drivers: flash: spi_nor: simplify defines
simplify defines by using `DT_INST_**_OR` macros.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
(cherry picked from commit 83c3b1c708)
2024-11-04 09:25:14 -05:00
Fin Maaß
3c242d5eaf drivers: flash: spi_nor: fix config struct
lots of values from the DT where not set corretly, if
`CONFIG_SPI_NOR_SFDP_RUNTIME` was
enabled. This fixes it.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
(cherry picked from commit 27aeabb5b2)
2024-11-04 09:25:14 -05:00
Artur Wilczak
debf3e0ffc boards: Fix to accommodate for slowly tests on UP2
To accommodate for some slow tests on up2.
For example: tests/arch/x86/info/arch.x86.info.userspace
Execution time of this test is close to 55s and sometimes
above up to the 60s.
Related issue: #80134

Signed-off-by: Artur Wilczak <arturx.wilczak@intel.com>
(cherry picked from commit 9cce72daa1)
2024-11-04 09:24:50 -05:00
Gerson Fernando Budke
739247e680 mgmt: mcumgr: stat: Fix stat_mgmt_list behavior
The MCUmgr statistics only work correctly when selecting
MCUMGR_SMP_LEGACY_RC_BEHAVIOUR option. Checks the option
flag on the stat_mgmt_list and fix the behavior.

Fixes: 80476

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
(cherry picked from commit b46e176704)
2024-11-04 09:24:35 -05:00
Daniel DeGrasse
04bbca7464 boards: nxp: frdm_rw612: correct max frequency for WS25Q512JV
WS25Q512JV can only run at 104MHz at 3.3V, unless the read parameter
bits are changed. Since we don't reprogram these currently, reduce max
frequency to safe value

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
(cherry picked from commit 23d253727c)
2024-11-04 09:24:07 -05:00
Daniel DeGrasse
29b2bf89f8 drivers: flash: flash_mcux_flexspi: add support for W25Q512JV
Add support for the W25Q512JV with the FLEXSPI, using a custom
LUT table.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
(cherry picked from commit 6bc73df06b)
2024-11-04 09:24:07 -05:00
Andreas Huber
96a05d09f2 net: ipv4: Fix ARP probe check in address conflict detection
The second condition needs to check ARP probes only

The ACD is not properly implemented as described in RFC5227 ch. 2.1.1
The implementation incorrectly detects an IP conflict, if an ARP request
is received for the target IP.
The reason is that the current implementation checks for ARP requests
instead of ARP probes.

Signed-off-by: Andreas Huber <andreas.huber@ch.sauter-bc.com>
(cherry picked from commit 27d93f8b6c)
2024-11-04 09:23:45 -05:00
Alberto Escolar Piedras
a3315af1d1 manifest: Update EDTT to latest version
Update the EDTT module to:
b9ca3c7030518f07b7937dacf970d37a47865a76

Including the following:
* b9ca3c7 Fix for for python >= 3.11
* fe9b1d1 Corrected ISO interval for LL/CIS/PER/BV-05-C

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
(cherry picked from commit 59685b512e)
2024-11-04 09:22:34 -05:00
Daniel Leung
db2df7129f xtensa: mpu: update hardware if manipulating current domain
If adding/removing to the domain of the current running
thread, we need to update the hardware MPU regions or else
the addition or removal would not be reflected to current
running thread.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
(cherry picked from commit da5f7e1816)
2024-11-04 09:20:49 -05:00
Daniel Leung
5d466aad19 xtensa: mpu: make sure write to MPU regions is atomic
This adds a spinlock to make sure writing to hardware MPU
regions is atomic, and cannot be interrupted until all
regions are written to hardware.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
(cherry picked from commit 6bd0dcf920)
2024-11-04 09:20:49 -05:00
Yong Cong Sin
4aa56071f1 testsuite: coverage: fix typo in the CMakeLists.txt
`zephyr_BASE` should have been `ZEPHYR_BASE`, fix it.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
(cherry picked from commit a5555ab077)
2024-11-04 09:20:21 -05:00
Benjamin Cabé
61c2965c65 doc: css: fix styling of signatures
Sync the section of the custom.css dedicated to object
signatures with Godot custom CSS.

Fixes #80005.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit c7f1f32ebe)
2024-11-04 09:20:06 -05:00
Henrik Brix Andersen
30b0a75429 ci: build samples/cpp/hello_world as part of the multiplatform test
Build the C++ version of the Hello, World sample as part of the
multiplatform (build) test in CI.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
(cherry picked from commit cd543887f4)
2024-11-04 09:19:36 -05:00
Henrik Brix Andersen
1f93bd74b3 SDK_VERSION: Use Zephyr SDK 0.16.9
This commit updates ZEPHYR_SDK to point to the Zephyr SDK 0.16.9 release.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-11-04 09:19:36 -05:00
Torsten Rasmussen
6da35a811a cmake: limit Zephyr SDK to 0.16.x series for Zephyr 3.7 LTS
Zephyr SDK compatibility level 0.16 is now an LTS intended for
Zephyr v3.7 LTS.

Thus, limit the upper Zephyr SDK lookup to <0.17, so that developers
working with Zephyr v3.7 LTS and latest Zephyr main can install both
Zephyr SDK 0.16.x along side Zephyr SDK >=0.17 and have the Zephyr SDK
0.16.x series being used for v3.7 LTS development.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-10-24 14:05:16 +02:00
Torsten Rasmussen
c94fee82c1 cmake: support range for find_package(Zephyr-sdk)
Fixes: #80200

CMake `find_package(<package> <version>)` support the use of ranges,
like `1.0.0...4.0.0`.

Update the FindZephyr-sdk.cmake module to support this.
This allows looking up the Zephyr SDK with an upper boundry, for example
`find_package(Zephyr-sdk 0.16...<0.17)`.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-10-24 14:05:16 +02:00
Jakub Topic
f5e54e6255 drivers: rtc: rv3028: preserve CLKOUT when enabling callbacks
This commit addresses an issue where enabling the alarm or update
callbacks unexpectedly disabled the RTC's programmable clock output
during runtime.

The interrupt configuration has been moved to the driver's init
function.

Signed-off-by: Jakub Topic <jakub.topic@anitra.cz>
(cherry picked from commit f395519104)
2024-10-23 20:10:18 -04:00
Tomi Fontanilles
d662d62ef0 mbedtls: update to 3.6.2
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.2

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-10-23 20:09:42 -04:00
Jun Lin
a3266a8b62 drivers: espi: host_subs: npcx: fix LDN register definition of PMCH
The register offset definition of the I/O port Data Base Address
register (0x60, 0x61) and Command/Status Base Address register
(0x62, 0x63) are reversed. This commit fixes it to avoid confusion.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
(cherry picked from commit 51cfbd8c5f)
2024-10-17 23:20:45 -04:00
Yong Cong Sin
793065cc19 irq: multilevel: fix irq_parent_level_3()
The IRQ for level 1 and above is incremented by 1 when encoded
with Zephyr's multilevel IRQ scheme, so it should be
decremented by 1.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-17 23:20:08 -04:00
Laurentiu Mihalcea
22b72e62d3 drivers: dai: sai: don't crash on underrun/overrun
TX/RX FIFO underrun shouldn't crash the RTOS when it occurs.
Also, since this can also happen under "normal" conditions
(i.e: DMA doesn't copy data fast enough from/to SAI's FIFOs)
the software should be able to recover from it.

As such:
	1) Remove `z_irq_spurious()` call.
	2) Clear error flag
	3) De-escalate error message to warning message

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
(cherry picked from commit e224a41ec8)
2024-10-17 23:19:03 -04:00
Ibe Van de Veire
ff72087063 test: net: igmp: Add extra IGMPv3 testcase
Added extra testcases for the IGMPv3 protocol. The IGMP driver is
supposed to send an IGMPv3 report when joining a group.

Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
(cherry picked from commit e6dd4cda89)
2024-10-17 23:18:32 -04:00
Ibe Van de Veire
29f425f687 net: ip: igmp: Add igmp.h for definitions
Add igmp.h file to declare definitions for IGMP that are not meant te be
included by the application but can be used in e.g. tests.

Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
(cherry picked from commit ba9eca3181)
2024-10-17 23:18:32 -04:00
Ibe Van de Veire
a126a0858c net: ip: igmp: Remove too strict length check
According to RFC2236 section 2.5, the IGMP message may be longer then 8
bytes. The rest of the bytes should be ignored.

Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
(cherry picked from commit c646dd37e5)
2024-10-17 23:18:32 -04:00
Ibe Van de Veire
ea219dbb82 net: ip: igmp: Fix wrong header length
The header length of the net ip packet was calculated using only the
net_pkt_ip_hdr_len function. The correct header length should be
calculated by adding net_pkt_ip_hdr_len and net_pkt_ipv4_opts_len. This
resulted in an incorrect IGMP version type in case of IGMPv2 message
(when IGMPv3 was enabled). The IGMP message was not parsed correctly and
therefore dropped.

Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
(cherry picked from commit f852c12360)
2024-10-17 23:18:32 -04:00
Marcio Ribeiro
c69bea047f sample: input_dump: enables INPUT_ESP32_TOUCH_SENSOR for Espressif boards
.conf files added to enable INPUT_ESP32_TOUCH_SENSOR during sample build.
The absence of these files incorrectly prevented the input_dump sample
build from failing due to missing required hal files.

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-10-17 23:17:53 -04:00
Marcio Ribeiro
a3f574e5dd manifest: esp32: update hal_espressif
Update to fix regression regarding to touch_sensor on hal_espressif.

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-10-17 23:17:53 -04:00
Johann Fischer
1c9470285a drivers: udc: add opaque pointer to store upper layer private data
Add an opaque pointer to store upper layer private data and initialize
it with the USB device context during controller initialization. Use the
pointer in event processing to get the correct context.

Fixes commit 48f2a4bc1a
("usb: device_next: remove initialized state checks in event processing")

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
(cherry picked from commit 5ddaa3b1a1)
2024-10-17 23:16:08 -04:00
Daniel DeGrasse
da137a587a soc: nxp: lpc55xxx: fix dependencies for SOC_FLASH_MCUX
SOC_FLASH_MCUX has additional dependencies for LPC55xxx CPUs, due to the
fact that the flash should be disabled when executing in nonsecure mode.

Since the merge of HWMv2, this dependency has been set incorrectly at
the SOC level, resulting in the IAP flash driver being enabled when
targeting CPU1, which is incorrect. Fix the Kconfig dependency to
resolve this issue.

Fixes #79576

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
(cherry picked from commit feb0241536)
2024-10-17 23:15:29 -04:00
Gero Schwäricke
69f61ebcaa boards: hardkernel: odroid_go: fix PSRAM size
Booting the hello world sample fails with an error on the odroid go:

  I (124) quad_psram: This chip is ESP32-D0WD
  I (124) esp_psram: Found 4MB PSRAM device
  I (124) esp_psram: Speed: 40MHz
  I (125) esp_psram: PSRAM initialized, cache is in normal (1-core) mode.
  SPIRAM size is less than configured size, aborting.
  abort()

The device features only 32 Mbit PSRAM (4 MiB), see

  dts/xtensa/espressif/esp32/esp32_wrover_e_n16r4.dtsi

included from

  boards/hardkernel/odroid_go/odroid_go_procpu.dts

Signed-off-by: Gero Schwäricke <gero.schwaericke@posteo.de>
(cherry picked from commit db1adf4c7e)
2024-10-16 13:35:09 -04:00
Benjamin Cabé
65cc5d4d31 doc: fix issue with keydown/keyup being ignored
Ensure initial search menu visibility is properly set so that key
events don't get trapped preventing arrow key navigation on the
document.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit b3776ca97c)
2024-10-16 13:34:53 -04:00
Jamie McCrae
cd43f1be07 sysbuild: cmake: Fix ExternalZephyrProject_Add() revision handling
Fixes an issue with HWMv2 boards whereby the specified board
revision was not applied at the correct place, which would cause
the target image to fail configuration

Fixes #79208

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
(cherry picked from commit 96c6c7863a)
2024-10-16 13:34:37 -04:00
Abram Early
32029b8dd0 modbus: reset wait semaphore before tx
A response returned after a request times out would increment the
semaphore and stay until the next request is made which will immediately
return when k_sem_take is called even before a response is returned. This
will once again have the same problem when the actual response arrives.
So the wait semaphore just needs to be reset before transmitting.

Signed-off-by: Abram Early <abram.early@gmail.com>
(cherry picked from commit 583f4956dc)
2024-10-16 13:33:55 -04:00
Jonathan Rico
02352b35a2 Bluetooth: L2CAP: document memset requirement
The `struct bt_l2cap_le_chan` and `struct bt_l2cap_br_chan` objects
should be memset before passing them to the stack.

This was not stated anywhere, but all the in-tree users are doing it, so
it must be API.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit e1ac3866ee)
2024-10-15 19:07:56 -04:00
Yong Cong Sin
34a68c47d7 tests: arch: common: stack_unwind: add qemu_riscv32e
qemu_riscv32e uses a different ISA and is kinda special, add it
to the testcase for better coverage.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-15 19:07:37 -04:00
Yong Cong Sin
d1a519e1a5 arch: riscv: stacktrace: fix output without ra on the stack top
Account for the scenario when we are doing `esf`-based
unwinding from a function which doesn't have any callee.
In this case the `ra` is not saved on the stack and the
second function from the top of the frame could be missing.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-15 19:07:37 -04:00
Simone Orru
7caed78e47 modules: mbedtls: Enable PEM writing when PEM cert format is selected
Enable the `MBEDTLS_PEM_WRITE_C` mbedtls configuration option when
`CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT` is selected.

Signed-off-by: Simone Orru <simone.orru@secomind.com>
(cherry picked from commit ad208e1e7c)
2024-10-15 19:07:02 -04:00
Kurtis Dinelle
29a84b13ec sensor: tsl2591: fix: Address CID 353644 & 353654
Fixes implicit sign-extension/potential overflow by explicitly casting
to int64_t.

Signed-off-by: Kurtis Dinelle <kurtisdinelle@gmail.com>
(cherry picked from commit 5eeff698ca)
2024-10-15 19:06:46 -04:00
Declan Snyder
46a13006d0 ethernet: phy_mc_ksz8081: Don't reset in cfg link
No need to reset in cfg link, this was blocking system workqueue during
phy callbacks that call cfg link, since this happens from monitor work
handler which is in the system workqueue.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
(cherry picked from commit e904743152)
2024-10-15 19:06:32 -04:00
Christophe Dufaza
9739759fef west: blobs: verify fetched blobs after downloading
Running 'west blobs fetch' does not verify the digest of downloaded files:
1. if the checksum of the previously downloaded file does match
   that in the blob metadata (status BLOB_PRESENT), do nothing
2. if the checksum of the previously downloaded file does not match
   that in the blob metadata (status BLOB_OUTDATED),
   download the "up to date" file
3. if the blob has not yet been downloaded (status BLOB_NOT_PRESENT),
   download it

None of the 2) and 3) code paths will verify that the checksum of the file
just downloaded actually matches the digest in the blob's metadata.

In the event that the metadata of a module is incorrect, then the user
will not notice anything, and may rely on an unexpected binary,
e.g. a static library for a different architecture.

According to the Binary Blobs documentation [1], the expected
behavior is to check the blob digest after downloading.

[1] Fetching blobs, Zephyr 3.6.0 (still applies to Zephyr 3.7.0rc3)
docs.zephyrproject.org/3.6.0/contribute/bin_blobs.html#fetching-blobs

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
(cherry picked from commit 2b2a0e04b2)
2024-10-05 16:11:41 -04:00
Christophe Dufaza
0e62cd5831 west: blobs: prefer constants to literals for blob status
Replace blob status literals with the corresponding
constants defined in zephyr_module.

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
(cherry picked from commit ae9326c920)
2024-10-05 16:11:41 -04:00
Martin Stumpf
2da1ef8677 drivers: cc: mcux: Fix incorrect clock source of FlexSPI2
The clock control mcux rev2 returns FlexSPI1 clock rate when FlexSPI2
clock rate is requested.

Signed-off-by: Martin Stumpf <martin.stumpf@vected.de>
(cherry picked from commit 4ec266152d)
2024-10-05 16:11:27 -04:00
Jamie McCrae
68247afbae doc: services: device_mgmt: mcumgr: Correct license for tool
Corrects an incorrect license for a tool

Fixes #78927

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-10-05 15:58:02 -04:00
Sylvio Alves
53a9f6b7ca soc: esp32s3: fix initialization code
ESP32-S3 initialization code should apply the errata
after cache initialization. This fixes it making sure
data and cache instruction are properly
handled and let following calls to work as needed.

This also update hal_espressif to force gcc to treat
register bitfield structs declared as volatile to
ensure writes on 32 bit peripheral registers.

Fixes #71397
Fixes #76325

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-05 15:57:39 -04:00
Grzegorz Swiderski
1c3cb74c67 cmake: Require Python >= 3.10
The minimum Python version was bumped for Zephyr LTSv3, but only in the
documentation and CI. The build system would still accept Python 3.8,
yet some scripts in tree have already broken support with that version.
Incompatibility errors should be prevented early.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
(cherry picked from commit 9d1b361265)
2024-10-05 15:57:04 -04:00
Daekeun Kang
bc18a9a7c0 net: fix handle unaligned memory access in net_context_bind()
This commit addresses an issue in net_context_bind() where unaligned
memory access was not properly handled when checking for INADDR_ANY.
The problem primarily affected MCUs like ARMv6 that don't support
unaligned memory access.

- Use UNALIGNED_GET() to safely access the sin_addr.s_addr field
- Ensures correct behavior on architectures with alignment restrictions

This fix improves compatibility and prevents potential crashes or
unexpected behavior on affected platforms.

Signed-off-by: Daekeun Kang <dkkang@huconn.com>
(cherry picked from commit b24c5201a0)
2024-10-05 15:56:30 -04:00
Yong Cong Sin
5e4e4bf511 tests: arch: riscv: test csf registers value
Test if callee-saved-registers values are as expected.

Signed-off-by: David Reiss <dreiss@meta.com>
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
(cherry picked from commit 4da4ee8ece)
2024-10-05 15:56:08 -04:00
Yong Cong Sin
6a1f9982ff arch: riscv: isr.S: restore s0 before jumping to z_riscv_fatal_error_csf
Restore the s0 we saved early in ISR entry so it shows up
properly in the CSF.

Signed-off-by: David Reiss <dreiss@meta.com>
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
(cherry picked from commit 4bbc2a7893)
2024-10-05 15:56:08 -04:00
Alexi Demers
b26773fc08 usb: fix wrong capacity report for USB mass storage device
Usb "write" method never copies the input data buffer, it uses the
buffer pointer directly. The fact that it was on the stack made
the buffer ephemeral, and could disappear before the USB transfer
actually occurred. The data transmitted was then random. This commit
converts the transfer buffer to a static buffer, so that it always
exists for the duration of the USB transfer.

Known side-effect: if "read capacity" command is read twice
simultaneously, the same buffer will be used twice. As the capacity of a
USB drive should not change between 2 calls, this side effect can be
ignored.

Signed-off-by: Alexi Demers <alexi.demers@axceta.com>
(cherry picked from commit 32481b6418)
2024-10-02 14:41:57 +01:00
Lyle Zhu
53738cf924 bluetooth: AVDTP: Check buffer len before pulling data
Check the remaining buffer length is not less than
required data length before pulling data from the
buffer.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
(cherry picked from commit 8113ff7e9c)
2024-09-26 09:22:20 -04:00
Yong Cong Sin
448cb69a78 drivers: intc: plic: fix IRQ on every hart regardless of mapping
Allow IRQs to work on every hart regardless of the mapping
of the contexts.

Add a test to validate the hart-context mapping.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit 475ff826d6)
2024-09-26 09:21:59 -04:00
Robert Lubos
60fe9f9d91 net: sockets: tls: Prevent infinite block during handshake
In case peer goes down or we disconnect from the network during the
TLS handshake, the TLS socket may block indefinitely during
connect()/accept(), waiting for data from the peer. This should be
avoided, hence use the preconfigured timeout for the TLS handshake,
same as we use for TCP-level handshake.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit fc007eeef5)
2024-09-26 09:21:29 -04:00
Florian Grandel
60fb882739 net: l2: ieee802154: decouple frame decryption from upper layer fields
The L2 function `ieee802154_decipher_data_frame()` relied on upper layer
LL address fields which breaks encapsulation.

Also fixes a bug introduced in another fix that went overboard (#53734).

Fixes: #78490

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
(cherry picked from commit da0371accf)
2024-09-26 09:21:09 -04:00
Florian Grandel
110eb533a8 net: l2: ieee802154: move vars to top of block
Found a few variable declarations that were not yet moved to the top of
the function/block. Doing this before actually fixing #78490 so that the
fix becomes more readable.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
(cherry picked from commit 766fda06c2)
2024-09-26 09:21:09 -04:00
Florian Grandel
3c3d2a26dc net: l2: ieee802154: fix typo
renamed ieeee802154 to ieee802154

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
(cherry picked from commit a7f235596c)
2024-09-26 09:21:09 -04:00
Lukasz Mrugala
a0ee633030 scripts: Remove wrong bz package
Package in the requirements-run-test.txt file, bz,
is not package enabling bz2 support.
It is a security concern and must be removed.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
(cherry picked from commit cbe5d9833b)
2024-09-26 09:20:44 -04:00
Jukka Rissanen
a62c741720 net: if: Check chksum offloading properly for VLAN interfaces
Make sure we check the checksum offloading capabilities correctly
for VLAN interfaces. Use the real Ethernet interface when doing the
check.

Fixes #78724

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 00bb90a42e)
2024-09-26 09:19:59 -04:00
Florian Grandel
86e62dd482 net: l2: ieee802154: fix deadlock
When an incoming PAN ID does not match or when an error occurs while
sending association requests, then locks were not properly released.

Fixes #78495

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
(cherry picked from commit 041d8c707c)
2024-09-25 04:02:38 -04:00
Jeppe Odgaard
d826a69a88 dts: arm: st: stm32h5: fix spi 1-3 clocks
The STM32 SPI driver, `spi_ll_stm32.c`, reads the clock frequency via
`clock_control_get_rate()`. The first `clocks` index is used as subsystem
argument if there is no second index, but this is not the source clock for
SPI 1, 2, and 3.
This causes the prescaler value calculation to be incorrect, resulting in a
frequency potentially above the `spi-max-frequency` value.

Add clock source for SPI instances 1, 2 and 3, that matches the default
clock configuration register reset value, which resolves the issue.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
(cherry picked from commit 40cae2d281)
2024-09-23 06:56:20 -04:00
Jukka Rissanen
db20aca2c7 net: mdns_responder: Set socket of service for statistics purposes
If the dispatcher is muxing the connection i.e., so there are two
services for the same port, then mark service socket descriptor
of the service with the socket number so that "net sockets" shell
command can show a proper value for it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 1f627e3a1b)
2024-09-23 06:56:05 -04:00
Jukka Rissanen
50227e38f6 net: dns: Add per socket user data for the dispatcher
The socket services API has a limitation where the user data is shared
between file descriptors described in the same service.

This can cause problem in DNS dispatcher where each listened socket
needs to have their own dispatcher struct set as user data so that we
can map between dispatcher context and socket. Solve this by always
have a dispatcher table as user data, and then have the actual mapping
done via the dispatcher table when receiving data to the dispatcher socket.

Fixes #78146

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit caf9fd345f)
2024-09-23 06:56:05 -04:00
Yong Cong Sin
51b53de08e arch: riscv: fill all IRQ stacks with 0xAA
Fill the memory of all CPU's IRQ stack with 0xAA on init, so
that `z_stack_space_get` can calculate the remaining space
correctly.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit 035c822253)
2024-09-23 06:55:25 -04:00
Yong Cong Sin
331ad9956a devicetree: add DT_INST_NUM_IRQS()
Add `DT_INST_NUM_IRQS()` to get the number of interrupt lines
of the current `DT_DRV_COMPAT`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit ee08ebd9ca)
2024-09-23 06:54:09 -04:00
Maxime Vincent
f2ef1c8cd8 soc: arm: nxp: fix USB w/ SPEED_OPTIMIZATIONS
Fix USB w/ SPEED_OPTIMIZATIONS for LPC55xxx SoCs
Root cause was non-volatile register access,
which could get optimized by the compiler
(by -fschedule-insns, specifically)

Signed-off-by: Maxime Vincent <maxime@veemax.be>
(cherry picked from commit f86f98fa2e)
2024-09-23 06:52:28 -04:00
Sylvio Alves
ed1db9695e bugfix: soc: esp32: disable interrupts in flash operation
When interrupts are placed in flash, it needs to be disabled
when flash operations are called. This is not happening in current
v3.7.0 release, causing system to crash whenever flash operations
and interrupts happens simultaneously.

Fixes #77952

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-09-17 20:43:09 -04:00
Flavio Ceolin
062d4d5e11 serial: uart_async_rx: Avoid possible division by zero
Ensures that config->but_cnt is not zero.

Fixes #66800
CID #338107

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
(cherry picked from commit 5822267c23)
2024-09-17 15:05:06 -04:00
Luca Burelli
2b4e3274f2 samples/llext/modules: sample.yaml fixes
Apply cleanups suggested by Anas in a Github discussion to the
sample.yaml file.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
(cherry picked from commit f889c4e288)
2024-09-17 15:04:51 -04:00
Luca Burelli
e6599a1e30 samples/llext/modules: build hello_world as built-in by default
This commit changes the default value of CONFIG_HELLO_WORLD_MODE to 'y'
so that the hello_world function is compiled as a built-in part of the
Zephyr image by default. This is the simplest possible configuration,
that works for all architectures.

To build hello_world as an llext module, the user must either follow the
commands in the documentation or set CONFIG_HELLO_WORLD_MODE=m in the
project file along with additional architecture-specific settings that
may be required for proper LLEXT support on the target.
Leave a note in the prj.conf and sample.yaml files to remind the user.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
(cherry picked from commit 030c1c8308)
2024-09-17 15:04:51 -04:00
Tomi Fontanilles
ef5f7bb9ee doc: release notes: add 3.7.1
And the Mbed TLS update entry.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-09-16 06:49:19 -04:00
Tomi Fontanilles
bff2e8d1a5 manifest: mbedtls: update to 3.6.1
Brings in Mbed TLS 3.6.1.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
(cherry picked from commit b9b166c7f8)
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-09-16 06:49:19 -04:00
Matthias Alleman
42bffa7eee drivers: ethernet: nxp_enet: Fused MAC address fixes
Add required initialisation of OCOTP. The IMXRT10XX
variants don't support fuseWords to be greater than 1.
MAC0 fuse map address is 0x22 instead of 0x620.
Fill in mac_addr buffer correctly.

Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
(cherry picked from commit 931628a78a)
2024-09-11 07:40:49 -04:00
Martin Stumpf
5c8d7b2671 linker: section_tags: fix missing include
If using `<zephyr/linker/section_tags.h>` without including
`zephyr/linker/sections.h` as well, we get a warning an the linker fails
to place the data in the desired section.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
(cherry picked from commit 77eafac1bf)
2024-09-06 13:06:45 -04:00
IBEN EL HADJ MESSAOUD Marwa
b8fa7eec2e drivers: i2s: i2s_ll_stm32: Handle single clock source
Modify the function "i2s_stm32_set_clock" to handle the case where pclk_len
it is not greater then 1 and to ensure that the freq_in
variable is correctly set in both cases.

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
(cherry picked from commit 2353b9391b)
2024-09-06 13:06:22 -04:00
Pavel Vasilyev
d4a551437e bluetooth: host: adv: Release buf if failed to set addr
The `bt_id_set_adv_own_addr` function itself tries to allocate a buffer
for the command and it failes due to lack of buffers, it returns error.
However, the `le_ext_adv_param_set` function doesn't handle the error
properly and keeps its own allocated buffer.

This commit releases the allocated buffer.
Partially fixes mesh in #77241.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
(cherry picked from commit 2f02474448)
2024-09-06 13:06:03 -04:00
Erik Tamlin
2d75520b66 modules: percepio: Fix python executable name
Fix python executable name in percepio module's CMakeLists.txt

Signed-off-by: Erik Tamlin <erik.tamlin@percepio.com>
(cherry picked from commit bb784c45dd)
2024-09-02 18:28:30 -04:00
Axel Le Bourhis
9f39eb92c5 tests: net: socket: udp: clear control data buffer before recvmsg
Currently, the test doesn't clear the control data buffer before
calling recvmsg. This leads to recvmsg being unable to add the new
control data, which corresponds to the current received data.
This commit aims to clear the control data buffer to match most use
cases, when the control data buffer is empty before calling recvmsg.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
(cherry picked from commit 179c85aa06)
2024-08-31 06:51:43 -04:00
Axel Le Bourhis
ae03e45bf5 net: sockets: Update msg_controllen in recvmsg properly
According to recvmsg man page, msg_controllen should be set to the sum
of the length of all control messages in the buffer.
This is missing from the current recvmsg implementation.
This commit aims to fix this by updating msg_controllen each time control
data are added to the buffer.
This commit also fixes cases where the msg_controllen is cleared
incorrectly.

Fixes #77303

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
(cherry picked from commit 5d643f4b00)
2024-08-31 06:51:43 -04:00
Jonathan Rico
574a6dff57 tests: Bluetooth: disable optimizations in unit test
Very very weird behavior.

Deleting the `options & BT_LE_ADV_OPT_USE_NRPA` branch in
`id.c:bt_id_set_adv_own_addr` makes the test pass. But add a log in that
branch, and you'll see that we never take it in the UT binary..

I don't have time for this, maybe some compiler guru or C language
lawyer can look at that decompiled function and figure out the root
cause.

Someone should also really fix the Bluetooth unit tests and make them
run on any Bluetooth related PR. Also nightly.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 4ab8073b87)
2024-08-31 06:51:32 -04:00
Johan Hedberg
7378a05350 Bluetooth: Host: Fix incorrect build assert
We want to make sure `struct closure` fits in the user data, so a user data
size of `sizeof(struct closure)` is valid.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
(cherry picked from commit 5736b71193)
2024-08-31 06:51:32 -04:00
Daniel DeGrasse
cc62418d75 drivers: sdhc: imx_usdhc: assume card is present if no detection method
The imx USDHC driver previously queried the peripheral's internal card
detect signal to check card presence if no card detect method was
configured. However, some boards do not route the card detect signal and
do not work correctly with the DAT3 detection method supported by this
peripheral. As a fallback, assume the card is present in the slot but
log a warning to the user.

Fixes #42227

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
(cherry picked from commit 17f71e19f0)
2024-08-31 06:51:21 -04:00
Armando Visconti
d800ccea86 drivers/sensor/st: Fix wrong data byte swap for be
A 16-bit value built using byte shifts and ORs from a given
couple of lsb and msb bytes will result to be the same on both
little-endian and big-endian architectures, e.g.

    uint8_t lsb, msb;
    int16_t val;

    /* val is the same number on both le and be archs, but has
       different layout in memory */
    val = (msb << 8) | lsb;

All the xyz_raw_get() APIs of stmemsc sensor module build the sensor
data using the above method and DO NOT hence require (it actually leads
to wrong values on big-endian machines) to use any le/be swap routines,
such as sys_le16_to_cpu().

Fix #75758

Signed-off-by: Armando Visconti <armando.visconti@st.com>
(cherry picked from commit 9ea4cb96cd)
2024-08-31 06:51:05 -04:00
Anas Nashif
df9a905979 ci: rerun issue check on PR edit
Re-run issue check when a PR is updated, i.e. when someone adds
'Fixes...` to the PR body.

This is mostly for release branches and has no effect on main branch.

Also, add concurrency check in the workflow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit 4077249cc7)
2024-08-27 21:33:23 -04:00
Dat Nguyen Duy
e84c516589 dts: nxp_rt1010: mark edma channel has separate interrupt entry
In SoC imxrt1010, edma channel has separate interrupt entry,
not like the rest of in-tree imxrt SoC series

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
(cherry picked from commit b7b17fa0eb)
2024-08-26 20:58:46 -04:00
Joel Guittet
57a0dbd729 net: websocket: fix undefined reference
Fix undefined reference to MSG_DONTWAIT while building websocket client.

Signed-off-by: Joel Guittet <joelguittet@gmail.com>
(cherry picked from commit 4c16ec1fba)
2024-08-26 20:58:31 -04:00
Peter van der Perk
9b58209b01 soc: rt11xx: Fix bus clocking
IMXRT117X bus clock should be 240MHz and IMXRT116X should be 200MHz

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
(cherry picked from commit d1a6b45345)
2024-08-26 20:58:09 -04:00
Anders Bjørn Nedergaard
abf93151c2 soc: rt11xx: Fix dual core ENET PLL
IMXRT11XX secondary core should not deinit ENET PLL
as it could be configured by primary core.

Signed-off-by: Anders Bjørn Nedergaard <abn@polytech.com>
(cherry picked from commit 29dc419ad2)
2024-08-26 20:57:47 -04:00
Jonathan Rico
afedbb419e Bluetooth: Host: Add missing bt_tx_irq_raise()
Trigger the TX processor on connection teardown.

When a disconnection happens before the controller has acknowledged some
ACL fragments the host has sent, we run `process_unack_tx()` to free
those unacknowledged buffers and their associated TX contexts.

The problem is that the TX processor still holds a reference to the conn
object. That reference is not released until the TX processor is
triggered again and figures out that the connection is invalid.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 80a92f51a5)
2024-08-22 14:22:15 -04:00
Jonathan Rico
22877ed2ae Bluetooth: Host: Add disconnection during TX fragmentation test
Verifies that we don't leak connection references when the peer goes out
of range whilst we are fragmenting and sending data to the controller.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 043de7da2a)
2024-08-22 14:22:15 -04:00
Ioannis Damigos
6c4a190a31 gpio_smartbond: Fix port_set_masked_raw
Writing directly to Px_DATA_REG modifies pins which are not
indicated by mask, causing gpio_basic_api test to fail.

Use Px_SET_DATA_REG and Px_RESET_DATA_REG to modify only
pins indicated by mask.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
(cherry picked from commit 782967a1e3)
2024-08-21 21:07:25 -04:00
Ioannis Damigos
da2d5e6fbe gpio_smartbond: Remove pdc entry only if it exists
Remove pdc entry only if index exists when CONFIG_PM
is set.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
(cherry picked from commit 82d17f1f2c)
2024-08-21 21:07:25 -04:00
Ioannis Damigos
7a24c590cf gpio_smartbond: Set pin to input when it is configured as GPIO_DISCONNECTED
Set pin to input with no resistors selected when it is configured as
GPIO_DISCONNECTED.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
(cherry picked from commit df86860319)
2024-08-21 21:07:25 -04:00
Ioannis Damigos
c0ed85cb60 entropy_smartbond: Clear pending interrupts after disabling TRNG
Clear pending interrupts after disabling TRNG to avoid
smartbond_trng_isr getting called with TRNG disabled

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
(cherry picked from commit bacd6c31d6)
2024-08-21 21:07:25 -04:00
Jonathan Rico
9584ac74d6 Bluetooth: Host: Free ACL RX fragments on disconnection
This function call frees the buffer kept by the host for reassembling L2CAP
PDUs into.

Without this call, the current buffer will eventually be
leaked, leading to a non-functional host due to lack of RX buffers.

The effect is worse when host flow control is not enabled, as the RX
buffer pool is shared with events, which means communication with the
controller is essentially dead.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 8a2fe27c00)
2024-08-21 16:50:44 -04:00
Jonathan Rico
01dc4e1adc Bluetooth: hci_common: Add assert on buf allocation
`net_buf_alloc(K_FOREVER)` can now return NULL if running in the system
workqueue. `bt_hci_evt_create()` is called in that context in a few cases.

Since we can't really do anything about it, add a (default-on) assert.

This should ideally never fail. I saw it fail because of a leak in the ACL
buffer pool, which is also shared with events when host flow control is not
enabled.

In that particular case, the host is rendered non-functional, so trying to
recover using error handling is futile.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 5a4fdfbf3e)
2024-08-21 16:50:44 -04:00
Jonathan Rico
fb270828a6 Bluetooth: L2CAP: Add re-assembly stress test
Add a test that verifies no resources are leaked when re-assembling L2CAP
PDUs over an unreliable channel (ie. lots of disconnects).

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit e489ec2b95)
2024-08-21 16:50:44 -04:00
Benjamin Cabé
25adea3428 fs: fuse: ensure S_IFxxx macros are available
set _XOPEN_SOURCE appropriately to avoid compilation errors
due to missing S_IFxxx macros on some systems.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit 4458a05ec2)
2024-08-20 14:53:13 -04:00
Théo Battrel
4f0e8a80f3 Tests: Bluetooth: Add another ISO frag test
This test create a setup where an ISO broadcaster will send fragmented
data and get stopped after sending the first fragment and repeating that
operation multiple time to verify that buffers are not leaked.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
(cherry picked from commit f3dcaaee35)
2024-08-20 14:51:41 -04:00
Théo Battrel
7e17f1e4ed Bluetooth: Host: Unref ISO fragments after disconnection
When sending data using ISO and the data is fragmented, if the
connection is cut before all the fragments are sent, the data buffer
will be leaked.

Fix the issue by unref'ing the buffer when ISO is not in a connected
state.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
(cherry picked from commit 3a098c9f61)
2024-08-20 14:51:41 -04:00
Théo Battrel
5bd5bf8530 Bluetooth: Host: Free ISO TX context
When disconnected while sending data, if ISO doesn't get the number of
completed packets it will not call `process_unack_tx` and thus will leak
TX context.

Fix that by setting the connection state in ISO disconnection which will
trigger a call to `process_unack_tx`.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
(cherry picked from commit 70696f5b0f)
2024-08-20 14:51:41 -04:00
Maxime Vincent
748ccc1661 soc: arm: nxp lpc55xx: fix nxp,ctimer-pwm init procedure (attach clock)
Add clock init for nxp-ctimer-pwm DTS nodes.

Signed-off-by: Maxime Vincent <maxime@veemax.be>
(cherry picked from commit 3a895ecea8)
2024-08-19 17:23:02 -04:00
Robert Lubos
20e7ef389d net: lib: http_server: Clear http1_headers_sent flag on new request
http1_headers_sent flag has to be cleared when entering
HTTP_SERVER_REQUEST_STATE and not only on the client init. Otherwise,
serving multiple HTTP1 POST requests over the same connection does not
work as intended (headers were not sent for the second and further
requests).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 086faa56aa)
2024-08-18 16:00:45 -04:00
Henrik Brix Andersen
6c4d9e0b59 dts: arm: nxp: lpc55sxx: fix sram node address
Add missing "0" to the SRAM devicetree node addresses.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
(cherry picked from commit ec85b0b4ef)
2024-08-17 08:54:19 -04:00
Ryan Erickson
b421ca7b7e drivers: modem: cellular: hl7800 fix enter cmux
The OK response should be processed before entering CMUX mode.

Use UART ISR mode by default.

Fix warnings and errors produced by the sample.

Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
(cherry picked from commit bbcf23e95e)
2024-08-17 08:54:01 -04:00
Alberto Escolar Piedras
37cea05f5d Bluetooth: drivers: userchan: Fix gcc 13 overflow warning
gcc 13 produces a build warning (see below), as it seems to
believe the number of read bytes may overflow the frame_size
type.
Let's increase the frame_size bitwidth to avoid this.
(Any 32bit type, signed or unsigned, avoids this warning)

The build warning:
```
In file included from /usr/include/features.h:502,
                 from bits/libc-header-start.h:33,
                 from /usr/include/stdint.h:26,
                 from include/stdint.h:9,
                 from zephyr/include/zephyr/types.h:11,
                 from zephyr/include/zephyr/kernel_includes.h:21,
                 from zephyr/include/zephyr/kernel.h:17,
                 from zephyr/drivers/bluetooth/hci/userchan.c:9:
In function ‘read’,
    inlined from ‘rx_thread’ at drivers/bluetooth/hci/userchan.c:201:9:
/usr/include/i386-linux-gnu/bits/unistd.h:28:10: warning: ‘__read_alias’
specified size between 4294902273 and 4294967295 exceeds maximum object
size 2147483647
[-Wstringop-overflow=]
   28 |   return __glibc_fortify (read, __nbytes, sizeof (char),
      |          ^~~~~~~~~~~~~~~
drivers/bluetooth/hci/userchan.c: In function ‘rx_thread’:
drivers/bluetooth/hci/userchan.c:187:32: note: destination object allocated
  here
  187 |                 static uint8_t frame[512];
      |                                ^~~~~
/usr/include/i386-linux-gnu/bits/unistd-decl.h:29:16: note: in a call to
  function
‘__read_alias’ declared with attribute ‘access (write_only, 2, 3)’
   29 | extern ssize_t __REDIRECT_FORTIFY (__read_alias, (int __fd, void
      |                ^~~~~~~~~~~~~~~~~~
```

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
(cherry picked from commit ee08327b4c)
2024-08-16 14:08:00 -04:00
Vinayak Kariappa Chettimada
c823c550b0 Bluetooth: Controller: Relax radio packet pointer assignment deadline
Relax the radio packet pointer assignment deadline assertion
until access address being transmitted. The PDU buffer is
probably only needed just after access address is being
transmitted or received by the radio. This will give some
more breathing room for slow CPUs like in nRF51x SoCs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 4dbfb22a7e)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
dcc9255796 Bluetooth: Controller: Fix regression using speed optimization
Fix regression using speed optimization introduced in
commit 1b7fe792e0 ("Bluetooth: Controller: Support Link
Time Optimizations (LTO)").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 642d4be940)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
f5fd647605 Bluetooth: Controller: nRF51x: Fix regression in encrypted connection
Fix regression in encrypted connection introduced in
commit f3deccda91 ("Bluetooth: Controller: CCM read data
to early when DF enabled on PHY 1M").

Due to this nRF51x SoC hang waiting to encrypt and/or
check MIC.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit b9a7a64563)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
17f0ec9900 Bluetooth: Controller: Fix PDU length in case of ISR latency issue
In case of ISR latencies, if packet pointer has not been
set on time then we do not want to check uninitialized
length in rx buffer that did not get used by Radio DMA.
This would help us in detecting radio ready event being
set? We can not detect radio ready if it happens twice
before Radio ISR executes after latency.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 40b71c9773)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
5e00ea9e4f Bluetooth: Controller: Fix empty PDU buffer overrun under ISR latency
Only 3 bytes (PDU_EM_LL_SIZE_MAX) is required for empty PDU
transmission, but in case of Radio ISR latency if rx packet
pointer is not setup then Radio DMA will use previously
assigned buffer which can be this empty PDU buffer. Radio
DMA will overrun this buffer and cause memory corruption.
Any detection of ISR latency will not happen if the ISR
function pointer in RAM is corrupted by this overrun.
Increasing ISR latencies in OS and CPU usage in the
ULL_HIGH priority if it is same as LLL priority in
Controller implementation then it is making it tight to
execute Controller code in the tIFS between Tx-Rx PDU's
Radio ISRs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit e36ddffa7a)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
3125273a78 Bluetooth: Controller: Fix ISR profiling for single timer use
Fix ISR profiling when using single timer for tIFS radio
switching wherein in the timer is cleared on every radio
end. Hence, the captured timer value is the latency and
does not required the radio end timestamp to be subtracted.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 8ef919a7a4)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
269c91850a Bluetooth: Controller: Verbose radio is ready assertion
Provide Radio ISR latency in microseconds when asserting due
to high ISR latency.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 53b6bc56fc)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
680779e5f5 Bluetooth: Controller: Add ISR profiling using ticker ticks
Add ISR profiling using ticker ticks, hence profile ISR
CPU use outside radio events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 409402f0cc)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
e06bbce3e7 Bluetooth: Controller: Use uint16_t to store ISR profiling value
Use uint16_t to store ISR profiling value to avoid overflow
in case of higher latencies.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 56ca9b873d)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
efb3576a54 Bluetooth: Controller: Fix in-system ISR profiling for adv and conn
Fix in-system ISR profiling for advertiser and connection
role for the missing implementation when there is CRC error.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 90bc2b2064)
2024-08-16 09:56:50 -04:00
Erik Tamlin
6c454a6edc manifest: update percepio
Update the percepio module to use TraceRecorder v4.9.2.hotfix1

Signed-off-by: Erik Tamlin <erik.tamlin@percepio.com>
(cherry picked from commit 858a687052)
2024-08-16 09:56:37 -04:00
Jonathan Rico
a58f407367 Bluetooth: L2CAP: Set NULL callback for PDUs
It was not being set, and thus if the user_data contained garbage from
before, then conn.c would attempt to call that garbage.

Static channels don't have this issue, as every "SDU" fits into one PDU.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Huajiang Zheng <nxf88597@lsv051208.swis.nl-cdc01.nxp.com>
(cherry picked from commit 1c6510312d)
2024-08-09 08:39:09 -04:00
Jonathan Rico
fcc3a7e483 Bluetooth: remove forgotten TODO
It's already done.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 8d7c1bc7bc)
2024-08-09 08:39:09 -04:00
Jonathan Rico
afb8c8922a Bluetooth: adapt l2cap/userdata test
Modify the test so it checks that user_data is used and then cleared by
the stack.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 08706f98bc)
2024-08-09 08:39:09 -04:00
Jonathan Rico
45a6994f5c Bluetooth: L2CAP: Mark user_data as owned by the stack
Storing stuff in user_data? That's a paddlin'

We have been debugging issue after issue because ownership of this
"user" data is not clearly defined. Now it is. L2CAP owns the user_data
field entirely, as soon as `send()` is called.

Also add a warning and retval using CHECKIF.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit ea9449979b)
2024-08-09 08:39:09 -04:00
Jonathan Rico
e41c69a3c5 Bluetooth: allow compiling host with CONFIG_NO_RUNTIME_CHECKS
Werror fails the build on that function.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 5c6cd27723)
2024-08-09 08:39:09 -04:00
Jonathan Rico
350f9fbc2e Bluetooth: host: add more info to conn.c log
Print user_data and callback pointers.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit d02a13d726)
2024-08-09 08:39:09 -04:00
Sylvio Alves
296983709a linker: esp32: fix cpp rom region
cplusplus-rom linker initialization was wrongly placed
in RAM area when it should be in ROM area.

Fixes #75853

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
(cherry picked from commit c374d3147b)
2024-08-07 08:26:49 -04:00
Armando Visconti
3cd429f0e0 drivers/sensor: lis2dux12: fix mode when setting odr
In lis2dux12_set_odr(), the call to stmemsc module lis2dux12_mode_set()
API is done with the .fs field left uninitialized, so setting the
underlying device regs in an unproper way.

Suggested-by: Luis Ubieda <luisf@croxel.com>
Signed-off-by: Armando Visconti <armando.visconti@st.com>
(cherry picked from commit 8bc00e1420)
2024-08-07 08:26:13 -04:00
Thales Bacelar
b8010bf19d logging: Trigger logging thread when we start to drop messages
Wake up logging thread when we start to drop messages.

Signed-off-by: Thales Bacelar <thalesbacelar@duck.com>
(cherry picked from commit d6429431d6)
2024-08-07 08:25:49 -04:00
Yong Cong Sin
2600eaf6de tests: gdbstub: add build-only test
Add build-only test for existing boards.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit 58f66623aa)
2024-08-06 13:04:37 -04:00
Yong Cong Sin
f9770bd48e tests: gdbstub: minor refactor to the testcase.yaml
Change the `platform_allow` to multi-line format so that newly
supported archs/boards can be added as a new line.

Refactor the tags out to `common`, and add
`CONFIG_ARCH_HAS_GDBSTUB` filter

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit b97d97ff17)
2024-08-06 13:04:37 -04:00
Yong Cong Sin
0299538a11 arm: debug: gdbstub: fix header
`exc.h` should be `exception.h` now, fix  it.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit 79ed64909f)
2024-08-06 13:04:37 -04:00
Jukka Rissanen
5470dc3f62 net: context: Check null pointer in V6ONLY getsockopt
Make sure we are not accessing NULL pointer when checking
if the IPv4 mapping to IPv6 is enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit cf552905f4)
2024-08-06 13:02:10 -04:00
Rubin Gerritsen
a58e039b6a Bluetooth: Host: Fix compiling PAwR Sync without PAST RX
The function `bt_hci_le_past_received_v2()` is not compiled
in for this configuration, so the reference needs to be removed.

Fixes #76268.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
(cherry picked from commit e23345b4d1)
2024-08-06 13:01:44 -04:00
Jamie McCrae
37e5eb997e samples: tfm_integration: psa_crypto: Disable sample
Disables running this sample as doing so requires qcbor, which
is not apache licensed

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
(cherry picked from commit db5a5fa109)
2024-08-06 13:01:05 -04:00
Daniel Berlin
ff02673d6e bl5340_dvk: Move MIPI_DBI interface back to spi4
Commit 3dbbb73 accidentally changed the MIPI_DBI spi interface from
spi4 to spi2 for this board during conversion to use the MIPI_DBI wrapper.

This does not work, and this change reverts it back to spi4.

Tested on actual boards (bl5340, bl5340pa).
Before this change LVGL demo displays nothing, after this change it works
fine again.

Signed-off-by: Daniel Berlin <dberlin@dberlin.org>
(cherry picked from commit 08e44f9dae)
2024-08-06 13:00:40 -04:00
Robert Lubos
4ac4795945 net: tcp: Keep track of recv window size change since last ACK
Windows TCP stack has a peculiar behavior - when running iperf, it will
fill out the RX window almost entirely, but will not set PSH flag on
packets. In result, our stack would delay the ACK and thus window
update, affecting throughputs heavily.

In order to avoid that, keep track of the most recent window size
reported to the peer, and reduce it when receiving new data. In case the
RX window, as seen from the peer perspective, drops below certain
threshold, and the real RX window is currently empty, send an ACK
immediately when updating window, so that peer can continue
with sending data.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 349bf81e00)
2024-08-06 13:00:21 -04:00
Chris Friedt
905f22b018 tests: posix: net: open native_sim in c++,posix,net,native case
Prior to the fixes in the previous commits, combining a build
for native_sim with

CONFIG_CPP=y
CONFIG_POSIX_API=y
CONFIG_STD_CPP20=y
CONFIG_REQUIRES_FULL_LIBCPP=y

would fail.

It succeeds now.

This change adds a testcase to monitor that scenario in CI.

Note: this was partially necessary because the deprecation of
CONFIG_NET_SOCKETS_POSIX_NAMES is not yet complete, so there
is a dependency cycle, and also because <sys/types.h> was
pulling in the host <sys/types.h> instead of Zephyr's or one
of the embedded OSes we support.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
(cherry picked from commit d0808473f2)
2024-08-06 13:00:03 -04:00
Chris Friedt
fe0b5ab37b posix: posix_types.h: simplify conditions on pthread types
Simplify the conditions for pthread type declaration

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
(cherry picked from commit 6cf557d64a)
2024-08-06 13:00:03 -04:00
Chris Friedt
ab836482f0 posix: sys/stat.h: move declarations to posix_types.h
A number of types such as uid_t, gitd_t, etc, were defined in
sys/stat.h to workaround compatibility issues many years ago.

Since posix_types.h is slated to become equivalent to
sys/types.h in terms of standard headers, move these types
to where they belong.

For more information, please see

https://pubs.opengroup.org/onlinepubs/9699919799/\
 basedefs/sys_types.h.html

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
(cherry picked from commit 6667b500c6)
2024-08-06 13:00:03 -04:00
Chris Friedt
117fb6c27f net + posix: avoid host includes when building for native_sim
A corner case involving C++, posix, networking, and native_sim
was causing problems.

Even though C and C++ builds should include zephyr/posix/.. in
the default search path with `CONFIG_POSIX_API=y`, for some
reason, the native compiler pulls in /usr/include first anyway.

The stat.h header pulled in <sys/types.h> (which is normally
fine) but due to the native build, it was pulling in
/usr/include/sys/types.h, from the host toolchain.

Explicitly include <zephyr/posix/posix_types.h> instead of
<sys/types.h> from stat.h, and continue using the workarounds
for native builds (explicitly including zephyr/posix/arpa/net.h
from net/sockets.h .

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
(cherry picked from commit 81f5205006)
2024-08-06 13:00:03 -04:00
Chris Friedt
8fff3c24a4 Revert "net: socket: fix sys/_timespec.h not found error"
This reverts commit 269729a5db.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
(cherry picked from commit 6a0593d554)
2024-08-06 13:00:03 -04:00
Tim Sørensen
13a8b9dcd3 bluetooth: avoid USB starvation in bap_broadcast_sink
fix to ensure that USB audio interface is not starved when
no audio data is received over bluetooth.

Signed-off-by: Tim Sørensen <tims@demant.com>
(cherry picked from commit 86032bcf85)
2024-08-06 12:59:25 -04:00
Declan Snyder
b8c126abfc drivers: mdio: Clear interrupt signal in ISR
Apparently, disabling the intterupt is not enough,
because without clearing the flag, some errors are occurring.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
(cherry picked from commit 9f56ff5d64)
2024-08-06 12:58:47 -04:00
Tom Burdick
79b78b8201 icm42688: Fix divide by zero potential
There were code paths that could have lead to divide by zero given an
invalid scale setting for accel or gyro. In practice this should be an
invalid setup even before getting to these conversion functions. The
conversion functions now better show all valid values are accounted for
by using CODE_UNREACHABLE in the default case.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
(cherry picked from commit 5474b611cb)
2024-08-06 12:58:25 -04:00
Armando Visconti
29c3fc13db boards: st: sensortile_box_pro: remove hts221 sensor
Remove HTS221 sensor support from sensortile_box_pro as it has been ruled
out from final version. In fact, HTS221 is in the process of being
terminated and is not recommended for new design. The candidate replacement
is SHT40 from Sensirion, which is available also as a DIL24 adapter, which
can be plugged on sensortile_box_pro board.

See SENSEVAL-SHT4XV1:
https://www.st.com/en/partner-products-and-services/senseval-sht4xv1.html

Signed-off-by: Armando Visconti <armando.visconti@st.com>
(cherry picked from commit cdce68e4c8)
2024-08-06 12:57:51 -04:00
Francois Ramu
8a98c84647 drivers: usb: stm32 udc driver get the global otg interrupt
The global otg interrupt hs/fs is enabled by the udc_stm32
driver. Get it in the list of interrupts of the OTG node.
Use UDC_STM32_IRQ naming.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
(cherry picked from commit 9ec7697bdb)
2024-08-06 12:57:35 -04:00
Martin Stumpf
bb65669a94 dts: fix warnings in nxp_rt11xx.dtsi
Caused by a simple typo.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
(cherry picked from commit 706ba43bb5)
2024-08-06 12:56:40 -04:00
Jose Alberto Meza
4744f569ef drivers: i3c: common: Do not tread GETCAPS failure as error for 1.0 device
If it's a I3C v1.0 device without any HDR modes do not treat as an error
if GETCAPS gives no valid response.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
(cherry picked from commit c76e776b67)
2024-08-06 12:50:58 -04:00
Armando Visconti
ee6c00843a drivers/sensor: lis2dux12: fix temperature conversion
Return to sensor_api i/f the temperature in Celsius instead
of the register raw value in LSB.

Fixes #75686

Signed-off-by: Armando Visconti <armando.visconti@st.com>
(cherry picked from commit a1f9793e0e)
2024-08-06 12:49:31 -04:00
Armando Visconti
a6cbc326e3 drivers/sensor: lis2dux12: fix odr and range
The current implementation assumes that sensor odr and range are
always configured in the Device Tree at compile time which might
not be the case.

Instead, application can set odr and range either at compile time
through the DT or using SENSOR_ATTR_SAMPLING_FREQUENCY and
SENSOR_ATTR_FULL_SCALE attributes at runtime, so each driver instance
must keep trace of the latest values set and use them in the sensor
APIs which require them (e.g. lis2dux12_mode_set).

Signed-off-by: Armando Visconti <armando.visconti@st.com>
(cherry picked from commit cf20aa050d)
2024-08-06 12:49:31 -04:00
Armando Visconti
81e8c6dc5c sensor: lis2dux12: fix SENSOR_ATTR_FULL_SCALE case
When setting the full scale through SENSOR_ATTR_FULL_SCALE the
driver must convert the g value (i.e. one of 2g/4g/8g/16g) to
the corrispondent sensor fs raw value.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
(cherry picked from commit 2eaec8b779)
2024-08-06 12:49:31 -04:00
Armando Visconti
57ef4996f5 samples/shields: x-nucleo-iks4a1: Add lsm6dsv16x temp display
Extended the x-nucleo-iks4a1 shield standard sample adding lsm6dsv16x
sensor die temperature display.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
(cherry picked from commit 878b5a9d2e)
2024-08-06 12:49:31 -04:00
Anas Nashif
085bf35912 device: remove const qualifier from node label copy
k_usermode_string_copy does not accept const in its arguements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit 2a39132645)
2024-08-06 12:47:58 -04:00
Anas Nashif
508d402aad tests: device: test CONFIG_DEVICE_DT_METADATA=y
Looks like this option is not tested with userspace enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit c5e6416a65)
2024-08-06 12:47:58 -04:00
Alessandro Manganaro
d947fbb378 drivers: bluetooth: hci: Fix stm32wb BLE behavior
Enabling BT_HCI_SETUP for STM32WB55 to have a
correct and proper initialization procedure to fix
#75318 issue

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
(cherry picked from commit 4fc77248de)
2024-08-06 12:45:25 -04:00
Alessandro Manganaro
d698d40bb7 drivers: bluetooth: hci: Fix stm32wb BLE behavior
Implementing HCI setup function to have a correct and proper
initialization procedure to fix #75318 issue

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
(cherry picked from commit 7ca2072ed0)
2024-08-06 12:45:25 -04:00
Robert Lubos
67a6217906 doc: migration-guide-3.7: Add entry about CoAP block API change
Add entry about the coap_get_block1_option() and
coap_get_block2_option() API change.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-08-06 12:44:17 -04:00
Robert Lubos
0807227653 net: coap: Parse more flag in coap_get_block2_option()
Parse the more flag in coap_get_block2_option(), so that the function
can be used not only with requests but also with replies (where the more
flag should not be ignored).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-08-06 12:44:17 -04:00
Robert Lubos
bc1c81bc00 net: coap: Fix underlying type for block number
The block number in block1/2 options can be encoded on up to 20 bits
according to RFC 7959, therefore the underlying type used in helper
functions to retrieve the block number should be large enough to hold
the result. Therefore, replace the container for block number with
uint32_t instead of uint8_t.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-08-06 12:44:17 -04:00
Julia Azziz
c5472feea3 drivers: adc: fix missing ref_internal in adc_sam0
The .ref_internal field in the adc_driver_api
struct was previously unset.
Now it's set to the proper value, 1 V.

Signed-off-by: Julia Azziz <juliaazziz7@gmail.com>
(cherry picked from commit e7cfb05c72)
2024-08-06 12:42:22 -04:00
Georges Oates_Larsen
c5de8ab5d1 net: net_if: fix net_if_send_data for offloaded ifaces
Some offloaded ifaces have an L2, but lack support for
net_l2->send. This edge case is not handled by
net_if_send_data, resulting in a NULL dereference under
rare circumstances.

This patch expands the offloaded iface guard in
net_if_send_data to handle this edge case.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
(cherry picked from commit 1c79445059)
2024-08-06 12:41:41 -04:00
Benjamin Cabé
c394cdb0fa net: ptp: Properly handle second overflow/underflow
Fixes issues with net_ptp_time arithmetic where second
overflow/underflow would not be handled properly.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
(cherry picked from commit 43b948f9a8)
2024-08-06 12:41:07 -04:00
Benjamin Cabé
ec8dc79124 net: ptp: Adjust clock using correct offset
Offset should be *subtracted* from current clock value, not added.
This was causing clock to accumulate error instead of actually
"converging".

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit dff19c3ac6)
2024-08-06 12:41:07 -04:00
Maochen Wang
642b308bfc net: wifi: Fix the nm type check error
Fix the NM iface type check error, should use (1 << WIFI_TYPE_STA),
instead of WIFI_TYPE_STA. Same for WIFI_TYPE_SAP.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
(cherry picked from commit bf42164084)
2024-08-02 22:11:51 -05:00
Robert Lubos
3a6653a7a9 net: sockets: tls: Fix poll update event check
In case POLLIN is set, and no new application data has been detected,
the ztls_poll_update_ctx() should only return -EAGAIN if no other events
are available for the socket. Otherwise, the function may end up
busy-looping, in case for example POLLOUT is also monitored for the
socket.

Current check verifying that was wrong, as it caused to function to
return -EAGAIN even if some other events could've been reported for the
socket.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit bfe958a7f1)
2024-08-02 22:11:03 -05:00
Manuel Argüelles
7d59805274 soc: s32k3: fix RAM retention
Initialize TCM and SRAM contents only after a destructive reset (e.g.
PoR reset). SRAM retains content during functional reset through a
hardware mechanism, therefore accesses do not cause content
corruption errors.

Fixes #75912

Signed-off-by: Manuel Argüelles <marguelles.dev@gmail.com>
(cherry picked from commit ec7289039b)
2024-08-02 22:10:45 -05:00
Yong Cong Sin
57c1f22178 arch: riscv: stacktrace: fix user thread stack bound check
According to the riscv's `arch.h`:

 +------------+ <- thread.arch.priv_stack_start
 | Guard      | } Z_RISCV_STACK_GUARD_SIZE
 +------------+
 | Priv Stack | } CONFIG_PRIVILEGED_STACK_SIZE
 +------------+ <- thread.arch.priv_stack_start +
                   CONFIG_PRIVILEGED_STACK_SIZE +
                   Z_RISCV_STACK_GUARD_SIZE

The start of the privilege stack should be:

  `thread.arch.priv_stack_start + Z_RISCV_STACK_GUARD_SIZE`

Instead of

  `thread.arch.priv_stack_start - CONFIG_PRIVILEGED_STACK_SIZE`

For the `end`, use the same equation of `top_of_priv_stack` in
the `arch_user_mode_enter()`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
(cherry picked from commit 7db18ab721)
2024-08-02 22:10:08 -05:00
Benjamin Cabé
dc7129bd20 boards: disco_l475_iot1: fix arduino_i2c config
disco l475 board exposes I2C3 on standard Arduino Uno pins A4/A5,
not I2C1.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit 0f05f58bf5)
2024-08-02 22:09:41 -05:00
249 changed files with 4416 additions and 1008 deletions

View File

@@ -2,12 +2,20 @@ name: Backport Issue Check
on:
pull_request_target:
types:
- edited
- opened
- reopened
- synchronize
branches:
- v*-branch
jobs:
backport:
name: Backport Issue Check
concurrency:
group: backport-issue-check-${{ github.ref }}
cancel-in-progress: true
runs-on: ubuntu-22.04
if: github.repository == 'zephyrproject-rtos/zephyr'

View File

@@ -68,7 +68,7 @@ jobs:
elif [ "${{ runner.os }}" = "Windows" ]; then
EXTRA_TWISTER_FLAGS="-P native_sim --short-build-path -O/tmp/twister-out"
fi
./scripts/twister --force-color --inline-logs -T samples/hello_world -v $EXTRA_TWISTER_FLAGS
./scripts/twister --force-color --inline-logs -T samples/hello_world -T samples/cpp/hello_world -v $EXTRA_TWISTER_FLAGS
- name: Upload artifacts
if: failure()
@@ -77,3 +77,4 @@ jobs:
if-no-files-found: ignore
path:
zephyr/twister-out/*/samples/hello_world/sample.basic.helloworld/build.log
zephyr/twister-out/*/samples/cpp/hello_world/sample.cpp.helloworld/build.log

View File

@@ -1 +1 @@
0.16.8
0.16.9

View File

@@ -1,5 +1,5 @@
VERSION_MAJOR = 3
VERSION_MINOR = 7
PATCHLEVEL = 0
PATCHLEVEL = 1
VERSION_TWEAK = 0
EXTRAVERSION =
EXTRAVERSION = rc1

View File

@@ -1,6 +1,5 @@
/*
* Copyright (c) 2018 Linaro, Limited
* Copyright (c) 2023 Arm Limited
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -48,63 +47,3 @@ int arch_swap(unsigned int key)
*/
return _current->arch.swap_return_value;
}
uintptr_t z_arm_pendsv_c(uintptr_t exc_ret)
{
/* Store LSB of LR (EXC_RETURN) to the thread's 'mode' word. */
IF_ENABLED(CONFIG_ARM_STORE_EXC_RETURN,
(_kernel.cpus[0].current->arch.mode_exc_return = (uint8_t)exc_ret;));
/* Protect the kernel state while we play with the thread lists */
uint32_t basepri = arch_irq_lock();
/* fetch the thread to run from the ready queue cache */
struct k_thread *current = _kernel.cpus[0].current = _kernel.ready_q.cache;
/*
* Clear PendSV so that if another interrupt comes in and
* decides, with the new kernel state based on the new thread
* being context-switched in, that it needs to reschedule, it
* will take, but that previously pended PendSVs do not take,
* since they were based on the previous kernel state and this
* has been handled.
*/
SCB->ICSR = SCB_ICSR_PENDSVCLR_Msk;
/* For Cortex-M, store TLS pointer in a global variable,
* as it lacks the process ID or thread ID register
* to be used by toolchain to access thread data.
*/
IF_ENABLED(CONFIG_THREAD_LOCAL_STORAGE,
(extern uintptr_t z_arm_tls_ptr; z_arm_tls_ptr = current->tls));
IF_ENABLED(CONFIG_ARM_STORE_EXC_RETURN,
(exc_ret = (exc_ret & 0xFFFFFF00) | current->arch.mode_exc_return));
/* Restore previous interrupt disable state (irq_lock key)
* (We clear the arch.basepri field after restoring state)
*/
basepri = current->arch.basepri;
current->arch.basepri = 0;
arch_irq_unlock(basepri);
#if defined(CONFIG_MPU_STACK_GUARD) || defined(CONFIG_USERSPACE)
/* Re-program dynamic memory map */
z_arm_configure_dynamic_mpu_regions(current);
#endif
/* restore mode */
IF_ENABLED(CONFIG_USERSPACE, ({
CONTROL_Type ctrl = {.w = __get_CONTROL()};
/* exit privileged state when returning to thread mode. */
ctrl.b.nPRIV = 0;
/* __set_CONTROL inserts an ISB which is may not be necessary here
* (stack pointer may not be touched), but it's recommended to avoid
* executing pre-fetched instructions with the previous privilege.
*/
__set_CONTROL(ctrl.w | current->arch.mode);
}));
return exc_ret;
}

View File

@@ -27,7 +27,6 @@ _ASM_FILE_PROLOGUE
GTEXT(z_arm_svc)
GTEXT(z_arm_pendsv)
GTEXT(z_do_kernel_oops)
GTEXT(z_arm_pendsv_c)
#if defined(CONFIG_USERSPACE)
GTEXT(z_arm_do_syscall)
#endif
@@ -118,20 +117,125 @@ out_fp_endif:
#error Unknown ARM architecture
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */
mov r4, lr
mov r0, lr
bl z_arm_pendsv_c
mov lr, r4
/* Protect the kernel state while we play with the thread lists */
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
cpsid i
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
movs.n r0, #_EXC_IRQ_DEFAULT_PRIO
msr BASEPRI_MAX, r0
isb /* Make the effect of disabling interrupts be realized immediately */
#else
#error Unknown ARM architecture
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */
ldr r1, =_kernel
ldr r2, [r1, #_kernel_offset_to_current]
/*
* Prepare to clear PendSV with interrupts unlocked, but
* don't clear it yet. PendSV must not be cleared until
* the new thread is context-switched in since all decisions
* to pend PendSV have been taken with the current kernel
* state and this is what we're handling currently.
*/
ldr r7, =_SCS_ICSR
ldr r6, =_SCS_ICSR_UNPENDSV
/* _kernel is still in r1 */
/* fetch the thread to run from the ready queue cache */
ldr r2, [r1, #_kernel_offset_to_ready_q_cache]
str r2, [r1, #_kernel_offset_to_current]
/*
* Clear PendSV so that if another interrupt comes in and
* decides, with the new kernel state based on the new thread
* being context-switched in, that it needs to reschedule, it
* will take, but that previously pended PendSVs do not take,
* since they were based on the previous kernel state and this
* has been handled.
*/
/* _SCS_ICSR is still in r7 and _SCS_ICSR_UNPENDSV in r6 */
str r6, [r7, #0]
#if defined(CONFIG_THREAD_LOCAL_STORAGE)
/* Grab the TLS pointer */
ldr r4, =_thread_offset_to_tls
adds r4, r2, r4
ldr r0, [r4]
/* For Cortex-M, store TLS pointer in a global variable,
* as it lacks the process ID or thread ID register
* to be used by toolchain to access thread data.
*/
ldr r4, =z_arm_tls_ptr
str r0, [r4]
#endif
#if defined(CONFIG_ARM_STORE_EXC_RETURN)
/* Restore EXC_RETURN value. */
mov lr, r0
ldrsb lr, [r2, #_thread_offset_to_mode_exc_return]
#endif
/* Restore previous interrupt disable state (irq_lock key)
* (We clear the arch.basepri field after restoring state)
*/
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) && (_thread_offset_to_basepri > 124)
/* Doing it this way since the offset to thread->arch.basepri can in
* some configurations be larger than the maximum of 124 for ldr/str
* immediate offsets.
*/
ldr r4, =_thread_offset_to_basepri
adds r4, r2, r4
ldr r0, [r4]
movs.n r3, #0
str r3, [r4]
#else
ldr r0, [r2, #_thread_offset_to_basepri]
movs r3, #0
str r3, [r2, #_thread_offset_to_basepri]
#endif
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
/* BASEPRI not available, previous interrupt disable state
* maps to PRIMASK.
*
* Only enable interrupts if value is 0, meaning interrupts
* were enabled before irq_lock was called.
*/
cmp r0, #0
bne _thread_irq_disabled
cpsie i
_thread_irq_disabled:
#if defined(CONFIG_MPU_STACK_GUARD) || defined(CONFIG_USERSPACE)
/* Re-program dynamic memory map */
push {r2,lr}
mov r0, r2
bl z_arm_configure_dynamic_mpu_regions
pop {r2,r3}
mov lr, r3
#endif
#ifdef CONFIG_USERSPACE
/* restore mode */
ldr r3, =_thread_offset_to_mode
adds r3, r2, r3
ldr r0, [r3]
mrs r3, CONTROL
movs.n r1, #1
bics r3, r1
orrs r3, r0
msr CONTROL, r3
/* ISB is not strictly necessary here (stack pointer is not being
* touched), but it's recommended to avoid executing pre-fetched
* instructions with the previous privilege.
*/
isb
#endif
ldr r4, =_thread_offset_to_callee_saved
adds r0, r2, r4
@@ -149,6 +253,9 @@ out_fp_endif:
subs r0, #36
ldmia r0!, {r4-r7}
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
/* restore BASEPRI for the incoming thread */
msr BASEPRI, r0
#ifdef CONFIG_FPU_SHARING
/* Assess whether switched-in thread had been using the FP registers. */
tst lr, #_EXC_RETURN_FTYPE_Msk
@@ -178,6 +285,30 @@ in_fp_endif:
isb
#endif
#if defined(CONFIG_MPU_STACK_GUARD) || defined(CONFIG_USERSPACE)
/* Re-program dynamic memory map */
push {r2,lr}
mov r0, r2 /* _current thread */
bl z_arm_configure_dynamic_mpu_regions
pop {r2,lr}
#endif
#ifdef CONFIG_USERSPACE
/* restore mode */
ldr r0, [r2, #_thread_offset_to_mode]
mrs r3, CONTROL
bic r3, #1
orr r3, r0
msr CONTROL, r3
/* ISB is not strictly necessary here (stack pointer is not being
* touched), but it's recommended to avoid executing pre-fetched
* instructions with the previous privilege.
*/
isb
#endif
/* load callee-saved + psp from thread */
add r0, r2, #_thread_offset_to_callee_saved
ldmia r0, {r4-r11, ip}
@@ -300,6 +431,7 @@ _stack_frame_endif:
/* exception return is done in z_arm_int_exit() */
ldr r0, =z_arm_int_exit
bx r0
#endif
_oops:

View File

@@ -428,6 +428,12 @@ do_fault:
1: mv a1, sp
#ifdef CONFIG_EXCEPTION_DEBUG
/*
* Restore the s0 we saved early in ISR entry
* so it shows up properly in the CSF.
*/
lr s0, __struct_arch_esf_s0_OFFSET(sp)
/* Allocate space for caller-saved registers on current thread stack */
addi sp, sp, -__callee_saved_t_SIZEOF

View File

@@ -62,7 +62,8 @@ boot_first_core:
#ifdef CONFIG_INIT_STACKS
/* Pre-populate all bytes in z_interrupt_stacks with 0xAA */
la t0, z_interrupt_stacks
li t1, __z_interrupt_stack_SIZEOF
/* Total size of all cores' IRQ stack */
li t1, __z_interrupt_all_stacks_SIZEOF
add t1, t1, t0
/* Populate z_interrupt_stacks with 0xaaaaaaaa */
@@ -71,7 +72,7 @@ aa_loop:
sw t2, 0x00(t0)
addi t0, t0, 4
blt t0, t1, aa_loop
#endif
#endif /* CONFIG_INIT_STACKS */
/*
* Initially, setup stack pointer to

View File

@@ -58,12 +58,12 @@ static inline bool in_user_thread_stack_bound(uintptr_t addr, const struct k_thr
/* See: zephyr/include/zephyr/arch/riscv/arch.h */
if (IS_ENABLED(CONFIG_PMP_POWER_OF_TWO_ALIGNMENT)) {
start = thread->arch.priv_stack_start - CONFIG_PRIVILEGED_STACK_SIZE;
end = thread->arch.priv_stack_start;
start = thread->arch.priv_stack_start + Z_RISCV_STACK_GUARD_SIZE;
} else {
start = thread->stack_info.start - CONFIG_PRIVILEGED_STACK_SIZE;
end = thread->stack_info.start;
}
end = Z_STACK_PTR_ALIGN(thread->arch.priv_stack_start + K_KERNEL_STACK_RESERVED +
CONFIG_PRIVILEGED_STACK_SIZE);
return (addr >= start) && (addr < end);
}
@@ -134,22 +134,53 @@ static void walk_stackframe(stack_trace_callback_fn cb, void *cookie, const stru
ra = csf->ra;
}
for (int i = 0; (i < MAX_STACK_FRAMES) && vrfy(fp, thread, esf) && (fp > last_fp);) {
if (in_text_region(ra)) {
if (!cb(cookie, ra)) {
break;
}
/*
* Increment the iterator only if `ra` is within the text region to get the
* most out of it
*/
i++;
for (int i = 0; (i < MAX_STACK_FRAMES) && vrfy(fp, thread, esf) && (fp > last_fp); i++) {
if (in_text_region(ra) && !cb(cookie, ra)) {
break;
}
last_fp = fp;
/* Unwind to the previous frame */
frame = (struct stackframe *)fp - 1;
ra = frame->ra;
if ((i == 0) && (esf != NULL)) {
/* Print `esf->ra` if we are at the top of the stack */
if (in_text_region(esf->ra) && !cb(cookie, esf->ra)) {
break;
}
/**
* For the first stack frame, the `ra` is not stored in the frame if the
* preempted function doesn't call any other function, we can observe:
*
* .-------------.
* frame[0]->fp ---> | frame[0] fp |
* :-------------:
* frame[0]->ra ---> | frame[1] fp |
* | frame[1] ra |
* :~~~~~~~~~~~~~:
* | frame[N] fp |
*
* Instead of:
*
* .-------------.
* frame[0]->fp ---> | frame[0] fp |
* frame[0]->ra ---> | frame[1] ra |
* :-------------:
* | frame[1] fp |
* | frame[1] ra |
* :~~~~~~~~~~~~~:
* | frame[N] fp |
*
* Check if `frame->ra` actually points to a `fp`, and adjust accordingly
*/
if (vrfy(frame->ra, thread, esf)) {
fp = frame->ra;
frame = (struct stackframe *)fp;
}
}
fp = frame->fp;
ra = frame->ra;
}
}
#else /* !CONFIG_FRAME_POINTER */

View File

@@ -33,6 +33,9 @@ extern char _heap_start[];
/** MPU foreground map for kernel mode. */
static struct xtensa_mpu_map xtensa_mpu_map_fg_kernel;
/** Make sure write to the MPU region is atomic. */
static struct k_spinlock xtensa_mpu_lock;
/*
* Additional information about the MPU maps: foreground and background
* maps.
@@ -629,6 +632,9 @@ void xtensa_mpu_map_write(struct xtensa_mpu_map *map)
#endif
{
int entry;
k_spinlock_key_t key;
key = k_spin_lock(&xtensa_mpu_lock);
#ifdef CONFIG_USERSPACE
struct xtensa_mpu_map *map = thread->arch.mpu_map;
@@ -652,6 +658,8 @@ void xtensa_mpu_map_write(struct xtensa_mpu_map *map)
__asm__ volatile("wptlb %0, %1\n\t"
: : "a"(map->entries[entry].at), "a"(map->entries[entry].as));
}
k_spin_unlock(&xtensa_mpu_lock, key);
}
/**
@@ -765,6 +773,7 @@ int arch_mem_domain_partition_remove(struct k_mem_domain *domain,
{
int ret;
uint32_t perm;
struct k_thread *cur_thread;
struct xtensa_mpu_map *map = &domain->arch.mpu_map;
struct k_mem_partition *partition = &domain->partitions[partition_id];
uintptr_t end_addr = partition->start + partition->size;
@@ -833,6 +842,15 @@ int arch_mem_domain_partition_remove(struct k_mem_domain *domain,
CONFIG_XTENSA_MPU_DEFAULT_MEM_TYPE,
NULL);
/*
* Need to update hardware MPU regions if we are removing
* partition from the domain of the current running thread.
*/
cur_thread = _current_cpu->current;
if (cur_thread->mem_domain_info.mem_domain == domain) {
xtensa_mpu_map_write(cur_thread);
}
out:
return ret;
}
@@ -841,6 +859,7 @@ int arch_mem_domain_partition_add(struct k_mem_domain *domain,
uint32_t partition_id)
{
int ret;
struct k_thread *cur_thread;
struct xtensa_mpu_map *map = &domain->arch.mpu_map;
struct k_mem_partition *partition = &domain->partitions[partition_id];
uintptr_t end_addr = partition->start + partition->size;
@@ -855,6 +874,20 @@ int arch_mem_domain_partition_add(struct k_mem_domain *domain,
CONFIG_XTENSA_MPU_DEFAULT_MEM_TYPE,
NULL);
/*
* Need to update hardware MPU regions if we are removing
* partition from the domain of the current running thread.
*
* Note that this function can be called with dummy thread
* at boot so we need to avoid writing MPU regions to
* hardware.
*/
cur_thread = _current_cpu->current;
if (((cur_thread->base.thread_state & _THREAD_DUMMY) != _THREAD_DUMMY) &&
(cur_thread->mem_domain_info.mem_domain == domain)) {
xtensa_mpu_map_write(cur_thread);
}
out:
return ret;
}

View File

@@ -111,7 +111,7 @@
compatible = "zephyr,mipi-dbi-spi";
reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
dc-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
spi-dev = <&spi2>;
spi-dev = <&spi4>;
write-only;
#address-cells = <1>;
#size-cells = <0>;

View File

@@ -15,7 +15,7 @@ config ESP_SPIRAM
default y if !MCUBOOT
choice SPIRAM_TYPE
default SPIRAM_TYPE_ESPPSRAM64
default SPIRAM_TYPE_ESPPSRAM32
endchoice
config HEAP_MEM_POOL_ADD_SIZE_BOARD

View File

@@ -64,7 +64,7 @@
status = "okay";
erase-block-size = <4096>;
write-block-size = <1>;
spi-max-frequency = <133000000>;
spi-max-frequency = <104000000>;
};
};

View File

@@ -35,6 +35,6 @@
};
};
arduino_i2c: &i2c1 {};
arduino_i2c: &i2c3 {};
arduino_spi: &spi1 {};
arduino_serial: &uart4 {};

View File

@@ -163,8 +163,6 @@ Motion and environmental sensors
(`lps22df datasheet`_)
- **LIS2DU12** 3-axis accelerometer
(`lis2du12 datasheet`_)
- **HTS221** Humidity sensor
(`hts221 datasheet`_)
- **STTS22H** Digital temperature sensor
(`stts22hh datasheet`_)
- **MP23db01HP** Microphone / audio sensor
@@ -353,9 +351,6 @@ References
.. _lis2du12 datasheet:
https://www.st.com/en/mems-and-sensors/lis2du12.html
.. _hts221 datasheet:
https://www.st.com/en/mems-and-sensors/hts221.html
.. _stts22hh datasheet:
https://www.st.com/en/mems-and-sensors/stts22h.html

View File

@@ -228,13 +228,6 @@ stm32_lp_tick_source: &lptim1 {
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
hts221@5f {
compatible = "st,hts221";
reg = <0x5f>;
drdy-gpios = <&gpioe 11 GPIO_ACTIVE_HIGH>;
status = "okay";
};
lps22df@5d {
compatible = "st,lps22df";
reg = <0x5d>;

View File

@@ -9,6 +9,7 @@ supported:
- acpi
- smp
testing:
timeout_multiplier: 2
ignore_tags:
- net
- bluetooth

View File

@@ -50,7 +50,7 @@ endif()
find_package(Deprecated COMPONENTS CROSS_COMPILE)
find_package(Zephyr-sdk 0.16)
find_package(Zephyr-sdk 0.16...<0.17)
# gperf is an optional dependency
find_program(GPERF gperf)

View File

@@ -54,7 +54,7 @@ if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
# To support Zephyr SDK tools (DTC, and other tools) with 3rd party toolchains
# then we keep track of current toolchain variant.
set(ZEPHYR_CURRENT_TOOLCHAIN_VARIANT ${ZEPHYR_TOOLCHAIN_VARIANT})
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION}
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION_COMPLETE}
REQUIRED QUIET CONFIG HINTS ${ZEPHYR_SDK_INSTALL_DIR}
)
if(DEFINED ZEPHYR_CURRENT_TOOLCHAIN_VARIANT)
@@ -82,10 +82,20 @@ if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
list(REMOVE_DUPLICATES Zephyr-sdk_CONSIDERED_VERSIONS)
list(SORT Zephyr-sdk_CONSIDERED_VERSIONS COMPARE NATURAL ORDER DESCENDING)
if("${Zephyr-sdk_FIND_VERSION_RANGE_MAX}" STREQUAL "INCLUDE")
set(upper_bound _EQUAL)
endif()
if(NOT DEFINED Zephyr-sdk_FIND_VERSION_RANGE)
# Range not given, max out to ensure max version is not in effect.
set(Zephyr-sdk_FIND_VERSION_MAX 99999999)
endif()
# Loop over each found Zepher SDK version until one is found that is compatible.
foreach(zephyr_sdk_candidate ${Zephyr-sdk_CONSIDERED_VERSIONS})
if("${zephyr_sdk_candidate}" VERSION_GREATER_EQUAL "${Zephyr-sdk_FIND_VERSION}")
if("${zephyr_sdk_candidate}" VERSION_GREATER_EQUAL "${Zephyr-sdk_FIND_VERSION}"
AND "${zephyr_sdk_candidate}" VERSION_LESS${upper_bound} "${Zephyr-sdk_FIND_VERSION_MAX}"
)
# Find the path for the current version being checked and get the directory
# of the Zephyr SDK so it can be checked.
list(FIND zephyr_sdk_found_versions ${zephyr_sdk_candidate} zephyr_sdk_current_index)
@@ -93,7 +103,7 @@ if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
get_filename_component(zephyr_sdk_current_check_path ${zephyr_sdk_current_check_path} DIRECTORY)
# Then see if this version is compatible.
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION} QUIET CONFIG PATHS ${zephyr_sdk_current_check_path} NO_DEFAULT_PATH)
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION_COMPLETE} QUIET CONFIG PATHS ${zephyr_sdk_current_check_path} NO_DEFAULT_PATH)
if (${Zephyr-sdk_FOUND})
# A compatible version of the Zephyr SDK has been found which is the highest
@@ -106,7 +116,7 @@ if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
if (NOT ${Zephyr-sdk_FOUND})
# This means no compatible Zephyr SDK versions were found, set the version
# back to the minimum version so that it is displayed in the error text.
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION} REQUIRED CONFIG PATHS ${zephyr_sdk_search_paths})
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION_COMPLETE} REQUIRED CONFIG PATHS ${zephyr_sdk_search_paths})
endif()
endif()

View File

@@ -11,7 +11,7 @@ if (WIN32)
set(ENV{PYTHONIOENCODING} "utf-8")
endif()
set(PYTHON_MINIMUM_REQUIRED 3.8)
set(PYTHON_MINIMUM_REQUIRED 3.10)
find_package(Deprecated COMPONENTS PYTHON_PREFER)

View File

@@ -114,42 +114,92 @@ hr,
}
/* JavaScript documentation directives */
.rst-content dl:not(.docutils) dt {
background-color: var(--admonition-note-background-color) !important;
border-color: var(--admonition-note-title-background-color) !important;
color: var(--admonition-note-color) !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list) > dt {
background-color: var(--admonition-note-background-color);
border-color: var(--admonition-note-title-background-color);
color: var(--admonition-note-color);
}
.rst-content dl:not(.docutils) dl dt {
background-color: var(--admonition-attention-background-color) !important;
border-color: var(--admonition-attention-title-background-color) !important;
color: var(--admonition-attention-color) !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl dt {
background-color: transparent;
border-color: transparent;
color: var(--footer-color);
}
.rst-content dt.sig .k {
color: var(--highlight-keyword2-color) !important;
font-style: normal !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).attribute dt {
font-weight: 600;
padding: 0 8px;
margin-bottom: 1px;
width: 100%;
}
.rst-content dt.sig .kt {
color: var(--highlight-keyword-color) !important;
font-style: normal !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class > dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function > dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method > dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).attribute > dt {
font-family: var(--monospace-font-family);
font-variant-ligatures: none;
font-size: 90%;
font-weight: normal;
margin-bottom: 16px;
padding: 6px 8px;
}
.rst-content dt.sig .sig-name .n {
color: var(--highlight-function-color) !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-prename.descclassname {
color: var(--highlight-type2-color);
font-weight: normal;
}
.rst-content dt.sig .k,
.rst-content dt.sig .kt,
.rst-content dt.sig .n {
font-weight: normal !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-name.descname {
color: var(--highlight-function-color);
font-weight: 700;
}
.rst-content dl:not(.docutils) dt a.headerlink {
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-paren,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional {
color: var(--highlight-operator-color) !important;
font-weight: normal;
padding: 0 2px;
}
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional {
font-style: italic;
}
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-param,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > em,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt > em,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt > em {
color: var(--code-literal-color);
font-style: normal;
padding: 0 4px;
}
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .k {
font-style: normal;
}
html.writer-html5 .rst-content dl:not(.docutils) > dt, html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt {
border-top-color: var(--highlight-background-emph-color);
background: var(--highlight-background-color);
}
html.writer-html5 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt, html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt {
border-left-color: var(--highlight-background-emph-color);
background: var(--highlight-background-color);
}
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-param,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > .optional ~ em,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt > .optional ~ em,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt > .optional ~ em {
color: var(--highlight-number-color);
font-style: italic;
}
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > em.property {
color: var(--highlight-keyword-color);
}
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt a.headerlink {
color: var(--link-color) !important;
}
.rst-content dl:not(.docutils) dt a.headerlink:visited {
color: var(--link-color-visited) !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt a.headerlink:visited {
color: var(--link-color-visited);
}
html.writer-html5 .rst-content dl.field-list > dd strong {
font-family: var(--monospace-font-family);
font-variant-ligatures: none;
}
footer,

View File

@@ -57,6 +57,7 @@
.getElementById("search-se-settings-icon")
.setAttribute("aria-expanded", visible ? "true" : "false");
};
setSearchEngineSettingsMenuVisibility(false);
window.toggleSearchEngineSettingsMenu = function () {
isVisible = searchMenu.style.display === "block";

View File

@@ -905,6 +905,12 @@ Networking
:kconfig:option:`PSA_WANT_ALG_SHA_256` instead of legacy ``CONFIG_MBEDTLS_*``
features. (:github:`71827`)
* The CoAP public API functions :c:func:`coap_get_block1_option` and
:c:func:`coap_get_block2_option` have changed. The ``block_number`` pointer
type has changed from ``uint8_t *`` to ``uint32_t *``. Additionally,
:c:func:`coap_get_block2_option` now accepts an additional ``bool *has_more``
parameter, to store the value of the more flag. (:github:`76052`)
Other Subsystems
****************

View File

@@ -2,6 +2,147 @@
.. _zephyr_3.7:
.. _zephyr_3.7.1:
Zephyr 3.7.1
############
This is an LTS maintenance release with fixes.
Issues fixed
************
These GitHub issues were addressed since the previous 3.7.0 tagged release:
* :github:`42227` - Teensy41 support SDHC - Storage init Error
* :github:`66800` - [Coverity CID: 338107] Division or modulo by zero in subsys/shell/backends/shell_uart.c
* :github:`70498` - cellular_modem: Pinnacle 100 does not work with CONFIG_UART_INTERRUPT_DRIVEN
* :github:`71397` - Espressif HAL5.1 - Core panic'ed on EPS32S3 with hello_world sample
* :github:`71916` - Bump minimum Python version (3.10?) ahead of LTSv3 release
* :github:`74291` - Multiple USB contexts for same device lead to bus faults
* :github:`74750` - [Coverity CID: 353644] Unintended sign extension in drivers/sensor/ams/tsl2591/tsl2591.c
* :github:`74752` - [Coverity CID: 353654] Unintended sign extension in drivers/sensor/ams/tsl2591/tsl2591.c
* :github:`75256` - [Coverity CID: 394233] Division or modulo by zero in drivers/sensor/tdk/icm42688/icm42688.h
* :github:`75257` - [Coverity CID: 394232] Division or modulo by zero in drivers/sensor/tdk/icm42688/icm42688.h
* :github:`75265` - display: stm32-ltdc: incorrect return value for blanking on/off calls when panel controller is not passed in DT
* :github:`75318` - Zephyr 3.7 RC2 BLE on STM32 Nucleo WB55 does not work
* :github:`75319` - `fatal error: sys/_timespec.h: No such file or directory` with v3.7.0-rc2
* :github:`75427` - `CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT` is misleading as it only enables PEM parsing
* :github:`75676` - tests: dma: chan_blen_transfer: test breakage on Nucleo-H743ZI
* :github:`75686` - ST LIS2DUX12 driver: temperature is not converted to Celsius and raw values are returned
* :github:`75736` - Logging stops on all backend when overloaded for a time
* :github:`75758` - ST LIS2DUX12 driver: will not correctly read values on big-endian HW
* :github:`75834` - xtensa: mpu: adding or removing partitions from memory domain of current running thread has no effect
* :github:`75853` - C++: Boot fails with global STL objects
* :github:`75909` - CONFIG_NET_NATIVE_OFFLOADED_SOCKETS fails after DTLS handshake
* :github:`75912` - RAM retention not working on NXP S32K3
* :github:`75967` - bl5340_dvk LCD does not work
* :github:`76000` - coap: block_number in coap_get_block1_option() is too small
* :github:`76090` - TF-M: builds download source from external git repository
* :github:`76185` - scripts: 'west blobs fetch' does not verify digests after downloading
* :github:`76254` - linker: section_tags: missing include
* :github:`76268` - Bluetooth: PAwR Sync does not compile without PAST receiver compiled in
* :github:`76325` - ESP32S3: Zephyr freezes during OTA Update over UDP and BLE
* :github:`76360` - Crash if enabling v4-mapping-to-v6 and DHCPv4
* :github:`76397` - gdbstub: compilation error on ARM
* :github:`76398` - arch: riscv: stacktrace: user thread stack bound check is wrong
* :github:`76403` - net: wifi: NM type check is incorrect
* :github:`76427` - CONFIG_BT_CTLR_OPTIMIZE_FOR_SPEED not selected by default in zephyr 3.7
* :github:`76446` - drivers: mdio: mdio_nxp_enet: Link goes up and down sporadically
* :github:`76447` - Odroid Go Boot Failure
* :github:`76471` - TCP Delay ACK in case no PSH flag is present causing extremly low download throughput for some clients
* :github:`76519` - Get I3C basic device fails for devices that do not support GETCAP
* :github:`76549` - Bug in STM32 Disco L475 Arduino I2C header
* :github:`76551` - Bluetooth: USB Audio Starvation in BAP Broadcast Sink Sample
* :github:`76603` - sensortile_box_pro board does not support hts221 sensor
* :github:`76607` - Fixes an uninitialized value in lis2dux12
* :github:`76625` - drivers: usb: stm32 udc driver get the global otg interrupt
* :github:`76655` - RT11xx device tree build warnings
* :github:`76717` - Check L2 send properly for offloaded ifaces
* :github:`76718` - PTP - incorrect clock offset calculation
* :github:`76737` - Bluetooth L2CAP TX fragmentation state not cleared upon disconnect
* :github:`76738` - Sending Bluetooth L2CAP messages after reconnecting sometimes leads to crashes due to uninitalized net_buf callback
* :github:`76747` - CONFIG_DEVICE_DT_METADATA=y not tested with usespace enabled
* :github:`76762` - arch: riscv: stacktrace: trace is incomplete when unwinding from function without callee
* :github:`76776` - http1 dynamic post request response doesn't send header a second time
* :github:`76912` - drivers/bluetooth/hci/userchan.c build waring w gcc13
* :github:`76932` - Compilation error on Ubuntu 24.04 when CONFIG_FUSE_FS_ACCESS=y
* :github:`77006` - Bluetooth: Host: ISO buffer not unreffed
* :github:`77007` - Bluetooth: Host: ISO not clearing TX context on disconnect
* :github:`77078` - manifest: update percepio
* :github:`77089` - nxp: lpc55sxx: sram node address error
* :github:`77096` - nxp lpc55xx will crash when trying to use a nxp,ctimer-pwm DTS node
* :github:`77126` - RTC RV3028 clock output disabled by enabling alarm/update callback
* :github:`77129` - NXP's IMX RT1010 triggers assert on SPI Loopback test when EDMA enabled
* :github:`77175` - SCSI Read Capacity reports wrong capacity when used with USB Mass storage device
* :github:`77188` - Unaligned 32-bit reads following casts on dns_socket_dispatcher::local_addr (Cortex-M0)
* :github:`77221` - Websocket compile issue if Posix API is not set
* :github:`77241` - bluetooth: Behavior change in host causing MESH to fail on sending messages
* :github:`77269` - da1469x: entropy and gpio drivers throw assertions
* :github:`77303` - net: socket: recvmsg() doesn't update msg_controllen accordingly
* :github:`77371` - RT11xx bus clocks set incorrectly
* :github:`77396` - doc: Documentation scrolling does not work with arrow keys
* :github:`77424` - IMXRT11xx secondary core improperly deinit the ENET PLL
* :github:`77545` - modules: percepio: Fix python executable name in CMakeLists.txt
* :github:`77557` - drivers: ethernet: nxp_enet: Fused MAC address handling is wrong
* :github:`77594` - Bluetooth: Failures in unit tests
* :github:`77633` - drivers: dai: nxp: sai: RTOS crashes on TX/RX underrun/overrun
* :github:`77658` - backported PRs maintain fail status after issues are added to the PR description
* :github:`77669` - BLE EDTT GATT tests fail with python >= 3.11
* :github:`77784` - STM32 I2S Driver Clock Configuration
* :github:`77824` - llext samples fail with BUS ERROR (zephyr-3.7 stable)
* :github:`77952` - ESP32: Interrupts with ISRs in flash are not disabled during flash operations
* :github:`78037` - [Backport v3.7-branch] Failed to backport #77874
* :github:`78138` - riscv: plic: IRQs may not be enabled in non-zero HART
* :github:`78146` - mDNS reponder might fail to serve if mDNS resolver is enabled
* :github:`78244` - arch: riscv: IRQ stacks of secondary cores are not initialized to `0xAA` when `CONFIG_INIT_STACKS=y`
* :github:`78263` - building samples/cpp/hello_world reports "undefined reference to `_impure_ptr` error
* :github:`78268` - LPC55xx USB not working with SPEED_OPTIMIZATIONS=y
* :github:`78490` - net: l2: ieee802154: IEEE-802.15.4 packets dropped when CONFIG_NET_L2_IEEE802154_SECURITY is enabled
* :github:`78494` - subsys: net: socket_tls: Connection vanishes -> Caller blocked forever
* :github:`78495` - net: l2: ieee802154: ctx_lock taken but not given
* :github:`78608` - Bluetooth: classic: avdtp: missing buffer length check
* :github:`78622` - Wrong package for bz2
* :github:`78651` - drivers: PHY Microchip KSZ8081 will block system work queue for 500/1000ms
* :github:`78724` - net: checksum offloading not working for virtual network interfaces used for Virtual LAN (VLAN)
* :github:`78769` - backport: v3.7: dts: arm: st: stm32h5: fix spi 1-3 clocks
* :github:`78927` - doc: mcumgr: Wrong license for mcumgr-client
* :github:`79208` - sysbuild: ExternalZephyrProject_Add() cannot cope with hwmv2 board and revision
* :github:`79288` - driver: clock-control: imx-ccm-rev2: get_rate(FLEXSPI2) returns FLEXSPI1 clock rate
* :github:`79298` - arch: riscv: the `s0` dumped during a fatal error is not correct
* :github:`79301` - arch: irq: multilevel: the value return from `irq_parent_level_3()` is wrong
* :github:`79518` - Temporary Modbus Client "Soft Lock"
* :github:`79576` - Dependencies for `SOC_FLASH_MCUX` are incorrect on LPC55xxx platforms
* :github:`79788` - net: ip: igmp: IGMPv2 does not work when IGMPv3 is enabled
* :github:`79800` - stream_flash: stream_flash_erase_page does not check whether requested offset is in range of stream flash owned area
* :github:`79947` - ESP32 touch_sensor not working
* :github:`80005` - doc: Documentation issue in 'contribute/documentation/guidelines'
* :github:`80134` - up_squared: tests/arch/x86/info/arch.x86.info.userspace [timeout]
* :github:`80200` - CMake: Find package with version ranges are ignored for Zephyr SDK
* :github:`80383` - drivers: flash: spi_nor: values vom DT not correctly used, when `CONFIG_SPI_NOR_SFDP_RUNTIME=y`
* :github:`80429` - Bug in ACD implementation RFC5227
* :github:`80476` - mgmt: mcumgr: stat_mgmt: stat_mgmt_list always send legacy behavior
* :github:`80541` - Incorrect part number LPC55S69 in Konfig.soc
* :github:`80593` - Not possible to write beyond 16MB using flash sample on FRDM_RW612
* :github:`80701` - Changes to cortex_m swap code have major impact on kernel context switching times.
* :github:`80723` - testsuite: coverage: application unable to include `coverage.h`
* :github:`80750` - drivers: can: sam: wrong MRBA configuration
* :github:`80810` - samples: subsys: mgmt: mcumgr: smp_svr: UDP overlay missing random selection
* :github:`80818` - shell: shell_help: terminal offset of subcommands' help text isn't aligned
Mbed TLS
********
Mbed TLS was updated to version 3.6.2 (from 3.6.0). The release notes can be found at:
* https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.1
* https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.2
Mbed TLS 3.6 is an LTS release that will be supported
with security and bug fixes until at least March 2027.
.. _zephyr_3.7.0:
Zephyr 3.7.0
############

View File

@@ -48,26 +48,26 @@ project.
.. table:: Tools and Libraries for MCUmgr
:align: center
+--------------------------------------------------------------------------------+-------------------------------------------+--------------------------+--------------------------------------------------+---------------+------------+---------+
| Name | OS support | Transports | Groups | Type | Language | License |
| +---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+ | | |
| | Windows | Linux | mac | Mobile | Embedded | Serial | Bluetooth | UDP | OS | IMG | Stat | Settings | FS | Shell | Zephyr | | | |
+================================================================================+=========+=======+=====+========+==========+========+===========+=====+====+=====+======+==========+====+=======+========+===============+============+=========+
| `AuTerm <https://github.com/thedjnK/AuTerm/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | Application | C++ (Qt) | GPLv3 |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
| `mcumgr-client <https://github.com/vouch-opensource/mcumgr-client/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Application | Rust | BSD |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
| `mcumgr-web <https://github.com/boogie/mcumgr-web/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Web page | Javascript | MIT |
| | | | | | | | | | | | | | | | | (chrome only) | | |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
| nRF Connect Device Manager: |br| | | | | | | | | | | | | | | | | | | |
| `Android | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✓ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | Library and | Java, | Apache |
| <https://github.com/NordicSemiconductor/Android-nRF-Connect-Device-Manager/>`_ | | | | | | | | | | | | | | | | application | Kotlin, | |
| and `iOS | | | | | | | | | | | | | | | | | Swift | |
| <https://github.com/NordicSemiconductor/IOS-nRF-Connect-Device-Manager>`_ | | | | | | | | | | | | | | | | | | |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
| Zephyr MCUmgr client (in-tree) | ✕ | ✓ | ✕ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Library | C | Apache |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
+--------------------------------------------------------------------------------+-------------------------------------------+--------------------------+--------------------------------------------------+---------------+------------+------------+
| Name | OS support | Transports | Groups | Type | Language | License |
| +---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+ | | |
| | Windows | Linux | mac | Mobile | Embedded | Serial | Bluetooth | UDP | OS | IMG | Stat | Settings | FS | Shell | Zephyr | | | |
+================================================================================+=========+=======+=====+========+==========+========+===========+=====+====+=====+======+==========+====+=======+========+===============+============+============+
| `AuTerm <https://github.com/thedjnK/AuTerm/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | Application | C++ (Qt) | GPL-3.0 |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
| `mcumgr-client <https://github.com/vouch-opensource/mcumgr-client/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Application | Rust | Apache-2.0 |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
| `mcumgr-web <https://github.com/boogie/mcumgr-web/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Web page | Javascript | MIT |
| | | | | | | | | | | | | | | | | (chrome only) | | |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
| nRF Connect Device Manager: |br| | | | | | | | | | | | | | | | | | | |
| `Android | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✓ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | Library and | Java, | Apache-2.0 |
| <https://github.com/NordicSemiconductor/Android-nRF-Connect-Device-Manager/>`_ | | | | | | | | | | | | | | | | application | Kotlin, | |
| and `iOS | | | | | | | | | | | | | | | | | Swift | |
| <https://github.com/NordicSemiconductor/IOS-nRF-Connect-Device-Manager>`_ | | | | | | | | | | | | | | | | | | |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
| Zephyr MCUmgr client (in-tree) | ✕ | ✓ | ✕ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Library | C | Apache-2.0 |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
.. only:: latex

View File

@@ -179,7 +179,7 @@ taking form:
| Content | Size | Description |
+===============+===============+===========================+
| body | no more than | Raw body data fragment |
| | MTU - 3 | |
| | MTU - 5 | |
+---------------+---------------+---------------------------+
| crc16 | 2 bytes | CRC16 of entire packet |
| | | body, preceding length |

View File

@@ -506,6 +506,7 @@ static int adc_sam0_read_async(const struct device *dev,
static const struct adc_driver_api adc_sam0_api = {
.channel_setup = adc_sam0_channel_setup,
.read = adc_sam0_read,
.ref_internal = 1000U, /* Fixed 1.0 V reference */
#ifdef CONFIG_ADC_ASYNC
.read_async = adc_sam0_read_async,
#endif

View File

@@ -63,6 +63,7 @@ config BT_STM32_IPM
depends on DT_HAS_ST_STM32WB_RF_ENABLED
select USE_STM32_HAL_CORTEX
select HAS_STM32LIB
select BT_HCI_SETUP
help
TODO

View File

@@ -565,6 +565,19 @@ static int bt_ipm_open(const struct device *dev, bt_hci_recv_t recv)
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO),
0, K_NO_WAIT);
hci->recv = recv;
LOG_DBG("IPM Channel Open Completed");
return 0;
}
static int bt_ipm_setup(const struct device *dev, const struct bt_hci_setup_params *params)
{
ARG_UNUSED(params);
ARG_UNUSED(dev);
int err;
#ifdef CONFIG_BT_HCI_HOST
err = bt_ipm_ble_init();
if (err) {
@@ -572,9 +585,7 @@ static int bt_ipm_open(const struct device *dev, bt_hci_recv_t recv)
}
#endif /* CONFIG_BT_HCI_HOST */
hci->recv = recv;
LOG_DBG("IPM Channel Open Completed");
LOG_DBG("IPM Channel Setup Completed");
return 0;
}
@@ -613,6 +624,7 @@ static const struct bt_hci_driver_api drv = {
.close = bt_ipm_close,
#endif
.send = bt_ipm_send,
.setup = bt_ipm_setup,
};
static int _bt_ipm_init(const struct device *dev)

View File

@@ -181,7 +181,7 @@ static void rx_thread(void *p1, void *p2, void *p3)
LOG_DBG("started");
uint16_t frame_size = 0;
ssize_t frame_size = 0;
while (1) {
static uint8_t frame[512];

View File

@@ -106,7 +106,7 @@ static int can_sam_init(const struct device *dev)
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);
sys_write32((sys_read32(sam_cfg->dma_base) & 0x0000FFFF) | mrba, sam_cfg->dma_base);
ret = can_mcan_configure_mram(dev, mrba, sam_cfg->mram);
if (ret != 0) {

View File

@@ -155,10 +155,8 @@ static int mcux_ccm_get_subsys_rate(const struct device *dev,
#ifdef CONFIG_MEMC_MCUX_FLEXSPI
case IMX_CCM_FLEXSPI_CLK:
clock_root = kCLOCK_Root_Flexspi1;
break;
case IMX_CCM_FLEXSPI2_CLK:
clock_root = kCLOCK_Root_Flexspi2;
clock_root = kCLOCK_Root_Flexspi1 + instance;
break;
#endif
#ifdef CONFIG_COUNTER_NXP_PIT

View File

@@ -95,20 +95,14 @@ void sai_isr(const void *parameter)
/* check for TX FIFO error */
if (SAI_TX_RX_STATUS_IS_SET(DAI_DIR_TX, data->regmap, kSAI_FIFOErrorFlag)) {
LOG_ERR("FIFO underrun detected");
/* TODO: this will crash the program and should be addressed as
* mentioned in TODO list's 2).
*/
z_irq_spurious(NULL);
LOG_WRN("FIFO underrun detected");
SAI_TX_RX_STATUS_CLEAR(DAI_DIR_TX, data->regmap, kSAI_FIFOErrorFlag);
}
/* check for RX FIFO error */
if (SAI_TX_RX_STATUS_IS_SET(DAI_DIR_RX, data->regmap, kSAI_FIFOErrorFlag)) {
LOG_ERR("FIFO overrun detected");
/* TODO: this will crash the program and should be addressed as
* mentioned in TODO list's 2).
*/
z_irq_spurious(NULL);
LOG_WRN("FIFO overrun detected");
SAI_TX_RX_STATUS_CLEAR(DAI_DIR_RX, data->regmap, kSAI_FIFOErrorFlag);
}
}

View File

@@ -210,6 +210,11 @@ LOG_MODULE_REGISTER(nxp_dai_sai);
((dir) == DAI_DIR_RX ? ((UINT_TO_I2S(regmap))->RCSR & (which)) : \
((UINT_TO_I2S(regmap))->TCSR & (which)))
/* used to clear status flags */
#define SAI_TX_RX_STATUS_CLEAR(dir, regmap, which) \
((dir) == DAI_DIR_RX ? SAI_RxClearStatusFlags(UINT_TO_I2S(regmap), which) \
: SAI_TxClearStatusFlags(UINT_TO_I2S(regmap), which))
/* used to retrieve the SYNC direction. Use this macro when you know for sure
* you have 1 SYNC direction with 1 ASYNC direction.
*/

View File

@@ -252,8 +252,10 @@ static int stm32_ltdc_display_blanking_off(const struct device *dev)
const struct display_stm32_ltdc_config *config = dev->config;
const struct device *display_dev = config->display_controller;
/* Panel controller's phandle is not passed to LTDC in devicetree */
if (display_dev == NULL) {
return 0;
LOG_ERR("There is no panel controller to forward blanking_off call to");
return -ENOSYS;
}
if (!device_is_ready(display_dev)) {
@@ -269,8 +271,10 @@ static int stm32_ltdc_display_blanking_on(const struct device *dev)
const struct display_stm32_ltdc_config *config = dev->config;
const struct device *display_dev = config->display_controller;
/* Panel controller's phandle is not passed to LTDC in devicetree */
if (display_dev == NULL) {
return 0;
LOG_ERR("There is no panel controller to forward blanking_on call to");
return -ENOSYS;
}
if (!device_is_ready(config->display_controller)) {

View File

@@ -93,6 +93,7 @@ static void trng_enable(bool enable)
} else {
CRG_TOP->CLK_AMBA_REG &= ~CRG_TOP_CLK_AMBA_REG_TRNG_CLK_ENABLE_Msk;
TRNG->TRNG_CTRL_REG = 0;
NVIC_ClearPendingIRQ(IRQN);
entropy_smartbond_pm_policy_state_lock_put();
}

View File

@@ -199,12 +199,12 @@ struct host_sub_npcx_data host_sub_data;
#define EC_CFG_LDN_HCMD 0x12 /* PM Channel 2 */
/* Index of EC (4E/4F) Configuration Register */
#define EC_CFG_IDX_LDN 0x07
#define EC_CFG_IDX_CTRL 0x30
#define EC_CFG_IDX_CMD_IO_ADDR_H 0x60
#define EC_CFG_IDX_CMD_IO_ADDR_L 0x61
#define EC_CFG_IDX_DATA_IO_ADDR_H 0x62
#define EC_CFG_IDX_DATA_IO_ADDR_L 0x63
#define EC_CFG_IDX_LDN 0x07
#define EC_CFG_IDX_CTRL 0x30
#define EC_CFG_IDX_DATA_IO_ADDR_H 0x60
#define EC_CFG_IDX_DATA_IO_ADDR_L 0x61
#define EC_CFG_IDX_CMD_IO_ADDR_H 0x62
#define EC_CFG_IDX_CMD_IO_ADDR_L 0x63
/* LDN Activation Enable */
#define EC_CFG_IDX_CTRL_LDN_ENABLE 0x01
@@ -1029,15 +1029,15 @@ void npcx_host_init_subs_host_domain(void)
host_c2h_write_io_cfg_reg(EC_CFG_IDX_LDN, EC_CFG_LDN_HCMD);
#if defined(CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM)
/* Configure IO address of CMD portt (default: 0x200) */
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_H,
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_H,
(CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM >> 8) & 0xff);
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_L,
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_L,
CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM & 0xff);
/* Configure IO address of Data portt (default: 0x204) */
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_H,
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_H,
((CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM + 4) >> 8)
& 0xff);
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_L,
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_L,
(CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM + 4) & 0xff);
#endif
/* Enable 'Host Command' io port (PM Channel 2) */

View File

@@ -224,15 +224,16 @@ static int eth_nxp_enet_tx(const struct device *dev, struct net_pkt *pkt)
ret = ENET_SendFrame(data->base, &data->enet_handle, data->tx_frame_buf,
total_len, RING_ID, frame_is_timestamped, pkt);
if (ret == kStatus_Success) {
if (ret != kStatus_Success) {
LOG_ERR("ENET_SendFrame error: %d", ret);
ENET_ReclaimTxDescriptor(data->base, &data->enet_handle, RING_ID);
ret = -EIO;
goto exit;
}
if (frame_is_timestamped) {
eth_wait_for_ptp_ts(dev, pkt);
} else {
LOG_ERR("ENET_SendFrame error: %d", ret);
ENET_ReclaimTxDescriptor(data->base, &data->enet_handle, RING_ID);
}
exit:
@@ -634,20 +635,25 @@ static inline void nxp_enet_fused_mac(uint8_t *mac_addr)
#ifdef CONFIG_SOC_FAMILY_NXP_IMXRT
uint32_t mac_addr_fuse[2] = {0};
OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE,
#if defined(CONFIG_SOC_SERIES_IMXRT10XX)
0x620,
OCOTP_Init((OCOTP_Type *)OCOTP_BASE, CLOCK_GetIpgFreq());
/* OTP bank 4, word 2: MAC0 */
OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE,
0x22, &mac_addr_fuse[0], 1);
/* OTP bank 4, word 3: MAC1*/
OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE,
0x23, &mac_addr_fuse[1], 1);
#elif defined(CONFIG_SOC_SERIES_IMXRT11XX)
0xA90,
OCOTP_Init((OCOTP_Type *)OCOTP_BASE, 0);
OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE,
0x28, &mac_addr_fuse[0], 2);
#endif
mac_addr_fuse, 2);
mac_addr[0] = mac_addr_fuse[0] & 0x000000FF;
mac_addr[1] = mac_addr_fuse[0] & 0x0000FF00;
mac_addr[2] = mac_addr_fuse[0] & 0x00FF0000;
mac_addr[3] = mac_addr_fuse[0] & 0xFF000000;
mac_addr[4] = mac_addr_fuse[1] & 0x00FF;
mac_addr[5] = mac_addr_fuse[1] & 0xFF00;
mac_addr[1] = (mac_addr_fuse[0] & 0x0000FF00) >> 8;
mac_addr[2] = (mac_addr_fuse[0] & 0x00FF0000) >> 16;
mac_addr[3] = (mac_addr_fuse[0] & 0xFF000000) >> 24;
mac_addr[4] = (mac_addr_fuse[1] & 0x00FF);
mac_addr[5] = (mac_addr_fuse[1] & 0xFF00) >> 8;
#else
ARG_UNUSED(mac_addr);
#endif

View File

@@ -26,12 +26,12 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#define PHY_MC_KSZ8081_OMSO_REG 0x16
#define PHY_MC_KSZ8081_OMSO_FACTORY_MODE_MASK BIT(15)
#define PHY_MC_KSZ8081_OMSO_NAND_TREE_MASK BIT(5)
#define PHY_MC_KSZ8081_OMSO_RMII_OVERRIDE_MASK BIT(1)
#define PHY_MC_KSZ8081_OMSO_MII_OVERRIDE_MASK BIT(0)
#define PHY_MC_KSZ8081_CTRL2_REG 0x1F
#define PHY_MC_KSZ8081_CTRL2_REF_CLK_SEL BIT(7)
#define PHY_MC_KSZ8081_RESET_HOLD_TIME
enum ksz8081_interface {
KSZ8081_MII,
KSZ8081_RMII,
@@ -237,6 +237,10 @@ static int phy_mc_ksz8081_static_cfg(const struct device *dev)
omso &= ~PHY_MC_KSZ8081_OMSO_FACTORY_MODE_MASK &
~PHY_MC_KSZ8081_OMSO_NAND_TREE_MASK;
if (config->phy_iface == KSZ8081_RMII) {
omso &= ~PHY_MC_KSZ8081_OMSO_MII_OVERRIDE_MASK;
omso |= PHY_MC_KSZ8081_OMSO_RMII_OVERRIDE_MASK;
}
ret = phy_mc_ksz8081_write(dev, PHY_MC_KSZ8081_OMSO_REG, (uint32_t)omso);
if (ret) {
@@ -289,11 +293,15 @@ static int phy_mc_ksz8081_reset(const struct device *dev)
goto done;
}
/* Wait for 500 ms as specified by datasheet */
k_busy_wait(USEC_PER_MSEC * 500);
/* Wait for at least 500 us as specified by datasheet */
k_busy_wait(1000);
/* Reset over */
ret = gpio_pin_set_dt(&config->reset_gpio, 1);
/* After deasserting reset, must wait at least 100 us to use programming interface */
k_busy_wait(200);
goto done;
skip_reset_gpio:
#endif /* DT_ANY_INST_HAS_PROP_STATUS_OKAY(reset_gpios) */
@@ -301,8 +309,11 @@ skip_reset_gpio:
if (ret) {
goto done;
}
/* Wait for 500 ms as specified by datasheet */
k_busy_wait(USEC_PER_MSEC * 500);
/* According to IEEE 802.3, Section 2, Subsection 22.2.4.1.1,
* a PHY reset may take up to 0.5 s.
*/
k_busy_wait(500 * USEC_PER_MSEC);
done:
/* Unlock mutex */
@@ -329,12 +340,6 @@ static int phy_mc_ksz8081_cfg_link(const struct device *dev,
/* We are going to reconfigure the phy, don't need to monitor until done */
k_work_cancel_delayable(&data->phy_monitor_work);
/* Reset PHY */
ret = phy_mc_ksz8081_reset(dev);
if (ret) {
goto done;
}
/* DT configurations */
ret = phy_mc_ksz8081_static_cfg(dev);
if (ret) {

View File

@@ -886,6 +886,37 @@ static int flash_flexspi_nor_check_jedec(struct flash_flexspi_nor_data *data,
/* Switch on manufacturer and vendor ID */
switch (vendor_id & 0xFFFF) {
case 0x40ef:
/* W25Q512JV flash, use 4 byte read/write */
flexspi_lut[READ][0] = FLEXSPI_LUT_SEQ(
kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, SPI_NOR_CMD_4READ_4B,
kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_4PAD, 32);
/* Flash needs 6 dummy cycles (at 104MHz) */
flexspi_lut[READ][1] = FLEXSPI_LUT_SEQ(
kFLEXSPI_Command_DUMMY_SDR, kFLEXSPI_4PAD, 6,
kFLEXSPI_Command_READ_SDR, kFLEXSPI_4PAD, 0x04);
/* Only 1S-1S-4S page program supported */
flexspi_lut[PAGE_PROGRAM][0] = FLEXSPI_LUT_SEQ(
kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, SPI_NOR_CMD_PP_1_1_4_4B,
kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 32);
flexspi_lut[PAGE_PROGRAM][1] = FLEXSPI_LUT_SEQ(
kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_4PAD, 0x4,
kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0x0);
/* Update ERASE commands for 4 byte mode */
flexspi_lut[ERASE_SECTOR][0] = FLEXSPI_LUT_SEQ(
kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, SPI_NOR_CMD_SE_4B,
kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 32);
flexspi_lut[ERASE_BLOCK][0] = FLEXSPI_LUT_SEQ(
kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0xDC,
kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 32),
/* Read instruction used for polling is 0x05 */
data->legacy_poll = true;
flexspi_lut[READ_STATUS_REG][0] = FLEXSPI_LUT_SEQ(
kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, SPI_NOR_CMD_RDSR,
kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x01);
/* Device uses bit 1 of status reg 2 for QE */
return flash_flexspi_nor_quad_enable(data, flexspi_lut,
JESD216_DW15_QER_VAL_S2B1v5);
case 0x25C2:
/* MX25 flash, use 4 byte read/write */
flexspi_lut[READ][0] = FLEXSPI_LUT_SEQ(

View File

@@ -1603,20 +1603,12 @@ static const struct flash_driver_api spi_nor_api = {
#define INST_HAS_LOCK(idx) DT_INST_NODE_HAS_PROP(idx, has_lock)
#define INST_HAS_WP_GPIO(idx) DT_INST_NODE_HAS_PROP(idx, wp_gpios)
#define INST_HAS_HOLD_GPIO(idx) DT_INST_NODE_HAS_PROP(idx, hold_gpios)
#define LOCK_DEFINE(idx) \
IF_ENABLED(INST_HAS_LOCK(idx), (BUILD_ASSERT(DT_INST_PROP(idx, has_lock) == \
(DT_INST_PROP(idx, has_lock) & 0xFF), \
"Need support for lock clear beyond SR1");))
#define INST_HAS_ENTER_4BYTE_ADDR(idx) DT_INST_NODE_HAS_PROP(idx, enter_4byte_addr)
#define CONFIGURE_4BYTE_ADDR(idx) \
IF_ENABLED(INST_HAS_ENTER_4BYTE_ADDR(idx), \
(.enter_4byte_addr = DT_INST_PROP(idx, enter_4byte_addr),))
#define CONFIGURE_4BYTE_ADDR(idx) .enter_4byte_addr = DT_INST_PROP_OR(idx, enter_4byte_addr, 0),
#define INIT_T_ENTER_DPD(idx) \
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, t_enter_dpd), \
@@ -1632,15 +1624,9 @@ static const struct flash_driver_api spi_nor_api = {
(.t_exit_dpd = 0))
#endif
#define INIT_WP_GPIOS(idx) \
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, wp_gpios), \
(.wp = GPIO_DT_SPEC_INST_GET(idx, wp_gpios)), \
(.wp = {0}))
#define INIT_WP_GPIOS(idx) .wp = GPIO_DT_SPEC_INST_GET_OR(idx, wp_gpios, {0})
#define INIT_HOLD_GPIOS(idx) \
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, hold_gpios), \
(.hold = GPIO_DT_SPEC_INST_GET(idx, hold_gpios)), \
(.hold = {0},))
#define INIT_HOLD_GPIOS(idx) .hold = GPIO_DT_SPEC_INST_GET_OR(idx, hold_gpios, {0})
#define INIT_WAKEUP_SEQ_PARAMS(idx) \
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, dpd_wakeup_sequence), \
@@ -1652,44 +1638,42 @@ static const struct flash_driver_api spi_nor_api = {
DT_INST_PROP_BY_IDX(idx, dpd_wakeup_sequence, 2), NSEC_PER_MSEC)),\
(.t_dpdd_ms = 0, .t_crdp_ms = 0, .t_rdp_ms = 0))
#define INIT_MXICY_MX25R_POWER_MODE(idx) \
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, mxicy_mx25r_power_mode), \
(.mxicy_mx25r_power_mode = DT_INST_ENUM_IDX(idx, mxicy_mx25r_power_mode)),\
(.mxicy_mx25r_power_mode = 0))
#define INIT_MXICY_MX25R_POWER_MODE(idx) \
.mxicy_mx25r_power_mode = DT_INST_ENUM_IDX_OR(idx, mxicy_mx25r_power_mode, 0)
#define INIT_RESET_GPIOS(idx) \
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, reset_gpios), \
(.reset = GPIO_DT_SPEC_INST_GET(idx, reset_gpios)), \
(.reset = {0}))
#define INIT_RESET_GPIOS(idx) .reset = GPIO_DT_SPEC_INST_GET_OR(idx, reset_gpios, {0})
#define INST_CONFIG_STRUCT_GEN(idx) \
DEFINE_PAGE_LAYOUT(idx) \
.flash_size = DT_INST_PROP(idx, size) / 8, \
.jedec_id = DT_INST_PROP(idx, jedec_id), \
.dpd_exist = DT_INST_PROP(idx, has_dpd), \
.dpd_wakeup_sequence_exist = DT_INST_NODE_HAS_PROP(idx, dpd_wakeup_sequence), \
.mxicy_mx25r_power_mode_exist = DT_INST_NODE_HAS_PROP(idx, mxicy_mx25r_power_mode), \
.reset_gpios_exist = DT_INST_NODE_HAS_PROP(idx, reset_gpios), \
.requires_ulbpr_exist = DT_INST_PROP(idx, requires_ulbpr), \
.wp_gpios_exist = DT_INST_NODE_HAS_PROP(idx, wp_gpios), \
.hold_gpios_exist = DT_INST_NODE_HAS_PROP(idx, hold_gpios), \
IF_ENABLED(INST_HAS_LOCK(idx), (.has_lock = DT_INST_PROP(idx, has_lock),)) \
IF_ENABLED(CONFIG_SPI_NOR_SFDP_MINIMAL, (CONFIGURE_4BYTE_ADDR(idx))) \
IF_ENABLED(CONFIG_SPI_NOR_SFDP_DEVICETREE, \
(.bfp_len = sizeof(bfp_##idx##_data) / 4, \
.bfp = (const struct jesd216_bfp *)bfp_##idx##_data,)) \
IF_ENABLED(ANY_INST_HAS_DPD, (INIT_T_ENTER_DPD(idx),)) \
IF_ENABLED(UTIL_AND(ANY_INST_HAS_DPD, ANY_INST_HAS_T_EXIT_DPD), (INIT_T_EXIT_DPD(idx),))\
IF_ENABLED(ANY_INST_HAS_DPD_WAKEUP_SEQUENCE, (INIT_WAKEUP_SEQ_PARAMS(idx),)) \
IF_ENABLED(ANY_INST_HAS_MXICY_MX25R_POWER_MODE, (INIT_MXICY_MX25R_POWER_MODE(idx),)) \
IF_ENABLED(ANY_INST_HAS_RESET_GPIOS, (INIT_RESET_GPIOS(idx),)) \
IF_ENABLED(ANY_INST_HAS_WP_GPIOS, (INIT_WP_GPIOS(idx),)) \
IF_ENABLED(ANY_INST_HAS_HOLD_GPIOS, (INIT_HOLD_GPIOS(idx),))
.bfp = (const struct jesd216_bfp *)bfp_##idx##_data,))
#define GENERATE_CONFIG_STRUCT(idx) \
static const struct spi_nor_config spi_nor_##idx##_config = { \
.spi = SPI_DT_SPEC_INST_GET(idx, SPI_WORD_SET(8), CONFIG_SPI_NOR_CS_WAIT_DELAY),\
COND_CODE_1(CONFIG_SPI_NOR_SFDP_RUNTIME, EMPTY(), (INST_CONFIG_STRUCT_GEN(idx)))};
.dpd_exist = DT_INST_PROP(idx, has_dpd), \
.dpd_wakeup_sequence_exist = DT_INST_NODE_HAS_PROP(idx, dpd_wakeup_sequence), \
.mxicy_mx25r_power_mode_exist = \
DT_INST_NODE_HAS_PROP(idx, mxicy_mx25r_power_mode), \
.reset_gpios_exist = DT_INST_NODE_HAS_PROP(idx, reset_gpios), \
.requires_ulbpr_exist = DT_INST_PROP(idx, requires_ulbpr), \
.wp_gpios_exist = DT_INST_NODE_HAS_PROP(idx, wp_gpios), \
.hold_gpios_exist = DT_INST_NODE_HAS_PROP(idx, hold_gpios), \
IF_ENABLED(INST_HAS_LOCK(idx), (.has_lock = DT_INST_PROP(idx, has_lock),)) \
IF_ENABLED(ANY_INST_HAS_DPD, (INIT_T_ENTER_DPD(idx),)) \
IF_ENABLED(UTIL_AND(ANY_INST_HAS_DPD, ANY_INST_HAS_T_EXIT_DPD), \
(INIT_T_EXIT_DPD(idx),)) \
IF_ENABLED(ANY_INST_HAS_DPD_WAKEUP_SEQUENCE, (INIT_WAKEUP_SEQ_PARAMS(idx),)) \
IF_ENABLED(ANY_INST_HAS_MXICY_MX25R_POWER_MODE, \
(INIT_MXICY_MX25R_POWER_MODE(idx),)) \
IF_ENABLED(ANY_INST_HAS_RESET_GPIOS, (INIT_RESET_GPIOS(idx),)) \
IF_ENABLED(ANY_INST_HAS_WP_GPIOS, (INIT_WP_GPIOS(idx),)) \
IF_ENABLED(ANY_INST_HAS_HOLD_GPIOS, (INIT_HOLD_GPIOS(idx),)) \
IF_DISABLED(CONFIG_SPI_NOR_SFDP_RUNTIME, (INST_CONFIG_STRUCT_GEN(idx)))};
#define ASSIGN_PM(idx) \
PM_DEVICE_DT_INST_DEFINE(idx, spi_nor_pm_control);

View File

@@ -17,8 +17,6 @@
#include <da1469x_pdc.h>
#include <da1469x_pd.h>
#define GPIO_MODE_RESET 0x200
#define GPIO_PUPD_INPUT 0
#define GPIO_PUPD_INPUT_PU 1
#define GPIO_PUPD_INPUT_PD 2
@@ -117,8 +115,8 @@ static int gpio_smartbond_pin_configure(const struct device *dev,
const struct gpio_smartbond_config *config = dev->config;
if (flags == GPIO_DISCONNECTED) {
/* Reset to default value */
config->mode_regs[pin] = GPIO_MODE_RESET;
/* Set pin as input with no resistors selected */
config->mode_regs[pin] = GPIO_PUPD_INPUT << GPIO_P0_00_MODE_REG_PUPD_Pos;
return 0;
}
@@ -166,7 +164,8 @@ static int gpio_smartbond_port_set_masked_raw(const struct device *dev,
{
const struct gpio_smartbond_config *config = dev->config;
config->data_regs->data = value & mask;
config->data_regs->set = value & mask;
config->data_regs->reset = ~value & mask;
return 0;
}
@@ -244,7 +243,9 @@ static int gpio_smartbond_pin_interrupt_configure(const struct device *dev,
config->wkup_regs->clear = pin_mask;
data->both_edges_pins &= ~pin_mask;
#if CONFIG_PM
da1469x_pdc_del(pdc_ix);
if (pdc_ix >= 0) {
da1469x_pdc_del(pdc_ix);
}
#endif
} else {
if (trig == GPIO_INT_TRIG_BOTH) {

View File

@@ -139,12 +139,21 @@ static int i2s_stm32_set_clock(const struct device *dev,
uint8_t i2s_div, i2s_odd;
if (cfg->pclk_len > 1) {
/* Handle multiple clock sources */
if (clock_control_get_rate(DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE),
(clock_control_subsys_t)&cfg->pclken[1],
&freq_in) < 0) {
LOG_ERR("Failed call clock_control_get_rate(pclken[1])");
return -EIO;
}
} else {
/* Handle single clock source */
if (clock_control_get_rate(DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE),
(clock_control_subsys_t)&cfg->pclken[0],
&freq_in) < 0) {
LOG_ERR("Failed call clock_control_get_rate(pclken[0])");
return -EIO;
}
}
/*
* The ratio between input clock (I2SxClk) and output

View File

@@ -561,6 +561,8 @@ int i3c_device_basic_info_get(struct i3c_device_desc *target)
memcpy(&target->getcaps, &caps, sizeof(target->getcaps));
} else if ((ret != 0) && (target->bcr & I3C_BCR_ADV_CAPABILITIES)) {
goto out;
} else {
ret = 0;
}
target->dcr = dcr.dcr;

View File

@@ -63,9 +63,11 @@
#ifdef CONFIG_TEST_INTC_PLIC
#define INTC_PLIC_STATIC
#define INTC_PLIC_STATIC_INLINE
#else
#define INTC_PLIC_STATIC static inline
#endif
#define INTC_PLIC_STATIC static
#define INTC_PLIC_STATIC_INLINE static inline
#endif /* CONFIG_TEST_INTC_PLIC */
typedef void (*riscv_plic_irq_config_func_t)(void);
struct plic_config {
@@ -77,6 +79,7 @@ struct plic_config {
uint32_t num_irqs;
riscv_plic_irq_config_func_t irq_config_func;
struct _isr_table_entry *isr_table;
const uint32_t *const hart_context;
};
struct plic_stats {
@@ -91,12 +94,12 @@ struct plic_data {
static uint32_t save_irq;
static const struct device *save_dev;
INTC_PLIC_STATIC uint32_t local_irq_to_reg_index(uint32_t local_irq)
INTC_PLIC_STATIC_INLINE uint32_t local_irq_to_reg_index(uint32_t local_irq)
{
return local_irq >> LOG2(PLIC_REG_SIZE);
}
INTC_PLIC_STATIC uint32_t local_irq_to_reg_offset(uint32_t local_irq)
INTC_PLIC_STATIC_INLINE uint32_t local_irq_to_reg_offset(uint32_t local_irq)
{
return local_irq_to_reg_index(local_irq) * sizeof(uint32_t);
}
@@ -108,9 +111,11 @@ static inline uint32_t get_plic_enabled_size(const struct device *dev)
return local_irq_to_reg_index(config->num_irqs) + 1;
}
static inline uint32_t get_first_context(uint32_t hartid)
static ALWAYS_INLINE uint32_t get_hart_context(const struct device *dev, uint32_t hartid)
{
return hartid == 0 ? 0 : (hartid * 2) - 1;
const struct plic_config *config = dev->config;
return config->hart_context[hartid];
}
static inline mem_addr_t get_context_en_addr(const struct device *dev, uint32_t cpu_num)
@@ -119,17 +124,13 @@ static inline mem_addr_t get_context_en_addr(const struct device *dev, uint32_t
uint32_t hartid;
/*
* We want to return the irq_en address for the context of given hart.
* If hartid is 0, we return the devices irq_en property, job done. If it is
* greater than zero, we assume that there are two context's associated with
* each hart: M mode enable, followed by S mode enable. We return the M mode
* enable address.
*/
#if CONFIG_SMP
hartid = _kernel.cpus[cpu_num].arch.hartid;
#else
hartid = arch_proc_id();
#endif
return config->irq_en + get_first_context(hartid) * CONTEXT_ENABLE_SIZE;
return config->irq_en + get_hart_context(dev, hartid) * CONTEXT_ENABLE_SIZE;
}
static inline mem_addr_t get_claim_complete_addr(const struct device *dev)
@@ -138,14 +139,9 @@ static inline mem_addr_t get_claim_complete_addr(const struct device *dev)
/*
* We want to return the claim complete addr for the hart's context.
* We are making a few assumptions here:
* 1. for hart 0, return the first context claim complete.
* 2. for any other hart, we assume they have two privileged mode contexts
* which are contiguous, where the m mode context is first.
* We return the m mode context.
*/
return config->reg + get_first_context(arch_proc_id()) * CONTEXT_SIZE +
return config->reg + get_hart_context(dev, arch_proc_id()) * CONTEXT_SIZE +
CONTEXT_CLAIM;
}
@@ -161,7 +157,7 @@ static inline mem_addr_t get_threshold_priority_addr(const struct device *dev, u
hartid = arch_proc_id();
#endif
return config->reg + (get_first_context(hartid) * CONTEXT_SIZE);
return config->reg + (get_hart_context(dev, hartid) * CONTEXT_SIZE);
}
/**
@@ -556,8 +552,14 @@ SHELL_CMD_ARG_REGISTER(plic, &plic_cmds, "PLIC shell commands",
irq_enable(DT_INST_IRQN(n)); \
}
#define HART_CONTEXTS(i, n) IF_ENABLED(IS_EQ(DT_INST_IRQN_BY_IDX(n, i), DT_INST_IRQN(n)), (i,))
#define PLIC_HART_CONTEXT_DECLARE(n) \
INTC_PLIC_STATIC const uint32_t plic_hart_contexts_##n[DT_CHILD_NUM(DT_PATH(cpus))] = { \
LISTIFY(DT_INST_NUM_IRQS(n), HART_CONTEXTS, (), n)}
#define PLIC_INTC_CONFIG_INIT(n) \
PLIC_INTC_IRQ_FUNC_DECLARE(n); \
PLIC_HART_CONTEXT_DECLARE(n); \
static const struct plic_config plic_config_##n = { \
.prio = PLIC_BASE_ADDR(n), \
.irq_en = PLIC_BASE_ADDR(n) + CONTEXT_ENABLE_BASE, \
@@ -568,6 +570,7 @@ SHELL_CMD_ARG_REGISTER(plic, &plic_cmds, "PLIC shell commands",
.num_irqs = DT_INST_PROP(n, riscv_ndev), \
.irq_config_func = plic_irq_config_func_##n, \
.isr_table = &_sw_isr_table[INTC_INST_ISR_TBL_OFFSET(n)], \
.hart_context = plic_hart_contexts_##n, \
}; \
PLIC_INTC_IRQ_FUNC_DEFINE(n)

View File

@@ -41,17 +41,13 @@ struct nxp_enet_mdio_data {
static int nxp_enet_mdio_wait_xfer(const struct device *dev)
{
struct nxp_enet_mdio_data *data = dev->data;
ENET_Type *base = data->base;
/* This function will not make sense from IRQ context */
if (k_is_in_isr()) {
return -EWOULDBLOCK;
}
if (data->interrupt_up) {
/* Enable the interrupt */
base->EIMR |= ENET_EIMR_MII_MASK;
} else {
if (!data->interrupt_up) {
/* If the interrupt is not available to use yet, just busy wait */
k_busy_wait(CONFIG_MDIO_NXP_ENET_TIMEOUT);
k_sem_give(&data->mdio_sem);
@@ -77,7 +73,7 @@ static int nxp_enet_mdio_read(const struct device *dev,
* Clear the bit (W1C) that indicates MDIO transfer is ready to
* prepare to wait for it to be set once this read is done
*/
data->base->EIR |= ENET_EIR_MII_MASK;
data->base->EIR = ENET_EIR_MII_MASK;
/*
* Write MDIO frame to MII management register which will
@@ -105,7 +101,7 @@ static int nxp_enet_mdio_read(const struct device *dev,
*read_data = (data->base->MMFR & ENET_MMFR_DATA_MASK) >> ENET_MMFR_DATA_SHIFT;
/* Clear the same bit as before because the event has been handled */
data->base->EIR |= ENET_EIR_MII_MASK;
data->base->EIR = ENET_EIR_MII_MASK;
/* This MDIO interaction is finished */
(void)k_mutex_unlock(&data->mdio_mutex);
@@ -127,7 +123,7 @@ static int nxp_enet_mdio_write(const struct device *dev,
* Clear the bit (W1C) that indicates MDIO transfer is ready to
* prepare to wait for it to be set once this write is done
*/
data->base->EIR |= ENET_EIR_MII_MASK;
data->base->EIR = ENET_EIR_MII_MASK;
/*
* Write MDIO frame to MII management register which will
@@ -153,7 +149,7 @@ static int nxp_enet_mdio_write(const struct device *dev,
}
/* Clear the same bit as before because the event has been handled */
data->base->EIR |= ENET_EIR_MII_MASK;
data->base->EIR = ENET_EIR_MII_MASK;
/* This MDIO interaction is finished */
(void)k_mutex_unlock(&data->mdio_mutex);
@@ -170,11 +166,9 @@ static void nxp_enet_mdio_isr_cb(const struct device *dev)
{
struct nxp_enet_mdio_data *data = dev->data;
/* Signal that operation finished */
k_sem_give(&data->mdio_sem);
data->base->EIR = ENET_EIR_MII_MASK;
/* Disable the interrupt */
data->base->EIMR &= ~ENET_EIMR_MII_MASK;
k_sem_give(&data->mdio_sem);
}
static void nxp_enet_mdio_post_module_reset_init(const struct device *dev)
@@ -210,7 +204,9 @@ void nxp_enet_mdio_callback(const struct device *dev,
nxp_enet_mdio_isr_cb(dev);
break;
case NXP_ENET_INTERRUPT_ENABLED:
/* IRQ was enabled in NVIC, now enable in enet */
data->interrupt_up = true;
data->base->EIMR |= ENET_EIMR_MII_MASK;
break;
default:
break;

View File

@@ -1924,7 +1924,7 @@ MODEM_CHAT_SCRIPT_CMDS_DEFINE(swir_hl7800_init_chat_script_cmds,
MODEM_CHAT_SCRIPT_CMD_RESP("", ok_match),
MODEM_CHAT_SCRIPT_CMD_RESP("AT+CIMI", cimi_match),
MODEM_CHAT_SCRIPT_CMD_RESP("", ok_match),
MODEM_CHAT_SCRIPT_CMD_RESP_NONE("AT+CMUX=0,0,5,127", 0));
MODEM_CHAT_SCRIPT_CMD_RESP("AT+CMUX=0,0,5,127", ok_match));
MODEM_CHAT_SCRIPT_DEFINE(swir_hl7800_init_chat_script, swir_hl7800_init_chat_script_cmds,
abort_matches, modem_cellular_chat_callback_handler, 10);

View File

@@ -377,40 +377,6 @@ static int rv3028_update_cfg(const struct device *dev, uint8_t addr, uint8_t mas
#if RV3028_INT_GPIOS_IN_USE
static int rv3028_int_enable_unlocked(const struct device *dev, bool enable)
{
const struct rv3028_config *config = dev->config;
uint8_t clkout = 0;
int err;
if (enable || config->cof == RV3028_CLKOUT_FD_LOW) {
/* Disable CLKOUT */
clkout |= FIELD_PREP(RV3028_CLKOUT_FD, RV3028_CLKOUT_FD_LOW);
} else {
/* Configure CLKOUT frequency */
clkout |= RV3028_CLKOUT_CLKOE |
FIELD_PREP(RV3028_CLKOUT_FD, config->cof);
}
/* Configure the CLKOUT register */
err = rv3028_update_cfg(dev,
RV3028_REG_CLKOUT,
RV3028_CLKOUT_FD | RV3028_CLKOUT_CLKOE,
clkout);
if (err) {
return err;
}
err = gpio_pin_interrupt_configure_dt(&config->gpio_int,
enable ? GPIO_INT_EDGE_TO_ACTIVE : GPIO_INT_DISABLE);
if (err) {
LOG_ERR("failed to %s GPIO interrupt (err %d)", enable ? "enable" : "disable", err);
return err;
}
return 0;
}
static void rv3028_work_cb(struct k_work *work)
{
struct rv3028_data *data = CONTAINER_OF(work, struct rv3028_data, work);
@@ -725,7 +691,6 @@ static int rv3028_alarm_set_callback(const struct device *dev, uint16_t id,
#else
const struct rv3028_config *config = dev->config;
struct rv3028_data *data = dev->data;
uint8_t control_2;
int err = 0;
if (config->gpio_int.port == NULL) {
@@ -742,26 +707,8 @@ static int rv3028_alarm_set_callback(const struct device *dev, uint16_t id,
data->alarm_callback = callback;
data->alarm_user_data = user_data;
err = rv3028_read_reg8(dev, RV3028_REG_CONTROL2, &control_2);
if (err) {
goto unlock;
}
if (callback != NULL) {
control_2 |= RV3028_CONTROL2_AIE;
} else {
control_2 &= ~(RV3028_CONTROL2_AIE);
}
if ((control_2 & RV3028_CONTROL2_UIE) == 0U) {
/* Only change INT GPIO if periodic time update interrupt not enabled */
err = rv3028_int_enable_unlocked(dev, callback != NULL);
if (err) {
goto unlock;
}
}
err = rv3028_write_reg8(dev, RV3028_REG_CONTROL2, control_2);
err = rv3028_update_reg8(dev, RV3028_REG_CONTROL2, RV3028_CONTROL2_AIE,
callback != NULL ? RV3028_CONTROL2_AIE : 0);
if (err) {
goto unlock;
}
@@ -785,7 +732,6 @@ static int rv3028_update_set_callback(const struct device *dev, rtc_update_callb
{
const struct rv3028_config *config = dev->config;
struct rv3028_data *data = dev->data;
uint8_t control_2;
int err;
if (config->gpio_int.port == NULL) {
@@ -797,26 +743,8 @@ static int rv3028_update_set_callback(const struct device *dev, rtc_update_callb
data->update_callback = callback;
data->update_user_data = user_data;
err = rv3028_read_reg8(dev, RV3028_REG_CONTROL2, &control_2);
if (err) {
goto unlock;
}
if (callback != NULL) {
control_2 |= RV3028_CONTROL2_UIE;
} else {
control_2 &= ~(RV3028_CONTROL2_UIE);
}
if ((control_2 & RV3028_CONTROL2_AIE) == 0U) {
/* Only change INT GPIO if alarm interrupt not enabled */
err = rv3028_int_enable_unlocked(dev, callback != NULL);
if (err) {
goto unlock;
}
}
err = rv3028_write_reg8(dev, RV3028_REG_CONTROL2, control_2);
err = rv3028_update_reg8(dev, RV3028_REG_CONTROL2, RV3028_CONTROL2_UIE,
callback != NULL ? RV3028_CONTROL2_UIE : 0);
if (err) {
goto unlock;
}
@@ -867,6 +795,12 @@ static int rv3028_init(const struct device *dev)
return -ENODEV;
}
err = gpio_pin_interrupt_configure_dt(&config->gpio_int, GPIO_INT_EDGE_TO_ACTIVE);
if (err) {
LOG_ERR("failed to enable GPIO interrupt (err %d)", err);
return err;
}
gpio_init_callback(&data->int_callback, rv3028_int_handler,
BIT(config->gpio_int.pin));

View File

@@ -58,6 +58,7 @@ struct usdhc_config {
const struct gpio_dt_spec pwr_gpio;
const struct gpio_dt_spec detect_gpio;
bool detect_dat3;
bool detect_cd;
bool no_180_vol;
uint32_t data_timeout;
uint32_t read_watermark;
@@ -809,10 +810,18 @@ static int imx_usdhc_get_card_present(const struct device *dev)
imx_usdhc_dat3_pull(cfg, true);
USDHC_CardDetectByData3(cfg->base, false);
}
} else if (cfg->detect_cd) {
/*
* Detect the card via the USDHC_CD signal internal to
* the peripheral
*/
data->card_present = USDHC_DetectCardInsert(cfg->base);
} else if (cfg->detect_gpio.port) {
data->card_present = gpio_pin_get_dt(&cfg->detect_gpio) > 0;
} else {
data->card_present = USDHC_DetectCardInsert(cfg->base);
LOG_WRN("No card detection method configured, assuming card "
"is present");
data->card_present = true;
}
return ((int)data->card_present);
}
@@ -1090,6 +1099,7 @@ static const struct sdhc_driver_api usdhc_api = {
.detect_gpio = GPIO_DT_SPEC_INST_GET_OR(n, cd_gpios, {0}), \
.data_timeout = DT_INST_PROP(n, data_timeout), \
.detect_dat3 = DT_INST_PROP(n, detect_dat3), \
.detect_cd = DT_INST_PROP(n, detect_cd), \
.no_180_vol = DT_INST_PROP(n, no_1_8_v), \
.read_watermark = DT_INST_PROP(n, read_watermark), \
.write_watermark = DT_INST_PROP(n, write_watermark), \

View File

@@ -136,7 +136,7 @@ static int tsl2591_channel_get(const struct device *dev, enum sensor_channel cha
struct sensor_value *val)
{
const struct tsl2591_data *data = dev->data;
int64_t cpl = data->atime * data->again;
int64_t cpl = (int64_t)data->atime * (int64_t)data->again;
int64_t strength;
/* Unfortunately, datasheet does not provide a lux conversion formula for this particular

View File

@@ -9,7 +9,6 @@
#include <zephyr/drivers/i2c.h>
#include <zephyr/init.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/byteorder.h>
#include <string.h>
#include <zephyr/logging/log.h>
@@ -82,8 +81,8 @@ static int hts221_sample_fetch(const struct device *dev,
return status;
}
data->rh_sample = sys_le16_to_cpu(buf[0] | (buf[1] << 8));
data->t_sample = sys_le16_to_cpu(buf[2] | (buf[3] << 8));
data->rh_sample = buf[0] | (buf[1] << 8);
data->t_sample = buf[2] | (buf[3] << 8);
return 0;
}
@@ -105,12 +104,12 @@ static int hts221_read_conversion_data(const struct device *dev)
data->h0_rh_x2 = buf[0];
data->h1_rh_x2 = buf[1];
data->t0_degc_x8 = sys_le16_to_cpu(buf[2] | ((buf[5] & 0x3) << 8));
data->t1_degc_x8 = sys_le16_to_cpu(buf[3] | ((buf[5] & 0xC) << 6));
data->h0_t0_out = sys_le16_to_cpu(buf[6] | (buf[7] << 8));
data->h1_t0_out = sys_le16_to_cpu(buf[10] | (buf[11] << 8));
data->t0_out = sys_le16_to_cpu(buf[12] | (buf[13] << 8));
data->t1_out = sys_le16_to_cpu(buf[14] | (buf[15] << 8));
data->t0_degc_x8 = buf[2] | ((buf[5] & 0x3) << 8);
data->t1_degc_x8 = buf[3] | ((buf[5] & 0xC) << 6);
data->h0_t0_out = buf[6] | (buf[7] << 8);
data->h1_t0_out = buf[10] | (buf[11] << 8);
data->t0_out = buf[12] | (buf[13] << 8);
data->t1_out = buf[14] | (buf[15] << 8);
return 0;
}

View File

@@ -12,7 +12,6 @@
#include <zephyr/init.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/util_macro.h>
#include <zephyr/logging/log.h>
#include <zephyr/drivers/sensor.h>
@@ -213,9 +212,9 @@ static int iis2dh_sample_fetch(const struct device *dev,
return -EIO;
}
iis2dh->acc[0] = sys_le16_to_cpu(buf[0]);
iis2dh->acc[1] = sys_le16_to_cpu(buf[1]);
iis2dh->acc[2] = sys_le16_to_cpu(buf[2]);
iis2dh->acc[0] = buf[0];
iis2dh->acc[1] = buf[1];
iis2dh->acc[2] = buf[2];
return 0;
}

View File

@@ -12,7 +12,6 @@
#include <zephyr/init.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/logging/log.h>
#include <zephyr/drivers/sensor.h>
@@ -244,9 +243,9 @@ static int iis2dlpc_sample_fetch(const struct device *dev,
shift = IIS2DLPC_SHIFT_PMOTHER;
}
iis2dlpc->acc[0] = sys_le16_to_cpu(buf[0]) >> shift;
iis2dlpc->acc[1] = sys_le16_to_cpu(buf[1]) >> shift;
iis2dlpc->acc[2] = sys_le16_to_cpu(buf[2]) >> shift;
iis2dlpc->acc[0] = buf[0] >> shift;
iis2dlpc->acc[1] = buf[1] >> shift;
iis2dlpc->acc[2] = buf[2] >> shift;
return 0;
}

View File

@@ -15,7 +15,6 @@
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <string.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/logging/log.h>
@@ -204,8 +203,8 @@ static int iis2iclx_sample_fetch_accel(const struct device *dev)
return -EIO;
}
data->acc[0] = sys_le16_to_cpu(buf[0]);
data->acc[1] = sys_le16_to_cpu(buf[1]);
data->acc[0] = buf[0];
data->acc[1] = buf[1];
return 0;
}
@@ -222,7 +221,7 @@ static int iis2iclx_sample_fetch_temp(const struct device *dev)
return -EIO;
}
data->temp_sample = sys_le16_to_cpu(buf);
data->temp_sample = buf;
return 0;
}

View File

@@ -12,7 +12,6 @@
#include <zephyr/device.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/util.h>
#include <zephyr/kernel.h>
@@ -171,8 +170,8 @@ static int hts221_read_conv_data(const struct device *dev,
ht->y0 = buf[0] / 2;
ht->y1 = buf[1] / 2;
ht->x0 = sys_le16_to_cpu(buf[6] | (buf[7] << 8));
ht->x1 = sys_le16_to_cpu(buf[10] | (buf[11] << 8));
ht->x0 = buf[6] | (buf[7] << 8);
ht->x1 = buf[10] | (buf[11] << 8);
return 0;
}

View File

@@ -12,7 +12,6 @@
#include <zephyr/init.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/drivers/sensor.h>
#include <string.h>
#include <zephyr/logging/log.h>
@@ -63,7 +62,7 @@ static int iis2mdc_set_hard_iron(const struct device *dev,
int16_t offset[3];
for (i = 0U; i < 3; i++) {
offset[i] = sys_cpu_to_le16(val->val1);
offset[i] = val->val1;
val++;
}
@@ -185,9 +184,9 @@ static int iis2mdc_sample_fetch_mag(const struct device *dev)
return -EIO;
}
iis2mdc->mag[0] = sys_le16_to_cpu(raw_mag[0]);
iis2mdc->mag[1] = sys_le16_to_cpu(raw_mag[1]);
iis2mdc->mag[2] = sys_le16_to_cpu(raw_mag[2]);
iis2mdc->mag[0] = raw_mag[0];
iis2mdc->mag[1] = raw_mag[1];
iis2mdc->mag[2] = raw_mag[2];
return 0;
}
@@ -205,7 +204,7 @@ static int iis2mdc_sample_fetch_temp(const struct device *dev)
}
/* formula is temp = 25 + (temp / 8) C */
temp = sys_le16_to_cpu(raw_temp);
temp = raw_temp;
iis2mdc->temp_sample = 2500 + (temp * 100) / 8;
return 0;

View File

@@ -13,7 +13,6 @@
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/logging/log.h>
@@ -30,9 +29,9 @@ static int iis3dhhc_sample_fetch(const struct device *dev,
__ASSERT_NO_MSG(chan == SENSOR_CHAN_ALL);
iis3dhhc_acceleration_raw_get(data->ctx, raw_accel);
data->acc[0] = sys_le16_to_cpu(raw_accel[0]);
data->acc[1] = sys_le16_to_cpu(raw_accel[1]);
data->acc[2] = sys_le16_to_cpu(raw_accel[2]);
data->acc[0] = raw_accel[0];
data->acc[1] = raw_accel[1];
data->acc[2] = raw_accel[2];
return 0;
}

View File

@@ -15,7 +15,6 @@
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <string.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/util_macro.h>
#include <zephyr/logging/log.h>
@@ -309,9 +308,9 @@ static int ism330dhcx_sample_fetch_accel(const struct device *dev)
return -EIO;
}
data->acc[0] = sys_le16_to_cpu(buf[0]);
data->acc[1] = sys_le16_to_cpu(buf[1]);
data->acc[2] = sys_le16_to_cpu(buf[2]);
data->acc[0] = buf[0];
data->acc[1] = buf[1];
data->acc[2] = buf[2];
return 0;
}
@@ -326,9 +325,9 @@ static int ism330dhcx_sample_fetch_gyro(const struct device *dev)
return -EIO;
}
data->gyro[0] = sys_le16_to_cpu(buf[0]);
data->gyro[1] = sys_le16_to_cpu(buf[1]);
data->gyro[2] = sys_le16_to_cpu(buf[2]);
data->gyro[0] = buf[0];
data->gyro[1] = buf[1];
data->gyro[2] = buf[2];
return 0;
}
@@ -344,7 +343,7 @@ static int ism330dhcx_sample_fetch_temp(const struct device *dev)
return -EIO;
}
data->temp_sample = sys_le16_to_cpu(buf);
data->temp_sample = buf;
return 0;
}

View File

@@ -12,7 +12,6 @@
#include <zephyr/device.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/util.h>
#include <zephyr/kernel.h>
@@ -165,8 +164,8 @@ static int ism330dhcx_hts221_read_conv_data(const struct device *dev, uint8_t i2
ht->y0 = buf[0] / 2;
ht->y1 = buf[1] / 2;
ht->x0 = sys_le16_to_cpu(buf[6] | (buf[7] << 8));
ht->x1 = sys_le16_to_cpu(buf[10] | (buf[11] << 8));
ht->x0 = buf[6] | (buf[7] << 8);
ht->x1 = buf[10] | (buf[11] << 8);
return 0;
}

View File

@@ -15,7 +15,6 @@
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <string.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/logging/log.h>
#include <zephyr/dt-bindings/sensor/lis2ds12.h>
@@ -175,9 +174,9 @@ static int lis2ds12_sample_fetch_accel(const struct device *dev)
return -EIO;
}
data->sample_x = sys_le16_to_cpu(buf[0]);
data->sample_y = sys_le16_to_cpu(buf[1]);
data->sample_z = sys_le16_to_cpu(buf[2]);
data->sample_x = buf[0];
data->sample_y = buf[1];
data->sample_z = buf[2];
return 0;
}

View File

@@ -15,7 +15,6 @@
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <string.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/util_macro.h>
#include <zephyr/logging/log.h>
@@ -27,10 +26,12 @@ LOG_MODULE_REGISTER(LIS2DUX12, CONFIG_SENSOR_LOG_LEVEL);
static int lis2dux12_set_odr(const struct device *dev, uint8_t odr)
{
struct lis2dux12_data *data = dev->data;
const struct lis2dux12_config *cfg = dev->config;
stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx;
lis2dux12_md_t mode = {.odr = odr};
lis2dux12_md_t mode = {.odr = odr, .fs = data->range};
data->odr = odr;
return lis2dux12_mode_set(ctx, &mode);
}
@@ -40,7 +41,7 @@ static int lis2dux12_set_range(const struct device *dev, uint8_t range)
struct lis2dux12_data *data = dev->data;
const struct lis2dux12_config *cfg = dev->config;
stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx;
lis2dux12_md_t val = { .odr = cfg->odr, .fs = range };
lis2dux12_md_t val = { .odr = data->odr, .fs = range };
err = lis2dux12_mode_set(ctx, &val);
@@ -66,6 +67,7 @@ static int lis2dux12_set_range(const struct device *dev, uint8_t range)
break;
}
data->range = range;
return 0;
}
@@ -107,6 +109,39 @@ static int lis2dux12_freq_to_odr_val(const struct device *dev, uint16_t freq)
return -EINVAL;
}
static int lis2dux12_set_fs(const struct device *dev, int16_t fs)
{
int ret;
uint8_t range;
switch (fs) {
case 2:
range = LIS2DUX12_DT_FS_2G;
break;
case 4:
range = LIS2DUX12_DT_FS_4G;
break;
case 8:
range = LIS2DUX12_DT_FS_8G;
break;
case 16:
range = LIS2DUX12_DT_FS_16G;
break;
default:
LOG_ERR("fs [%d] not supported.", fs);
return -EINVAL;
}
ret = lis2dux12_set_range(dev, range);
if (ret < 0) {
LOG_ERR("%s: range init error %d", dev->name, range);
return ret;
}
LOG_DBG("%s: set fs to %d g", dev->name, fs);
return ret;
}
static int lis2dux12_accel_config(const struct device *dev, enum sensor_channel chan,
enum sensor_attribute attr, const struct sensor_value *val)
{
@@ -114,7 +149,7 @@ static int lis2dux12_accel_config(const struct device *dev, enum sensor_channel
switch (attr) {
case SENSOR_ATTR_FULL_SCALE:
return lis2dux12_set_range(dev, sensor_ms2_to_g(val));
return lis2dux12_set_fs(dev, sensor_ms2_to_g(val));
case SENSOR_ATTR_SAMPLING_FREQUENCY:
odr_val = lis2dux12_freq_to_odr_val(dev, val->val1);
if (odr_val < 0) {
@@ -154,7 +189,7 @@ static int lis2dux12_sample_fetch_accel(const struct device *dev)
stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx;
/* fetch raw data sample */
lis2dux12_md_t mode = {.fs = cfg->range};
lis2dux12_md_t mode = {.fs = data->range};
lis2dux12_xl_data_t xzy_data = {0};
if (lis2dux12_xl_data_get(ctx, &mode, &xzy_data) < 0) {
@@ -162,9 +197,9 @@ static int lis2dux12_sample_fetch_accel(const struct device *dev)
return -EIO;
}
data->sample_x = sys_le16_to_cpu(xzy_data.raw[0]);
data->sample_y = sys_le16_to_cpu(xzy_data.raw[1]);
data->sample_z = sys_le16_to_cpu(xzy_data.raw[2]);
data->sample_x = xzy_data.raw[0];
data->sample_y = xzy_data.raw[1];
data->sample_z = xzy_data.raw[2];
return 0;
}
@@ -185,7 +220,7 @@ static int lis2dux12_sample_fetch_temp(const struct device *dev)
return -EIO;
}
data->sample_temp = sys_le16_to_cpu(temp_data.heat.raw);
data->sample_temp = temp_data.heat.deg_c;
return 0;
}
@@ -246,7 +281,7 @@ static inline int lis2dux12_get_channel(enum sensor_channel chan, struct sensor_
break;
#if defined(CONFIG_LIS2DUX12_ENABLE_TEMP)
case SENSOR_CHAN_DIE_TEMP:
sensor_value_from_double(val, data->sample_temp);
sensor_value_from_float(val, data->sample_temp);
break;
#endif
default:
@@ -322,11 +357,7 @@ static int lis2dux12_init(const struct device *dev)
/* set sensor default pm and odr */
LOG_DBG("%s: pm: %d, odr: %d", dev->name, cfg->pm, cfg->odr);
lis2dux12_md_t mode = {
.odr = cfg->odr,
.fs = cfg->range,
};
ret = lis2dux12_mode_set(ctx, &mode);
ret = lis2dux12_set_odr(dev, cfg->odr);
if (ret < 0) {
LOG_ERR("%s: odr init error (12.5 Hz)", dev->name);
return ret;

View File

@@ -51,9 +51,11 @@ struct lis2dux12_data {
int sample_y;
int sample_z;
float gain;
uint8_t range;
uint8_t odr;
#ifdef CONFIG_LIS2DUX12_ENABLE_TEMP
int sample_temp;
float sample_temp;
#endif
#ifdef CONFIG_LIS2DUX12_TRIGGER

View File

@@ -13,7 +13,6 @@
#include <zephyr/init.h>
#include <stdlib.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/logging/log.h>
#include <zephyr/drivers/sensor.h>
@@ -332,9 +331,9 @@ static int lis2dw12_sample_fetch(const struct device *dev,
shift = LIS2DW12_SHIFT_PMOTHER;
}
lis2dw12->acc[0] = sys_le16_to_cpu(buf[0]) >> shift;
lis2dw12->acc[1] = sys_le16_to_cpu(buf[1]) >> shift;
lis2dw12->acc[2] = sys_le16_to_cpu(buf[2]) >> shift;
lis2dw12->acc[0] = buf[0] >> shift;
lis2dw12->acc[1] = buf[1] >> shift;
lis2dw12->acc[2] = buf[2] >> shift;
return 0;
}

View File

@@ -12,7 +12,6 @@
#include <zephyr/init.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/pm/device.h>
#include <string.h>
@@ -74,7 +73,7 @@ static int lis2mdl_set_hard_iron(const struct device *dev,
int16_t offset[3];
for (i = 0U; i < 3; i++) {
offset[i] = sys_cpu_to_le16(val->val1);
offset[i] = val->val1;
val++;
}
@@ -229,9 +228,9 @@ static int lis2mdl_sample_fetch_mag(const struct device *dev)
LOG_ERR("Failed to read raw data");
return rc;
}
lis2mdl->mag[0] = sys_le16_to_cpu(raw_mag[0]);
lis2mdl->mag[1] = sys_le16_to_cpu(raw_mag[1]);
lis2mdl->mag[2] = sys_le16_to_cpu(raw_mag[2]);
lis2mdl->mag[0] = raw_mag[0];
lis2mdl->mag[1] = raw_mag[1];
lis2mdl->mag[2] = raw_mag[2];
if (cfg->cancel_offset) {
/* The second measurement is needed when offset
@@ -247,9 +246,9 @@ static int lis2mdl_sample_fetch_mag(const struct device *dev)
LOG_ERR("Failed to read raw data");
return rc;
}
lis2mdl->mag[0] += sys_le16_to_cpu(raw_mag[0]);
lis2mdl->mag[1] += sys_le16_to_cpu(raw_mag[1]);
lis2mdl->mag[2] += sys_le16_to_cpu(raw_mag[2]);
lis2mdl->mag[0] += raw_mag[0];
lis2mdl->mag[1] += raw_mag[1];
lis2mdl->mag[2] += raw_mag[2];
lis2mdl->mag[0] /= 2;
lis2mdl->mag[1] /= 2;
lis2mdl->mag[2] /= 2;
@@ -262,9 +261,9 @@ static int lis2mdl_sample_fetch_mag(const struct device *dev)
LOG_ERR("Failed to read sample");
return rc;
}
lis2mdl->mag[0] = sys_le16_to_cpu(raw_mag[0]);
lis2mdl->mag[1] = sys_le16_to_cpu(raw_mag[1]);
lis2mdl->mag[2] = sys_le16_to_cpu(raw_mag[2]);
lis2mdl->mag[0] = raw_mag[0];
lis2mdl->mag[1] = raw_mag[1];
lis2mdl->mag[2] = raw_mag[2];
}
return 0;
}
@@ -282,7 +281,7 @@ static int lis2mdl_sample_fetch_temp(const struct device *dev)
return -EIO;
}
lis2mdl->temp_sample = (sys_le16_to_cpu(raw_temp));
lis2mdl->temp_sample = raw_temp;
return 0;
}

View File

@@ -15,7 +15,6 @@
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <string.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/logging/log.h>
@@ -525,12 +524,12 @@ static inline int lsm6dso_magn_get_channel(enum sensor_channel chan,
}
sample[0] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8)));
sample[1] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][2] |
(data->ext_data[idx][3] << 8)));
sample[2] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][4] |
(data->ext_data[idx][5] << 8)));
sample[0] = (int16_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8));
sample[1] = (int16_t)(data->ext_data[idx][2] |
(data->ext_data[idx][3] << 8));
sample[2] = (int16_t)(data->ext_data[idx][4] |
(data->ext_data[idx][5] << 8));
switch (chan) {
case SENSOR_CHAN_MAGN_X:
@@ -568,8 +567,8 @@ static inline void lsm6dso_hum_convert(struct sensor_value *val,
return;
}
raw_val = sys_le16_to_cpu((int16_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8)));
raw_val = (int16_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8));
/* find relative humidty by linear interpolation */
rh = (ht->y1 - ht->y0) * raw_val + ht->x1 * ht->y0 - ht->x0 * ht->y1;
@@ -592,9 +591,9 @@ static inline void lsm6dso_press_convert(struct sensor_value *val,
return;
}
raw_val = sys_le32_to_cpu((int32_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8) |
(data->ext_data[idx][2] << 16)));
raw_val = (int32_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8) |
(data->ext_data[idx][2] << 16));
/* Pressure sensitivity is 4096 LSB/hPa */
/* Convert raw_val to val in kPa */
@@ -615,8 +614,8 @@ static inline void lsm6dso_temp_convert(struct sensor_value *val,
return;
}
raw_val = sys_le16_to_cpu((int16_t)(data->ext_data[idx][3] |
(data->ext_data[idx][4] << 8)));
raw_val = (int16_t)(data->ext_data[idx][3] |
(data->ext_data[idx][4] << 8));
/* Temperature sensitivity is 100 LSB/deg C */
val->val1 = raw_val / 100;

View File

@@ -12,7 +12,6 @@
#include <zephyr/device.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/util.h>
#include <zephyr/kernel.h>
@@ -155,8 +154,8 @@ static int lsm6dso_hts221_read_conv_data(const struct device *dev,
ht->y0 = buf[0] / 2;
ht->y1 = buf[1] / 2;
ht->x0 = sys_le16_to_cpu(buf[6] | (buf[7] << 8));
ht->x1 = sys_le16_to_cpu(buf[10] | (buf[11] << 8));
ht->x0 = buf[6] | (buf[7] << 8);
ht->x1 = buf[10] | (buf[11] << 8);
return 0;
}

View File

@@ -15,7 +15,6 @@
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <string.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/logging/log.h>
@@ -556,12 +555,12 @@ static inline int lsm6dso16is_magn_get_channel(enum sensor_channel chan,
}
sample[0] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8)));
sample[1] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][2] |
(data->ext_data[idx][3] << 8)));
sample[2] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][4] |
(data->ext_data[idx][5] << 8)));
sample[0] = (int16_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8));
sample[1] = (int16_t)(data->ext_data[idx][2] |
(data->ext_data[idx][3] << 8));
sample[2] = (int16_t)(data->ext_data[idx][4] |
(data->ext_data[idx][5] << 8));
switch (chan) {
case SENSOR_CHAN_MAGN_X:
@@ -599,8 +598,8 @@ static inline void lsm6dso16is_hum_convert(struct sensor_value *val,
return;
}
raw_val = sys_le16_to_cpu((int16_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8)));
raw_val = (int16_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8));
/* find relative humidty by linear interpolation */
rh = (ht->y1 - ht->y0) * raw_val + ht->x1 * ht->y0 - ht->x0 * ht->y1;
@@ -623,9 +622,9 @@ static inline void lsm6dso16is_press_convert(struct sensor_value *val,
return;
}
raw_val = sys_le32_to_cpu((int32_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8) |
(data->ext_data[idx][2] << 16)));
raw_val = (int32_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8) |
(data->ext_data[idx][2] << 16));
/* Pressure sensitivity is 4096 LSB/hPa */
/* Convert raw_val to val in kPa */
@@ -646,8 +645,8 @@ static inline void lsm6dso16is_temp_convert(struct sensor_value *val,
return;
}
raw_val = sys_le16_to_cpu((int16_t)(data->ext_data[idx][3] |
(data->ext_data[idx][4] << 8)));
raw_val = (int16_t)(data->ext_data[idx][3] |
(data->ext_data[idx][4] << 8));
/* Temperature sensitivity is 100 LSB/deg C */
val->val1 = raw_val / 100;

View File

@@ -12,7 +12,6 @@
#include <zephyr/device.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/util.h>
#include <zephyr/kernel.h>
@@ -156,8 +155,8 @@ static int lsm6dso16is_hts221_read_conv_data(const struct device *dev,
ht->y0 = buf[0] / 2;
ht->y1 = buf[1] / 2;
ht->x0 = sys_le16_to_cpu(buf[6] | (buf[7] << 8));
ht->x1 = sys_le16_to_cpu(buf[10] | (buf[11] << 8));
ht->x0 = buf[6] | (buf[7] << 8);
ht->x1 = buf[10] | (buf[11] << 8);
return 0;
}

View File

@@ -15,7 +15,6 @@
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <string.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/logging/log.h>
@@ -602,12 +601,12 @@ static inline int lsm6dsv16x_magn_get_channel(enum sensor_channel chan,
}
sample[0] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8)));
sample[1] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][2] |
(data->ext_data[idx][3] << 8)));
sample[2] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][4] |
(data->ext_data[idx][5] << 8)));
sample[0] = (int16_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8));
sample[1] = (int16_t)(data->ext_data[idx][2] |
(data->ext_data[idx][3] << 8));
sample[2] = (int16_t)(data->ext_data[idx][4] |
(data->ext_data[idx][5] << 8));
switch (chan) {
case SENSOR_CHAN_MAGN_X:
@@ -645,8 +644,8 @@ static inline void lsm6dsv16x_hum_convert(struct sensor_value *val,
return;
}
raw_val = sys_le16_to_cpu((int16_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8)));
raw_val = (int16_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8));
/* find relative humidty by linear interpolation */
rh = (ht->y1 - ht->y0) * raw_val + ht->x1 * ht->y0 - ht->x0 * ht->y1;
@@ -669,9 +668,9 @@ static inline void lsm6dsv16x_press_convert(struct sensor_value *val,
return;
}
raw_val = sys_le32_to_cpu((int32_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8) |
(data->ext_data[idx][2] << 16)));
raw_val = (int32_t)(data->ext_data[idx][0] |
(data->ext_data[idx][1] << 8) |
(data->ext_data[idx][2] << 16));
/* Pressure sensitivity is 4096 LSB/hPa */
/* Convert raw_val to val in kPa */
@@ -692,8 +691,8 @@ static inline void lsm6dsv16x_temp_convert(struct sensor_value *val,
return;
}
raw_val = sys_le16_to_cpu((int16_t)(data->ext_data[idx][3] |
(data->ext_data[idx][4] << 8)));
raw_val = (int16_t)(data->ext_data[idx][3] |
(data->ext_data[idx][4] << 8));
/* Temperature sensitivity is 100 LSB/deg C */
val->val1 = raw_val / 100;

View File

@@ -12,7 +12,6 @@
#include <zephyr/device.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/util.h>
#include <zephyr/kernel.h>
@@ -156,8 +155,8 @@ static int lsm6dsv16x_hts221_read_conv_data(const struct device *dev,
ht->y0 = buf[0] / 2;
ht->y1 = buf[1] / 2;
ht->x0 = sys_le16_to_cpu(buf[6] | (buf[7] << 8));
ht->x1 = sys_le16_to_cpu(buf[10] | (buf[11] << 8));
ht->x0 = buf[6] | (buf[7] << 8);
ht->x1 = buf[10] | (buf[11] << 8);
return 0;
}

View File

@@ -417,7 +417,7 @@ int icm42688_read_all(const struct device *dev, uint8_t data[14]);
static inline void icm42688_accel_g(struct icm42688_cfg *cfg, int32_t in, int32_t *out_g,
uint32_t *out_ug)
{
int32_t sensitivity = 0; /* value equivalent for 1g */
int32_t sensitivity;
switch (cfg->accel_fs) {
case ICM42688_DT_ACCEL_FS_2:
@@ -432,6 +432,8 @@ static inline void icm42688_accel_g(struct icm42688_cfg *cfg, int32_t in, int32_
case ICM42688_DT_ACCEL_FS_16:
sensitivity = 2048;
break;
default:
CODE_UNREACHABLE;
}
/* Whole g's */
@@ -452,7 +454,7 @@ static inline void icm42688_accel_g(struct icm42688_cfg *cfg, int32_t in, int32_
static inline void icm42688_gyro_dps(const struct icm42688_cfg *cfg, int32_t in, int32_t *out_dps,
uint32_t *out_udps)
{
int64_t sensitivity = 0; /* value equivalent for 10x gyro reading deg/s */
int64_t sensitivity;
switch (cfg->gyro_fs) {
case ICM42688_DT_GYRO_FS_2000:
@@ -479,6 +481,8 @@ static inline void icm42688_gyro_dps(const struct icm42688_cfg *cfg, int32_t in,
case ICM42688_DT_GYRO_FS_15_625:
sensitivity = 20972;
break;
default:
CODE_UNREACHABLE;
}
int32_t in10 = in * 10;

View File

@@ -137,6 +137,7 @@ void uart_async_rx_reset(struct uart_async_rx *rx_data)
int uart_async_rx_init(struct uart_async_rx *rx_data,
const struct uart_async_rx_config *config)
{
__ASSERT_NO_MSG(config->buf_cnt > 0);
__ASSERT_NO_MSG(config->length / config->buf_cnt <= UINT8_MAX);
memset(rx_data, 0, sizeof(*rx_data));
rx_data->config = config;

View File

@@ -739,13 +739,14 @@ udc_disable_error:
return ret;
}
int udc_init(const struct device *dev, udc_event_cb_t event_cb)
int udc_init(const struct device *dev,
udc_event_cb_t event_cb, const void *const event_ctx)
{
const struct udc_api *api = dev->api;
struct udc_data *data = dev->data;
int ret;
if (event_cb == NULL) {
if (event_cb == NULL || event_ctx == NULL) {
return -EINVAL;
}
@@ -757,6 +758,7 @@ int udc_init(const struct device *dev, udc_event_cb_t event_cb)
}
data->event_cb = event_cb;
data->event_ctx = event_ctx;
ret = api->init(dev);
if (ret == 0) {

View File

@@ -31,12 +31,18 @@ LOG_MODULE_REGISTER(udc_stm32, CONFIG_UDC_DRIVER_LOG_LEVEL);
#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32_otghs)
#define DT_DRV_COMPAT st_stm32_otghs
#define UDC_STM32_IRQ_NAME otghs
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_otgfs)
#define DT_DRV_COMPAT st_stm32_otgfs
#define UDC_STM32_IRQ_NAME otgfs
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_usb)
#define DT_DRV_COMPAT st_stm32_usb
#define UDC_STM32_IRQ_NAME usb
#endif
#define UDC_STM32_IRQ DT_INST_IRQ_BY_NAME(0, UDC_STM32_IRQ_NAME, irq)
#define UDC_STM32_IRQ_PRI DT_INST_IRQ_BY_NAME(0, UDC_STM32_IRQ_NAME, priority)
struct udc_stm32_data {
PCD_HandleTypeDef pcd;
const struct device *dev;
@@ -547,7 +553,7 @@ static int udc_stm32_disable(const struct device *dev)
struct udc_stm32_data *priv = udc_get_private(dev);
HAL_StatusTypeDef status;
irq_disable(DT_INST_IRQN(0));
irq_disable(UDC_STM32_IRQ);
if (udc_ep_disable_internal(dev, USB_CONTROL_EP_OUT)) {
LOG_ERR("Failed to disable control endpoint");
@@ -1124,12 +1130,12 @@ static int udc_stm32_driver_init0(const struct device *dev)
data->caps.mps0 = UDC_MPS0_64;
priv->dev = dev;
priv->irq = DT_INST_IRQN(0);
priv->irq = UDC_STM32_IRQ;
priv->clk_enable = priv_clock_enable;
priv->clk_disable = priv_clock_disable;
priv->pcd_prepare = priv_pcd_prepare;
IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), udc_stm32_irq,
IRQ_CONNECT(UDC_STM32_IRQ, UDC_STM32_IRQ_PRI, udc_stm32_irq,
DEVICE_DT_INST_GET(0), 0);
err = pinctrl_apply_state(usb_pcfg, PINCTRL_STATE_DEFAULT);

View File

@@ -6,7 +6,7 @@
/ {
soc {
sram: sram@400000 {
sram: sram@4000000 {
ranges = <0x4000000 0x4000000 0x20000000>;
};

View File

@@ -6,7 +6,7 @@
/ {
soc {
sram: sram@400000 {
sram: sram@4000000 {
ranges = <0x4000000 0x4000000 0x20000000>;
};

View File

@@ -11,7 +11,7 @@
/ {
soc {
sram: sram@400000 {
sram: sram@4000000 {
ranges = <0x4000000 0x4000000 0x20000000>;
};

View File

@@ -6,7 +6,7 @@
/ {
soc {
sram: sram@400000 {
sram: sram@4000000 {
ranges = <0x4000000 0x4000000 0x20000000>;
};

View File

@@ -57,6 +57,8 @@
};
&edma0 {
/* Each channel has separate interrupt entry */
irq-shared-offset = <0>;
dma-channels = <16>;
};

View File

@@ -831,13 +831,13 @@
status = "disabled";
};
usbphy1: usbphy@0x40434000 {
usbphy1: usbphy@40434000 {
compatible = "nxp,usbphy";
reg = <0x40434000 0x1000>;
status = "disabled";
};
usbphy2: usbphy@0x40438000 {
usbphy2: usbphy@40438000 {
compatible = "nxp,usbphy";
reg = <0x40438000 0x1000>;
status = "disabled";

View File

@@ -443,7 +443,8 @@
#size-cells = <0>;
reg = <0x40013000 0x400>;
interrupts = <55 5>;
clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00001000>;
clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00001000>,
<&rcc STM32_SRC_PLL1_Q SPI1_SEL(0)>;
status = "disabled";
};
@@ -453,7 +454,8 @@
#size-cells = <0>;
reg = <0x40003800 0x400>;
interrupts = <56 5>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00004000>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00004000>,
<&rcc STM32_SRC_PLL1_Q SPI2_SEL(0)>;
status = "disabled";
};
@@ -463,7 +465,8 @@
#size-cells = <0>;
reg = <0x40003c00 0x400>;
interrupts = <57 5>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00008000>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00008000>,
<&rcc STM32_SRC_PLL1_Q SPI3_SEL(0)>;
status = "disabled";
};

View File

@@ -66,3 +66,10 @@ properties:
Enable the host to detect an SD card via the DAT3 line of the SD card
connection. Requires the board to define a function to pull DAT3 low or
high using pullup/pulldown resistors.
detect-cd:
type: boolean
description: |
Use the host's internal card detect signal (USDHC_CD) to detect the SD
card. This signal is available as an alternative to card detect via GPIO,
and should be connected to the SD slot's detect pin if used.

View File

@@ -7,7 +7,7 @@
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_GDBSTUB_H_
#define ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_GDBSTUB_H_
#include <zephyr/arch/arm/exc.h>
#include <zephyr/arch/arm/exception.h>
#ifndef _ASMLANGUAGE

View File

@@ -462,6 +462,9 @@ struct bt_l2cap_server {
* This callback is called whenever a new incoming connection requires
* authorization.
*
* @warning It is the responsibility of this callback to zero out the
* parent of the chan object.
*
* @param conn The connection that is requesting authorization
* @param server Pointer to the server structure this callback relates to
* @param chan Pointer to received the allocated channel
@@ -516,6 +519,9 @@ int bt_l2cap_br_server_register(struct bt_l2cap_server *server);
* each channel connected() callback will be called. If the connection is
* rejected disconnected() callback is called instead.
*
* @warning It is the responsibility of the caller to zero out the
* parents of the chan objects.
*
* @param conn Connection object.
* @param chans Array of channel objects.
* @param psm Channel PSM to connect to.
@@ -551,6 +557,9 @@ int bt_l2cap_ecred_chan_reconfigure(struct bt_l2cap_chan **chans, uint16_t mtu);
* the location (address) of bt_l2cap_chan type object which is a member
* of both transport dedicated objects.
*
* @warning It is the responsibility of the caller to zero out the
* parent of the chan object.
*
* @param conn Connection object.
* @param chan Channel object.
* @param psm Channel PSM to connect to.
@@ -600,6 +609,10 @@ int bt_l2cap_chan_disconnect(struct bt_l2cap_chan *chan);
* on the stack's global buffer pool (sized
* @kconfig{CONFIG_BT_L2CAP_TX_BUF_COUNT}).
*
* @warning The buffer's user_data _will_ be overwritten by this function. Do
* not store anything in it. As soon as a call to this function has been made,
* consider ownership of user_data transferred into the stack.
*
* @note Buffer ownership is transferred to the stack in case of success, in
* case of an error the caller retains the ownership of the buffer.
*

View File

@@ -4215,6 +4215,14 @@
*/
#define DT_INST_REG_SIZE(inst) DT_INST_REG_SIZE_BY_IDX(inst, 0)
/**
* @brief Get a `DT_DRV_COMPAT`'s number of interrupts
*
* @param inst instance number
* @return number of interrupts
*/
#define DT_INST_NUM_IRQS(inst) DT_NUM_IRQS(DT_DRV_INST(inst))
/**
* @brief Get a `DT_DRV_COMPAT` interrupt level
*

View File

@@ -277,8 +277,10 @@ struct udc_data {
struct udc_device_caps caps;
/** Driver access mutex */
struct k_mutex mutex;
/** Callback to submit an UDC event to upper layer */
/** Callback to submit an UDC event to higher layer */
udc_event_cb_t event_cb;
/** Opaque pointer to store higher layer context */
const void *event_ctx;
/** USB device controller status */
atomic_t status;
/** Internal used Control Sequence Stage */
@@ -345,14 +347,16 @@ static inline bool udc_is_suspended(const struct device *dev)
* After initialization controller driver should be able to detect
* power state of the bus and signal power state changes.
*
* @param[in] dev Pointer to device struct of the driver instance
* @param[in] event_cb Event callback from the higher layer (USB device stack)
* @param[in] dev Pointer to device struct of the driver instance
* @param[in] event_cb Event callback from the higher layer (USB device stack)
* @param[in] event_ctx Opaque pointer to higher layer context
*
* @return 0 on success, all other values should be treated as error.
* @retval -EINVAL on parameter error (no callback is passed)
* @retval -EALREADY already initialized
*/
int udc_init(const struct device *dev, udc_event_cb_t event_cb);
int udc_init(const struct device *dev,
udc_event_cb_t event_cb, const void *const event_ctx);
/**
* @brief Enable USB device controller
@@ -702,6 +706,24 @@ static inline struct udc_buf_info *udc_get_buf_info(const struct net_buf *const
return (struct udc_buf_info *)net_buf_user_data(buf);
}
/**
* @brief Get pointer to higher layer context
*
* The address of the context is passed as an argument to the udc_init()
* function and is stored in the UDC data.
*
* @param[in] dev Pointer to device struct of the driver instance
*
* @return Opaque pointer to higher layer context
*/
static inline const void *udc_get_event_ctx(const struct device *dev)
{
struct udc_data *data = dev->data;
return data->event_ctx;
}
/**
* @}
*/

View File

@@ -163,8 +163,9 @@ static inline unsigned int irq_to_level_3(unsigned int irq)
*/
static inline unsigned int irq_parent_level_3(unsigned int irq)
{
return (irq >> CONFIG_1ST_LEVEL_INTERRUPT_BITS) &
BIT_MASK(CONFIG_2ND_LEVEL_INTERRUPT_BITS);
return ((irq >> CONFIG_1ST_LEVEL_INTERRUPT_BITS) &
BIT_MASK(CONFIG_2ND_LEVEL_INTERRUPT_BITS)) -
1;
}
/**

View File

@@ -13,6 +13,8 @@
#if !defined(_ASMLANGUAGE)
#include <zephyr/linker/sections.h>
#define __noinit __in_section_unique(_NOINIT_SECTION_NAME)
#define __noinit_named(name) __in_section_unique_named(_NOINIT_SECTION_NAME, name)
#define __irq_vector_table Z_GENERIC_SECTION(_IRQ_VECTOR_TABLE_SECTION_NAME)

View File

@@ -887,21 +887,22 @@ int coap_get_option_int(const struct coap_packet *cpkt, uint16_t code);
* @return Integer value of the block size in case of success
* or negative in case of error.
*/
int coap_get_block1_option(const struct coap_packet *cpkt, bool *has_more, uint8_t *block_number);
int coap_get_block1_option(const struct coap_packet *cpkt, bool *has_more, uint32_t *block_number);
/**
* @brief Get values from CoAP block2 option.
*
* Decode block number and block size from option. Ignore the has_more flag
* as it should always be zero on queries.
* Decode block number, more flag and block size from option.
*
* @param cpkt Packet to be inspected
* @param has_more Is set to the value of the more flag
* @param block_number Is set to the number of the block
*
* @return Integer value of the block size in case of success
* or negative in case of error.
*/
int coap_get_block2_option(const struct coap_packet *cpkt, uint8_t *block_number);
int coap_get_block2_option(const struct coap_packet *cpkt, bool *has_more,
uint32_t *block_number);
/**
* @brief Retrieves BLOCK{1,2} and SIZE{1,2} from @a cpkt and updates

View File

@@ -1401,13 +1401,28 @@ struct net_socket_register {
* We have these includes here so that we do not need
* to change the applications that were only including
* zephyr/net/socket.h header file.
*
* Additionally, if non-zephyr-prefixed headers are used here,
* native_sim pulls in those from the host rather than Zephyr's.
*
* This should be removed when CONFIG_NET_SOCKETS_POSIX_NAMES is removed.
*/
#if defined(CONFIG_POSIX_API)
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <poll.h>
#include <sys/socket.h>
#if !defined(ZEPHYR_INCLUDE_POSIX_ARPA_INET_H_)
#include <zephyr/posix/arpa/inet.h>
#endif
#if !defined(ZEPHYR_INCLUDE_POSIX_NETDB_H_)
#include <zephyr/posix/netdb.h>
#endif
#if !defined(ZEPHYR_INCLUDE_POSIX_UNISTD_H_)
#include <zephyr/posix/unistd.h>
#endif
#if !defined(ZEPHYR_INCLUDE_POSIX_POLL_H_)
#include <zephyr/posix/poll.h>
#endif
#if !defined(ZEPHYR_INCLUDE_POSIX_SYS_SOCKET_H_)
#include <zephyr/posix/sys/socket.h>
#endif
#endif /* CONFIG_POSIX_API */
#endif /* ZEPHYR_INCLUDE_NET_SOCKET_H_ */

View File

@@ -21,6 +21,48 @@
extern "C" {
#endif
#if !defined(_DEV_T_DECLARED) && !defined(__dev_t_defined)
typedef int dev_t;
#define _DEV_T_DECLARED
#define __dev_t_defined
#endif
#if !defined(_INO_T_DECLARED) && !defined(__ino_t_defined)
typedef int ino_t;
#define _INO_T_DECLARED
#define __ino_t_defined
#endif
#if !defined(_NLINK_T_DECLARED) && !defined(__nlink_t_defined)
typedef unsigned short nlink_t;
#define _NLINK_T_DECLARED
#define __nlink_t_defined
#endif
#if !defined(_UID_T_DECLARED) && !defined(__uid_t_defined)
typedef unsigned short uid_t;
#define _UID_T_DECLARED
#define __uid_t_defined
#endif
#if !defined(_GID_T_DECLARED) && !defined(__gid_t_defined)
typedef unsigned short gid_t;
#define _GID_T_DECLARED
#define __gid_t_defined
#endif
#if !defined(_BLKSIZE_T_DECLARED) && !defined(__blksize_t_defined)
typedef unsigned long blksize_t;
#define _BLKSIZE_T_DECLARED
#define __blksize_t_defined
#endif
#if !defined(_BLKCNT_T_DECLARED) && !defined(__blkcnt_t_defined)
typedef unsigned long blkcnt_t;
#define _BLKCNT_T_DECLARED
#define __blkcnt_t_defined
#endif
#if !defined(CONFIG_ARCMWDT_LIBC)
typedef int pid_t;
#endif
@@ -45,12 +87,10 @@ struct pthread_attr {
uint32_t details[2];
};
#if defined(CONFIG_MINIMAL_LIBC) || defined(CONFIG_PICOLIBC) || defined(CONFIG_ARMCLANG_STD_LIBC) \
|| defined(CONFIG_ARCMWDT_LIBC)
#if !defined(CONFIG_NEWLIB_LIBC)
typedef struct pthread_attr pthread_attr_t;
#endif
BUILD_ASSERT(sizeof(pthread_attr_t) >= sizeof(struct pthread_attr));
#endif
typedef uint32_t pthread_t;
typedef uint32_t pthread_spinlock_t;
@@ -65,11 +105,10 @@ struct pthread_mutexattr {
unsigned char type: 2;
bool initialized: 1;
};
#if defined(CONFIG_MINIMAL_LIBC) || defined(CONFIG_PICOLIBC) || defined(CONFIG_ARMCLANG_STD_LIBC) \
|| defined(CONFIG_ARCMWDT_LIBC)
#if !defined(CONFIG_NEWLIB_LIBC)
typedef struct pthread_mutexattr pthread_mutexattr_t;
#endif
BUILD_ASSERT(sizeof(pthread_mutexattr_t) >= sizeof(struct pthread_mutexattr));
#endif
/* Condition variables */
typedef uint32_t pthread_cond_t;
@@ -78,11 +117,10 @@ struct pthread_condattr {
clockid_t clock;
};
#if defined(CONFIG_MINIMAL_LIBC) || defined(CONFIG_PICOLIBC) || defined(CONFIG_ARMCLANG_STD_LIBC) \
|| defined(CONFIG_ARCMWDT_LIBC)
#if !defined(CONFIG_NEWLIB_LIBC)
typedef struct pthread_condattr pthread_condattr_t;
#endif
BUILD_ASSERT(sizeof(pthread_condattr_t) >= sizeof(struct pthread_condattr));
#endif
/* Barrier */
typedef uint32_t pthread_barrier_t;
@@ -99,14 +137,12 @@ struct pthread_once {
bool flag;
};
#if defined(CONFIG_MINIMAL_LIBC) || defined(CONFIG_PICOLIBC) || defined(CONFIG_ARMCLANG_STD_LIBC) \
|| defined(CONFIG_ARCMWDT_LIBC)
#if !defined(CONFIG_NEWLIB_LIBC)
typedef uint32_t pthread_key_t;
typedef struct pthread_once pthread_once_t;
#endif
/* Newlib typedefs pthread_once_t as a struct with two ints */
BUILD_ASSERT(sizeof(pthread_once_t) >= sizeof(struct pthread_once));
#endif
#ifdef __cplusplus
}

View File

@@ -36,43 +36,8 @@ extern "C" {
#include <time.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/_timespec.h>
#ifndef _DEV_T_DECLARED
typedef int dev_t;
#define _DEV_T_DECLARED
#endif
#ifndef _INO_T_DECLARED
typedef int ino_t;
#define _INO_T_DECLARED
#endif
#ifndef _NLINK_T_DECLARED
typedef unsigned short nlink_t;
#define _NLINK_T_DECLARED
#endif
#ifndef _UID_T_DECLARED
typedef unsigned short uid_t;
#define _UID_T_DECLARED
#endif
#ifndef _GID_T_DECLARED
typedef unsigned short gid_t;
#define _GID_T_DECLARED
#endif
#ifndef _BLKSIZE_T_DECLARED
typedef unsigned long blksize_t;
#define _BLKSIZE_T_DECLARED
#endif
#ifndef _BLKCNT_T_DECLARED
typedef unsigned long blkcnt_t;
#define _BLKCNT_T_DECLARED
#endif
#include <zephyr/posix/posix_types.h>
/* dj's stat defines _STAT_H_ */
#ifndef _STAT_H_

View File

@@ -149,7 +149,8 @@ int stream_flash_erase_page(struct stream_flash_ctx *ctx, off_t off);
* @param settings_key key to use with the settings module for loading
* the stream write progress
*
* @return non-negative on success, negative errno code on fail
* @return non-negative on success, -ERANGE in case when @p off is out
* of area designated for stream or negative errno code on fail
*/
int stream_flash_progress_load(struct stream_flash_ctx *ctx,
const char *settings_key);

View File

@@ -117,7 +117,7 @@ const struct device *z_impl_device_get_by_dt_nodelabel(const char *nodelabel)
#ifdef CONFIG_USERSPACE
static inline const struct device *z_vrfy_device_get_by_dt_nodelabel(const char *nodelabel)
{
const char nl_copy[Z_DEVICE_MAX_NODELABEL_LEN];
char nl_copy[Z_DEVICE_MAX_NODELABEL_LEN];
if (k_usermode_string_copy(nl_copy, (char *)nodelabel, sizeof(nl_copy)) != 0) {
return NULL;

View File

@@ -110,8 +110,9 @@ void z_fatal_error(unsigned int reason, const struct arch_esf *esf)
}
#endif /* CONFIG_ARCH_HAS_NESTED_EXCEPTION_DETECTION */
LOG_ERR("Current thread: %p (%s)", thread,
thread_name_get(thread));
if (IS_ENABLED(CONFIG_MULTITHREADING)) {
LOG_ERR("Current thread: %p (%s)", thread, thread_name_get(thread));
}
coredump(reason, esf, thread);

View File

@@ -71,6 +71,7 @@ GEN_OFFSET_SYM(_thread_t, tls);
#endif /* CONFIG_THREAD_LOCAL_STORAGE */
GEN_ABSOLUTE_SYM(__z_interrupt_stack_SIZEOF, sizeof(z_interrupt_stacks[0]));
GEN_ABSOLUTE_SYM(__z_interrupt_all_stacks_SIZEOF, sizeof(z_interrupt_stacks));
/* member offsets in the device structure. Used in image post-processing */
#ifdef CONFIG_DEVICE_DEPS

View File

@@ -378,6 +378,7 @@
#if defined(CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT) && \
defined(MBEDTLS_X509_CRT_PARSE_C)
#define MBEDTLS_PEM_PARSE_C
#define MBEDTLS_PEM_WRITE_C
#define MBEDTLS_BASE64_C
#endif

View File

@@ -104,7 +104,7 @@ if(CONFIG_PERCEPIO_TRACERECORDER)
)
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
COMMAND python3 ${TRACERECORDER_DIR}/kernelports/Zephyr/scripts/tz_parse_syscalls.py ${CMAKE_BINARY_DIR} ${ZEPHYR_BASE}
COMMAND ${PYTHON_EXECUTABLE} ${TRACERECORDER_DIR}/kernelports/Zephyr/scripts/tz_parse_syscalls.py ${CMAKE_BINARY_DIR} ${ZEPHYR_BASE}
)
endif()

View File

@@ -432,15 +432,13 @@ static void usb_data_request_cb(const struct device *dev)
uint8_t usb_audio_data[USB_STEREO_SAMPLE_SIZE] = {0};
static struct net_buf *pcm_buf;
static size_t cnt;
uint32_t size;
int err;
size = ring_buf_get(&usb_ring_buf, (uint8_t *)usb_audio_data, sizeof(usb_audio_data));
if (size == 0) {
/* size is 0, noop */
return;
}
/* Size lower than USB_STEREO_SAMPLE_SIZE is OK as usb_audio_data is 0-initialized */
ring_buf_get(&usb_ring_buf, (uint8_t *)usb_audio_data, sizeof(usb_audio_data));
/* Ignore ring_buf_get() return value, if size is 0 we send empty PCM frames to
* not starve USB audio interface, if size is lower than USB_STEREO_SAMPLE_SIZE
* we send frames padded with 0's as usb_audio_data is 0-initialized
*/
pcm_buf = net_buf_alloc(&usb_tx_buf_pool, K_NO_WAIT);
if (pcm_buf == NULL) {

View File

@@ -12,7 +12,6 @@ This sample enables all sensors of SensorTile.box Pro board, and then
periodically reads and displays data on the console from the following
sensors:
- HTS221: ambient temperature and relative humidity
- LPS22DF: ambient temperature and atmospheric pressure
- LSM6DSV16X: 6-Axis acceleration and angular velocity
- LIS2DU12: 3-Axis acceleration
@@ -62,8 +61,6 @@ The sample code outputs sensors data on the SensorTile.box Pro console.
SensorTile.box Pro dashboard
HTS221: Temperature: 26.4 C
HTS221: Relative Humidity: 60.5%
LPS22DF: Temperature: 28.4 C
LPS22DF: Pressure:99.694 kpa
LSM6DSV16X: Accel (m.s-2): x: -0.158, y: 0.158, z: 9.811

Some files were not shown because too many files have changed in this diff Show More