Commit graph

63866 commits

Author SHA1 Message Date
Yong Cong Sin 94624dc0c5 drivers: sensor: stm32_temp: No need to calibrate ADC
The ADC should be calibrated on init, there is no requirement
to calibrate ADC again on stm32_temp_init, remove it.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2022-04-29 16:10:51 +02:00
Veijo Pesonen d8b7449b52 net: lwm2m: SenML CBOR key ordering
Keys' order - bn, n - might differ from the default due to
Length-First Map Key Ordering rules.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-04-29 16:10:43 +02:00
Veijo Pesonen 975d170792 net: lwm2m: use stack for SenML CBOR data
Formatter data are is shared between different threads.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-04-29 16:10:43 +02:00
Veijo Pesonen a1bd90646e net: lwm2m: adds README
Includes instructions for generating the SenML CBOR encoder and
decoder.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-04-29 16:10:43 +02:00
Veijo Pesonen 98b22a1850 net: lwm2m: SenML CBOR optimisations
Regenerates the encoder and decoder. Treats integers and floating-point
values as separate entities instead of saying that those are numerical
values. Brings some memory savings.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-04-29 16:10:43 +02:00
Veijo Pesonen b78dd2498a net: lwm2m: Sets ct to registration msg
Tells the server which content format is preferred in a registration
message.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-04-29 16:10:43 +02:00
Veijo Pesonen 4f76b194a4 net: lwm2m: empty CBOR array support
Makes possible to write an empty CBOR array if there are no SenML CBOR
records that needs to be written. This came up when trying to delete a
portfolio object instance.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-04-29 16:10:43 +02:00
Veijo Pesonen aa42e3e238 net: lwm2m: enable SenML CBOR
With LwM2M v1.1 SenML CBOR is preferred over SenML JSON.

TLV is on by default only with v1.0.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-04-29 16:10:43 +02:00
Veijo Pesonen 60eaafe293 net: lwm2m: SenML CBOR gencode adaption
Generated code needs some modifications for it to work correctly.

Adds license information.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-04-29 16:10:43 +02:00
Veijo Pesonen 0562de9fbe net: lwm2m: SenML CBOR RW support
* LwM2M v1.1 SenML CBOR content format support.
* Composite operations
* SEND functionality

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-04-29 16:10:43 +02:00
Lingao Meng 2ef96e2f66 Bluetooth: Host: Fix unable cleanup conn
The peripheral is configured to update the connection
parameters for 5 seconds by default.

There is an abnormal situation with a very low probability.

The central actively disconnects or abnormally disconnects the
Bluetooth connection at the same time.

At this time, the connection disconnection event will be
handled by BT RX.

At this time, sysworkq has sent a parameter update request and
will receive a reply with status = 0x02, because the handle is
invalid at this time.

We can not just cancel work, because work->flag may be
in K_WORK_RUNNING, so work->flag is set to K_WORK_CANCELING
and subsequent conn_cleanup will unable call k_work_rescheduler
successfully.

According submit_to_queue_locked will return ret = -EBUSY.

	if (flag_test(&work->flags, K_WORK_CANCELING_BIT)) {
		/* Disallowed */
		ret = -EBUSY;
As a result, the connection cannot be cleanup correctly.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-04-29 15:35:10 +02:00
Adrien Rouault bc47f66062 drivers: lora: sx127x: fix missing reset gpio instantiation
Instantiate the value of `sx127x` reset GPIO

Signed-off-by: Adrien Rouault <adrien.rouault@nemeus.fr>
2022-04-29 15:30:10 +02:00
Nicolas Pitre f51d89df30 riscv: pmp: work around a QEMU bug
The NAPOT mode isn't computed properly in qemu when the full address
range is covered. Let's hardcode the value that the qemu code checks
explicitly until the appropriate fix is applied to qemu itself.

For reference, here's the qemu patch:
https://lists.gnu.org/archive/html/qemu-devel/2022-04/msg00961.html

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-04-29 15:30:00 +02:00
Nicolas Pitre 5e002e8d7d riscv: linker: align end of ROM area to a "page" boundary for QEMU
QEMU does its dynamic instruction translation in 4096-byte-sized chunks.
Therefore it doesn't vet PMP access for each instruction prefetch but
for the whole "page" at once. If the end of the ROM area lands in the
middle of such a page with a corresponding PMP entry then any instruction
access within that page will fault even if it is located in the PMP
mapped portion.

To work around this QEMU peculiarity, we simply align the end of the ROM
area to a page boundary.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-04-29 15:30:00 +02:00
Nicolas Pitre ec9c2ec2d8 riscv: pmp: rename CONFIG_PMP_SLOT
The plural form is clearer.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-04-29 15:30:00 +02:00
Nicolas Pitre 554f24661f riscv: pmp: remove previous implementation
Overall diffstat with the new PMP code in place:

 18 files changed, 866 insertions(+), 1372 deletions(-)

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-04-29 15:30:00 +02:00
Nicolas Pitre 2fece49a14 riscv: pmp: switch over to the new implementation
Add the appropriate hooks effectively replacing the old implementation
with the new one.

Also the stackguard wasn't properly enforced especially with the
usermode combination. This is now fixed.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-04-29 15:30:00 +02:00
Nicolas Pitre 7a55bda7e1 riscv: pmp: add new usermode support
The idea here is to compute the PMP register set on demand i.e. upon
scheduling in the affected threads, and only if changes occurred.
A simple sequence number is used to stay in sync with the latest update.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-04-29 15:30:00 +02:00
Nicolas Pitre 68b8f0e5ce riscv: pmp: new stackguard implementation
Stackguard uses the PMP to prevents many types of stack overflow by
making any access to the bottom stack area raise a CPU exception. Each
thread has its set of precomputed PMP entries and those are written to
PMP registers at context switch time.

This is the code to set it up. It will be connected later.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-04-29 15:30:00 +02:00
Nicolas Pitre 2e66da3bc3 riscv: pmp: new implementation
This is the core code to manage PMP entries with only the global entries
initialisation for now. It is not yet linked into the build.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-04-29 15:30:00 +02:00
Krzysztof Chruscinski 3b990c9ddd samples: shell: shell_module: Add section subcommands
Extend sample to show how to use alternative approach of adding
subcommands using new APIs: SHELL_SUBCMD_SET_CREATE, SHELL_SUBCMD_ADD
and SHELL_SUBCMD_COND_ADD.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-04-29 14:54:08 +02:00
Krzysztof Chruscinski a15274839a tests: shell: Add test for section commands
Added test for new macros in the API for adding subcommands:
SHELL_SUBCMD_SET_CREATE, SHELL_SUBCMD_ADD and SHELL_SUBCMD_COND_ADD.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-04-29 14:54:08 +02:00
Krzysztof Chruscinski 3ee5c57934 shell: Add new way of adding subcommands
Added macro SHELL_SUBCMD_SET_CREATE which creates a set of subcommands.
SHELL_SUBCMD_ADD and SHELL_SUBCMD_COND_ADD can be used from any file to
add command to the set. This approach allows to have subcommands added
from multiple files.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-04-29 14:54:08 +02:00
Henrik Brix Andersen 270dea717c dts: bindings: can: stm32*: fix descriptions
Fix the descriptions for the ST STM32 FDCAN devicetree bindings. These
are derivates of the Bosch M_CAN, but they target specific SoC
implementations.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-29 05:04:42 -07:00
Henrik Brix Andersen f1d1153543 dts: bindings: can: rename base Bosch M_CAN binding and compatible
Rename the base Bosch M_CAN CAN-FD controller devicetree binding to
match the product name and the upstream Linux devicetree binding.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-29 05:04:42 -07:00
Henrik Brix Andersen 44817099ad dts: bindings: can: mcan: fold the simple binding into front-end bindings
Fold the simple bosch,m-can devicetree binding into the front-end
devicetree bindings. The bosch,m-can compatible is not used in Zephyr.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-29 05:04:42 -07:00
Henrik Brix Andersen 44f3f2e49b drivers: can: initialize CAN transceivers prior to CAN controllers
Change the default initialization priority for CAN transceiver from 70 to
45 to initialize them before the CAN controllers (with default a
initialization priority of 50).

Fixes: #45219

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-04-29 12:34:28 +02:00
Evgeniy Paltsev 9ce0d31c33 ARC: SMP: debug: workaround MDB changing debug_select value
MDB debugger may modify debug_select and debug_mask registers
on start, so we can't rely on debug_select reset value.

Let's set correct value on primary CPU without reading initial
value from debug_select.

Internal ID: P10019563-50516

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2022-04-29 12:34:21 +02:00
Juha Heiskanen 1b10f8345e net: lwm2m: LwM2M RD client registration update failure fix
Client jump to full registration state if registration update fail.
Update keep already opened DTLS session.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2022-04-29 08:57:30 +02:00
Juha Heiskanen f20eeebbd1 net: lwm2m: DTLS session cache enable and queue mode update
Enabled DTLS session cache for support session resume.
Fixed LwM2M queue mode for close connection and reconnect automatically.
Re-connect will do Registration update before it send queued data.
Session resume is helping a case when NAT change address and cause less
network traffic.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2022-04-29 08:57:30 +02:00
Juha Heiskanen 5249e43e54 net: coap: Coap pending allocation fix
When sending 2 or more confirmable message before first one is
writed to socket all messages use same coap pending structure.
Now coap_pending_init() set data pointer which lock allocation
by each call.

Using data pointer for detecting free is more stable than timeout.
Timeout is initialized only before first socket send. Queued packet
may be triggered later than other and may cause that same block is
allocated multiple time.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2022-04-29 08:57:30 +02:00
Stephanos Ioannidis e6629abcb0 cmake: Correct PATHS usage
`PATH` is not a valid option for `find_program`; correct all such
usages to `PATHS`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-04-29 08:57:21 +02:00
Stephanos Ioannidis fbe8a673d4 MAINTAINERS: Add Toolchain Integration entry
This commit adds the MAINTAINERS entry for the Toolchain Integration,
with @tejlmand as the maintainer and @stephanosio as a collaborator.

The purpose of this is to provide a corresponding MAINTAINERS entry for
the "area: Toolchains" and differentiate the toolchain integration-
related maintenance tasks from the general build system maintenance
tasks.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-04-29 08:57:09 +02:00
Vinayak Kariappa Chettimada 2da7a8d786 samples: Bluetooth: hci_rpmsg: Fix Broadcast and Sync Receiver prj conf
Fix Broadcast ISO and Synchronized Receiver project
configurations related to IPC use.

Relates to commit cf6a58d3f6 ("bluetooth: hci: rpmsg:
use ipc service library").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-04-29 08:57:02 +02:00
Francois Ramu 41efe865ed drivers: dma: stm32 dma driver valid override control
This change is controlling of function parameters before
configuring the STM32_DMA_HAL_OVERRIDE mode.
Then, in case the DMA channel is not valid (wrong ID) or busy,
an error occurs before overriding the DMA channel.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-04-29 08:56:55 +02:00
Esteban Valverde 426c1f6aff drivers: i2c: Fix get_regs() to happen after DEVICE_MMIO_MAP
Fixing a bug where get_regs() was being executed before MMIO mapping
moving the declaration of reg_base after DEVICE_MMIO_MAP

Signed-off-by: Esteban Valverde <esteban.valverde.vega@intel.com>
2022-04-29 08:56:49 +02:00
Daniel DeGrasse b0ec63fe01 drivers: led_pwm: fix build error
Remove stray parenthesis causing build error in led_pwm driver.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-04-29 08:56:42 +02:00
Leonard Pollak f7171e20b3 tests: drivers: Add bme680-spi to build_all
Add BME680 (SPI) sensor driver to build_all tests.

Signed-off-by: Leonard Pollak <leonardp@tr-host.de>
2022-04-28 18:11:50 +02:00
Leonard Pollak 35b55175cc drivers: sensor: bme680: Add SPI interface
This enables the SPI interface for the BME680 sensor driver.

Signed-off-by: Leonard Pollak <leonardp@tr-host.de>
2022-04-28 18:11:50 +02:00
Leonard Pollak 4e804bfa73 drivers: sensor: bme680: prep work
Consolidate the initialization routines and change the include guard to
conform with the coding guidelines as a preparation for the following
commits which add support for the SPI interface.

Signed-off-by: Leonard Pollak <leonardp@tr-host.de>
2022-04-28 18:11:50 +02:00
Leonard Pollak 8e7907aa6f drivers: sensor: bme680: fix constants
This fixes the constant for the mem page and replaces a
magic number with the already defined `BME680_LEN_COEFF2` constant.

Signed-off-by: Leonard Pollak <leonardp@tr-host.de>
2022-04-28 18:11:50 +02:00
Carlo Caione 69b28bfd07 pm: policy: Consider substates for state lock functions
Extend the current pm_policy_state_lock_*() functions to support
substates.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-04-28 16:32:23 +02:00
Øyvind Rønningstad 619fce9e0f modules: zcbor: kconfig: Disallow ZCBOR_VERBOSE with MINIMAL_LIBC
Because Minimal LIBC doesn't have PRIuFAST32 and PRIxFAST32 which is
needed when printing traces in zcbor.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2022-04-28 16:18:28 +02:00
Gerard Marull-Paretas 04836af2a9 drivers: pwm: shell: fix pwm_set calls
PWM has a single set function now, macros like PWM_USEC() can be used to
specify other units than nanoseconds. This conversion was missed during
API updates.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-28 09:08:41 -04:00
Gerard Marull-Paretas 61f2ed8356 drivers: pwm: shell: fix struct variable name
The pwm field in struct args_index was missed when pwm was renamed to
channel in all drivers. As a result, the PWM shell could no longer be
built.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-28 09:08:41 -04:00
Stephanos Ioannidis 9b1a0e70bc editorconfig: Improve verbosity
This commit adds missing `indent_size` configurations for some file
types.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-04-28 08:55:39 -04:00
Stephanos Ioannidis 3a7cf87821 editorconfig: Add C++ indentation style
This commit adds the indentation style for the C++ source and header
files.

Note that the C++ indentation style has been configured to match that
of the C files because the C++ source files we currently have in the
Zephyr repository follow the style we enforce for the C files.

In the future, it may be preferable to follow the indentation style
recommended by one of the common C++ style guides, such as the Google
C++ Style Guide which recommends 2 spaces for indentation.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-04-28 08:55:39 -04:00
Stephanos Ioannidis ef9c4f76cc editorconfig: Add linker script indentation style
This commit adds the indentation style for the linker script files.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-04-28 08:55:39 -04:00
Stephanos Ioannidis 380bf3ad04 editorconfig: Add reStructuredText indentation style
This commit adds the reStructuredText indentation style.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-04-28 08:55:39 -04:00
Stephanos Ioannidis 5d8f1de3bf editorconfig: Update commit message max. line length to 75
This commit updates the maximum line length for the commit messages
from 72 to 75, in order to align with the checkpatch and gitlint
policies.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-04-28 08:55:39 -04:00