Commit graph

62420 commits

Author SHA1 Message Date
Yuichiro SAGISAKA 82ac3fa079 boards: riscv: longan_nano: Update document
Improve documentation

- Add a photo of the board
- Add hardware information from the board manual
- Fix options for build (set OPENOCD_DEFAULT_PATH to make it
  valid for also windows environment)
- Improve the build instructions to make it easier to understand

Signed-off-by: Yuichiro SAGISAKA <yu.sagisaka@fujitsu.com>
2022-03-29 12:35:30 -07:00
Valerio Setti 45751e2a11 logging: fix for 64 bit timestamp + new timestamp format option
Timestamps can be 32 or 64 bit long based on the platform and
build configurations. The proper way to handle these timestamps
is to use the ad-hoc log_timestamp_t variable.
This patch fixes some timestamp's reference which were still
using uint32_t changing them to log_timestamp_t.

Moreover also a new config is added in order to print the
timestamp as the Linux's kernel format. This might be useful
in AMP platforms in which Linux's and Zephyr's logs must be
interleaved in order to get a more comprehensive log solution.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-03-29 12:34:58 -07:00
Yuval Peress fab5bb9ed3 printk: Add tests for print format
Add tests to verify that the different print formats and constant
macros match.

Fixes #44199

Signed-off-by: Yuval Peress <peress@google.com>
2022-03-29 12:34:08 -07:00
Stephanos Ioannidis 44ddb308c7 toolchain: Override __INTN_C macros to match Zephyr stdint types
This commit overrides the toolchain internal `__INTN_C(value)` integer
constant macros to match the types defined by the `zephyr_stdint.h`
header.

For more details, refer to the GitHub issue #44199.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-03-29 12:34:08 -07:00
Jordan Yates 332a6f084a wifi: esp_at: reset the modem in device init
Reset the ESP modem inside the device initialisation function so that
errors can be detected through the use of `device_is_ready`.

Fixes #43891 for this driver.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-03-29 12:32:43 -07:00
Jordan Yates 06960750c7 wifi: esp_at: return modem reset result
Return an error code indicating whether the modem was successfully reset
or not.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-03-29 12:32:43 -07:00
Jordan Yates 9cd80bb732 wifi: esp_at: move network device inst macro
Move the network device instantiation macro to above the esp_init
function so that static variables declared by the macro are visible to
the init function.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-03-29 12:32:43 -07:00
Emil Obalski 764f9fc6f9 ipc_service: samples: Remove redundant config options from samples
This change remove options that no longer needs to be set in
configuration file.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2022-03-29 12:30:50 -07:00
Emil Obalski d877e1dded ipc_service: Automatically include source files for backends
The purpose of this change is to allow to enable more than one
backend at once by removing choice from ipc-service backend Kconfig
and depending backend Kconfig option on existing of correct compatible.

Overwriting IPC_SERVICE_BACKEND option in some places is removes
as no longer needed.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2022-03-29 12:30:50 -07:00
Emil Gydesen 5d18f93561 Bluetooth: Audio: Unicast client missing unref on ACL disconnected
The unicast client takes a reference to the ACL, but did
not return the reference when the ACL disconnected, but
rather just reset everything.

Modified to detach the stream, ensuring
a bt_conn_unref on ACL disconnect.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-29 12:30:07 -07:00
Krzysztof Chruscinski 6d98a1cc7e debug: Revert ASSERT options dependency
f4df23c9 added dependency on ASSERT to some options prefixed
with ASSERT_ assuming that they are no used elsewhere. Turned
out that there are subsystem specific assert macros (e.g. BT_ASSERT)
which relies on those options. Removing the dependency.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-29 12:29:55 -07:00
Tom Burdick 2f792c2de5 dma/dw_common: Update dma_dw_common from sof
Ports the SOF DesignWare DMA code to Zephyr.

Effectively replaces much of what was the designware driver as this
driver enables scatter gather which the older driver did not.

* Enables cyclic transfer description lists when the cyclic config
  param is given.
* Enables linear link position usage with cAVS GPDMA.
* Passes suspend/resume, scatter/gather tests.
* Provides status updates of the transfer through dma_get_status()
* Enables reloading a cyclic transfer with dma_reload()
* Enables dma handshakes using the dma_slot config param.
* cAVS specifics remain in the dma_cavs_gpdma driver.

Co-authored-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Co-authored-by: Tom Burdick <thomas.burdick@intel.com>
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-03-29 14:33:48 -04:00
Adrian Bonislawski 8ea474e8fc dma: Status gives free bytes in buffer
Adds to the dma_status struct the number of free bytes available
in the current transfer buffer.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-03-29 14:33:48 -04:00
Adrian Bonislawski b19e8cf979 dma: Add config option for cyclic transfer lists
Adds a bit flag config option for cyclic transfer lists, where the
transfer list tail may link to its head creating a never ending
loop of transfer descriptors.

DesignWare DMA supports such cyclic transfers.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-03-29 14:33:48 -04:00
Brian Bradley 5ae78fbca5 boards: add support for stm32f401_mini
Adds support for the stm32f401cc based stm32 mini f401 board.

Signed-off-by: Brian Bradley <brian.bradley.p@gmail.com>
2022-03-29 11:35:56 -05:00
Daniel DeGrasse 585eb7f9cb include: dt-bindings: fix overlap between SYSCON clock constants
Fix all syscon dt bindings clock constants to avoid any overlap, to
prevent case statement in mcux syscon clock driver from failing to
build.

Fixes #44216

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-29 10:31:21 -05:00
Wilfred Mallawa 378e75ea0c include: app_memory: mem_domain: fixup single typo
Fixup a single typo in `mem_domain.h`.

Signed-off-by: Wilfred Mallawa <thulith.mallawa@uqconnect.edu.au>
2022-03-29 10:29:34 -05:00
Sylvio Alves d2ea3e715d soc: esp32: linker: exclude smp source from rom area
SMP support might not work if esp_mp.c initialization code
is placed in ROM area. This fix that scenario.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-03-29 10:28:23 -05:00
Bartosz Bilas 1d40d4fa5a drivers: spi_handlers: switch to gpio_dt_spec member
Don't use the old gpio_dev spi_cs_control's member
since it's been deprecated in favor of gpio_dt_spec.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2022-03-29 10:24:56 -05:00
HaiLong Yang 823b468890 samples: spi_flash: add gd32f450i_eval and gd32vf103v_eval boards
This add gd32f450i_eval and gd32vf103v_eval boards to spi_flash sample.

Signed-off-by: HaiLong Yang <cameledyang@pm.me>
2022-03-29 10:21:15 -05:00
HaiLong Yang 140bce498b boards: add gd35q16 flash to gd32f450i_eval and gd32vf103v_eval boards
Add gd25q16 as "jedec,spi-nor" compatible flash to gd32f450i_eval and
gd32vf103v_eval boards.

Signed-off-by: HaiLong Yang <cameledyang@pm.me>
2022-03-29 10:21:15 -05:00
HaiLong Yang 9d2425c186 drivers: spi: introduce gd32 spi driver
Add a simple gd32 spi driver.

Signed-off-by: HaiLong Yang <cameledyang@pm.me>
2022-03-29 10:21:15 -05:00
HaiLong Yang 2e53071006 dts: arm: introduce gd32 spi interface
Add gd32 spi initial support.

Signed-off-by: HaiLong Yang <cameledyang@pm.me>
2022-03-29 10:21:15 -05:00
Casper Meijn 465c038546 boards: arm: pinetime: Enable SPI_NOR flash driver
When the application requests `CONFIG_FLASH`, then automatically
enable the flash driver using `CONFIG_SPI_NOR`.

Signed-off-by: Casper Meijn <casper@meijn.net>
2022-03-29 09:38:01 -05:00
Henrik Brix Andersen af10f6910a MAINTAINERS: add samples/net/sockets/can/ to CAN files
Add samples/net/sockets/can/ to the CAN area.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-29 09:14:36 -05:00
Henrik Brix Andersen b55fe2eb27 MAINTAINERS: sort CAN files section
Sort the entries in the CAN drivers files section.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-29 09:14:36 -05:00
Pavel Vasilyev 6d17bf6aa7 MAINTAINERS/CODEOWNERS: Add myself as a code owner of Bluetooth mesh
Add myself as a code owner of Bluetooth mesh subsystem.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-03-29 09:20:44 -04:00
Jedrzej Ciupis bc1f85d769 MAINTAINERS: add @jciupis to IEEE 802.15.4 drivers collaborators
Adds @jciupis as collaborator of IEEE 802.15.4 drivers.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2022-03-29 08:34:11 -04:00
Lingao Meng 154f5c02a8 Bluetooth: host: crypto: Add a config to select how rand is generated
Considering that in most scenarios, bt_rand will not be called
frequently, but the current implementation of tinycrypt will
occupy more than 300 bytes of RAM space. Its existence is to
optimize the frequent call of bt_rand.

Therefore, it is considered to put it into a config
(`BT_HOST_CRYPTO_RANDOM`), when this config has been selected,
will use tinycrypt library for random. Otherwise will call bt random
hci command.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-03-29 12:59:33 +02:00
Stephanos Ioannidis 989b71b461 doc: beyong-GSG: Update instructions for multi-platform Zephyr SDK
Since Zephyr SDK is now supported on all major operating systems, there
is no need to restrict it to "on Linux."

This commit also removes an endorsement of the GNU Arm Embedded
toolchain because there is no need to recommend and/or use it anymore
for the aforementioned reason.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-03-29 11:14:29 +02:00
Stephanos Ioannidis 97e226c79b doc: getting_started: Add instructions for multi-platform Zephyr SDK
This commit adds the Linux, macOS and Windows instructions for
installing the new multi-platform Zephyr SDK.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-03-29 11:14:29 +02:00
Stephanos Ioannidis 73059052d5 doc: getting_started: Add wget as a common host dependency
This commit adds the instruction for installing the `wget` application
for macOS and Windows hosts, such that it is available on all three
host platforms when the Getting Started Guide is followed.

The rationale behind this is as follows:

  * The Zephyr documentations, including the Getting Started Guide,
    makes extensive use of the wget command.

  * wget is a purpose-made tool for get/download requests and is more
    user-friendly than curl for the purpose of downloading files.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-03-29 11:14:29 +02:00
Dominik Ermel 30fcf494be mgmt/mcumgr: Fix possible buffer overflow in BT tranport
The commit add checks whether frame received from BT transport
will really fit into allocated net_buf form mcumgr.

Fixes: #44271

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-03-29 10:19:09 +02:00
Kai Vehmanen 199048b2ed soc/intel_adsp: boot: simplify the ifdef rules for cAVS versions
Only cAVS15 is different in terms of definitions, so the ifdef logic can
be simplified quite a bit. Also reorder some of the definitions to
improve readability. No functional change.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-03-28 14:03:41 -04:00
Kai Vehmanen 3cead66939 soc/intel_adsp: fetch HPSRAM bank count from devicetree
Replace the Kconfig ifdefs with direct query from devicetree.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-03-28 14:03:41 -04:00
Davide Bortolami bd4d7fb5bd include: usb: add missing HID collection types
Add Logical, Report, Named Array, Usage Switch,
and Modifier collections types.

Signed-off-by: Davide Bortolami <davide.bortolami@thinksmartbox.com>
2022-03-28 17:59:47 +02:00
Kweh Hock Leong ea43f89285 net: gptp: Fix type mismatch calculation error in gptp_mi
NSEC_PER_SEC is an unsigned integer macro. Thus, -NSEC_PER_SEC will be
treated as unsigned integer as well which lead to calculation error on
64bits integer variables. Added the correct type casting into the formula
to fix the calculation error.

Signed-off-by: Kweh Hock Leong <hock.leong.kweh@intel.com>
2022-03-28 12:47:41 +02:00
Vinayak Kariappa Chettimada 586ba9fd13 Bluetooth: Controller: Increase BT_RX_STACK_SIZE for BT_HCI_RAW enabled
Increase BT_RX_STACK_SIZE for BT_HCI_RAW enabled, as HCI
Extended Advertising Report generation requires more program
stack.

Without the update conformance test run failed with hanging
controller with mem manage fault.

Profiled the hci_uart sample using BlueZ by performing
`find -l` in `btmgmt` utility with the sample built
using:

CONFIG_THREAD_ANALYZER=y
CONFIG_THREAD_ANALYZER_AUTO=y
CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=5
CONFIG_THREAD_NAME=y

Thread analyze:
 HCI uart TX         : STACK: unused 496 usage 528 / 1024 (51 %); CPU: 0 %
      : Total CPU cycles used: 146
 BT RX               : STACK: unused 72 usage 696 / 768 (90 %); CPU: 0 %
      : Total CPU cycles used: 3549
 BT RX pri           : STACK: unused 88 usage 168 / 256 (65 %); CPU: 0 %
      : Total CPU cycles used: 1210
 thread_analyzer     : STACK: unused 528 usage 496 / 1024 (48 %); CPU: 0 %
      : Total CPU cycles used: 889
 sysworkq            : STACK: unused 344 usage 168 / 512 (32 %); CPU: 0 %
      : Total CPU cycles used: 0
 logging             : STACK: unused 240 usage 528 / 768 (68 %); CPU: 0 %
      : Total CPU cycles used: 4305
 idle 00             : STACK: unused 228 usage 92 / 320 (28 %); CPU: 99 %
      : Total CPU cycles used: 3101052
 main                : STACK: unused 672 usage 352 / 1024 (34 %); CPU: 0 %
      : Total CPU cycles used: 395
 ISR0                : STACK: unused 1248 usage 800 / 2048 (39 %)

Signed-off-by: Vinayak Kariappa Chettimada <vinayak.kariappa@gmail.com>
2022-03-28 12:47:34 +02:00
Joakim Andersson f8fc1f5b72 tfm: Fix TF-M nonsecure interface disptach handling in pre kernel
Fix TF-M nonsecure interface dispatch handling when calling secure
service before the kernel is fully active.

This fixes crash in nordicsemi_nrf53_init, which is called with
PRE_KERNEL_1, when calling soc_secure_gpio_pin_mcu_select.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-03-28 12:47:27 +02:00
Christopher Friedt d5ae42aa1d tests: lib: c_lib: add coverage for qsort_r
A user previously reported that `qsort_r()` did not have test
coverage. Prior to 845a200c1b
`qsort()` was actually just calling `qsort_r()` inline.

There is still virtually no difference between the two
sorting routines, but it would be good to add coverage.

Relates-to #44218

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2022-03-28 12:47:16 +02:00
Asbjørn Sæbø ed2ea2c7df Bluetooth: Audio: Media - truncate strings for notification
Truncate strings being notified to fit the ATT_MTU, to prevent
notifications from not being delivered due to being too long.

For now uses the minimum ATT_MTU, as the MCS does not yet track
connections.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-28 12:46:53 +02:00
Tom Burdick 2ec3222426 dma: Scatter gather test
Adds a scatter gather test against memory to memory transfers. Initially
excludes all platforms as they are all failing.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-03-28 12:46:41 +02:00
Kamil Piszczek cb0d8c262f soc: arm: nordic_nrf: enable shared memory reset for nRF53 App Core
Enabled the Shared Memory Reset feature for nRF5340 Application Core
when the RPMsg backend for IPC Service is enabled.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-03-28 12:46:32 +02:00
Kamil Piszczek 33408fa7af ipc: backends: rpmsg: initialize shared memory to zero
Added a code for initializing shared memory to zero. This operation
normalizes the memory state so that the IPC service is no longer
prone to reading status bits from the previous reset session.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-03-28 12:46:32 +02:00
Carlo Caione 92d8329d5b ipc_service: static_vrings: Move to one WQ per instance
Instead of having one single WQ per backend, move to one WQ per
instance instead and add a new "zephyr,priority" property in the DT to
set the WQ priority of the instance. Fix the sample as well.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-03-28 12:46:15 +02:00
Abe Kohandel 3a03d9c50d bluetooth: ots: reduce directory listing memory usage
Allocating a buffer to hold the entire directory listing consumes a very
large sum of memory when a large number of OTS objects are supported.

This implementation minimizes the memory footprint of the directory
listing by only allocating the minimum necessary buffer size to allow
for efficient over the air transfer. The contents of the transferred
buffer are built incrementally and upon request.

The directory listing manipulation upon object creation and deletion can
be removed since the directory listing content is never constructed
until it is requested.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2022-03-28 12:45:51 +02:00
Zack Cornelius f3285998b7 boards: adafruit_feather_nrf52840: Enable qspi QER
Enable quad-mode for adafruit_feather_nrf52840

Signed-off-by: Zack Cornelius <zcornelius@securityesys.com>
2022-03-28 12:45:18 +02:00
Emil Gydesen a7ed7b7250 Bluetooth: Audio: Make bt_tbs_client_cb const
Add `const` for the bt_tbs_client_cb as it is a singleton
that should not change over time.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-28 12:45:03 +02:00
Emil Gydesen 7eef8d705f Bluetooth: Audio: Add TBS server and client BSIM tests
Add babblesim tests for the TBS server and client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-28 12:45:03 +02:00
Emil Gydesen b32491df11 Bluetooth: Audio: Add Telephone Bearer Client shell module
Add a shell module for the TBS client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-28 12:45:03 +02:00