Commit graph

74753 commits

Author SHA1 Message Date
Yasushi SHOJI d51f874158 sys/cbprintf_internal.h: Silence spurious warnings with -save-temps
Because Z_CBPRINTF_STATIC_PACKAGE_GENERIC()'s first argument can be a
static memory location and we have `-Wall`, which implicitly enables
`-Waddress`, we get the following warnings when you enable
`EXTRA_CFLAGS=-save-temps=obj`.

    $ west build -b qemu_cortex_m3 samples/hello_world -- \
          -DEXTRA_CFLAGS=-save-temps=obj
       :
       :
    zephyr/kernel/fatal.c: In function 'k_sys_fatal_error_handler':
    zephyr/kernel/fatal.c:45:1125: warning: the comparison will
    always evaluate as 'true' for the address of 'data' will never be NULL
    [-Waddress]
       45 |         LOG_ERR("Halting system");
          |
    In file included from zephyr/include/zephyr/logging/log_backend.h:9,
                     from zephyr/include/zephyr/logging/log_ctrl.h:10,
                     from zephyr/kernel/fatal.c:13:
    .../include/zephyr/logging/log_msg.h:94:17: note: 'data' declared here
       94 |         uint8_t data[];
          |                 ^~~~

The reason why you don't see this warning without the flag is that GCC
tracks tokens and suppress the warning if it's from a macro expansion.  You
can disable this feature by adding `-ftrack-macro-expansion=0`:

    west build -b qemu_cortex_m3 samples/hello_world -- \
          -DEXTRA_CFLAGS=-ftrack-macro-expansion=0

Because `-save-temps` generates .i files, all macros have been expanded and
the information has already been lost.  All GCC sees at the compilation
stage are the comparisons of static memory locations.

This commit replaces `buf != NULL` with a static inline function
`___is_null()` to silence the compiler.  By passing a static memory
location to a function, the compiler doesn't see the comparisons of a
static memory locations against literal values.  But it's still able to
optimize out in the later stage.

There is another way to silence it; By ignoring `-Waddress` with a pragma.
But its effect is the macro wide and it's too wide IMHO.  Thus, I've
decided to go with the inline function.

To add one more note: The name `___is_null()` is obviously too generic.
But let's have it here until someone finds it problematic.

This closes #51528.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2023-02-06 10:05:26 +01:00
Siyuan Cheng 575dfbf5d6 board: nsim: enable FPU for nsim_sem and nsim_em7d_v22
To run zdsp tests on nsim_sem and nsim_em7d_v22, FPU feature
is needed to be added in their nsim.props file.

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-02-06 10:05:17 +01:00
Liam Clark d3c2448b39 soc: arm: st_stm32: fix sram devicetree nodes
This commit fixes the SRAM definition for the STM32L471xx.

Signed-off-by: Liam Clark <liam.james.clark@gmail.com>
2023-02-06 10:04:17 +01:00
Krishna T 8069d47c5e net: pkt: Allow zero payload for non-IPv4/v6 frames
For socket families that are niether INET/INET6 e.g., PACKET, we cannot
estimate header length, so, if the payload is zero as well, networking
stack drop the packet.

Instead, allow for zero header + payload packets and let L2 take care of
handling them, for some L2's this is still a valid frame.

E..g, In case of Wi-Fi this is sent as 802.11 Header + LLC Header
(no payload).

Add unittests for both AF_INET + Zero payload and AF_PACKET + Zero
payload.

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2023-02-06 10:04:03 +01:00
Anas Nashif 1bed8accd1 twister: fix some pylint warnings
Unnecessary parens after '=' keyword (superfluous-parens)

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-02-06 10:03:52 +01:00
Anas Nashif 5ab9bcfdf3 twister: fix reporting and example in synopsis
Take an instance that has failed and not whatever was last processed in
the for loop.

Also, change instructions to use `west twister` rather than
`./scripts/twister` to be consistent.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-02-06 10:03:52 +01:00
Emil Gydesen c4d80f7760 Bluetooth: Audio: Shell: Fix issue with setting contexts
There was a bug where BT_AUDIO_DIR_SINK should have been
BT_AUDIO_DIR_SOURCE when setting supported contexts.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-02-06 10:03:43 +01:00
Henrik Brix Andersen 921e69af40 samples: canbus: isotp: add option for running in loopback mode
Add Kconfig option for running the CAN ISO-TP sample in loopback mode. This
removes the need for a fixture when running the sample via twister.

Exclude the loopback tests for kvaser,pcican. See
836f582664 for more information.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-02-06 10:03:31 +01:00
Andrei Emeltchenko 250f212688 modbus: Remove redundant check
ctx is the result of pointer math and never NULL.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-02-06 10:03:20 +01:00
Sam Hurst ce65f86d0a samples: usb-c: sink: Enable Dead Battery functionality on Port1
Enable Dead Battery functionality on PD Port1

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-02-06 10:03:13 +01:00
Sam Hurst cc416a8b9b usb-c: tcpc: Add support for Dead Battery
Add Dead Battery functionality to the TCPC drive

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-02-06 10:03:13 +01:00
Sam Hurst de0a64fa0d samples: subsys: usb_c: sink: Change PD port to Port1
The stm32g081b_eval board does not implement Dead Battery
functionality on PD Port2. Change the sample configuration
so that PD Port1 is used, which has Dead Battery support.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2023-02-06 10:03:13 +01:00
Lukas Woodtli 6403c02112 tests: net: coap: Add test for options
The test checks if options are added to a CoAP buffer correctly.
It should eventually check if opstions can be added out of order
e.g. not in increasing order of option codes.

Signed-off-by: Lukas Woodtli <lukas.woodtli@husqvarnagroup.com>
2023-02-06 10:02:19 +01:00
Lukas Woodtli 6a5260394b net: coap: Allow insertion of an option at arbitrary position
The insertion moves the data in the message buffer to make space for
the new option.

Signed-off-by: Lukas Woodtli <lukas.woodtli@husqvarnagroup.com>
2023-02-06 10:02:19 +01:00
Stephanos Ioannidis 7e20b81954 release: Zephyr 3.3.0-rc2
This commit sets the Zephyr version to v3.3.0-rc2.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2023-02-05 09:35:27 +09:00
Robert Lubos 432ff20a72 net: websockets: Fix websocket close procedure
The websocket implementation did not comply with the RFC 6455 when it
comes to connection close. The websocket should send in such case Close
control frame. This commit fixes this behaviour.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-02-03 10:37:57 -08:00
Robert Lubos 7f0219985d net: websockets: Fix ZFD_IOCTL_SET_LOCK handling
The websocket "socket" layer did not handle ZFD_IOCTL_SET_LOCK command,
and just forwarded it to the underlying socket. This overwritten the
mutex pointer used by the underlying socket, resulting in erroneous
behaviour in certain cases.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-02-03 10:37:57 -08:00
Andrzej Głąbek 8eba36dd56 drivers: spi_nrfx_spi[m]: Handle transaction timeouts properly
Add code that acts accordingly when a transaction does not complete
in the expected time. It makes sure that the transaction is aborted
so that no unexpected interrupt occurs afterwards and it also cleans
up after that abort so that the driver can handle further requests.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-02-03 10:34:27 -08:00
Vaishnav Achath 52ef8e44e5 MAINTAINERS: Add vaishnavachath as maintainer for TI Platforms
Add myself as a maintainer for existing TI platforms,
currently I am an employee with Texas Instruments Inc. in
the Embedded Processors software department and has worked
on the supported simplelink platforms in Zephyr for the last
2 years.

Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com>
2023-02-03 12:32:16 -05:00
Marcin Szkudlinski 44222b7dfc mtl: bugfix: tlb driver should allow remapping all unused pages
UNUSED_L2_START_ALIGNED is a marker of first page not used by the
linker. Starting from this page, the memory may be re-mapped.
assertion <= is banning remapping of the first unused page
changing to <

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-02-03 20:59:08 +09:00
Vinayak Kariappa Chettimada f00da4b0d4 Bluetooth: Controller: Fix ISO Data sn nesn on flush
Fix sn and nesn values of ISO data when starting a new burst.
When central retransmitted but did not get an ack, it did
not update the sn correctly causing the peripheral to drop
the next ISO data PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-02-03 20:54:20 +09:00
Martí Bolívar 5c0a07fcf0 doc: communication: update stale info
At this point I think it's clear that discord is more important than
email as a discussion forum for the project, so clarify that on the
communication and collaboration page.

Email is still important, though (e.g. Discord is currently not
available in China) -- and we are not deprecating it at all.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2023-02-03 20:53:37 +09:00
Anas Nashif 66fa169623 ci: do not hardcode es server in script
Use environment variable instead of hardcoding server in script. This
will allow reuse.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-02-03 20:53:20 +09:00
Anas Nashif fcd60cf789 ci: make any arch/ changes trigger kernel testing as well
This should fix issue like #54337 where architecture code changes were
filtering out kernel tests, where those changes are being tested. Kernel
and arch code is tightly coupled and we need to run kernel tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-02-03 10:09:26 +09:00
Aastha Grover 2196efe192 tests: kernel: cpu_exception: Make expected reason code generic.
Change expected reason code for cpu exception to be generic and
in compliance with a3774fd51a

Fixes #54335

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2023-02-02 18:35:01 -05:00
Marti Bolivar a2f203dd1a runners: restore obsolete synonyms for -i/--dev-id
This is a partial revert of commit
2cee5ff519
("scripts: west_commands: runners: remove deprecated options").

I remarked at the time that the removal of the older way of writing
things from the runners themselves seemed gratuitous since they are
easy to continue to support indefinitely and people may have been used
to the old way of doing things. It didn't seem worth the fight to push
for a revert at the time, though.

Since then I've run into real problems that their removal has caused
in the wild and I am convinced that this part of that patch was wrong.

Restore the original, undeprecated forms of these options, but make it
clear in the command line help that they're just obsolete alternative
spellings at this point.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-02-02 09:47:17 -08:00
Vinayak Kariappa Chettimada 278b07c971 Bluetooth: Controller: Fix addr type in PA sync established event
The address type in the periodic adveritising sync
established event is incorrectly set to 0x01
(BT_ADDR_LE_RANDOM) when the address is a resolved one,
where it should have been BT_ADDR_LE_RANDOM_ID.

The address type has been fixed by offsetting by 2 to get
BT_ADDR_LE_PUBLIC_ID or BT_ADDR_LE_RANDOM_ID when the
address has been resolved.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-02-03 02:26:42 +09:00
David Leach 871611eeee tests: net: igmp: Set allowed platforms filter
The IGMP test cases are designed to use DUMMY L2 and not on real
hardware. Add an "platform_allow" filter to only run on qemu
platforms.

Fixes #54087

Signed-off-by: David Leach <david.leach@nxp.com>
2023-02-03 02:25:54 +09:00
Armin Brauns 22430ef8c4 net: ipv6_nbr: count outgoing ND packets as sent ICMP packets
This mirrors the behaviour of MLD packets, the only other ICMPv6 subtype
that is tracked separately.

Inbound ND packets are already counted as received ICMP packets by way of
going through the ICMP receive path.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-02-03 02:25:14 +09:00
Armin Brauns abd4dd4cc5 net: ipv6_nbr: don't count incoming Neighbour Advertisements in sent stats
This caused outgoing MAC address lookups to count as one received and two
sent Neighbour Discovery packets, when it's really one sent Neighbour
Solicitation and one received Neighbour Advertisement.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-02-03 02:25:14 +09:00
Mahesh Mahadevan 5d7051f173 drivers: kscan: Fix the kscan gt911 driver
Update the calculation of the row and column.
Issues were seen when running the LVGL sample.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-02-03 02:24:48 +09:00
Mahesh Mahadevan b2eeecfee0 boards: mimxrt1170_evk: Display configuration updates
1. Enable the input KSCAN device when LVGL is enabled
2. Add LVGL related configuration options

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-02-03 02:24:48 +09:00
Guillaume Gautier 645d91b028 soc: arm: st_stm32: common: Increase the value of HW semaphore retry
When running the blinky example on STM32H747, with the BOOT_CM4 bit set
to 0, the M4 core goes into panic.
Increasing the value of the hardware semaphore retry prevents this.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-02-03 02:22:22 +09:00
Bjarki Arge Andreasen 55aa282cdf net/net_pkt: Fix is_ppp dependency issue
The functions net_pkt_is_ppp() and net_pkt_set_ppp() are used by
both the l2 ppp subsystem (NET_L2_PPP) and the ppp uart based driver
(NET_PPP), but the function is only included when NET_PPP is enabled.

the l2 ppp subsystem does not depend on the uart based PPP driver, the
ppp uart driver does however depend on the l2 ppp subsystem. Including
the two functions should therefore be dependent on if the l2 ppp
subsystem is enabled using the symbol CONFIG_NET_L2_PPP instead of the
symbol CONFIG_NET_PPP

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-02-03 02:19:45 +09:00
Robert Lubos e540a98331 net: shell: Validate pointer provided with net pkt command
The net_pkt pointer provided to net pkt commands was not validated in
any way. Therefore it was fairly easy to crash an application by
providing invalid address.

This commit adds the pointer validation. It's checked whether the
pointer provided belongs to any net_pkt pools known to the net stack,
and if the pointer offset within the slab actually points to the
beginning of the net_pkt structure.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-02-03 02:14:32 +09:00
Evgeniy Paltsev c85e5438b9 ARC: west runner: mdb-hw: fix incorrect argument handling for jtag
Currently we just pass in case of the unsupported jtag adapter
is selected. Fix that by rising ValueError as we do in case of
other incorrect arguments.

While I'm at it add few missing test-cases for mdb west runners.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-02-02 09:05:18 -08:00
Evgeniy Paltsev 963c7a2d40 ARC: west runner: mdb: fix unexpected empty argument pass to MDB
Currently, in case of multi-core target or in case jtag adapter
auto-selectio, we pass unexpected empty argument (empty quotes `''`)
to MDB binary due to argument generation error.

Fix that.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-02-02 09:05:18 -08:00
Andries Kruithof 5329319d7a Tests: bluetooth: Fix failing df unittests
Due to recent refactoring following unittests are failing:
tests/bluetooth/df/*
tests/bluetooth/ctrl_user_ext

This commit fixes these by adding the include files containing the
missing type definitions

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-02-02 17:59:45 +01:00
Stephanos Ioannidis f05229c6bc MAINTAINERS: Change CI maintainer order
This commit places @stephanosio, the current CI maintainer, at the top
of the maintainer list for the "Continuous Integration" area such that
all CI-related PRs get assigned to @stephanosio.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2023-02-02 07:57:59 -08:00
Jonathan Rico c2e4029aad Bluetooth: host: resume advertising even when BT_EXT_ADV=y
When using extended advertising commands, the advertising set is not
considered to be over until we receive `BT_HCI_EVT_LE_ADV_SET_TERMINATED`
from the controller. Only then do we clear the `BT_ADV_ENABLED` flag.

The problem is that `bt_le_adv_resume` is called on connection established,
which can happen before adv set terminated, and in that case it will
early-return because `BT_ADV_ENABLED` is still set.

This change triggers `bt_le_adv_resume` when we get
`BT_HCI_EVT_LE_ADV_SET_TERMINATED`.

Fixes #53048

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-02-02 17:05:48 +02:00
David Leach ca843964f6 boards: arm: frdm_k64f: Set TEST_EXTRA_STACK_SIZE
The RTIO API test case needs a little extra stack size when run
on the frdm_k64f platform.

Fixes #54086

Signed-off-by: David Leach <david.leach@nxp.com>
2023-02-02 20:24:20 +09:00
Peter Mitsis 7eb27d580b tests: kernel: Add events to object tracking
Adds a test for kernel event object tracking.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-02-02 20:21:12 +09:00
Peter Mitsis 04daf752b9 doc: tracing: Include events in the documentation
Updates the tracing documentation to include a mention about the
event tracking list.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-02-02 20:21:12 +09:00
Peter Mitsis cbc3e5c999 tracing: Add event tracing to sysview
Adds event tracing to sysview. This will allow the event related
tracing symbols to be found when CONFIG_SEGGER_SYSTEMVIEW is
enabled.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-02-02 20:21:12 +09:00
Peter Mitsis bdb49f21ad tracing: Resolve undefined event symbols
Fixes various unresolved symbols when kernel event object tracking
is enabled via CONFIG_TRACING=y.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-02-02 20:21:12 +09:00
Seppo Takalo d0dc67a72d net: lwm2m: Fix native_posix fcntl() calls
Native POSIX target still needs to use the <fcntl.h> header
instead of <zephyr/posix/fcntl.h>

Also removed the include from various files that did not use it.

Also changed fcntl() calls to zsock_fcntl() because we directly
use zsock_* calls elsewhere.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-02-02 20:05:08 +09:00
Francois Ramu 78281132ba boards: arm: stm32f334 nucleo with pyocd and cubeprogrammer as runner
Add the pyocd ant the stm32cubeprogrammer as a runner
of the nucleo_f334r8 platforms,
when the openocd gives an flashing error.
Add the pyocd pack if needed : 'pyocd pack install stm32f334

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-02-02 10:35:17 +00:00
Francois Ramu bc95d19305 boards: arm: stm32f303 nucleo with pyocd and cubeprogrammer as runner
Add the pyocd ant the stm32cubeprogrammer as a runner of the
nucleo_f303k8 platforms,
when the openocd gives an flashing error.
Add the pyocd pack if needed : 'pyocd pack install stm32f303'

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-02-02 10:35:17 +00:00
Francois Ramu 0262d33478 soc: arm: stm32f3 enable Debug Module during SLEEP mode
This patch allows successive reflashing operation on stm32f3
boards by Enabling the Debug Module during SLEEP mode.
This will especially makes reflahing and debugging possible
with pyocd runner on west commands.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-02-02 10:35:17 +00:00
Vinayak Kariappa Chettimada de2029ac58 Bluetooth: Controller: Fix missing DF related radio register reset
Fix missing DF related Radio register reset on radio_reset().

Regression in commit 465a96181d ("Bluetooth: Controller:
Explicitly set all bits of used radio registers") due to the
removal of NRF_RADIO->POWER register use that was used to
reset all Radio registers on every new Radio Event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-02-02 11:15:44 +01:00