Commit graph

57461 commits

Author SHA1 Message Date
Christopher Friedt 918a574c88 clock: add k_cycle_get_64
This change adds `k_cycle_get_64()` on platforms that
support a 64-bit cycle counter.

The interface functions `arch_k_cycle_get_64()` and
`sys_clock_cycle_get_64()` are also introduced.

Fixes #39934

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-08 13:41:53 -05:00
Dominik Ermel 90ed7557e7 mgmt/mcumgr: Add mising static to zephyr_smp_alloc_rsp
The commit adds missing static to the zephyr_smp_alloc_rsp
function definition; it also reorders some of definitions
and removes no longer needed block of forward declarations
of functions.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-08 18:17:31 +01:00
Jakub Rzeszutko f29d46ac4a shell: add a directory for backends
This change organizes the file structure for the shell.
Files implementing backends are moved to a separate folder.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-11-08 11:07:49 -05:00
Ingar Kulbrandstad 59d5ef1e24 Bluetooth: Mesh: Moved composition data out of mesh shell
The mesh shell module owns the composition data for the shell
application, which makes it impossible to use it outside of the
application itself. To support the shell as a generic debugging
component that can be added to any application, we have moved the
composition data out of shell.c, and into the application.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2021-11-08 11:07:11 -05:00
Szymon Janc 5f16b9ce83 tests: bluetooth: tester: Fix not marking chan as unused on disconnect
This fix not being able to re-connect channel after disconnect.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-11-08 11:06:51 -05:00
Bartosz Bilas f445cb9a7e drivers: ieee802154_rf2xx: convert to use spi_dt_spec
Convert ieee802154_rf2xx driver to use `spi_dt_spec` helpers.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2021-11-08 11:06:16 -05:00
Krzysztof Chruscinski 8979fbc906 kernel: timer: Call user handler without spinlock
Add spinlock unlocking before calling timer expiration
handler. Locking was introduced by dde3d6c.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-11-08 11:05:49 -05:00
Johann Fischer 02c32d4474 usb: move USB_DEVICE_REMOTE_WAKEUP option to drivers
Kconfig USB_DEVICE_REMOTE_WAKEUP option depends only on
USB device controller capability, but is not controlled
by the USB device controller drivers configuration.
Move USB_DEVICE_REMOTE_WAKEUP option to drivers and
make it promptless.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-11-08 17:01:32 +01:00
Johann Fischer 14c28c45f1 usb: remove USB_SCD_ATTRIBUTES macro
USB_SCD_ATTRIBUTES is a configuration dependent macro
that does not map any part of the spec and does not
belong to usb_ch9 header.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-11-08 17:01:32 +01:00
Andrew Hedin e0715556e7 net: lwm2m: Add IPSO current sensor object
Add support for the current sensor object used by the MG100
and BT610 LwM2M demo.

Signed-off-by: Andrew Hedin <andrew.hedin@lairdconnect.com>
2021-11-08 11:01:22 -05:00
Ilya Makarov 2cab8772b5 Bluetooth: host: Fix MIC generation in Bluetooth CCM encryption
bt_ccm_encrypt only works when encrypting in place. To fix this
ccm_auth() inside bt_ccm_encrypt() must take plaintext instead of
enc_data, to not rely on assumption that plain and cypher data are the
same memory.

Signed-off-by: Ilya Makarov <ilya.makarov.592@gmail.com>

Fixes: #40069
2021-11-08 11:00:33 -05:00
Erwan Gouriou 08bb61e0ff drivers/disk: sdmmc: stm32: DMA header requested on L4/F7 series
Even if not used DMA HAL is required in L4/F7 SD HAL driver.
Add them for these specific series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-08 10:58:49 -05:00
Felipe Neves 857a188c76 drivers: watchdog: esp32: enabled esp32c3
support for the unified esp32 wdt driver.

Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
2021-11-08 10:56:28 -05:00
David Brown 28d2ee6af7 net: sockets: tls: Clarify missing entropy warning
Change the wording of the warning printed when there is no entropy to
hopefully remove any doubt that there might be security in TLS without
an entropy source.  TLS connections with insufficient entropy are
trivially decodable, and should not be relied on for any type of
security.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-11-08 10:56:04 -05:00
Henrik Brix Andersen 5cd2b1ac46 boards: arm: waveshare_open103z: disable CAN bus tests
Disable CAN bus tests since can1 is disabled by default due to an IRQ
conflict with the USB controller.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-11-08 10:55:34 -05:00
Vinayak Kariappa Chettimada 8613cc760e Bluetooth: Controller: Fix missing auxiliary context release
Fix missing auxiliary context release when reception of
Periodic Advertising Chain PDU fails due to header complete
timeout, i.e. no reception of on-air PDU. Also, fix missing
generation of auxiliary reception failure notification when
no auxiliary context was allocated for chain PDU reception.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-08 16:54:46 +01:00
Yuriy Vynnychek 4ae0165c8b drivers: ieee802154: b91: Kconfig update with new params.
Added SET_TXRX_DELAY_US and CCA_RSSI_THRESHOLD params to Kconfig.

Signed-off-by: Yuriy Vynnychek <yura.vynnychek@telink-semi.com>
2021-11-08 09:31:53 -05:00
Gerard Marull-Paretas 9bea59a8c4 doc: doxygen: adjust titles
Adjust the project title and the home page to make the sidebar tree more
usable.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-08 11:17:37 +01:00
Gerard Marull-Paretas 96b2b931fe doc: doxygen: adjust Doxygen theme to match Sphinx better
Adjust the Doxygen theme (based on doxygen-awesome) to match the Sphinx
theme. While not perfect, the experience should now be more consistent.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-08 11:17:37 +01:00
Nikolai Kondrashov 194aa431c2 doc: bluetooth: Clarify BLE HW reqs are for Nordic
Make it clearer that the listed BLE controller hardware/peripheral
requirements concern the Nordic Semiconductor implementation only,
in the Bluetooth guide.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
2021-11-08 10:41:26 +01:00
Alexander Wachter ecd7c23daa drivers: hwinfo: shell: Add reset cause shell command
This commit adds shell commands for the reset cause API
- show: show the persistent reset cause
- clear: clear the persistent reset cause
- supported: list all supported reset causes

Signed-off-by: Alexander Wachter <alexander.wachter@leica-geosystems.com>
2021-11-07 14:55:52 -05:00
Alexander Wachter 5db37b12a3 drivers: hwinfo: shell: rename args to satisfy rule 5.7
This commit changes the shell argument name from shell to sh
to satisfy the warning
"Violation to rule 5.7 (Tag name should be unique) tag: shell"

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2021-11-07 14:55:52 -05:00
Henrik Brix Andersen c817a09b0a canbus: rename zephyr,can-primary chosen property to zephyr,canbus
Rename the Zephyr chosen property for specifying the default CAN bus
controller from "zephyr,can-primary" to "zephyr,canbus".

The "zephyr,can-primary" property name was selected in antipation of
adding support for redundant CAN networks, which we have yet to
add. Meanwhile, the "primary" term causes confusion for non-redundant
CAN bus configurations (and the "can" term doesn't match the name of the
Zephyr CAN bus subsystem).

The CAN in Automation (CiA) 302-6, which deals with CANopen network
redundancy, uses the terms "default interface" and "redundant
interface". If/when we add support for redundant CAN networks, the
"zephyr,canbus" chosen property can be supplemented with a
"zephyr,canbus-redundant" chosen property.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-11-07 09:05:39 -05:00
Bartosz Bilas ee7cd10563 drivers: modem: improve modem context RSSI member
The previous bf68b67 commit incorrectly passes minfo.mdm_rssi
value to the modem context data_rssi member during the driver
initialization which causes the `modem info` shell command
to return 0 as RSSI value. Fix that by changing data_rssi
modem ctx member to a pointer that is assigned to the RSSI
variable stored within the modem driver context structure.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2021-11-07 15:02:43 +02:00
Emil Gydesen 69f1236657 Bluetooth: ISO: Store SDU and PHY for peripheral
When an CIS is connected, the peripheral did not have
any information about the QoS settings. This commit
adds information about the PHY and SDU. For some reason
the peripheral won't ever have information about the RTN.

The remaining values in the event (interval, delay and
latency) are still not exposed, nor is framing or
packing, the latter of which are not part of the event.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-07 05:42:29 -05:00
Lixin Guo 72dba936cb tests: heap: add test case for coverage
Add a test case for k_heap_aligned_alloc API.

Signed-off-by: Lixin Guo <lixinx.guo@intel.com>
2021-11-07 05:39:10 -05:00
Pavel Hübner 104714394f kernel: Introduce K_MEM_SLAB_DEFINE_STATIC
As the already existing macro K_MEM_SLAB_DEFINE results in
two variable definitions, the preceding static modifier leads to
a seemingly working solution, though linkage conflicts will occur
when the same memory slab name is used across multiple modules.

The new K_MEM_SLAB_DEFINE_STATIC macro duplicates the functionality of
K_MEM_SLAB_DEFINE with the difference that the static keywords are
internally prepended before both variable definitions.

The implementation has been tested on my Zephyr project (the build
issue faded out). The documentation has been updated altogether
with all incorrect occurences of static K_MEM_SLAB_DEFINE.

Signed-off-by: Pavel Hübner <pavel.hubner@hardwario.com>
2021-11-07 05:36:48 -05:00
Andrei-Edward Popa ea82845f1b samples: led_pwm: added overlay for the esp32 board
added pwm leds in board overlay file,
added configs in board conf file

Signed-off-by: Andrei-Edward Popa <andrei_edward.popa@upb.ro>
2021-11-07 05:36:42 -05:00
Andrei-Edward Popa 02c2cae942 samples: blinky_pwm: added overlay for the esp32 board
added pwm leds in board overlay file,
added configs in board conf file

Signed-off-by: Andrei-Edward Popa <andrei_edward.popa@upb.ro>
2021-11-07 05:36:42 -05:00
Andrei-Edward Popa 5413661a81 boards: xtensa: add ledc support to the esp32 board
add ledc to board dtsi file,
change compatible and device define in pwm driver,
add yaml for board ledc support,
fix missing include for board in gpio include

Signed-off-by: Andrei-Edward Popa <andrei_edward.popa@upb.ro>
2021-11-07 05:36:42 -05:00
Martí Bolívar 1ca60ab35f doc: dts: document multi-line property description policy
Document our policy regarding multi-line strings in devicetree
bindings which has been enforced starting with this PR:

https://github.com/zephyrproject-rtos/zephyr/pull/36189

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-11-07 05:35:21 -05:00
Marc Herbert af1dedf89c boards: intel_adsp: add curly braces around log data in debug mode
This commit makes absolutely no change to the output unless debug is
manually turned on. Debug can be turned on with this other code change:

--- a/boards/xtensa/intel_adsp_cavs15/tools/logtool.py
+++ b/boards/xtensa/intel_adsp_cavs15/tools/logtool.py
@@ -45,7 +45,7 @@ def main():
         else:
             etrace = QEMU_ETRACE

-    l = Loglist(etrace)
+    l = Loglist(etrace, True)
     l.print()

Below are two examples of the new debug output. For instance the empty
and duplicate (due to a bug) slot [33] is now much more obvious:

};  {[31] : 1434444: ssp_set_config(),
};  {[32] : 1485591: ssp_set_config(),
};  {[33] : };  {[33] : 1539091: ssp_set_config(),

In this other example it is now much clearer that [7] misses a
`\n` newline:

};  {[6] : 858361: starting dma_trace_init_complete()
};  {[7] : dma_tr_...() ret=0[00000005] <inf> main};  {[8] : ipc_dma..()
};  {[9] : entering dma_trace_enable
};  {[10] : entering dma_trace_buffer_init()

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-07 05:34:06 -05:00
Marc Herbert e4b453f5fc boards: intel_adsp: prefix "ADSP Reset" message with "invalid slot 0"
Unlike logtool.py, adsplog.py is not shielded from corrupted log data.
Lenghten the error message a bit and be more transparent about the
"invalid slot 0 => ADSP reset" assumption because it is usually but not
always true.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-07 05:34:06 -05:00
Marc Herbert 89bfee9975 boards: intel_adsp: suggest to unload driver when mmap fails in adsplog
When CONFIG_IO_STRICT_DEVMEM is set the logger script fails with a
cryptic `OSError: [Errno 22] Invalid argument`. Print a clue and
re-raise the OSError.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-07 05:34:06 -05:00
Marc Herbert 2fac69422c boards: intel_adsp: add comments explaining log IDs start from 1
The mismatch between the slot number and the sequence ("id") made me
suspect a bug for too long. Fix one related comment and add two more. No
code change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-07 05:34:06 -05:00
Gerson Fernando Budke d86b0de993 boards: arm: gd32f403z_eval: Enable gd32isp runner
Add support to gd32isp runner and update board documentation.

Signed-off-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
2021-11-07 05:20:50 -05:00
Gerson Fernando Budke 0de934b2a7 scripts: runner: Introduce gd32isp flash runner
Add GigaDevice ISP console flash runner.  This tool enable uses ROM
bootloader to flash devices using serial port.

The GD32_ISP_Console tool can be found at
  http://www.gd32mcu.com/download/down/document_id/175/path_type/1

Signed-off-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
2021-11-07 05:20:50 -05:00
Jan Zyczkowski d435340f1b drivers: led_pwm: Decrease power consumption
Changed pwm_pin_set_cycles into pwm_pin_set_nsec
to decrease power consumption. Changed default
value for period to 100000. There is no need in having
period for pwm leds equal to 100 cycles as human eye has ~100 fps.

Signed-off-by: Jan Zyczkowski <jan.zyczkowski@nordicsemi.no>
2021-11-06 21:38:35 -04:00
Jakub Rzeszutko b9d4471dbd shell: fix compilation error
Fixed compilatione error when shell sample has been build with flag
CONFIG_SHELL_VT100_COMMANDS set to n.

Fixes: #40124

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-11-06 21:38:02 -04:00
Dominik Ermel a333ffce1d storage/flash_map: Add FLASH_AREA_DEVICE macro
The macro returns pointer to a device object the flash area
exists on.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-06 21:37:47 -04:00
Jair Jack 5b5417a1dd net: lwm2m: Way to pass a destination hostname to socket
net: lwm2m: When mbedtls CONFIG_MBEDTLS_SERVER_NAME_INDICATION is
enabled, a destination hostname must be passed to socket to properly
connect do lwm2m server.

Passing lwm2m context to lwm2m_parse_peerinfo

Signed-off-by: Jair Jack <jack@icatorze.com.br>
2021-11-06 21:37:12 -04:00
Flavio Ceolin b83128e169 pm: Keep track of active states on state_force
Update z_cpu_active in pm_power_state_force

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-06 10:21:53 -04:00
Flavio Ceolin d3a1549ba2 pm: Keep cpu power state consistent
Set the cpu state to ACTIVE after it resumes.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-06 10:21:53 -04:00
Flavio Ceolin 05c17b8443 pm: Remove _handle_device_abort
_handle_device_abort is only called in one place and it basically does
two instructions. Just remove it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-06 10:21:53 -04:00
Flavio Ceolin 9ddcf255bd pm: smp: Properly handle device pm on SMP
On smp environment, we cannot do device power management based only on
the state the current core. For example, do not suspend devices if
there are other cores active, or resume devices if there are other
cores already active.

This change ensure that devices are only suspend when the last active
core become idle and that these devices are resumed only when the first
core becomes active.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-06 10:21:53 -04:00
Flavio Ceolin 9444480c7b pm: Better return type for pm_system_suspend
Instead of returning PM_STATE_ACTIVE for when the cpu didn't enter a
low power state and a different state when it entered, but has
already left the state and is active again, it changes
pm_system_suspend to return true when the cpu has entered a low power
state and false otherwise.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-06 10:21:53 -04:00
Flavio Ceolin 8c3d9afed7 pm: Change pm_power_state_next_get to support SMP
Change the API to account multiple CPUs.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-06 10:21:53 -04:00
Flavio Ceolin af2def14d8 pm: Document missing parameter in exit post ops
info parameter was not properly documented.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-06 10:21:53 -04:00
Flavio Ceolin bd83a46a56 pm: policy: residency: Support multiple CPUs
Each CPU can have its own set of states. Update the policy to get them
from DT and account it when return the best state to the kernel.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-06 10:21:53 -04:00
Flavio Ceolin dd152c2b89 pm: policy: Add cpu information in the API
On multicore environments the policy may need to know which CPU is
idle.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-06 10:21:53 -04:00