Increase `Z_HEAP_MIN_SIZE` values to successfully allocate a 1 byte
chunk when `CONFIG_SYS_HEAP_RUNTIME_STATS=y`.
Signed-off-by: Jordan Yates <jordan@embeint.com>
This fixes a compilation error in sdmmc_stm32.c. Depending on the
definition of CONFIG_SDMMC_STM32_EMMC now either
HAL_MMC_ConfigWideBusOperation() or HAL_SD_ConfigWideBusOperation()
gets called.
Signed-off-by: Andreas Schweigstill <andreas@schweigstill.de>
During a teardown sequence performed by the USB DC stack's "usb_disable()",
the controller is first disabled by calling "usb_dc_detach()", which turns
off the USB controller clock in the STM32 implementation. "usb_disable()"
then disables endpoints by calling "usb_dc_ep_disable()" on each of them,
which is merely forwarded to HAL_PCD_EP_Close() by the STM32 driver. This
order of operations means that the latter operation is actually operating
on the no-longer-clocks USB controller! Up until recently, memory accesses
to MMIO of unclocked peripherals in STM32 SoCs would not cause issues, even
if the resulting access was a no-op (read returns zero, write is ignored),
so everything worked fine even if the access was *technically* illegal...
However, on newer series with a different bus fabric, accesses to unclocked
peripherals will instead deadlock the SoC!
Prevent illegal accesses inside "usb_dc_stm32_ep_disable()" by checking if
the USB controller clock is enabled before calling HAL_PCD_EP_Close(), and
skipping the call if it isn't. This allows "usb_disable()" to complete on
series such as STM32N6.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Replace the open-ended while(true) with a null-terminated parent walk.
Improves readability, behavior is unchanged.
Signed-off-by: Vlad Kulikov <vlad_kulikov_c@pm.me>
3cc9a843e8 added '--external-init' to the GDB
Server command line whenever an external loader is provided, but it is not
a *necessary* argument and sometimes causes issues.
Provide a new runner argument "--external-init" (for consistency) which
controls whether or not the argument is added to command line if an
external loader is used. (It is otherwise ignored)
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The "--swd" argument had both an action='store_true' and default value of
True so it wasn't possible to disable it: providing the argument would set
its value to True, and not providing it would use the default=True!
Add a new argument "--no-swd" which shares its destination variable with
"--swd", but with action='store_false', such that either can be provided
to enable/disable SWD mode. Both arguments are placed in a mutually
exclusive group and use a common help message.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
SL_CODE_CLASSIFY() is a macro used by the upstream Simplicity SDK to mark
time sensitive functions (in order to relocate them in RAM). This macro
place the function in specific sections. So build scripts can identify
them.
However, Wiseconnect is not able to leverage this feature. Worse, this
mechanism conflict with gen_relocate_app.py and zephyr_code_relocate(). So,
we really need to disable this mechanism for Wiseconnect on Zephyr.
Fortunately, SLI_CODE_CLASSIFICATION_DISABLE allow to disable
SL_CODE_CLASSIFY().
Note that on Simplicity SDK, these macro also conflict with
zephyr_code_relocate(). However, the mechanism is officially supported by
Simplicity SDK and we could leverage the feature for the on going support
of Series-3.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
In target mode, issue the stop callback from the I2C DW driver after the
read/write callbacks. This mirrors the behavior of other I2C target mode
drivers, and allows target handler code to correctly service any pending
read or write requests before it handles the stop condition.
Fixes#98675
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
Commit d4d51dc062 ("kernel: Replace redundant switch_handle assignment
with assertion") introduced an assertion check that may be triggered
as follows by tests/kernel/smp_abort:
CPU0 CPU1 CPU2
---- ---- ____
* [thread A] * [thread B] * [thread C]
* irq_offload() * irq_offload() * irq_offload()
* k_thread_abort(thread B)
* k_thread_abort(thread C)
* k_thread_abort(thread A)
* thread_halt_spin()
* z_is_thread_halting(_current) is false
* while (z_is_thread_halting(thread B));
* thread_halt_spin()
* z_is_thread_halting(_current) is true
* halt_thread(_current...);
* z_dummy_thread_init()
- dummy_thread->switch_handle = NULL;
- _current = dummy_thread;
* while (z_is_thread_halting(thread C));
* z_get_next_switch_handle()
* z_arm64_context_switch()
* [thread A is dead]
* thread_halt_spin()
* z_is_thread_halting(_current) is true
* halt_thread(_current...);
* z_dummy_thread_init()
- dummy_thread->switch_handle = NULL;
- _current = dummy_thread;
* while(z_is_thread_halting(thread A));
* z_get_next_switch_handle()
- old_thread == dummy_thread
- __ASSERT(old_thread->switch_handle == NULL) OK
* z_arm64_context_switch()
- str x1, [x1, #___thread_t_switch_handle_OFFSET]
* [thread B is dead]
* %%% dummy_thread->switch_handle no longer NULL %%%
* z_get_next_switch_handle()
- old_thread == dummy_thread
- __ASSERT(old_thread->
switch_handle == NULL) FAIL
This needs at least 3 CPUs and the perfect timing for the race to work as
sometimes CPUs 1 and 2 may be close enough in their execution paths for
the assertion to pass. For example, QEMU is OK while FVP is not.
Also adding sufficient debug traces can make the issue go away.
This happens because the dummy thread is shared among concurrent CPUs.
It could be argued that a per-CPU dummy thread structure would be the
proper solution to this problem. However the purpose of a dummy thread
structure is to provide a dumping ground for the scheduler code to work
while the original thread structure might already be reused and
therefore can't be clobbered as demonstrated above. But the dummy
structure _can_ be clobbered to some extent and it is not worth the
additional memory footprint implied by per-CPU instances. We just have
to ignore some validity tests when the dummy thread is concerned.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
When a thread halts and dummifies, set its switch_handle to (void *)1
instead of the thread pointer itself. This maintains the non-NULL value
required to prevent deadlock in k_thread_join() while making it obvious
that this value is not meant to be dereferenced or used.
The switch_handle should be an opaque architecture-specific value and
not be assumed to be a thread pointer in generic code. Using 1 makes
the intent clearer.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
pm_policy_priv_device_find_device_constraints() function
is available only when zephyr_power_state is defined.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Remove board configurations without a proper devicetree overlay. The test
suite relies on pwm-test alias to be defined in a board overlay, which is
not set for these boards.
Fixes: #98775
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
When building an observer-only build the check_pending_conn label would
result in CI warnings/errors due to this only being a C23 feature:
scan.c:692:1: error: label at end of compound statement is a C23 extension
Turns out the #ifdefs are completely unnecessary, and the code can simply
take advantage of IS_ENABLED(), which should get rid of the warning.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
This allows upper tester to terminate existing call.
Was affecting TMAP/CG/VRC/BV-01-C qualification test case.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
For better agility add etienne-lms, mathieuchopstm and djiatsaf-st
as collaborators to STM32 module.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
In some cases, the host starts scanning internally for establishing
connections (BT_LE_SCAN_USER_CONN), such as host-based resolving or
auto-connection. In this situation, even if the application does not
start explicit scan, the host still needs to handle the advertising
reports to continue the connection process.
Previously, both bt_hci_le_adv_report() and bt_hci_le_adv_ext_report()
will break or discard all reports when explicit scan is not active.
This causes the connection to stay in SCAN_BEFORE_INITIATING and never
move forward.
This patch adds checking of BT_LE_SCAN_USER_CONN to allow advertising
reports to be processed during connection-purpose scanning. When the
scan is started explicitly by application, the behavior remains the
same, only small comments are updated to describe this behavior and keep
the original code style unchanged.
Signed-off-by: Zhijie Zhong <zhongzhijie1@xiaomi.com>
This commit fixes a bug which occurred when a socket was closed.
It was observed when multiple attempts to obtain dataset using ephemeral
key were performed. Failure was seen starting with attempt number 2,
incoming packets were not processed.
In a open-close-open scenario, incoming traffic was dropped, most likely
because there was stale data in the corresponding socket service
structure.
By calling, `net_socket_service_register` after a socket in closed, the
problem was resolved, and data shown in `net sockets` cli command is now
updated and correct.
Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
If verdict is NET_OK net_pkt may already be unreferenced and reutilized,
so that setting the `l2_processed` flag would be set on a different
packet, corrupting its state. Avoid this situation by only setting the
l2_processed flag for NET_CONTINUE.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Fixes some information that is very outdated to do with board
Kconfig files, which are not merged, and multiple dts files
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This fixes an issue of CI failing due to the github runner being
out of memory when cleaning up, and speed up the build prep stage
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Exclude the application and radio core targets for nRF54H20 since
they use Ironside as their PSA storage provider.
Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
This reverts the following commits:
commit c9b534c4eb
("arch: arm64: mmu: avoid using of set/way cache instructions")
commit c4ffadb0b6
("arch: arm64: avoid invalidating of RO mem after mem map")
The reason for the former is about Xen not virtualizing set/way cache
operations used by sys_cache_data_invd_all() originally used prior to
enabling the MMU and data cache. But the cure is worse than the Xen
issue as:
- Cache invalidation is performed on _every_ mapping change.
- Those invalidations are completely unnecessary with a PIPT data cache.
ARM64 implementations use Physically Indexed, Physically Tagged (PIPT)
data caches where cache maintenance is not needed during MMU operations.
- arch_mem_map() invoked with K_MEM_MAP_UNPAGED triggers page faults
when accessing the unmapped region for cache operations. The page
fault handler in do_page_fault() tries to reacquire z_mm_lock which
is already held by the caller of arch_mem_map(). This results in a
deadlock.
And the latter commit disables cache operations for read-only mappings,
effectively rendering the workaround described in the first commit
inoperative on half the mappings, making the performance cost of the
first commit's approach unjustifiable since it doesn't actually solve
the problem it set out to fix.
Given the above, the actual "fix" should simply have been the removal of
the sys_cache_data_invd_all() as, in theory, it isn't strictly needed
and its replacement is already ineffective on read-only areas as mentioned.
So let's revert them, which fixes the deadlock-induced CI test failures
on ARM FVP SMP configurations that were triggered when demand paging or
memory mapping operations were involved.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Use Inner Shareable (IS) TLB invalidation instructions in SMP
configurations to broadcast TLB invalidations to all CPUs.
Use TLBI VMALLE1IS instead of VMALLE1 in invalidate_tlb_all().
While at it, implement proper page-specific invalidation using TLBI VAE1IS
in invalidate_tlb_page() instead of falling back to full invalidation.
This fixes many SMP test failures with userspace enabled onArm's FVP.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Replace series-specific macros with generic macros shared across
multiple STM32 series to improve readability and maintainability.
Signed-off-by: Mario Paja <mariopaja@hotmail.com>
This patch introduces overlays to test the silabs eusart peripheral.
It requires 3 different boards in order to test minor differences
between peripheral chip IP versions.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
Ensure the blobs command is trying to display the license file for
click-through approval. Ensure that special characters doesn't
cause a problem in Windows by opening the file with utf-8 encoding.
Fixes#98520
Signed-off-by: David Leach <david.leach@nxp.com>
Change size of ext_memory node to 32MB, as the board uses a Macronix
MX25UW25645GXDI00 with 256MBits.
Signed-off-by: Thomas Decker <decker@jb-lighting.de>
The h7rs option byte default setting configures the AXI SRAM1-4 as one
contiguous memory, sram0 can therefore be increased to 456k (3x128k + 72k).
The .yaml files of the boards nucleo_h7s3l8 and stm32h7s78_dk are adjusted
accordingly.
Signed-off-by: Thomas Decker <decker@jb-lighting.de>
Add registered trademark symbol to Bluetooth where missing and
replace BLE with explicit Bluetooth Low Energy where applicable
in ST boards documentation.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Remove the erronously added chosen node for the MAX32690EVKit, to ensure
the flash base address is correct for the build.
Signed-off-by: Pete Johanson <pete.johanson@analog.com>
Add vendor-specific RF power mode configuration during HCI setup
for SiLabs SiWx91x devices. This configures the BLE TX power
index in the controller's RF subsystem.
The implementation sends a vendor command (OCF 0x0006) with
protocol mode (2) and power index (RSI_BLE_PWR_INX) during the
setup phase. This ensures proper RF power configuration before
normal Bluetooth operations begin.
Technical details:
- Uses bt_hci_cmd_alloc() with manual HCI header construction
- Command opcode: 0xFC06 (OGF=0x3F, OCF=0x0006)
- Parameters: protocol_mode=2, power_index from RSI_BLE_PWR_INX
- Executed during bt_hci_setup callback
Signed-off-by: Arun Kumar Nagelly <arnagell@silabs.com>
When the renesas-rv-lvd driver is built with SDK 1.0 using GCC 14, the
compiler emits a spurious uninitialized variable warning because it can't
follow the control flow to figure out that the variable wasn't ever used
without being initialized. Work around this by simply initializing it
to one of the valid values.
Signed-off-by: Keith Packard <keithp@keithp.com>