Commit graph

60233 commits

Author SHA1 Message Date
Henry Hsieh
58d50a0e97 riscv: fix non-standard assembly of RISC-V
Non-standard `jalr rd, rs` pseudo-instructions are used.
This commit changes them to `ret` for standard return pseudo-instruction
or `jalr rd, rs, 0` for no offset jump register and link.

Fixes #41100.

Signed-off-by: Henry Hsieh <r901042004@yahoo.com.tw>
2022-02-04 11:23:39 +01:00
Berend Ozceri
9edb8e2afb mgmt: smp: Fix NULL pointer dereferences in UDP transport.
Guard call to k_thread_abort() to ensure it's not called with an
uninitialized thread and fix improper use of inet_pton() with
INADDR_ANY passed in place of a dotted-decimal string. Both of these
would otherwise lead to NULL pointer dereferences.

Signed-off-by: Berend Ozceri <berend@recogni.com>
2022-02-04 11:23:16 +01:00
Thomas Ebert Hansen
07193f04c3 codeowners: Add Bluetooth controller tests
Add Bluetooth controller tests directory and set it to Bluetooth
controller maintainer (cvinayak) and the Bluethooth controller LLCP
refactoring team.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-02-04 11:23:05 +01:00
Martí Bolívar
efc0e75463 samples: blinky: use a gpio_dt_spec
Using a gpio_dt_spec is the current best practice for getting at pins
defined in the DT, because it gets all the boilerplate and flags right
for you. Use that in blinky, keeping the documentation in sync with
the code.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-02-04 11:20:46 +01:00
Martí Bolívar
c0cc6c7ba2 dts: bindings: gpio-leds: improve description
This is the compatible which is used in the blinky sample, so
it's worth trying to add a better example for what you can do with it
in general in the main description.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-02-04 11:20:46 +01:00
Martí Bolívar
baf2e7f3c5 api: gpio: add missing member docstrings for gpio_dt_spec
This makes the breathe output for this type useful.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-02-04 11:20:46 +01:00
Guillaume Lager
4d777b43fd drivers: modem: Fix loop variables type
int was used regardless of the type used in the
end-loop condition

Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
2022-02-04 11:19:28 +01:00
Vinayak Kariappa Chettimada
8f444e490c Bluetooth: Controller: Fix missing offset adjust field assignment
Fix missing offset adjust field assignment in the Periodic
Advertising's sync_info struct that is present in the
Extended Advertising PDU.

When the sync offset is equal or over 2.4576 seconds from
the Extended Advertising PDU, then the sync offset has to
be reduced by 2.4576 seconds and the offs_adjust flag be
set in the sync_info field.

This fixes a bug where Periodic Synchronization could not
be established for Periodic Advertisings with intervals
greater than 2.4576 seconds as the sync offset was
incorrect due to rollover in the 13-bit offset field.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-02-04 11:19:14 +01:00
Marin Jurjević
2f4ab97168 net: lwm2m: add missing optional resource to firmware object
Firmware Update Protocol Support resource initialization
has been left out in #41402.
Initialise the resource in object creation function.

Signed-off-by: Marin Jurjević <marin.jurjevic@hotmail.com>
2022-02-04 11:19:07 +01:00
Erwan Gouriou
9b704f520c west.yml: Fix issue with stm32wb ble library
Point to the commit fixing the issue that prevents
to establish ble connection on stm32wb

Fixes #42367

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-02-04 11:18:40 +01:00
David Leach
cbdc8652ff doc: release: Update 3.0 release notes with NXP changes
Capture SOC and board additions plus any support updates.

Signed-off-by: David Leach <david.leach@nxp.com>
2022-02-04 11:18:26 +01:00
Herman Berget
c537ac6aa3 Bluetooth: Host: Disallow sending unsupported MTU Exchange
The Exchange MTU sub-procedure shall only be supported on the
LE Fixed Channel Unenhanced ATT bearer.

This was checked when receiving, but sending was allowed.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-02-04 11:18:13 +01:00
Asbjørn Sæbø
73f5ffcf4e Bluetooth: Audio: Fix timeout message in BabbleSim tests
Update the WAIT_TIME definition and timeout-message so that the time
out message actually prints the elapsed time instead of "0".

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-02-04 11:17:08 +01:00
Asbjørn Sæbø
f7cd6afb79 Bluetooth: Audio: Align time-outs in babblesim tests
Increase the simulation lengths in the test scripts (where needed) to
be longer than the WAIT_TIME defined in common.h, so that simulations
will not end before the test has a chance to do proper time out.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-02-04 11:17:08 +01:00
Abe Kohandel
4ce354a382 bluetooth: ots: directory listing record length
The directory listing's record length should not reflect the size of the
directory listing object. This field is only the size of the directory
listing entry in the directory object and is intended to help a client
find the next record entry in the list.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2022-02-04 11:15:37 +01:00
Vinayak Kariappa Chettimada
7570af6c94 Bluetooth: Controller: Avoid reporting IQ samples after terminate
Avoid reporting IQ samples after terminate.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-02-04 11:15:07 +01:00
Daniel Leung
77f832fde3 samples: logging/syst: expand to doing v1/v2 immediate/deferred
This expands the sample to do both v1 and v2, and both immediate
and deferred modes for each logging verion. This is to make sure
MIPI Sys-T output is not broken for all combinations. Default is
v2/immediate using prj.conf. Deferred mode is enabled via
overlay.

Also add qemu_x86 as an allowed platform as the samples are
working there too.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-04 11:14:55 +01:00
Daniel Leung
579829776a logging: syst: fix logging v2 with strings as arguments
The packaged string coming from logging subsys requires some
additional processing if there are string arguments.
These strings are actually embedded inside the package so
the string pointers inside the argument list must be
replaced with pointers to strings inside the package.
Without this extra step of processing, MIPI Sys-T's printf
function would process these arguments directly which may be
NULL pointers or invalid one pointing to somewhere.

This utilizes the new cbpprintf_external() for the processing
before feeding data to the MIPI library.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-04 11:14:55 +01:00
Daniel Leung
e2f109456c lib/os: cbprintf_packaged: add ability to use external formatter
This adds to the cbprintf_packaged library to allow external
formatters to be used by the way of callback. This will allow
logging backends to use their own formatter for output if
needed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-04 11:14:55 +01:00
Daniel Leung
6eb3cc11e2 samples: logging/syst: add more lines to show string processing
This adds a few log lines to show how string processing works
with Sys-T.

Note that CONFIG_LOG_BLOCK_IN_THREAD=y to make sure all log
messages are printed instead of being dropped.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-04 11:14:55 +01:00
Wouter Cappelle
c9c32b2391 driver: entropy: stm32: Fix health dts properties
The properties from dts to driver were not translated
correctly from - to _. This PR fixes this

Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
2022-02-04 11:14:44 +01:00
Guillaume Lager
5387c25e81 shell: Add test for dictionary command
The test also check that dictionary set with matching
items can be declared

Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
2022-02-04 11:14:21 +01:00
Guillaume Lager
ac298bcde7 shell: Fix dictionary command naming
Add the handler function's name to the generated
sub command handler. Without it, it's not possible
to generate to dictionary matching items in a file.

Fixes #42398

Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
2022-02-04 11:14:21 +01:00
Dominik Ermel
0905e8e32f mgmt/mcumgr/lib: Fix message_size not updated
The commit fixes smp_process_request_packet failing to decrement
message_size, of read stream, by number of bytes it trims from
an input buffer.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-02-04 11:14:08 +01:00
Torsten Rasmussen
0454351001 cmake: fix DEPENDS issues for kobject hash targets
Fixes: #42184

This commit fixes dependency issues related to kobject hash generation.

Absolute path is ensured in cases where OUTPUT was provided with
absolute path, as `${CMAKE_CURRENT_BINARY_DIR}`.
DEPENDS referring to same file has been updated to also use
`${CMAKE_CURRENT_BINARY_DIR}` to ensure they reference identical
locations.

The custom command renaming sections in kobject_hash.o and creating
kobject_hash_renamed.o has been updated to depends on the target objects
of kobj_hash_output_lib in addition to the library itself.
This is needed because kobj_hash_output_lib is not a real library, and
thus no library is updated when this target rebuilds.
Instead the dependency must be on the object files created by
kobj_hash_outplut_lib. This ensures that when object files gets rebuilt
then the section renaming will also take place.
The reason why both the object library itself, and its object files are
required as dependencies has to do with build generators.
The library is needed to ensure Makefiles can correctly have a target to
invoke when the output of the custom command is missing. The object
files dependency is required to ensure that custom commands are
correctly brought up-to-date when the objects changes.

Similar, the custom command executing gen_kobject_placeholders.py
depending of kobj_prebuilt_hash_output_lib has been updated to also
depend on the object files created by kobj_prebuilt_hash_output_lib.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-02-04 11:13:51 +01:00
Ryan Erickson
a9eead1824 modem: hl7800: only send null packet for TCP
Only TCP sockets should send a NULL packet
if the server closes the connection or there
is a socket error.
UDP sockets do not need to do this because
they are connectionless.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-02-04 10:57:15 +01:00
Daniel Nejezchleb
208927d640 net: tcp: Fixed forever loop in tcp_resend_data
Increments send retry every time
after the tcp_send_data when resending.
That way unhandled return values can time
out after set amount of tcp_retries.

Signed-off-by: Daniel Nejezchleb <dnejezchleb@hwg.cz>
2022-02-04 10:56:25 +01:00
Attie Grande
24478c8a4d drivers: adc: adc_sam0: Change local variables to lower case
Local variables should not be in capitals.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-02-04 10:49:09 +01:00
Attie Grande
e4d4eaca03 soc: atmel_sam0: Implement fixup.h for ADC driver
The ADC driver now supports three different implementations. To maintain
readability, this patch implements an adc_fixup.h that permits more
generic access to relevant registers.

This patch also introduces support for a new third shape ADC - as found
in the SAML21 for example.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-02-04 10:49:09 +01:00
Attie Grande
ec1ab6d104 samples: drivers: adc: Add a device tree overlay for atsamd21_xpro
Add a basic device tree overlay to support the use of the ATSAMD21 XPro
dev board with the ADC sample application.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-02-04 10:49:09 +01:00
Attie Grande
c53a1e8b32 samples: drivers: adc: Revise handling of configurable inputs
All drivers that require input_positive to be set should be given it.
Some parts may require an offset, so abstract this away too.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-02-04 10:49:09 +01:00
Attie Grande
d45a9a11b7 drivers: adc: adc_sam0: Fix interpretation of channels
Previously this was expected to be equal to 1 at all times. This doesn't
play well with the sample or other users (e.g: adc_shell). Instead, we
should count the number of active channels in the bitfield, and ensure
that only one is identified.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-02-04 10:49:09 +01:00
Martí Bolívar
f86f6e0025 devicetree: clocks: fix a docstring
Fix the formatting and what looks like a copy/paste error
in the DT_CLOCKS_CTLR_BY_NAME doxygen docstring.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-02-03 14:19:16 -06:00
Henrik Brix Andersen
127c621275 doc: releases: 3.0: add EEPROM related release notes
Add EEPROM related release notes for Zephyr v3.0.0.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-02-03 14:08:46 -06:00
Jonathan Hahn
623bee2e68 doc: devicetree: fix broken link in api.rst
The devicetree binding link for fixed-partitions was
broken.

Signed-off-by: Jonathan Hahn <Jonathan.Hahn@t-online.de>
2022-02-03 14:01:25 -06:00
Kevin Townsend
43a97c84bd doc: releases: 3.0: add TF-M release notes
Mention update to TF-M 1.5.0 in Zephyr 3.0.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2022-02-03 13:59:51 -06:00
Alexander Mihajlovic
bd4ddec0c8 usb: Add macro for user defined string descriptors
The new macro USBD_STRING_DESCR_USER_DEFINE works like
USBD_STRING_DESCR_DEFINE with the exception of being
ordered strictly after it. The new macro is needed to
ensures that user defined string descriptors can be added
without disturbing the order of string descriptors
defined by the usb subsystem.

Signed-off-by: Alexander Mihajlovic <a@abxy.se>
2022-02-03 14:57:42 +01:00
Piotr Pryga
281ad2102e Bluetooth: Controller: Make PHY check in conn mode Kconf dependent
Constant Tone Extension may not be transmittied with PHY CODED.
There were check to avoid situation that controller tries to
transmit or receive CTE when PHY is set to CODED.
These check were not conditionally compilated, hence when
PHY Update feature is disabled code did build.

The commit fixes the issue.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-03 14:57:17 +01:00
Piotr Pryga
8f59477dc6 Bluetooth: host: df: Fix wrong HCI cmd buf size for RX params set
In case the direction finding RX is enabled but without Angle
of Arrival functionality enabled, there HCI command buffer
had wrong command length assigned. It didn't take into account
two dummy antenna IDs provided to fulfil requirement from
BT 5.3 Core Vol 4, Part E sections: 7.7.82, 7.7.85.

HCI driver when received such command buffer, didn't handle it
due to wrong command length.

The commit fixes the problem.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-03 14:57:17 +01:00
Piotr Pryga
48313ef4df Bluetooth: common: Kconfig: Extend EVT buf size to store IQ samples
BT_BUF_EVT_RX_SIZE size by default was set to 68 bytes.
In case of build with direction finding connected mode receiver
enabled the size of event buffer was not enough to store all
IQ samples. In such situation IQ samples reports were not delivered
to Host.

The commit changes default size of event RX buffer to 255 in
case the BT_DF_CONNECTION_CTE_RX is enabled.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-03 14:57:17 +01:00
Piotr Pryga
8f56d4ee19 samples: Bluetooth: df: Remove dep on CTLR Kconf in sample sources
Direction finding samples had dependency on KConfig option defined
in Controller. That caused a problem for split builds where
an application and host are not part of the same binary as
controller. The code dependend on the Kconfig option
was always disabled.

To fix that issue new Kconfig options were introduced to
Host. The dependency is removed. Unwanted features may stil be
disabled and samples binaier will be smaller.

The commit aligns all direction finding samples code.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-03 14:57:17 +01:00
Kim Bøndergaard
5bed77a611 sys: sys_heap: extern "C" was missing
In order to use functions orginating from C libs in C++ context, their
definitions must be declared as "C" functions

Signed-off-by: Kim Bøndergaard <kim@fam-boendergaard.dk>
2022-02-03 08:23:16 -05:00
Andrey Borisovich
770070725a soc: xtensa: Replaced /dev/null in scripts
Modified Xtensa soc intel_adsp to use nul when building on Windows host
and /dev/null when on Linux.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-02-03 07:59:55 -05:00
Carles Cufi
7107f7a00d doc: guides: Building the documentation
Add a couple of missing Arch packages for the .pdf build.

Fixes #41887.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-03 07:32:43 -05:00
Yong Cong Sin
731241f8d0 kernel: workq: Fix type errors in delayable work handlers
A common pattern here was to take the work item as the subfield of a
containing object. But the contained field is not a k_work, it's a
k_work_delayable.

Things were working only because the work field was first, so the
pointers had the same value. Do things right and fix things to
produce correct code if/when that field ever moves within delayable.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2022-02-02 18:43:12 -05:00
Daniel Leung
6964f2b130 doc: toolchain: add a few words about XCC
This adds a few words about setting up XCC.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-02 18:39:24 -05:00
Julien Massot
f5f61ac605 debug: Add back openocd alias
OpenOCD is still using these alias, until we fix OpenOCD
upstream we should keep them.

This partially reverts commit
1a7bc06086.

Signed-off-by: Julien Massot <julien.massot@iot.bzh>
2022-02-02 14:34:41 -05:00
Daniel DeGrasse
ed5e06420e boards: mimxrt1170_evk_cm7: Reduce DAT3 power toggle delay
dat3 power toggle delay was unreasonably long. Reduce it to a more
reasonable amount of system clock cycles.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-02-02 16:59:30 +01:00
Daniel DeGrasse
419dc385f2 drivers: usdhc: Add log for DAT3 detection
Add log to tell user when DAT3 detection method is in use

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-02-02 16:59:30 +01:00
Daniel DeGrasse
5dfd3c3786 soc: rt10xx: Set divisor for sys pll (PLL2) PFD0
Divisor must be set to calculate SD host controller clock frequency in
clock driver.

Fixes #42380

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-02-02 16:59:30 +01:00