The controller can implement a reception FIFO as deep as 256 bytes.
However, the computation made by the driver code to determine how many
bytes can be asked is stored in a signed 8-bit variable called rx_empty.
If the reception FIFO depth is greater or equal to 128 bytes and the FIFO
is currently empty, the rx_empty value will be 128 (or more), which
stands for a negative value as the variable is signed.
Thus, the later code checking if the FIFO is full will run while it should
not and exit from the i2c_dw_data_ask() function too early.
This hangs the controller in an infinite loop of interrupt storm because
the interrupt flags are never cleared.
Storing the rx_empty empty on a signed 32-bit variable instead of a 8-bit
one solves the issue and is compliant with the controller hardware
specifications of a maximum FIFO depth of 256 bytes.
It has been agreed with upstream maintainers to change the type of the
variables tx_empty, rx_empty, cnt, rx_buffer_depth and tx_buffer_depth to
plain int because it is most effectively handled by the CPUs. Using 8-bit
or 16-bit variables had no meaning here.
Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com>
Add "Architecture Review" and "dev-review" to the list of labels that
block a PR from merging, less chances to merge these before discussion
unintentionally.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Adds two test-cases to `test_suspend.c`, both checking that gatt
advertisement is stopped when suspending Mesh, and that is started again
when Mesh is resumed.
The first test-case involves suspending and resuming Mesh, and
the second test-case involves suspending Mesh and disabling Bluetooth,
then re-enabling Bluetooth and resuming Mesh.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Disables pb gatt- and gatt proxy advs when suspending Mesh, and
enables them again when resuming Mesh.
Adds `bt_mesh_adv_gatt_send` to `bt_mesh_resume` to make sure that
GATT advs start after resumption.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Previously, `bt_mesh_proxy_gatt_enable` returned the return value from
`k_work_schedule`, which could be a positive (non-error) message.
Now, it only returns negative error codes (else 0).
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Renames tx to DUT and rx to Tester to clarify roles in test.
Re-uses the same body for suspend/resume and suspend/disable/resume
for DUT with a parameter to toggle disabling BT.
Re-uses the same Tester config in both existing test-cases as the
previous configs were duplicates.
Updates the dut suspension status in the message handler.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Extracts logic related to waiting for packets from
`test_advertiser.c` and `test_beacon.c` to use in a sync mechanism.
Introduces a sync mechanism in bsim with the functions
`bt_mesh_test_send_over_adv` and `bt_mesh_test_wait_for_packet`
Extracts gatt-related logic from `test_advertiser.c` into a separate
file so it can be re-used.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Generated outputs can be difficult to read, preserving comments helps a
lot and they often provide good `git grep` search keywords.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Zero-functional change.
Also move it to a separate line so it's more convenient to temporarily
comment it out.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
CMake-based build systems like Zephyr's use separate build directories;
one for each build configuration. Even Zephyr's multi-build system
"sysbuild" (which is not relevant here) uses separate subdirectories.
So there is only one pre-processed, .toml file generated by build
directory and no need to vary its filename based on the platform name or
any other configuration parameter. It can and should keep the same
filename across build directories as zephyr.elf and all other build
artefacts do.
Moreover, when building a collection of configurations (as for instance
`sof/scripts/xtensa-build-zephyr.py` does), keeping all build
directories consistent with each other simplifies installation,
checksumming and any other post-processing.
"Fixes" recent commit 15336045af ("west: sign.py: generate platf.toml
from platf.toml.h with cc -E")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Physical boards work on these tests but some of the required
peripherals are not simulated by `renode`, executing the tests
with renode-simulated board in CI will fail.
Exclude `renode` simulation from these tests.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Changes to this file were missed out from the original
PR #65564 that added Renode support for this board, add them
here so that it gets ran in CI.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Enable FlexCAN peripheral driver for ucans32k1sic board. The GPIO-based
CAN transceiver driver is used to control the on-board CAN transceivers.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
Add message buffer allowed values for S32K1xx devices. Except S32K14xW
parts which supports 64 MBs, the rest of the parts support a maximum of
32 MBs.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
S32K1xx devices have a maximum of 3 FlexCAN peripherals. Each part may
define a different maximum number of instances and message buffers,
hence the interrupt lines are defined in the part specific dts.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
The board uses pinctrl API. This commit updates pin USART pin definition
to be compliant with new API.
Signed-off-by: Karol Gugala <kgugala@antmicro.com>
The board uses pinctrl API. This commit updates pin USART pin definition
to be compliant with new API.
Signed-off-by: Karol Gugala <kgugala@antmicro.com>
Make sure some ROM libc calls are weak to allow
Zephyr's libc implementation instead.
Fixes#66351
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Adds common thread-local-storage.ld provided
by Zephyr. This also fixes a wrong xtensa_core entry
that should be riscv_core.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
The entire switch statement is already wrapped in a lock which is
acquired just before configuring the gpio pin.
Signed-off-by: Yuval Peress <peress@google.com>
This board is similar to 'lora_e5_dev_board', but with smaller form-factor,
which makes it better suited as low volume prototype device.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Twister DeviceHandler now checks `--enable-coverage` command line argument
instead of `--coverage` when it deals with device output.
This resolves potential problem when only `--enable-coverage` argument
is given and the coverage report is not needed. In this case the test image
which is built for code coverage works slower also producing additional
console output, so the additional DeviceHandler timeout still have to be
applied and the output with coverage data correctly processed by Harness.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
It is useful for an application to be informed when there is
a subscriber waiting for HRS service notification.
Extend HRS service API and add required code to service implementation.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Emitting network beacons in parallel to proxy functionality
causes collisions. The commit disables network beacons and
allows the test scenario to be more precise.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Alarm interrupt is disabled in cancel_alarm, we should re-enable it
in set_alarm, at meanwhile, should reset the compare register in
cancel_alarm to avoid the contention condition in
cancel_alarm & set_alarm in short time.
This change fixes the test case failure at
zephyr\tests\drivers\counter\counter_basic_api.
Signed-off-by: Bryan Zhu <bzhu@ambiq.com>
New hal_nordic revision contains nrfx 3.3.0 which adds support
for nRF54H20 EngA and nRF54L15 EngA devices.
Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
The zephyr-gpio w1 driver introduced in this commit implements
all routines for the w1 api on top of the zephyr gpio driver.
W1 bit read, write, and reset operations are executed by
bit-banging the selected gpio.
Signed-off-by: Hudson C. Dalpra <hudson@bduncanltd.com>
Store the compile-time computed length of the `irq_count` into
a variable so that we have less to do in runtime.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Change the index variable type to `int` from `size_t` to compile
across 32bit and 64bit platforms without generating warnings.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
The RISCV32 Virtual board is a virtual platform made with
Renode as an alternative to QEMU. Contrary to QEMU, the
peripherals of this platform can be easily configured by
editing the `riscv32_virtual.repl` script and the devicetree
files accordingly, this allows certain hardware configurations
that only exist in proprietary boards/SoCs to be tested in
upstream CI.
Added another entry for this board to the excluded platform in
`kernel.timer.timer` test.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>