Commit graph

80869 commits

Author SHA1 Message Date
Alberto Escolar Piedras 56dc20eb1d Kconfig: Tidy up dependants of NATIVE_APPLICATION
So they depend or select on the right NATIVE_BUILD
instead of NATIVE_APPLICATION.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-07-05 07:01:19 -04:00
Alberto Escolar Piedras 2eb14f1469 Kconfig: Add new NATIVE_LIBRARY and NATIVE_BUILD options
To differentiate builds which will produce a native executable
as direct output from the Zephyr build,
or a library which can be used later.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-07-05 07:01:19 -04:00
Jerzy Kasenberg d58b315165 tests: drivers: counter: basic_api: add overlay for da1469x_dk_pro
Overlay adds 4 timers for testing and selects various frequencies
to select high speed (DIVN) and low-speed (LP-CLK) as sources.
Different  prescalers are applied for different timers to
test wider range of conditions.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2023-07-05 13:00:50 +02:00
Jerzy Kasenberg cc53f3f021 samples: drivers: counter: alarm: add support for the Smartbond Timer
Add support for the Renesas Smartbond Timer IP to the counter alarm sample.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2023-07-05 13:00:50 +02:00
Jerzy Kasenberg b896ca5771 drivers: counter: Add Smartbond basic support
This adds support for the TIMER1-4 counter.
Each counter has 24bits and can run on LP_CLK (15-32KHz)
or DIVN clock (32MHz) with prescaler 1-32.
Each counter can have one alarm set.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2023-07-05 13:00:50 +02:00
Andy Sinclair 7e3f6f1290 drivers: sensor: npm1300_charger: Added Ntc threshold config
The NTC thresholds (cold, cool, warm, hot) are now configured
during initialisation

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-07-05 12:59:38 +02:00
Andy Sinclair 725d45e6d4 drivers: sensor: npm1300_charger: Auto temp measurements
Enable automatic temperature measurements during charging.
Allows the PMIC to charge when the host is in low power mode.

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-07-05 12:59:38 +02:00
Andy Sinclair f93da64ec8 drivers: sensor: npm1300_charger: Startup vbus current limit
The vbus current limit is now written to the vbus startup
register. It is now applied at all times and does not need
to be updated on charger insertion.

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-07-05 12:59:38 +02:00
Jukka Rissanen 77c86e8ad3 net: Clarify the documentation of net_if_dev
The documentation of net_if_dev was missing information how
it should be instantiated.

Fixes #59975

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2023-07-05 11:19:40 +02:00
Robert Lubos e1964b8a82 net: wifi: shell: Fix unsafe pointer casts
parse_number() helper function accepts long * pointer or the output,
however in several places, an address of a variable of incompatible
type was passed to the function (for example an address of a bool
variable was cast to (long *) and provided to the function). This
could cause memory overwrites or other unexpected behaviour.

Fix this, by defining a helper variable of type long, and use it with
the parse_number() function. Only after successful parsing, the value is
then assigned to the proper destination.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-07-05 11:17:42 +02:00
Seppo Takalo aaa9cedf18 net: lwm2m: Update next event timestamp on PMAX change
When PMAX value is changed, it should update all events.
I believe there is a bug that caused the code only to update
events that are ongoing (to be send).

Now if PMAX changes, next event timestamp is recalculated.

Fixes #59397

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-07-05 11:16:06 +02:00
Arkadiusz Kozdra 82d8f09de1 bluetooth: host: track connection type enum
The enum used for connection types gets named bt_conn_type to guard
against accidental usage of generic integers with relation to it.

The added default case in several switch statements avoids warnings
against unhandled enum values.

Signed-off-by: Arkadiusz Kozdra <akozdra@antmicro.com>
2023-07-05 09:15:48 +02:00
Arkadiusz Kozdra 0885416b60 bluetooth: host: add checks for connection types
Fail gracefully if an HCI event of one type arrives for a handle of a
different connection type.  The requested types are currently based on
what fields are used, not on the usage context, in order to keep every
correct use so far still working.

A warning is logged if the connection identified by the handle does not
match the requested connection type.

Signed-off-by: Arkadiusz Kozdra <akozdra@antmicro.com>
2023-07-05 09:15:48 +02:00
Gerard Marull-Paretas 7b98cd6404 arch: arm: nmi: remove dummy NMI_INIT()
It is no longer used, so it can be dropped now.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-07-05 09:15:36 +02:00
Gerard Marull-Paretas fcaa259e22 soc: arm: remove all unnecessary NMI_INIT() calls
NMI_INIT() is now a no-op, so remove it from all SoC code. Also remove
the irq lock/unlock pattern as it was likely a cause of copy&paste when
NMI_INIT() was called.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-07-05 09:15:36 +02:00
Gerard Marull-Paretas 0d4e5bf67f arch: arm: nmi: simplify NMI initialization
Zephyr provides a default NMI handler (`z_SysNmiOnReset`), which will
basically call `wfi` endlessly. It is allowed to override such handler
when CONFIG_RUNTIME_NMI=y, via `z_arm_nmi_set_handler`. However,
enabling such option also provided `z_arm_nmi_init` (via `NMI_INIT()`),
which basically sets the handler to `DefaultHandler` (a new handler that
basically printks and reboots). This is strictly not needed, and
independent of the runtime NMI option. As a result, most SoCs were
blindly calling `NMI_INIT()`, probably because of a copy&paste effect.
In the majority of cases, this was a no-op, but most SoCs do IRQ
enable/disable, making this even more convoluted. To make things worse,
the init call is expected to run after console has been initialized (for
printk to work?), but most SoCs just called it in PRE_KERNEL_1+0.

This patch just drops this NMI initializer API, and leaves only the
handler set call when CONFIG_RUNTIME_NMI=y.

NMI_INIT() dummy definition is left in this patch to preserve
bisectability, will be dropped later.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-07-05 09:15:36 +02:00
Arnaud Pouliquen b227f89bcd samples: ipc: rename virtio_xxx static functions
The "virtio_" prefix is used by the open-amp library API.
Rename local functions using "ipc_virtio_" prefix to avoid
function redefinition.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2023-07-05 09:15:08 +02:00
Arnaud Pouliquen 85fe3c45fd ipc_service: rename virtio_xxx static functions
The "virtio_" prefix is used by the open-amp library API.
Rename local functions using "ipc_virtio_" prefix to avoid
function redefinition.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2023-07-05 09:15:08 +02:00
Johann Fischer 4d3611e95c include: drivers: uart: remove incorrect comments about CDC ACM UART
The CDC ACM implementation provides a virtual UART interface
that is used by various samples and subsystems in a way that is
compatible with the real UART interface.

Commit cc1b2c70cc
("uart: doc: Add special case for virtual UART")
added a questionable comment to uart_fifo_fill() API
description in an attempt to fix issue described in
https://github.com/zephyrproject-rtos/zephyr/issues/11455

However, this did not fix the problem because the API is not
designed to be used in this way.  Finally commit 0e57e4fb78
("samples: usb: cdc_acm: Update CDC ACM echo sample")
revised the sample to use the API in the correct way.

Remove incorrect comment in uart_fifo_fill(). For compatibility
reasons and due to the design of the API, such differences must not
exist.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-07-05 09:14:58 +02:00
Mariusz Skamra 7c21a9c189 Bluetooth: ascs: Make sure idle state can be always read
Instead of waiting for ase_buf to be available, the read of an
ASE in IDLE state can be handled without using ase_buf.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-07-05 09:14:37 +02:00
Mariusz Skamra 8797e50b64 tests: Bluetooth: ascs: Swap bt_gatt_attr_read mock with real function
This refactors the code to use exact copy of bt_gatt_attr_read instead
of mock, as the implementation might call the function with stack
allocated value. Using mock would require deep copy of the value for
further verification. As the buffer where the value is about to placed
is one of the attr->read() parameters, the test may call the read()
callback with stack allocated buffer of defined size and read the value
from the buffer.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-07-05 09:14:37 +02:00
Mariusz Skamra 12c89edc39 Bluetooth: ascs: Fix return without state change nor response
This fixes missing control point status and ASE status change, when
failed to disconnect the CIS. As the server may, but does not have to
disconnect the CIS, the operation should not be considered as failed
when it happens.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-07-05 09:13:45 +02:00
Tomislav Milkovic a459e56cc5 drivers: clock_control: Export initialization function for STM32H7
Because they are needed in SoC power.c, clock control init functions
for all other STM32 series has been exported as global.
This commit exports stm32_clock_control_init function as global for
STM32H7 series as well, making custom power management
implementations for STM32H7 series possible.

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2023-07-05 09:13:35 +02:00
Fabio Baltieri 9de541b9c2 scripts: ci: check_compliance: add a no-modules Kconfig check
Add a variation of the basic Kconfig check that runs with no modules,
catches symbols that are used in the main repository but are defined
only in modules, which are potentially problematic if a downstream
project is not using the specific module.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-07-05 09:11:02 +02:00
Fabio Baltieri 30fa612289 modules: define few undefined but referenced symbols
These are referenced by the "x module not available" message in
modules/Kconfig, but were only defined in the module, were generating an
undefined symbol warning when running CI compliance with no modules.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-07-05 09:11:02 +02:00
Wilfried Chauveau 690b21718a tfm: Fix the merged hex file name for mps3_an547
This fixes a typo that leads to failure when running `west build` with the
`run` target.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2023-07-04 14:14:51 +00:00
Marek Matej 6e72e401f2 drivers: wifi: Fix esp32 driver
Fix compilation issue on esp_wifi_drv.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2023-07-04 15:28:03 +02:00
Henrik Brix Andersen f3cafe7559 tests: drivers: can: api: do not quote overlay file name
Remove quotes from DTC_OVERLAY_FILE as they break the build.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-07-04 11:10:35 +00:00
Mahesh Mahadevan 074fdbb4f7 drivers: mcux_usb: Fix selection of NO_CACHE
NO_CACHE cannot be selected for certain cores.
Use ARCH_HAS_NOCACHE_MEMORY_SUPPORT as the condtion
to select NO_CACHE config

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-07-04 11:07:55 +00:00
Andrej Valek 9ccf5ae521 boards: arm: nucleo_f756zg: add flash0 partitions
Split flash into partitions (4x256KB). There is no way to make partitions
smaller, because of block size. This feature enables to switch between
2 applications.

Signed-off-by: Andrej Valek <andy@skyrain.eu>
2023-07-04 11:07:31 +00:00
Aleksandr Khromykh 25bfbb1caf Bluetooth: Mesh: instantiate cdb and core keys
PR instantiates cdb and core keys to prevent scenario
when key is changed over cdb API and gets new ID but
core still operates with old ID(potentially invalid).

Known issue the keys will be desynchronized
during\after key refresh procedure.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-07-04 11:01:47 +00:00
Szymon Czapracki 42a402abe3 bluetooth: audio: Rework PACS notify system
This commits eliminates the old way of
pacs notifications, replacing k_work with
simple bt_gatt_notify.

Signed-off-by: Szymon Czapracki <szymon.czapracki@codecoup.pl>
2023-07-04 11:00:38 +00:00
Jamie McCrae 3e385d9adf bluetooth: bt_gatt_subscribe: Fix documentation
Fixes a minor issue with the documentation where there are
conflicting messages about the required validity of the parameters.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-04 12:25:51 +02:00
Eric Holmberg acde5fe199 driver: gpio: fix shell blink command
The blink command should blink until the user presses a key, however on
some systems a pending keypress is present when entering the loop
causing it to immediate exit before getting a chance to blink.

Add a dummy read to clear the buffer before starting the blink loop.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2023-07-04 08:13:34 +00:00
Mariusz Skamra 03c04fd8d7 tests: Bluetooth: ascs: Fix build warning
This fixes incompatible pointer type warning.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-07-04 09:32:00 +02:00
Florian Grandel 30dab6c4f4 MAINTAINERS: add IEEE 802.15.4 drivers header file
The radio API header file was missing from the IEEE 802.15.4 maintenance
scope.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-04 09:31:40 +02:00
Florian Grandel 64eecd4488 MAINTAINERS: native IEEE 802.15.4 L2 maintenance
Introduce a new area of maintenance for the IEEE 802.15.4 native stack
as distinguished from both, IEEE 802.15.4 drivers and OpenThread and
more specialized than generic network subsystem maintainership.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-04 09:31:40 +02:00
Emil Gydesen b20ef863cd Bluetooth: OTS: Add explicit ignore of ret error when reset dir_list
When doing the bt_ots_dir_list_reset_anchor we now explicitly ignore
the return value of bt_gatt_ots_obj_manager_first_obj_get
to fix a coverity issue.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-07-04 09:30:01 +02:00
Emilio Benavente 28b6c36fc5 tests: drivers: dma: Added channel chaining support to mimxrt1050
Added test case support for the mimxrt1050_evk

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-07-04 09:29:39 +02:00
Carles Cufi ff2d9cfcb6 scripts: compliance: Fix handling of integer node items
Some node items in Kconfig can be kconfiglib.MENU or kconfiglib.COMMENT.
Those are integers and thus do not contain a node.item.name field.
Handle those separately to avoid hitting the followig exception:

Traceback (most recent call last):
  File "/home/runner/work/zephyr/zephyr/./scripts/ci/check_compliance.py",\
  line 1307, in main
    n_fails = _main(args)
  File "/home/runner/work/zephyr/zephyr/./scripts/ci/check_compliance.py",\
  line 1242, in _main
    test.run()
  File "/home/runner/work/zephyr/zephyr/./scripts/ci/check_compliance.py",\
  line 277, in run
    self.check_no_redefined_in_defconfig(kconf)
  File "/home/runner/work/zephyr/zephyr/./scripts/ci/check_compliance.py",\
  line 445, in check_no_redefined_in_defconfig
    Kconfig node '{node.item.name}' found with prompt or help in\
    {node.filename}.
AttributeError: 'int' object has no attribute 'name'

Seen in #58454.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-07-04 08:23:02 +02:00
Benjamin Perseghetti fe0efb4ea0 board: MIMXRT1062-FMURT6: Set CANFD bus-speed-data
Set the flexcan3 bus-speed-data to allow for correct CANFD data-speed.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2023-07-03 15:24:00 -05:00
Benjamin Perseghetti 3529de3349 board: MIMXRT1062-FMURT6: correct PWM prescaler
Set the PWM clock prescaler values to 64 for controlling standard servo
50Hz carrier frequency.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2023-07-03 15:24:00 -05:00
Sumit Batra 64c4d4dd5d board: MIMXRT1062-FMURT6: Add pinmux support for I2C3 module Pins
This patch adds the pinmux and pad settings for I2C3 SDA and SCL pins

Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2023-07-03 15:24:00 -05:00
Sumit Batra 5315a2e445 board: MIMXRT1062-FMURT6: Add pinmux support for FMU PPM Input
This commit adds the Pinmux and Pad settings for FMU PPM Input Pin

Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2023-07-03 15:24:00 -05:00
Benjamin Perseghetti 176d51555c soc: nxp_rt10xx: add unique PWM names.
Enable PWM to use unique device names.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2023-07-03 15:24:00 -05:00
Sumit Batra 0ae7010946 soc: rt10xx: fix the sequence of Enet2 ref clk enablement
This patch sets ENET2 ref clock to be generated by External OSC

ENET2 ref clock direction as output

ENET2 ref clk frequency to 50MHz

Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2023-07-03 15:24:00 -05:00
Sumit Batra c10b4ef301 board: MIMXRT1062-FMURT6: Removing the CONFIG_DISPLAY check in CMakeLists
This patch removes an unncessary message for presence or absence of DISPLAY

Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2023-07-03 15:24:00 -05:00
Sumit Batra 95c2dfce94 board: MIMXRT1062-FMURT6: Add pinmux support for uart ports
used for gps and telemtry.

This patch configures the correct pinmux settings for

lpuart2, lpuart3, lpuart5 ports used for gps and telemetry modules.

It also adds software pull up for the UART console port lpuart7.

Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
Co-authored-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
Co-authored-by: Iain Galloway <iaintravelgalloway@gmail.com>
2023-07-03 15:24:00 -05:00
Carles Cufi 9e0e2be765 Bluetooth: controller: Fix indent in calls to ticker_stop()
Follow-up from #59602.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-07-03 16:56:26 +00:00
Mateusz Kusiak 4337675436 Bluetooth: Controller: Ignore ticker_stop() return value
Cast ticker_stop() calls to void where return value is not checked.
This is to satisfy coverity and indicate that return value is not
important.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
2023-07-03 16:14:34 +02:00