Commit graph

76754 commits

Author SHA1 Message Date
Henrik Brix Andersen c41dd36de2 drivers: kconfig: unify menuconfig title strings
Unify the drivers/*/Kconfig menuconfig title strings to the format
"<class> [(acronym)] [bus] drivers".

Including both the full name of the driver class and an acronym makes
menuconfig more user friendly as some of the acronyms are less well-known
than others. It also improves Kconfig search, both via menuconfig and via
the generated Kconfig documentation.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-03-28 15:06:06 +02:00
Carlo Caione f43c7367b1 arm64: Break circular dependency on syscall.h
Commit fbf851cdc4 is introducing a
dependency between util.h and time_units.h.

Now, the problem is that time_units.h is from one side included by
arm64/syscall.h (syscall.h -> lib_helpers.h -> cpu.h -> util.h) but on
the other side it is including syscall.h (time_units.h -> syscall.h).

Break the dependency at cpu.h level.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-03-28 15:05:54 +02:00
Romain Mahoux e5b70121e7 samples: minimal: define an empty project configuration
Cmake configuration forces projects to define a prj.conf

Signed-off-by: Romain Mahoux <romain@mahoux.fr>
2023-03-28 15:05:01 +02:00
Nicolas Pitre a6809ef93a timer: hpet: a few improvements
- That MIN_DELAY is a magic arbitrary number that is never going to be
  right for all cases. Get rid of it in favor of a smarter solution.

- `sys_clock_set_timeout()` should not base its next match value on the
  current time. Tracking the `last_tick` and `last_elapsed` values avoids
  the need for all the tick rounding computation.

- Clamp the next timeout to HPET_MAX_TICKS/2. This leaves room for the
  added elapsed time and any possible IRQ servicing delay.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-03-28 07:26:08 -04:00
Théo Battrel 9c69f29d0d Bluetooth: Logging: Deprecate BT_DEBUG_LOG
Deprecate Kconfig symbol `BT_DEBUG_LOG`. With the new `BT_LOG` having
the same effect, `BT_DEBUG_LOG` is not useful anymore and shouldn't be
used.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2023-03-28 10:33:24 +02:00
Théo Battrel af01a0f313 Bluetooth: Logging: Move all logging symbols together
Move all Kconfig symbols related to Bluetooth logging into the newly
created `Kconfig.logging`. The logging symbols are now grouped by into a
menu "Bluetooth logging". Closely related symbols are grouped with each
others. For example, audio related logging symbol are found behind a
submenu "Audio" inside the "Bluetooth logging".

The deprecated logging symbols have also been moved in a submenu of
"Bluetooth logging", it's easier to avoid them so.

Behavior of the Bluetooth logging system:

When `LOG` symbol is selected, if Bluetooth is enabled (`BT` symbol
selected), the Bluetooth logging is enabled.

If the user does not set any log level, the Bluetooth logging symbols
will inherit the log level of `BT_LOG_LEVEL`. If the user does not set
the level of `BT_LOG_LEVEL`, the default log level will be the one
defined by the logging subsystem. Which currently is `LOG_LEVEL_INF`.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2023-03-28 10:33:24 +02:00
Declan Snyder 3af095b122 drivers: pinctrl: pinctrl_kinetis: Fix port array
Fix port array definition in kinetis pinctrl driver
so that it handles more flexibly the cases where the
number of PORT peripherals is more than 3, rather than only
handling the case where there are 5.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-03-28 10:23:46 +02:00
Francois Ramu f7f47dc437 drivers: adc: stm32 adc driver must wait about 1ms after enabling
After enabling the ADC, the peripheral has a certain delay (about 1ms)
to set its ADC Ready flag in the ADC ISR register.
In between, the ADRDY is still 0 and the ADEN is 1 in the CR.
The ADC can be used for conversion, only when the ADRDY bit is set

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-03-28 09:57:28 +02:00
Patryk Duda 5ec4aaff5c boards: beagle_bcf: Fix undefined references to pinctrl and gpio device
This patch fixes undefined references when compiling tests/drivers/flash
for beagleconnect_freedom board using following command:

west build -b beagleconnect_freedom tests/drivers/flash

Adding CONFIG_PINCTRL fixes undefined references to
'pinctrl_lookup_state' and 'pinctrl_configure_pins'.

Adding CONFIG_GPIO fixes undefined reference to '__device_dts_ord_13'
from spi_nor and spi_cc13xx_cc26xx drivers.

Fixes #56181

Signed-off-by: Patryk Duda <pdk@semihalf.com>
2023-03-28 09:56:56 +02:00
Alexander Svensen 674e23820f sd: Return ret if error in sdmmc_spi_read_cxd
- Check OCR when sending CMD58, reject if 0

Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
2023-03-28 09:23:47 +02:00
Daniel Leung e35733d2ff tests: mem_protect/syscalls: print FAILED when faulting
If there are any CPU exceptions, printing a failed message
would allow twister to stop early instead of waiting for
timeout.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-03-27 20:13:22 -04:00
Daniel Leung 4a39c0c49f tests: mem_protect/sys_sem: print FAILED when faulting
If there are any CPU exceptions, printing a failed message
would allow twister to stop early instead of waiting for
timeout.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-03-27 20:13:22 -04:00
Pete Dietl fd94ca7e78 cmake: modules: Make modules.cmake check more precise
When checking that modules contain a file `modules/modules.cmake`,
the CMake file only actually checked for the existence of the module
root, not the `modules/modules.cmake` file inside of it.

Signed-off-by: Pete Dietl <pete.dietl@worldcoin.org>
2023-03-27 22:15:59 +00:00
Romain Mahoux b096e092fa drivers/apbuart: correct the baud formula
The formula of set_baud first function was not consistent with the get_baud
one.

Signed-off-by: Romain Mahoux <romain@mahoux.fr>
2023-03-27 22:15:33 +00:00
Krzysztof Chruscinski e0082eded7 drivers: timer: nrf_rtc_timer: Add guard against conflict
Add missing guard which prevents use of nrf_rtc_timer on
the same RTC instance (RTC1) as counter driver instance.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2023-03-27 22:15:15 +00:00
Krzysztof Chruscinski a5865949d9 samples: drivers: counter: alarm: Fix nordic DKs
After reworking counter driver to use device tree this sample
stopped to compile for nordic DKs. Providing overlays to fix
the compliation.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2023-03-27 22:15:15 +00:00
Jeppe Odgaard 40ec70fd2a drivers: sensor: mcux qdec single-phase option
Add binding and sensor attribute to allow single phase
mode where only one signal is required from the encoder.
The signal must be connected to Phase A input.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2023-03-27 22:13:56 +00:00
Kumar Amit Mehta ccd88a4b61 documentation: samples: smp: Fix pathname for SMP sample examples
SMP sample applications are located in the 'arch' directory.
This patch fixes the pathname for SMP sample examples.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
2023-03-27 11:06:10 -04:00
Jamie McCrae c5fbcc468e snippets: Fix cmake path output on Windows
Uses linux style path output instead of windows style to prevent
issues with cmake assuming the slashes are for escape code
sequences.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-03-27 14:44:39 +00:00
Carles Cufi e0c90b9393 scripts: requirements: Move requests and pyserial to base
Both the requests and pyserial Python packages are used by west commands
(west fetch and west build -b esp* respectively) so move them to the
requirements-base.txt file.

Fixes #56215.
Fixes #56224.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-03-27 07:12:27 -07:00
Luca Fancellu 0deeb5ff65 soc: include: fvp_aemv8r: Define device memory as device tree node
A recent change introduced the possibility to declare MPU memory
regions using the device tree and the framework described in
zephyr/linker/devicetree_regions.h.

So remove the device region declared in mpu_regions[] and the used
defines for the addresses, rename REGION_DEVICE_ATTR to REGION_IO_ATTR
in arm_mpu.h to be compatible with the framework and add a device tree
node to fvp_baser_aemv8r.dts to describe the device memory region.

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
2023-03-27 13:20:47 +00:00
Aleksandr Khromykh 5ed6245f84 tests: Bluetooth: Mesh: bsim to check parallel work in remote provisioning
The commit adds bsim test to check ability to handle proviosioning
and scanning in parallel in remote provisioning models.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-03-27 13:20:33 +00:00
Aleksandr Khromykh 9011a067f2 Bluetooth: Mesh: split rpr cli ack ctx for provisionning and scanning
PR adds 2 acknowledgment contexts to RPR client to handle
scanning and provisioning in parallel.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-03-27 13:20:33 +00:00
Henrik Brix Andersen e440b023dd drivers: gpio: test: use CONFIG_GPIO_INIT_PRIORITY for init priority
Use the dedicated CONFIG_GPIO_INIT_PRIORITY for vnd,gpio test driver
initialization priority.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-03-27 13:20:03 +00:00
Henrik Brix Andersen 2c5d7d78dd drivers: gpio: test: add driver config and data structs
Add config and data structs to the vnd,gpio test driver as these are
required by the GPIO API.

Fixes: #55884

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-03-27 13:20:03 +00:00
Sylvio Alves afe57dd3d6 west.yml: update hal_espressif to bring ESP32S3 BLE support
This update includes the following:
* Add ESP32-S3 support
* Modify BT heap to use system heap instead of custom heap,
which adds ~13kB of RAM to application.

Fixes #55653 #54131

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-03-27 13:19:38 +00:00
Sylvio Alves 0567557d4f boards: esp32xx: update BT heap of all espressif boards
Current internal BT heap uses custom heap area, which reserves
unused RAM area. In order to free up some RAM, BT HAL
implementation was changed to use sysheap instead.
With this change, something around ~13kb is now available for
application, optmizing RAM usage.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-03-27 13:19:38 +00:00
Sylvio Alves 10a7baba0e soc: esp32s3: add bluetooth support
This only adds proper HEAP and HCI definition to enable
BLE support to ESP32-S3.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-03-27 13:19:38 +00:00
Alexander Mihajlovic de81c48a24 boards: stm32h747i_disco: Add pmod connector
Add pmod connector dts description.

Signed-off-by: Alexander Mihajlovic <alexander@eub.se>
2023-03-27 09:51:08 +02:00
Alexander Mihajlovic dfaa1d5682 boards: stm32h735g_disco: Add pmod connector
Add pmod connector dts description.

Signed-off-by: Alexander Mihajlovic <alexander@eub.se>
2023-03-27 09:51:08 +02:00
Alexander Mihajlovic 9d50b143ae dts: bindings: Add Pmod connector GPIO nexus
Add a GPIO nexus binding for Pmod interface connectors.
This commit also includes a header file with macros
that map signal names in the Pmod specification to
the corresponding indices in the GPIO nexus, meant for
use in devicetree files.

Signed-off-by: Alexander Mihajlovic <alexander@eub.se>
2023-03-27 09:51:08 +02:00
Fabian Blatz 1a132fabc0 tests: drivers: uart: add uart_emul test
Add test of the uart emulator polling API.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2023-03-27 09:50:44 +02:00
Fabian Blatz 6180f96799 serial: Add driver for emulated UART
The emulated UART controller will aid in automated
integration testing.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2023-03-27 09:50:44 +02:00
Henrik Brix Andersen 718099607e drivers: can: common: document sample point calculation function
Add documentation for the update_sampling_pnt() function and rename a few
internal variables to improve readability.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-03-27 09:50:24 +02:00
Henrik Brix Andersen ffefc6441b drivers: can: common: respect the range limits of phase_seg1
Respect the range limits of phase_seg1 when attempting to distribute ts1
between prop_seg and phase_seg1.

Even distribution may not be possible if the allowed ranges of prop_seg and
phase_seg1 are not equal.

Fixes: #55919

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-03-27 09:50:24 +02:00
Henrik Brix Andersen 7073da0257 drivers: can: common: include sync segment in timing calculation
Always include the SYNC segment of 1 time quanta when calculating ts1 and
ts2.

Fixes: #55919

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-03-27 09:50:24 +02:00
Szymon Janc 577d4b004f bluetooth: tester: Add MESH and LE Audio overlays
Initially I was hoping we can avoid dedicated overlays and have all
config options enabled but it turned out that built-in services
may affect other tests (especially core related like GAP and GATT).

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2023-03-27 09:50:09 +02:00
Chris St John 1c0ade0051 Bluetooth: Audio: fix possible overflow in BASE LTV decode
Consistently process BIS data, codec data and codec metadata.
Range check count of data received so that buffer overflow cannot occur.

Signed-off-by: Chris St John <chris_st._john@bose.com>
2023-03-27 09:49:58 +02:00
Fabio Baltieri adde272ab7 board: npcx: use templates for the openocd setup
The NPCX boards use the normal openocd setup with custom --cmd-load and
--cmd-verify. This can be done using the normal template instead of
calling board_set_flasher_ifnset and board_set_debugger_ifnset directly

Verified that the runner is indeed being called with the correct
arguments after this commit.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-03-27 09:49:48 +02:00
Kumar Gala 672aeace88 libc: share time() between minimal libc and armclang libc
Introduce a place to share implementations of libc functions that
are needed by different libc versions.  Place time() in this common
location so it can be shared when building for either minimal libc or
armclang libc.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-03-27 09:49:40 +02:00
Martí Bolívar a7aafcbbdc tests: add snippet test suite
Add an initial test suite for the basic SNIPPET_ROOT, SNIPPET, and
'append' features in snippet.yml.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2023-03-26 16:12:41 +02:00
Martí Bolívar cac263ec3f snippets: add cdc-acm-console
This snippet is based on samples/subsys/usb/console. Since it's a
snippet, it can be used in any application as long as its requirements
are met. This makes it more general purpose.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2023-03-26 16:12:41 +02:00
Marti Bolivar ee4b134dd6 doc: add snippets documentation
Document this new build system feature.

Since its purpose is customizing application builds, the logical place
for the main body of documentation is in a new snippets/ directory in
doc/build/. Create that directory and add its initial documentation.

Like boards and samples, however, we expect people to write
documentation for each snippet within the directory that defines the
snippet itself. Therefore, add a new top-level snippets/ directory and
stub out the documentation needed to document individual snippets as
well.

Add documentation and cross-references in other required places as
well.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-03-26 16:12:41 +02:00
Martí Bolívar 1f9ab85354 west: build: appease the linter
The linter is complaining about unnecessary parens.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2023-03-26 16:12:41 +02:00
Marti Bolivar 5880feee33 west: build: add -S <snippet> argument
Writing '-S foo' is a convenience shorthand for adding snippets at
CMake time without having to add '-- -DSNIPPET=foo' to the west build
command line. It is worth adding a new one-letter command line option
because snippets are anticipated to be a very commonly used feature.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-03-26 16:12:41 +02:00
Marti Bolivar 3f282da0e8 zephyr modules: add 'snippet_root' support to module.yml
This key may appear in a module.yml's 'settings' map, and works
analogously to the already existing 'board_root', 'dts_root', etc.
keys: if set, its value is interpreted as a directory that will be
added to SNIPPET ROOT.

For example, if a module.yml contains:

  settings:
    snippet_root: foo

Then 'foo', relative to the module's base directory, will be added to
SNIPPET_ROOT. This then means that any snippets in foo/snippets will
be discovered by the build system.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-03-26 16:12:41 +02:00
Marti Bolivar 06c9bf47b3 snippets: initial snippet.yml support
Add a new script, snippets.py, which is responsible for searching
SNIPPET_ROOT for snippet definitions, validating them, and informing
the build system about what needs doing as a result.

Use this script in snippets.cmake to:

- validate any discovered snippet.yml files
- error out on undefined snippets
- add a 'snippets' build system target that prints all snippet
  names (analogous to 'boards' and 'shields' targets)
- handle any specific build system settings properly,
  by include()-ing a file it generates

With this patch, you can define or extend a snippet in a snippet.yml
file anywhere underneath a directory in SNIPPET_ROOT. The snippet.yml
file format has a schema whose initial definition is in a new file,
snippet-schema.yml.

This initial snippet.yml file format supports adding .overlay and
.conf files, like this:

  name: foo
  append:
    DTC_OVERLAY_FILE: foo.overlay
    OVERLAY_CONFIG: foo.conf
  boards:
    myboard:
      append:
        DTC_OVERLAY_FILE: myboard.overlay
        OVERLAY_CONFIG: myboard.conf
    /my-regular-expression-over-board-names/:
      append:
        DTC_OVERLAY_FILE: myregexp.overlay
        OVERLAY_CONFIG: myregexp.conf

(Note that since the snippet feature is intended to be extensible, the
same snippet name may appear in multiple files throughout any
directory in SNIPPET_ROOT, with each addition augmenting prior ones.)

This initial syntax aligns with the following snippet design goals:

- extensible: you can add board-specific support for an existing
  snippet in another module

- able to combine multiple types of configuration: we can now apply a
  .overlay and .conf at the same time

- specializable: this allows you to define settings that only apply
  to a selectable set of boards (including with regular expression
  support for matching against multiple similar boards that follow
  a naming convention)

- DRY: you can use regular expressions to apply the same snippet
  settings to multiple boards like this: /(board1|board2|...)/

This patch is not trying to design and implement everything up front.
Additional features can and will be added to the snippet.yml format
over time; using YAML as a format allows us to make
backwards-compatible extensions as needed.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-03-26 16:12:41 +02:00
Marti Bolivar 80ca540522 snippets: basic build system boilerplate
Basic things needed to integrate the new 'snippets' feature into the
build system. The main CMake variable which controls snippets is
SNIPPET. It is a whitespace-or-semicolon-separated list of snippet
names.

- Add minimal new cmake module for processing snippets. This just has
  basic infrastructure for processing a SNIPPET variable into
  SNIPPET_AS_LIST, and warning the user if they try to change it too
  late.

- Integrate the new module into the build system, via
  zephyr_default.cmake

This is anologous to the shields and boards modules' boilerplate and
input variables.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-03-26 16:12:41 +02:00
Daniel Nejezchleb 6898094111 net: shell: Fix shell freeze
Adds clean up after failed ping from shell,
so it does not freeze the output.

Signed-off-by: Daniel Nejezchleb <dnejezchleb@hwg.cz>
2023-03-25 07:49:18 -04:00
Chris Friedt ff2efd7ae5 net: socket: socketpair: remove experimental status
Socketpair functionality has matured enough to be used in a
consistent way now regardless of architecture or platform,
even on `native_posix`.

Remove the experimental status to reflect that.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-03-25 07:05:53 -04:00