Commit graph

54884 commits

Author SHA1 Message Date
Fabio Baltieri
f88a420d69 toolchain: migrate iterable sections calls to the external API
This migrates all the current iterable section usages to the external
API, dropping the "Z_" prefix:

Z_ITERABLE_SECTION_ROM
Z_ITERABLE_SECTION_ROM_GC_ALLOWED
Z_ITERABLE_SECTION_RAM
Z_ITERABLE_SECTION_RAM_GC_ALLOWED
Z_STRUCT_SECTION_ITERABLE
Z_STRUCT_SECTION_ITERABLE_ALTERNATE
Z_STRUCT_SECTION_FOREACH

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2021-08-12 17:47:04 -04:00
Chen Peng1
34d2ca613f cmsis_rots_v1: fix for clearing signal flags in osSignalWait.
we use flag 0 in osSignalWait function to wait for
any single signal flag, but with this 0 flag,
it won't clear thread signal results as expected,
we need to check whether signal flag is 0 firstly.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
2021-08-12 17:30:03 -04:00
Sylvio Alves
907b5d9e7f drivers: spi: set max chunk len for esp32
Max SPI chunk len was missing from the
implementation, causing SPI to hang up in some
conditions.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-08-12 16:22:34 -05:00
Sylvio Alves
5061760293 linker: esp32: update linker with recent iterable
bt_conn_cb section was added into common-rom.ld and
as current ESP has limited segment section number, it
needs to be moved out from there.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-08-12 17:06:44 -04:00
Johann Fischer
4f2682bd79 usb: cdc_acm: avoid spurious interrupt on configured or resume events
Do not submit k_work on on configured or resume events and
avoid spurious interrupt.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-12 16:57:12 -04:00
Johann Fischer
37f4d9ba63 usb: cdc_acm: rework cdc_acm_poll_out to non-blocking
Change cdc_acm_poll_out to do the best to mimic behavior
of a hardware UART controller without flow control.

With this patch, if the USB subsystem is not ready,
no data is transfered to the buffer, that is, new character
is dropped. If the USB subsystem is ready and the buffer is full,
the first character from the tx_ringbuf is removed to
make room for the new character.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-12 16:57:12 -04:00
Mark Wang
4d3d734ffd boards: mimxrt1060_evk: Enable lpuart3's flow control pin mux
configure lpuart3's CTS and RTS

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2021-08-12 14:49:09 -05:00
Mark Wang
857b8508d0 drivers: serial: NXP: Enable flow control for uart_mcux_lpuart
add flow_ctrl filed and give it initialized value
    based on hw_flow_control.
Initialize mcux lpuart based on flow_ctrl

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2021-08-12 14:49:09 -05:00
Krzysztof Kopyściński
00bfac00ae Bluetooth: gatt: Add option to read multiple without variable length
Currently, with EATT enabled, when bt_gatt_read is called with multiple
handles first it'll try to use gatt_read_mult_vl, and if it fails
gatt_read_mult will be used to try again. Add option to skip
the gatt_read_mult_vl and use gatt_read_mult right away. This is needed
by tests that expect BT_ATT_OP_READ_MULT_REQ but support variable
lenght, thus don't return BT_ATT_ERR_NOT_SUPPORTED.

Removed fallback from read multiple vl to read multiple on
BT_ATT_ERR_NOT_SUPPORTED error.

This was affecting:
GATT/CL/GAR/BV-05-C, GATT/CL/GAR/BI-18-C, GATT/CL/GAR/BI-19-C,
GATT/CL/GAR/BI-20-C, GATT/CL/GAR/BI-21-C, GATT/CL/GAR/BI-22-C

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-08-12 11:07:08 -04:00
Ryan Erickson
e4dc8ed26b logging: Add log mem shell command
Add log mem shell command to determine memory pool
usage of logging system.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2021-08-12 11:06:32 -04:00
Andrew Hedin
b52ad8f3e1 logging: Add strdup current use to shell cmd
Add the number of strdup buffers currently in use to the
`log strdup_utilization` shell command.

Signed-off-by: Andrew Hedin <andrew.hedin@lairdconnect.com>
2021-08-12 11:06:32 -04:00
Martí Bolívar
185545e9f4 doc: dts: explain how to view preprocessor output
This is the debugging tool of last resort for figuring out where a
devicetree macro went wrong, but it's very effective. Document how to
do it on GCC based toolchains.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-12 11:04:16 -04:00
Kevin Townsend
1740aaeb9b doc: guides: Add a TF-M guide
This commit adds a high-level overview of Trusted Firmware-M,
describing the basic architecture and integration work with Zephyr.

Co-authored-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-08-12 10:03:57 -05:00
Daniel Leung
8b8e8f99ba display: introduce CONFIG_DISPLAY_INIT_PRIORITY
This introduces a new kconfig CONFIG_DISPLAY_INIT_PRIORITY
to specify the initialization priority for display devices.
Most of the display devices are using APPLICATION and
CONFIG_APPLICATION_INIT_PRIORITY which is not entirely
appropriate for devices. Due to linking order, the display
device may be initialized after application code at same
init level and priority. This results in the display device
not ready to be used for application code. So this kconfig
option allows the display devices to be initialized earlier
if needed.

For the drivers using CONFIG_APPLICATION_INIT_PRIORITY,
they have been changed to use CONFIG_DISPLAY_INIT_PRIORITY
instead.

Note that the default value for CONFIG_DISPLAY_INIT_PRIORITY
is the same as CONFIG_APPLICATION_INIT_PRIORITY at 90 to
avoid any functional changes.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-12 17:00:39 +02:00
Kai Vehmanen
7d1f133107 sys: util: fix compilation with XCC
Xtensa XCC does not like C99 style declarations in for
loops.

Fixes: 268f9bf163 ("nuvoton: battery-backed ram")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-08-12 09:17:14 -05:00
Crist Xu
d42833c68b drivers: can: Fix isotp test failed on rt1170 EVK
Config the FlexCAN3 with a maximum 80MHz root clock to fix

Signed-off-by: Crist Xu <crist.xu@nxp.com>
2021-08-12 09:00:30 -05:00
Thomas Stranger
1b238b8bd3 dts: arm: st: rename g0 tim1 interrupt to align with f0 series
Renames stm32g0 tim1 brk interrupt to brk_up_trg_com, such that the
naming aligns with stm32f0 series and drivers can find the interrupt
with a common name.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-08-12 07:06:14 -05:00
Vinayak Kariappa Chettimada
00d707e470 Bluetooth: Controller: Fix node rx memory corruption regression
Fix the node rx memory pool corruption regression introduced
due to same peer connection being rejected.

Regression introduced in commit 30f260dfaa ("Bluetooth:
controller: Fix adv/scan context access post release").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-12 11:57:12 +02:00
Vinayak Kariappa Chettimada
27b8beaa22 Bluetooth: Controller: Fix to handle relative short preempt timeout
When a new radio event is scheduled with a relatively short
preempt timeout while there is already a started preempt
ticker, then stop the ticker, abort the previous event that
requested the preemption, and request to start ticker with
the new relatively short preempt timeout.

Fixes #30245.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-12 11:56:56 +02:00
Vinayak Kariappa Chettimada
6cd9ec8c8d Bluetooth: Controller: Preempt ticker to use atmost one operation
When there are multiple events in prepare pipeline then fix
the implementation so that only one preempt ticker start
or stop operation is enqueued towards ticker_job for
processing.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-12 11:56:56 +02:00
Gerson Fernando Budke
a42890fb39 soc: arm: cypress: Fix psoc6 irq priority
PSoC-6 have different priority bit masks for cortex-m0+ and cortex-m4.

M0: 0-3 (2 bits of NVIC prio, no prio reserved by the kernel)
M4: 0-6 (3 bits of NVIC prio, one level reserved by the kernel)

The current macro that gets priority level value from devicetree apply
same value from cortex-m4 on cortex-m0+.  This add missing indirection
to get from intmux node the correct cortex-m0+ priority level value.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-08-11 19:45:44 -04:00
Scott Worley
2574d9848a Microchip: MEC172x: Add macro to encode ECIA GIRQ information
Add a macro for encoding interrupt source information: GIRQ number,
GIRQ bit position, GIRQ aggregated NVIC connection, and source
direct NVIC connection.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-08-11 19:44:45 -04:00
Scott Worley
19dd46ef68 Microchip: MEC172x: ADC driver
Add ADC driver version 2 for MEC172x using new in-tree headers
and device tree properties. Update the ADC shell for the new driver.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-08-11 19:44:31 -04:00
Flavio Ceolin
b6bd40f5fa tests: pm: Add device wakeup test
Add a test to exercise PM device wakeup API.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-11 19:39:13 -04:00
Flavio Ceolin
2aa67efd7a drivers: gpio_emul: Add dummy pm support
Add a simple device PM support to be used for tests.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-11 19:39:13 -04:00
Flavio Ceolin
1c6507afa8 doc: pm: Add wakeup information
Add documentation for wakeup sources.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-11 19:39:13 -04:00
Flavio Ceolin
69e57d633f pm: device: Do not suspend wake up sources
Check if a device is being used as a wake up source before suspend it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-11 19:39:13 -04:00
Flavio Ceolin
8eceeee798 pm: device: Add wakeup source API
Introduce a new API to allow devices capable of wake up the system
register themselves was wake up sources. This permits applications to
select the most appropriate way to wake up the system when it is
suspended.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-11 19:39:13 -04:00
Flavio Ceolin
a245ed2a87 pm: device: Change atomic flags type
Just using a simple atomic for flags instead of using an array.

While is neat using ATOMIC_DEFINE for future proof. The reality is
that it brings some problem for the wakeup source implementation
that needs to statically initialize it during the device definition.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-11 19:39:13 -04:00
Kumar Gala
689864ebe0 modules: hal_nxp: tweak integration to utilize cmake-ext/kconfig-ext
Update zephyr side to handle hal_nxp using cmake-ext/kconfig-ext.  This
allows for having zephyr specific integration code live with the zephyr
source tree.

For now on the cmake side we just use add_subdirectory() of the hal_nxp
repo so the integration is effectively transparent.

For Kconfig we add a place holder Kconfig file since the hal_nxp repo
doesn't have any Kconfig files in it currently.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-08-11 12:26:28 -05:00
Dong Wang
a56c42574e timer: hpet: make it support EHL/PSE CPU
Add config macro to set interrupt as level triggered for ARM CPUs
Merge all timer configures into one place, then no need to overwrite
hpet_timer_conf_get/set() functions in SoC layer
Make hpet_timer_comparator_set() as the only register access function
to implemented in the SoC layer

Signed-off-by: Dong Wang <dong.d.wang@intel.com>
2021-08-11 11:30:05 -04:00
Dong Wang
eeb15aa393 timer: hpet: enable 64 bit mode for better usages
Get longer maximum timeout
Make HPET counter usable as timestamp

Signed-off-by: Dong Wang <dong.d.wang@intel.com>
2021-08-11 11:30:05 -04:00
Eduardo Montoya
f6f521b927 manifest: openthread upmerge up to commit 2e625bfe
Update manifest with OpenThread up to commit `2e625bfe`.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2021-08-11 11:29:36 -04:00
Eduardo Montoya
570dab7a1a net: openthread: add Netdata Publisher Kconfig option
Enable new feature from the upmerge:
- OPENTHREAD_NETDATA_PUBLISHER

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2021-08-11 11:29:36 -04:00
Eduardo Montoya
4b4e298914 net: openthread: propagate security and header updated flags
When transmitting a frame, inform the radio driver whether
security processing and/or header updates are needed or not.

When a frame was transmitted, inform back to OpenThread whether
the security procedure and/or header updates were completed for
the frame or not.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2021-08-11 11:29:36 -04:00
Piotr Mienkowski
6c699239f9 drivers: flash_sam: fix flash_sam_write_page
According to Atmel SAM datasheet when writing data to the latch buffer
"32-bit words must be written continuously, in either ascending or
descending order. Writing the latch buffer in a random order is not
permitted." To enforce the requirement we need to call a memory barrier
instruction after copying every word of data to the latch buffer. In
the absensce of __DSB() call the ARM processor is free to change order
of AHB transfers. This has caused the driver to occasionally corrupt
data programmed in the flash.

Fixes #37515

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2021-08-11 11:29:04 -04:00
Evgeniy Paltsev
9e0acf3afa ARC: boards: allow Zephyr toolchain for ARCv3 64bit boards
As 0.13 SDK is available and used in upstream verification by
default we can allow Zephyr toolchain for ARCv3 64bit boards.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2021-08-11 11:28:45 -04:00
Torsten Rasmussen
eecc0961b6 cmake: dts: removing generated <board>.dts_compiled
The file <board>.dts_compiled was made obsolete in 8d8b06978c.

<board>.dts_compiled contains only a reference to zephyr.dts.

Users interested in devicetree should be familiar with zephyr.dts,
therefore it's time to remove the unused <board>.dts_compiled.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-11 11:16:18 -04:00
Krzysztof Chruscinski
2aa1247998 lib: os: ring_buffer: Clarify macro description
Description was falsely static that macros statically creates
the ring buffer objects. Clarify description since variables
are not static.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-08-11 11:15:11 -04:00
Carles Cufi
1126bbdca0 dts: psoc6: Use valid IRQ prio levels for CM4
The psoc6 SoC has 2 cores, each with different allowed priority ranges:

CM0: 0-3 (2 bits of NVIC prio, no prio reserved by the kernel)
CM4: 0-6 (3 bits of NVIC prio, one level reserved by the kernel)

Since some of the peripherals are only available to the CM4, those
should be set to a priority that is actually valid for it. In this case
the lowest possible one is 6, so transition from 7 to 6.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-08-11 10:06:13 -05:00
Andrzej Głąbek
0f949caee1 tests: drivers: i2s_speed: Allow testing on nRF52840 DK and nRF5340 DK
This is a follow-up to commit 954dfa755b.

Apply adjustments made in the i2s_api test to the i2s_speed one so that
it can also be executed successfully on the nRF DK boards.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-08-11 13:54:12 +02:00
Lingao Meng
8e1682d1ea samples: conn_cb replace to const zsector
It is more efficient and saves part of RAM
by replacing it with static one dynamically.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-08-11 13:42:28 +02:00
Lingao Meng
23a9594944 Bluetooth: Add connect event structure to zsector
Add an optional version for connection events
to save some memory.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-08-11 13:42:28 +02:00
Vinayak Kariappa Chettimada
f1f40b6675 tests: Bluetooth: bsim: Test random address change on adv re-enable
Verify that random address is changed when enabling an
already enabled advertising.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-11 07:32:59 -04:00
Vinayak Kariappa Chettimada
eb22d5acf2 Bluetooth: Controller: Change random address on advertising re-enable
If HCI LE Set Extended Advertising Enable command is sent
again for an advertising set while that set is enabled, then
any change to the random address shall take effect.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-11 07:32:59 -04:00
Vinayak Kariappa Chettimada
df3498bb75 tests: Bluetooth: init: Cover strict adv and scan enable/disable
Cover the strict advertising and scanning enable/disable
debug usecase.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-11 07:32:59 -04:00
Vinayak Kariappa Chettimada
cd344fe24c tests: Bluetooth: bsim: test advertising re-enable
Test advertising re-enable to cover reset of event counter,
duration and the number of events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-11 07:32:59 -04:00
Vinayak Kariappa Chettimada
e82fcb070a Bluetooth: Controller: Permit enabling already enabled advertising
Permit enabling already enabled advertising. Enabling
advertising when it is already enabled can cause the
random address to change, as specified in the Bluetooth
Specifications.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-11 07:32:59 -04:00
Vinayak Kariappa Chettimada
06f02b570e Bluetooth: Controller: Comment on enabling of already enabled scanning
Add comment about enabling of already enabled scanning.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-11 07:32:59 -04:00
Paweł Kwiek
da8f9d77c4 modules: hal_nordic: Increase number of serialization buffers
This commit increases number of available serialization buffers to
account for possible delays caused by serialization itself and
processing on the application core.

Signed-off-by: Paweł Kwiek <pawel.kwiek@nordicsemi.no>
2021-08-11 11:47:10 +02:00