Commit graph

82588 commits

Author SHA1 Message Date
Daniel Leung 88c43566fa arm64: renames shadow variables
Renames	shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-10 08:14:12 +00:00
Daniel Leung 7c91228896 ztest: rename shadow variables
This renames the shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-10 08:14:12 +00:00
Daniel Leung 6f6f7d6cd7 toolchain: gcc: rename argument for UNALIGNED_GET()
Rename the argument for UNALIGNED_GET() from p to g.
This fixes shadow variable warning of __p if UNALIGNED_GET()
is nested with UNALIGNED_PUT().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-10 08:14:12 +00:00
Daniel Leung 7c4e641f84 debug: rename shadow variables
This renames the shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-10 08:14:12 +00:00
Daniel Leung 179c46be03 syscall: Z_SYSCALL_VERIFY_MSG to ignore -Wshadow
Z_SYSCALL_VERIFY_MSG() does LOG_MODULE_DECLARE() internally to
log errors during verification. However, this is definitely
going to conflict with any LOG_MODULE_DECLARE() in the source
file using Z_SYSCALL_VERIFY_MSG(). So we need to selectively
disable -Wshadow for Z_SYSCALL_VERIFY_MSG() to avoid compiler
warnings as this is an intentional behavior.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-10 08:14:12 +00:00
Daniel Leung 8dc9d89d29 toolchain: introduce macros to ignore -Wshadow
This introduces two macros TOOLCHAIN_IGNORE_WSHADOW_BEGIN and
TOOLCHAIN_IGNORE_WSHADOW_END which can be used inside another
macro to ignore -Wshadow for certain block of code. This is
useful for common macros that may nest upon themselves
(for example, logging).

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-10 08:14:12 +00:00
Andries Kruithof ca6adf1364 Bluetooth: controller: some arguments are unsigned instead of int
There are some calls to ull_adv_aux_pdu_set_clear that are set to 0
but the argument is actually unsigned. This PR replaces the '0'
with '0U'

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-08-10 08:13:43 +00:00
Sreeram Tatapudi b7e623c886 drivers: counter: cat1: Fix formatting issues
Minor format fixes for consistency

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2023-08-10 08:13:11 +00:00
Sreeram Tatapudi fa471172b7 drivers: counter: cat1: Fix test_single_shot_alarm_notop
TC "test_single_shot_alarm_notop" is failing because there were 2 ISR
callbacks instead of one. this is because of invoking
ifx_cat1_counter_set_int_pending incorrectly. Updated
ifx_cat1_counter_set_alarm to fix this

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2023-08-10 08:13:11 +00:00
David Brown 3b3e28aeda manifest: Upgrade to trusted-firmware-m 1.8.0
Update trusted-firmware-m to 1.8.0, mbedtls to 3.4.0, and tf-m-tests to
1.8.0.  Includes minor cmake changes due to file renames and such, as well
as adjusting the return type of a callback function that has changed since
the previous version of trusted-firmware-m.

Signed-off-by: David Brown <david.brown@linaro.org>
2023-08-10 08:11:59 +00:00
Henrik Eriksen 5bd46b91fd bluetooth: tester: Added support for testing CSIS.
- Initialisation of Coordinated Set Identification Service.
- Set and clear member lock.
- Get member RSI.

Signed-off-by: Henrik Eriksen <heri@demant.com>
2023-08-10 08:11:13 +00:00
Martí Bolívar 3f8d33ee3b scripts: restore utils/migrate_includes.py
Commit 9b30667c77
("build: drop LEGACY_INCLUDE_PATH support")
removed scripts/utils/migrate_includes.py.

This was premature. This script is still useful to users of older
versions of zephyr that are attempting to migrate to current ones.

For example, users of v2.7 LTS who are migrating to v3.4 should
still be able to run the script to migrate their code bases.

Restore it. Maybe after next LTS we can remove it. It costs
basically nothing to keep it in the tree.

Signed-off-by: Martí Bolívar <mbolivar@amperecomputing.com>
2023-08-10 08:05:54 +00:00
Manimaran A aed0ecfd56 drivers: gpio: mchp: Twister fix for test_input_output failure
Added logic to return ENOTSUP, if input-output GPIO
direction requested.

Signed-off-by: Manimaran A <manimaran.a@microchip.com>
2023-08-09 20:24:22 -04:00
Robert Lubos 68be56d282 tests: net: tcp: Fix server tests
Fixing the bug with shadowed ret variable (and hence not returning
timeout error) reveled another bug in TCP server tests. Here, the
listening context was incorrectly used to receive new data, and since it
never arrived, the function timed out.

This commits fixes that issue, and limits the retransmission timeout to
ensure that Nagle's algorithm impact does not affect test timings.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-08-09 20:01:39 -04:00
Robert Lubos cc77f2749c net: context: Remove shadowing variable in net_context_recv()
Remove the shadowing ret variable and fix a bug that was related to
its existence - the shadowing ret variable was assigned with -ETIMEDOUT
which was supposed to be retuned by the function, but was not because
the ret variable at the function scope was left intact.

Also remove the unneded goto unlock; jump (assigning the error code is
the last operation before unlocking the mutex anyway).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-08-09 20:01:39 -04:00
Christopher Friedt 352ece1e7d dts: vendor-prefixes: remove facebook and add meta
Since we do not have any in-tree users, we will skip the
deprecation process for `facebook` and add `meta`.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-09 17:00:35 -04:00
Benjamin Cabé 3f1868e0f9 doc: drivers: i2s: doxygen cleanup
Added missing doxygen comments + fixed improperly documented structure.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-09 18:33:44 +00:00
Adam Wojasinski 9de69aabfd drivers: spi: spi_nrfx_spi: Add CPOL handling on SCK pin
Pin state after SPI deinitialization is based on pinctrl configuration.
On the other hand, CPOL is set during runtime. When the SPI instance
is disabled GPIO takes control over SCK and drives it to state set
by pinctrl driver. This might causes an invalid SCK state
when the transaction is configured with CPOL (Clock Polarity).

To address this issue, a patch was introduced to the SPI driver.
Now, when a SPI instance is configured with CPOL,
the driver is setting in the runtime the correct state of the SCK pin.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-08-09 18:31:28 +00:00
Adam Wojasinski 315dd0f41c drivers: spi: spi_nrfx_spim: Add CPOL handling on SCK pin
Pin state after SPIM deinitialization is based on pinctrl configuration.
On the other hand, CPOL is set during runtime. With the introduction
of the power-optimized SPIM driver, it disables the peripheral instance
once the transfer is completed.
As a result, the GPIO takes control over the SCK pin and drives it
based on pinctrl configuration which causes an invalid SCK state
when the transaction is configured with CPOL (Clock Polarity).

To address this issue, a patch was introduced to the SPIM driver.
Now, when a SPIM instance is configured with CPOL,
the driver is setting in the runtime the correct state of the SCK pin.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-08-09 18:31:28 +00:00
Alberto Escolar Piedras b40c052289 samples drivers led: Fix main return
Since 3a197934fc
main() should be int main(void) instead of void main(void)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-08-09 16:09:47 +00:00
Alberto Escolar Piedras 5d1eae6399 samples sensing simple: Fix main return
Since 3a197934fc
main() should be int main(void) instead of void main(void)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-08-09 16:09:47 +00:00
Alberto Escolar Piedras 6d0aa678ef tests bsim ccc_store: Fix main return
Since 3a197934fc
main() should be int main(void) instead of void main(void)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-08-09 16:09:47 +00:00
Alberto Escolar Piedras c0e2b97948 tests bsim settings: Fix main return
Since 3a197934fc
main() should be int main(void) instead of void main(void)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-08-09 16:09:47 +00:00
Alberto Escolar Piedras f514ff887f tests bsim ccc_update: Fix main return
Since 3a197934fc
main() should be int main(void) instead of void main(void)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-08-09 16:09:47 +00:00
Anas Nashif 498f294b27 west: update sof ref in manifest
Sync with upstream and set ee40f61b5
in west manifest.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-08-09 16:08:33 +00:00
Jani Hirsimäki 83ea1e26a2 net: l2: ppp: ppp uart usage fixed
This fixes 3 issues that came within PR #59124 for ppp uart usage.

Earlier start/stop of ppp was done at enable() but that
was removed in PR #59124. Now putting enable/disable() back and
putting start/stop there.
Additionally, there was a double ppp carrier ON when NET_EVENT_IF_DOWN.
For that net_if_carrier_on/off is set in uart ppp.c driver.
Also, maybe worth to be mentioned that after PR #59124 there is no
ppp carrier off when lcp is disconnected, for workaround that change,
application should use ppp dead/running events.

Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
2023-08-09 16:07:46 +00:00
Bruno Mendes 2510e1979b debug: arc: expose thread relinquish cause
When a thread is preempted on ARC, caller-saved registers
are saved on the stack automatically (RIRQ) or manually
by the kernel ISR (FIRQ).
Exposing the thread's relinquish cause hints the debugger
that it can read more or less register values.

Signed-off-by: Bruno Mendes <bd_mendes@outlook.com>
2023-08-09 16:06:57 +00:00
Immo Birnbaum eb731abeb8 doc: release-notes: document aarch32 cortex_a_r linker command file changes
Document the changes implemented in #60368:
* Placement of the .bss and .noinit sections at the end of the binary
  so that large zero-/uninitialized data structures such as heaps,
  arrays etc. don't have to be padded in the resulting binary.
* Location of the z_mapped_start marker: prevents the assignment
  of the single 4k-page wide .vectors section right at the RAM
  base address as dynamic memory by the MMU at run-time. Instead
  of pointing to the start of the subsequent .text section, the
  z_mapped_start marker now covers all the data contained within
  the binary that ends up in RAM.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2023-08-09 16:05:24 +00:00
Immo Birnbaum 9e9e60b67f arch: aarch32: fix z_mapped_start location for non-XIP operation
Move the z_mapped_start marker for non-XIP builds to the base RAM address.
This has already been the marker's location when building for XIP.

Prior to this change, z_mapped_start was located at the start of the
text section for non-XIP builds. However, at least for the Cortex-A
family of CPUs, the first section located at the RAM base address
isn't the text section, but the single 4k page containing the exception
vectors which are copied to either address 0 or the HIVECS address upon
early boot.

This resulted in this first 4k page at the bottom of RAM to be considered
available for memory mappings via the MMU at run-time, followed by all
the permanently mapped stuff, with available mappable memory only
continuing behind z_mapped_end. A call at run-time requesting memory to
be mapped via the MMU therefore always assigned the single 4k page
containing the vectors data first, before continuing mapping physical
memory behind z_mapped_end. For any map call requesting more than 4k,
this resulted in a contiguous virtual memory address range mapped to
non-contiguous physical memory. This behaviour has already been
documented in #51024.

This behaviour would also cause further problems in case of support
for the Cortex-A's VBAR register, which has been proposed before, but
eventually wasn't merged. Letting VBAR point to the RAM base where
the 4k vectors page is located within the Zephyr image instead of
copying the vectors to either 0 or the HIVECS address means that this
page may under no circumstance be re-assigned for use as regular RAM
mapped via the MMU.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2023-08-09 16:05:24 +00:00
Immo Birnbaum 36997de796 arch: aarch32: place .bss, .noinit sections at the end of the binary
This is a follow up to #53262, which still lacked the adjustment of the
.noinit section's position within the binary by the time the PR went
stale.

Adjust the linker command file so that the .bss and .noinit sections
are placed at the end of the resulting binary. Until now, those sections
have been located somewhere in the middle of the binary, so that the
inclusion of structures like statically defined heaps or large zero-
initialized arrays reflected 1:1 in the resulting binary's size. Even
for a stripped binary, such data was included in full as the linker
couldn't omit it due to subsequent sections within the binary.

This fix has been tested with a 32 MB statically allocated heap and
a 32 MB uint8 zero-initialized array. Both structures are clearly
identifyable in the memory consumption statistics, however, the final
binary's size is unaffected by their inclusion.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2023-08-09 16:05:24 +00:00
Ingar Kulbrandstad d36697ac53 Bluetooth: Mesh: Fixed OP_AGG_SRV dependency of OP_AGG_CLI
The OP_AGG_SRV is dependent that the OP_AGG_CLI is add
for the OP_AGG_SRV to work. Moved the define of OP_AGG_CLI
so it will call op_agg_send without the OP_AGG_CLI.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2023-08-09 18:15:32 +03:00
Ingar Kulbrandstad eafa2bb81b Bluetooth: Mesh: Fixed shell call to metadata-encode
The call to metadata-encode call in code and documentation
does does not match. Because the shell call in the documentation
looks correct the shell call in the code has been changed by
removeing the double metadata request.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2023-08-09 18:14:41 +03:00
Chaitanya Tata 66769cf023 scripts: twister: Fix return value for size
If size is given then twister prnits the size information for the ELF
but returns one which if used in automation fails the command.

Return zero as the command is successful. Also, fix the unit test case.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-08-09 10:29:20 -04:00
Jamie McCrae 485fa940aa west.yaml: MCUboot synchronization from upstream
Update Zephyr fork of MCUboot to revision:
  fc658eb5a22b7b1721c3b7d0853a7115fae08939

Brings following Zephyr relevant fixes:
 - c9fa608 boot: boot_serial: Fix issue with encrypted second slot
           images
 - 25d2f2c zephyr: encryption: Improve Kconfig and key generation
 - 99613c6 bootutil: fix downgrade prevention
 - 5b1d511 boot: bootutil: Add optional boot info shared data
           saving
 - ea88860 bootutil: Add bootloader info TLV entries
 - 3016d00 bootutil: Add active slot number and max app size to
           shared data
 - 0540d0f bootutil: Fix for flash_area_id_to_image
 - f17b005 bootutil: Fix boot_set_next passing wrong image number
 - fefc398 fix: update zephyr CONFIG_BOOTLOADER_MCUBOOT
 - 61898da boot: boot_serial: Add updated SMP header
 - 36ae4fd boot: zephyr: split esp32 to
           esp32_devkitc_{wroom,wrover}
 - 2c86755 boot: zephyr: Fix indication LED not selecting GPIO

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-09 13:48:25 +00:00
Diego Elio Pettenò 65f7f741f3 usb_tcpc: fix typo.
"verion" should obviously have been "version".

Signed-off-by: Diego Elio Pettenò <flameeyes@meta.com>
2023-08-09 13:47:22 +00:00
Johan Hedberg a88808fc9a samples: watchdog: Add overlay for Intel Alder Lake boards
Add watchdog overlays and necessary metadata to support Intel Alder Lake
boards.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-08-09 13:45:38 +00:00
Andrei Emeltchenko 9a140ca67d boards: intel_adl: Disable UARTs by default and enabled when needed
Disabled uart0 and uart1 by default in alder_lake.dtsi and enable only
for intel_adl_crb board.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-08-09 13:45:38 +00:00
Andrei Emeltchenko d49455ab4d boards: Add watchdog alias
Add watchdog alias for tco_wdt. Note that it needs to be enabled.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-08-09 13:45:38 +00:00
Andrei Emeltchenko 52b397ee54 boards: Add Alder Lake board definition
Add initial Alder Lake board definition. Initially copied from ELkhart
Lake which is predecessor of the board.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-08-09 13:45:38 +00:00
Andrei Emeltchenko c6e322d406 soc: alder_lake: Add Adler Lake SoC
Add Adler Lake SoC. The SoC is derived from Elkhart Lake SoC.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-08-09 13:45:38 +00:00
Ritwika Dey 814115794c west flash: openocd: support using modustoolbox added
User guide is updated with support for OPenOCD using ModusToolbox

Signed-off-by: Ritwika Dey <Ritwika.Dey@infineon.com>
2023-08-09 13:44:44 +00:00
Jeppe Odgaard e26d018253 samples: flash_shell: rework dump_buffer()
Add an optional compare buffer to check each byte. If the byte differ
the read value will be printed as an error.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2023-08-09 13:41:23 +00:00
Jeppe Odgaard 5ad65dfe36 samples: flash_shell: rework do_read()
Add an optional compare buffer to check if bytes read
match a provided buffer and print an error if they differ.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2023-08-09 13:41:23 +00:00
Fabian Blatz 29d07d6020 scripts: ci: check_compliance: Replace dead Kconfig doc link
Update the link to the Kconfig documentation page.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2023-08-09 12:47:12 +00:00
Benjamin Cabé 12e484cd41 drivers: dac: doc: Cleanup Doxygen documentation
Fixed Doxygen doc for dac_channel_cfg struct.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-09 07:47:45 -04:00
Benjamin Cabé e439ed2da1 doc: sys: onoff: cleanup doxygen documentation
Cleaned up some inconsistencies or mistakes in the way onoff.h
was documented.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-09 07:41:22 -04:00
Al Semjonovs dee493d311 ztest: Fix test statistics reporting
Flaky tests give innacurate test summary indicating a misleading
passing test suite.  Add new status for flaky tests.

Signed-off-by: Al Semjonovs <asemjonovs@google.com>
2023-08-09 07:38:22 -04:00
Bjarki Arge Andreasen 5f80f30747 tests/drivers/rtc: Add qemu_x86_64 board to test suite
This commit adds overlay and conf for the qemu_x86_64 board
to the RTC API test suite, and adds support for the RTC
subsystem to the qemu_x86_64's yaml file.

The commit also specifies integration platforms for the
RTC API test suite, since the qemu_x86_64 board runs in
real-time, causing it to time out if the test suite runs
for it.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-08-09 07:27:40 -04:00
Bjarki Arge Andreasen 7dd5fb6dc8 tests/drivers/rtc/rtc_api: Patch 64-bit arch support for test
The update callback test had a bug which prevented it from
running on 64-bit architectures. This patch makes the test
agnostic to 64-bit and 32-bit architectures.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-08-09 07:27:40 -04:00
Bjarki Arge Andreasen ff135b7e59 tests/drivers/rtc: Add MC146818 driver to test suite
This commit updates the qemu_x86 board's yaml file to
indicate its support for the RTC subsystem. Board overlay
and conf for the qemu_x86 has been added to the RTC test
suite to enable the MC146818 and its dependencies.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-08-09 07:27:40 -04:00