Commit Graph

82561 Commits

Author SHA1 Message Date
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
Bjarki Arge Andreasen 2c2f1c4576 drivers/rtc/rtc_mc146818.c: Add input clock config to driver
This commit adds input clock selection to the RTC driver. This
is required to allow for the real hardware to operate. The
QEMU emulated hardware ignores the input clock settings.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-08-09 07:27:40 -04:00
Bjarki Arge Andreasen 588d39112d drivers/rtc/mc146818: Patch MC146818 driver
The MC146818 driver was not properly initialized
by the driver, interrupts where not handled correctly,
and the alarm feature was not implemented properly.

This commit fixes these issues, while removing some
code which became redundant as the MC146818 driver
was patched.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-08-09 07:27:40 -04:00
Alberto Escolar Piedras e543fbdf9a native_sim: IRQ handling: dont swap if kernel is uninitialized
After an interrupt, do not attempt to swap
if the kernel is not yet initialized.

Otherwise, if an interrupt is raised with interrupts
unlocked while the kernel is not yet fully initialized,
a swap would lead to a crash.
(This could happen if a PREKERNEK1/2 driver enables interrupts
and an interrupt fires before the kernel has swapped to
main)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-08-09 13:19:19 +02:00
Alberto Escolar Piedras dcd6ee5188 native_posix: IRQ handling: dont swap if kernel is uninitialized
After an interrupt, do not attempt to swap
if the kernel is not yet initialized.

Otherwise, if an interrupt is raised with interrupts
unlocked while the kernel is not yet fully initialized,
a swap would lead to a crash.
(This could happen if a PREKERNEK1/2 driver enables interrupts
and an interrupt fires before the kernel has swapped to
main)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-08-09 13:19:19 +02:00
Alberto Escolar Piedras b6e32e4415 nrf52_bsim: IRQ handling: dont swap if kernel is uninitialized
After an interrupt, do not attempt to swap
if the kernel is not yet initialized.

Otherwise, if an interrupt is raised with interrupts
unlocked while the kernel is not yet fully initialized,
a swap would lead to a crash.
(This could happen if a PREKERNEK1/2 driver enables interrupts
and an interrupt fires before the kernel has swapped to
main)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-08-09 13:19:19 +02:00
Fabio Baltieri 4488a41f8c Revert "sensors: Fix overflow in default decoder"
This reverts commit b2a78ff679.

Causes CI fail on:

west build -p -b native_posix_64 -T
	tests/drivers/build_all/sensor/sensors.generic_test

Assertion failed at
WEST_TOPDIR/zephyr/tests/drivers/build_all/sensor/src/generic_test.c:204:
run_generic_test: (expected_shifted not within actual_shifted +/-
epsilon_shifted)

Expected -105484396736, got -103734438144 (shift 6, ch 8, iteration 1/5,
Error -1749958592, Epsilon 3221184)

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-09 11:11:37 +00:00
Dino Li b4f88dcdc1 tests/cmsis_rtos_v2: increase main thread sleep time
In the mutex and semaphore tests, main thread will sleep for 10 ticks
to wait for test thread to finish its work. And test thread will wait
5 ticks for timeout test. This means that test thread has 5 ticks to
finish its job.
On platform where idle thread has low power mode enabled
(e.g. it8xxx2_evb), latency in waking up from low power mode will cause
main thread to wake up early before test thread has finished its work.
This symptom will break next test (osThreadGetCount() not equal to 2).
This change makes the test threads have a full 10 ticks to finish its job.

fixes: #57557

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2023-08-09 09:05:42 +00:00
Morten Priess d21e3e3514 Bluetooth: controller: Fix CIS offset equivalent calculation
First implementation had a math error where the offset would be the
remainder from division (modulo). It should have been an ISO interval
minus the remainder. Refactored to not use modulo.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2023-08-09 08:40:52 +00:00
Jonathan Rico cc57633447 Build system: disable `OUTPUT_DISASSEMBLY` by default
This on-by-default option takes the majority of "link" time.
If people need the disassembly, they can turn it on.

Incremental builds of the bluetooth tester app:

```bash
west build -b nrf52840dk_nrf52840 zephyr/tests/bluetooth/shell
touch zephyr/subsys/bluetooth/shell/bt.c
time west build -b nrf52840dk_nrf52840
```

Before:
real    0m6,621s
user    0m6,430s
sys     0m0,175s

After:
real    0m1,011s
user    0m0,840s
sys     0m0,170s

```bash
rm -rf build
time west build -p -b nrf52840dk_nrf52840 zephyr/tests/bluetooth/shell
```

Before:
real    0m9,726s
user    0m11,735s
sys     0m2,665s

After:
real    0m4,545s
user    0m8,006s
sys     0m2,723s

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-08-09 08:36:19 +00:00
YuLong Yao af0583d87d driver: wifi: esp32: enable iface when enable ap mode
when ap mode is enable,
we don't enable iface by `net_eth_carrier_on` before,
this will cause wifi tx error.

this patch fix this issues.

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-08-09 08:34:56 +00:00
Manuel Argüelles c031c9359e mbox: nxp_s32: fix semicolon typos
Replace unintended commas with semicolons.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-08-09 08:34:28 +00:00
Manuel Argüelles dcb570985b gpio: nxp_s32: use CONFIG_GPIO_INIT_PRIORITY
Use `CONFIG_GPIO_INIT_PRIORITY` instead of the generic device driver
init priority.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-08-09 08:34:18 +00:00
Sjors Hettinga 9d2c17dee2 tests: net: tcp: Default disable logging in TCP socket test
Accidentally statements to enable logging in the TCP socket test
where pushed. This broke some tests running on real devices due
to the additional code size.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2023-08-09 08:34:06 +00:00
Aleksander Wasaznik 8e5fd3990f Bluetooth: Host: Explicitly ignore return value of auth latch
Fixes a coverity-reported issue by explicitly ignoring the return value
of the cas-operation. The return value is the old value, but we are not
interested in it in the situation when we just want to initialize a
value if it is in the uninitialized state.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/60474

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-08-09 08:33:47 +00:00
Morten Priess b0ab952ffe Bluetooth: controller: Prevent ULL stuck in semaphore
In certain scenarios, the semaphore sem_ticker_api_cb may be taken
during attempt to complete a synchronous ticker operation such as start
or stop, but is never released via ull_ticker_status_give. This could
happen if ticker temporarily runs out of ticker operation slots for any
ticker client.
The consequence of ULL stuck waiting in semaphore is anything from
allocation assertions to watchdog timeouts.

This commit also sets a timeout on ull_disable calls, which relies on
the disable callback being invoked from 'done'. Invocation of 'done' is
mandatory, and code shall not allow that not to happen, but to avoid
hiding the real cause, the semaphore now has a timeout which causes
assertion in the location the issue occurred.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2023-08-09 08:33:34 +00:00
Morten Priess 3ad58fde71 Bluetooth: controller: Introduce vendor ticker operations for ULL_LOW
Allow vendor configuration of addition ticker user operations for
TICKER_USER_ID_ULL_LOW.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2023-08-09 08:33:04 +00:00
Morten Priess e1f4452798 Bluetooth: controller: Use mayfly_is_running() in csrand_get()
Check mayfly_is_running() to determine use of blocking- or non-blocking
version of lll_csrand, instead of k_is_in_isr().
As mayflies run in ISR context for Nordic platform, change will have no
impact on Nordic configuration.

For vendors using META_IRQ mayflies, implementation will now prevent
blocking and reduce latencies and jitter in soft-realtime code.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2023-08-09 08:32:55 +00:00
YuLong Yao 28f5366e0e drivers: wifi: esp32: choose channel 0 by default
When channel set to WIFI_CHANNEL_ANY, ap will not work.
This patch choose channel 0 when channel is WIFI_CHANNEL_ANY.

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-08-09 08:32:39 +00:00
Eduardo Montoya f4d54fa4b9 drivers: ieee802154: nrf5: fix handling multiple CCA
Fix a couple of bugs introduced with last commits related to multiple
CCA support.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2023-08-09 08:32:26 +00:00
Fabio Baltieri ec15061e79 bindings: gpio-qdec use INPUT_REL_WHEEL as example
INPUT_REL_WHEEL is the code that normally refer to scroller wheel, which
probably makes a bit more sense in this context, use that instead of
INPUT_REL_Y.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-09 08:29:46 +00:00
TOKITA Hiroshi b2b0901c0d samples: sensor: change to use the app.overlay file
The DTC_OVERLAY_FILE variable is specified on the command line.
It's not preferable to set it in CMakeLists.txt.
The app.overlay file is used as the default overlay file, so use it.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-08-09 08:29:28 +00:00
Manuel Arguelles 3112b6de1a serial: nxp_s32: use CONFIG_SERIAL_INIT_PRIORITY
Use CONFIG_SERIAL_INIT_PRIORITY instead of the generic device driver
init priority.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-08-09 08:28:52 +00:00
Yuval Peress b2a78ff679 sensors: Fix overflow in default decoder
The default decoder would take the micro-unit value of the old sensor
value and multiply it by INT32_MAX. This would, at times, cause an
overflow for the int64_t which is the cause of some bugs like when
-7952 was used (-7952000000 * INT32_MAX < INT64_MIN). Instead the new
math converts:
- `value_u * INT32_MAX / ((1 << header->shift) * 1000000)`

to a bitmap:
- `sample.val1` consumes the upper `N` bits
- `sample.val2 * BIT(32 - N) / 1000000` consumes the lower `32-N`
    bits

This both improves the accuracy, and avoids the overflow since
`shift` is guaranteed to be between 0 and 31.

Signed-off-by: Yuval Peress <peress@google.com>
2023-08-09 08:28:32 +00:00
Tristan Honscheid 128b466dd1 emul: icm42688: Implement backend sensor emul API
Implement the backend emul API for the ICM42688 motion sensor so it can
be automatically tested by the generic sensor test (see #60394).
Supports all channels (temp, accel XYZ, and gyro XYZ) at each of the
programmable full-scale accel and gyro ranges.

Also fixes an arithmetic bug in the driver that was causing a minor
error in the returned readings.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2023-08-09 08:27:59 +00:00
Fabio Baltieri 2cfffda32a sensor: max17055: support fetching individual channels
Add support for fetching individual channels rather than forcing the
application to always fetch them all. Potentially saves few i2c
transactions.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-09 08:27:13 +00:00
Fabio Baltieri fa2481e6fb sensor: max17055: convert floating point operation to integer
Convert a few floating point operation to fixed point. May save some
stack and some flash as well on soft-fp systems.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-09 08:27:13 +00:00
Fabio Baltieri 2f9b120860 sensor: max17055: change register access function addr to uint8_t
The register space for the device is on 8 bit, use uint8_t for register
address to the low level read and write functions.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-09 08:27:13 +00:00