Commit graph

62528 commits

Author SHA1 Message Date
Henrik Brix Andersen
29548dfb23 tests: drivers: can: timing: extend the test to cover data phase timing
Extend the CAN driver timing tests to cover data phase timing on CAN-FD
capable CAN controllers.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-29 17:05:56 -07:00
Henrik Brix Andersen
df4297e2a0 tests: drivers: can: timing: extend verification to cover prescaler and sjw
Extend the CAN driver timing calculation test verification to cover the
sjw and prescaler values.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-29 17:05:56 -07:00
Henrik Brix Andersen
f633f74e03 tests: drivers: can: timing: run CAN timing tests in userspace
Convert the CAN driver timing calculation tests to run in userspace
where available.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-29 17:05:56 -07:00
Henrik Brix Andersen
3874a0d1e3 drivers: can: use correct size in z_vrfy_can_get_core_clock()
Use the correct size in z_vrfy_can_get_core_clock().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-29 17:05:56 -07:00
Henrik Brix Andersen
372cee4268 drivers: can: convert can_calc_timing*() to syscalls
Convert can_calc_timing() + can_calc_timing_data() to syscalls and use
the newly added syscalls calls for determing the minimum/maximum
supported timing parameter values.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-29 17:05:56 -07:00
Henrik Brix Andersen
15fde0a357 drivers: can: add syscalls for getting min/max timing values
Add CAN system calls for getting the minimum/maximum timing values
supported by a given CAN controller device driver instance:
- can_get_timing_min()
- can_get_timing_max()
- can_get_timing_min_data()
- can_get_timing_max_data();

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-29 17:05:56 -07:00
Daniel DeGrasse
dcac0ce0aa manifest: hal_nxp: update NXP hal to use new pin control headers
Pin control DTSI files need /omit-if-no-ref/ property to reduce
generated devicetree size and improve build times.

Fixes #44262

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-29 16:33:09 -07:00
Mark Ruvald Pedersen
d8df801fe4 cmake: Fix dependencies so builds are sparse again
In cmake we use target_byproducts() to register dependence on the map
file alongside the executable for it - this makes sense.
Thus if the map file is missing, ninja will detect and issue a linker
command again. However after that, cmake was instructed to rename the
map file. Thus a 2nd round of ninja, which should be a no-op, is not as
the registered byproduct file is missing.

To keep this static, and to keep the map file alongside the elf file, we
will instead copy the map file.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2022-03-29 13:04:35 -07:00
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