Commit Graph

70884 Commits

Author SHA1 Message Date
Ole Morten Haaland 667a3f9de9 qspi: stm32: Add support for reset cmd on init
If the flash is used in 4-byte addressing, reading SFDP will fail after
a system reset if the flash isn't power cycled or hardware reset, since
Zephyr will try to use 3-byte addressing while the flash (still) expects
4-byte addressing.

This commit adds the ability to send a reset command to the flash as part
of initialization, which complements the existing reset-gpio
functionality, and is useful on low-pincount flashes which do not have a
hardware reset.

Signed-off-by: Ole Morten Haaland <omh@icsys.no>
2022-10-11 11:14:46 +02:00
Seppo Takalo d454cc946e net: lwm2m: Add helper macro for filling lwm2m_obj_path structs
Allows filling up struct lwm2m_obj_path by a macro.
For example:
  struct lwm2m_obj_path p1 = LWM2M_OBJ(MY_OBJ);
  struct lwm2m_obj_path p2 = LWM2M_OBJ(MY_OBJ, 0, RESOURCE);

Similarly, some function calls accept the structure, so it can
be initialized from stack and given by a pointer
  lwm2m_notify_observer_path(&LWM2M_OBJ(obj_id, 0, RESOURCE_ID));

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2022-10-11 11:14:31 +02:00
Dominik Ermel c759eb0a93 mgmt/mcumgr: Remove net_buf_pool_get call from zephyr_smp_alloc_rsp
It was pointless and nothing has been done with a result.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-10-11 11:14:22 +02:00
Ahmed Moheb 0d5a49e815 tests: bluetooth: host: Add UT for bt_keys_foreach_type()
Unit test project for bt_keys_foreach_type().
This part of subsys/bluetooth/host/keys.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-10-11 11:14:10 +02:00
Seppo Takalo 65c084f9e5 net: lwm2m: Don't close the socket context on callbacks
I need to register a service for the pull-context so I can
safely close the socket context. Otherwise the socket loop
would crash, because context would be closed while going through
the list where it was located.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2022-10-11 11:13:56 +02:00
Seppo Takalo d49219aede net: lwm2m: Block on semaphose waiting
Minor change, the semaphore is freed by a caller so it was always
free, but just for being correct, it should be a blocking call,
so any errors would clearly block.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2022-10-11 11:13:56 +02:00
Seppo Takalo b72fde1f54 net: lwm2m: Remove second layer or rettrying from pull handler
CoAP layer handles retrying so having a second layer of retry
in the pull-context does not make sense. If we need more retrying
it should be done in CoAP layer.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2022-10-11 11:13:56 +02:00
Seppo Takalo 4ec698004c net: lwm2m: Set FOTA state correctly on URI write
When URI is written, we must first set the state to DOWNLOADING
so when any error happens on the initialization phase, the
result written on a callbacks are correctly reflected and the state
changes correctly IDLE -> DOWNLOADING -> IDLE (result written).

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2022-10-11 11:13:56 +02:00
Seppo Takalo 99ebcefc71 net: lib: lwm2m: Add shell commands for lock and unlock
Allowing locking the registry from commandline allows
us to test composite observation and observation of
object instances, etc. where multiple values are changed
before the notify message triggers.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2022-10-11 11:12:20 +02:00
Seppo Takalo f3ef443a97 samples: net: lwm2m_client: Split sensor modules out from main
Each module deserves their own file so we don't clutter the
main application.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2022-10-11 11:12:07 +02:00
Ingar Kulbrandstad 8e6d5561f6 tests: Bluetooth: Mesh: adv test buffer management
The advertiser runs in a loop, pulling advertising buffers from a queue.
Features covered:
Queue overflow
Sending order
Buffer freeing
Dedicated buffer pools

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2022-10-11 11:11:57 +02:00
Evgeniy Paltsev a76103ce59 tests/kernel/context: don't do print in time-critical section
In test_busy_wait and test_k_sleep test cases of
tests/kernel/context test we measure not only execution time of the
primitives itself (k_busy_wait and k_msleep respectively) but also
the overall test thread execution time.

The issue here is that we do printing in test threads which
means that we do printing in time-critical sections. That breaks
test if we do printing via some device which isn't fast enough.

Fix that by removing print from time-critical section

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2022-10-11 11:11:45 +02:00
Carles Cufi e50a859625 drivers: sensor: qdec_nrfx: Fix build with no optimizations
The build of this driver fails when `CONFIG_NO_OPTIMIZATIONS=y` is set:

error: expression in static assertion is not constant
   98 |  BUILD_ASSERT(steps > 0, "only positive number valid");

error: expression in static assertion is not constant
   99 |  BUILD_ASSERT(steps <= 2048, "overflow possible");

Fix this by using a simple macro to avoid the compiler from getting
confused.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-10-11 11:07:28 +02:00
Adrian Bonislawski 147d9cb127 dts: ace15: add Intel ALH to device tree
Add Intel ALH device tree entries to ace15

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-10-10 21:03:40 -04:00
Tomasz Moń 0e5c717434 doc: Fix kernel data structures typos
Add missing colons to properly render C references.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2022-10-10 21:01:51 -04:00
Dipak Shetty e97e24e7a6 drivers: flash_mcux_flexspi_nor: Add block erase
Change reduces time consumed when a block needs to be erased.
The change was tested on a mimxrt1060_evk board.

Signed-off-by: Dipak Shetty <dipak.shetty@zeiss.com>
2022-10-10 13:23:12 -05:00
Daniel DeGrasse 9d7039f9e9 drivers: regulator: add regulator shell
Add shell for interacting with regulator devices, to enable
users to test power management settings quickly and verify that their
regulator is functioning as expected. Also allows users to interact with
regulator PMIC devices

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-10-10 13:13:27 -05:00
Gerson Fernando Budke 5c484e28f9 drivers: eth: sam0: Fix missing devicetree dependency
The #48905 introduce a regression on gmac ethernet driver. The GMAC
driver matches two compatibles. This add missing compatible for SAM0
variant.

Fixes: #50970.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-10-10 11:23:35 -05:00
Anisetti Avinash Krishna 8df2568a20 soc: x86: Clean up GPIO related defines
Clean up and refactor x86 SoC headers in preparation of adding
new platforms in the future.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2022-10-10 19:17:03 +03:00
Daniel Leung 90456c94f7 logging: workaround hard fault on Cortex-M0 with sys-t/catalog.
For some reason, running sys-t with catalog message on
Cortex-M0 would result in hard fault in mipi_catalog_formatter()
if log_output_syst.c is complied before the backends (and weird
enough, only with SIZE optimization). This new ordering was
introduced in commit f5587552bb
as it was to group all backend source files under a single
directory.

Workaround the issue by compiling file later after backends
as this issue is causing CI failures. Actual root-cause is TBD.

Relates #50941

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-10-10 18:02:08 +02:00
Fabio Baltieri 34f74c96b0 ci: release: stop creating releases for RC tags
RC releases clutter the release page, there's no reason for keeping them
after the release is done, filter them out from the workflow so they
don't get created in the first place..

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-10-10 07:25:15 -07:00
Troels Nilsson 6137e8bc60 tests: Bluetooth: bsim: Ext. adv. duration handling change fixes
Update bsim test to account for timing difference introduced
by Extended Advertising duration fixes.

Signed-off-by: Troels Nilsson <trnn@demant.com>
2022-10-10 13:55:37 +02:00
Troels Nilsson 28a9a79b98 Bluetooth: Controller: JIT fixes for ext. adv. duration handling
- Account for the added random delay when updating remaining duration
- Re-worked JIT re-scheduling update a bit to keep the random delay
  information and remaining duration correct

Signed-off-by: Troels Nilsson <trnn@demant.com>
2022-10-10 13:55:37 +02:00
Troels Nilsson b6f5c75581 Bluetooth: Controller: Ext. adv. duration handling fix
- Remaining duration is now in us instead of ticks to avoid
  overflow when ticks have higher resolution
- First advertising event should not reduce remain duration

Signed-off-by: Troels Nilsson <trnn@demant.com>
2022-10-10 13:55:37 +02:00
Troels Nilsson 2a9cd8ffb1 Bluetooth: Controller: Add EVENT_OVERHEAD_START_US when enabling states
Add EVENT_OVERHEAD_START_US to ticks_anchor when enabling
advertising, so the first advertising event is not late due
to calculations for aux packets etc.

Signed-off-by: Troels Nilsson <trnn@demant.com>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-10-10 13:55:37 +02:00
Vinayak Kariappa Chettimada 236d0351e7 Bluetooth: Controller: EVENT_OVERHEAD_START_US for typical usecases
Tune the EVENT_OVERHEAD_START_US for typical usecases on
nRF52833 SoC using the central_gatt_write and
peripheral_gatt_write samples.

Manually run the samples for over 30 mins without any
assertions and use the actual profiled value that would
otherwise be printed on assertion.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-10-10 13:55:37 +02:00
Vinayak Kariappa Chettimada a3b0ade9c6 Bluetooth: Controller: Explicit ticker worker trigger on expire in past
When ticks_to_expire is in the past, i.e. ticks_to_expire is
0, perform an explicit trigger of ticker worker instead of
setting up the compare which delays the trigger by the
minimum ticks offset margin. The changes reduce latencies
of the O(n) ticker_resolve_collision by upto the minimum
ticks offset margin (3 for nRF SoCs) for each resolution.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-10-10 13:55:37 +02:00
Vinayak Kariappa Chettimada ebf7236267 Bluetooth: Controller: Add verbose assertion on delayed prepare
When an event's prepare is delayed due to ULL scheduling or
ISR latencies, check and have a verbose assertion that logs
the actual EVENT_OVERHEAD_START_US required.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-10-10 13:55:37 +02:00
Vinayak Kariappa Chettimada 7715fb40e2 Bluetooth: Controller: Add LL_ASSERT_MSG definition
Add LL_ASSERT_MSG definition to log a verbose message as
part of assertion check.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-10-10 13:55:37 +02:00
Vinayak Kariappa Chettimada 2d6f6a7729 samples: Bluetooth: hci_rpmsg with 2 BIS configuration
Update the config file to support 2 Broadcast Streams in
hci_rpmsg samples for running iso_broadcast and iso_receive
samples on nRF5340 DK.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-10-10 13:55:06 +02:00
Gaël PORTAY 29eee72ed4 boards: arm: olimex_lora_stm32wl_devkit: fix typo
The board embeds a Bosch BME280 temperature, humidity, pressure
sensor[1].

[1]: https://www.olimex.com/Products/IoT/LoRa/LoRa-STM32WL-DevKit/open-source-hardware

Signed-off-by: Gaël PORTAY <gael.portay@gmail.com>
2022-10-10 13:50:25 +02:00
Martí Bolívar 98bcc2d88e west: runners: blackmagicprobe: fix on windows
We need to give gdb slash-separated paths to ELF files on Windows.
Just make sure we always have slash-separated paths. We use this
technique in various places around the tree.

Fixes: #50789
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-10-10 09:54:14 +02:00
Andrei Emeltchenko 98580f1c22 tests: espressif_esp32: Fix docs generation issue
Fixes following bug:
...
Warning, treated as error:
../espressif_esp32/cache_coex/README.rst:4:Title underline too short.
...

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-10-08 18:33:21 +02:00
Daniel Leung 913c662062 tests: kernel/common: IRQ offload test if CONFIG_IRQ_OFFLOAD=y
This changes to compile the IRQ offload test only if
CONFIG_IRQ_OFFLOAD=y. For architectures that do not support
IRQ offload (or that developers with to disable IRQ offload
during bring-up), compiling the code would result in linking
errors.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-10-08 18:33:14 +02:00
Krzysztof Chruscinski 02664dbc91 logging: Use cbprintf flags for log_printk
Use cbprintf flags also when creating log message for printk entry.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-10-08 18:32:57 +02:00
Krzysztof Chruscinski dc9c5fca4f logging: Add option LOG_MSG_APPEND_RO_STRING_LOC
Bring back Kconfig option which was previously removed by
9cd5086407 (previously named LOG_MSG_PKG_ALWAYS_ADD_RO_STRING_IDXS).
Renamed to shorten and be more descriptive. It can be useful for
external backends or frontends.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-10-08 18:32:57 +02:00
Jay Vasanth f87acb5bdd soc: arm: microchip: add common mec_gpio.h
add common mec_gpio.h to allow access to common gpio_regs
structure for both mec15xx and mec17xx, used in pinctrl driver

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-10-08 18:32:33 +02:00
Henri Xavier a43b37bb07 boards: Add support for Khadas Edge-V board
This is an AArch64 board. We also add RK3399 SoC support,
as well as a very simple Synopsys 8250dw UART driver.

Signed-off-by: Henri Xavier <datacomos@huawei.com>
2022-10-08 18:32:14 +02:00
Peter Mitsis d308ca5695 drivers: timer: adsp: Improve elapsed ticks calculations
It is better to use 64-bit variable types for calculating the number
of elapsed ticks than 32-bit variable types. This guards against the
propagation of calculation errors should the lower 32-bits of the timer
counter roll over multiple times before the timer ISR is serviced.

(Such a scenario can easily occur when pausing the system for an
extended period of time with a debugging device such as a Lauterbach.)

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2022-10-07 18:34:50 -04:00
Daniel Leung ff46de7838 tests: intel_adsp/smoke: wait longer for sched IPI
This lengthens the CPU_IPI_DELAY as some hardware require
a bit more time for IDC to propagate.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-10-07 18:12:34 -04:00
Daniel Leung cdb77d843a soc: intel_adsp/ace: fix IDC processing for sched IPI
The Inter-DSP Communication (IDC) is being used to send
sched IPI to other CPU cores. When a core receives an IDC,
it needs to ACK it by clearing the BUSY bit in TDR, and also
needs to the BUSY bit in TDA to signal done after processing.
These two steps are needed to complete one IDC message.
If we do only one (and not both), the other side will not be
able to send another IDC message as the hardware still thinks
the core is processing the IDC message (and thus will not send
another one). So add the step to clear the BUSY bit in TDA so
we can have multiple sched IPIs.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-10-07 18:12:34 -04:00
Ederson de Souza 0e6aee3479 tests/boards/intel_adsp: Add cache related tests
Tests that exercise z_xtensa_cache_[flush|inv|flush_inv]_all()
functions.

These tests are at board level because what is mapped into memory is
SoC/board dependent - no one wants side effects due writing to some
inappropriate address.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-10-07 17:48:39 -04:00
Ederson de Souza c28d3820fd arch/xtensa: Fix z_xtensa_cache_[flush|inv|flush_inv]_all functions
They were basically using the wrong instructions to traverse the cache
by index: `dhi`, `dhwb` and `dhwbi` instead of `dii`, `diwb` and `diwbi`
variants.

Fixes #49112.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-10-07 17:48:39 -04:00
Erwan Gouriou 7b31b0e23c scripts: west_commands: openocd: Use 'reset init' by default
Instead of 'reset halt', default the command to reset and halt the target
to 'reset init'.

OpenOCD strictly requires 'reset init' to halt and prepare the device
before flash programming.
See https://openocd.org/doc/html/Flash-Commands.html chapter
"12.2 Preparing a Target before Flash Programming."

For targets implementing the init hook, it will allows to perform some
target specific init improvements (such as speed flash improvements).
Targets not implementing this hook will end up executing the usual and
previous 'halt'.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-10-07 12:19:46 -07:00
Maureen Helm 03c8deb599 devicetree: Add model name helpers based on compat
Follow up to e1e16640b5 adding model name
helpers to access generated macros based on a compatible's matching
entries in vendor prefixes.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-10-07 11:48:02 -07:00
Maureen Helm e73c363346 scripts: edtlib: gen_defines: Add model name macros based on compat
Follow up to 5b5aa6ebba adding model name
and existence macros for all compatibles of a node that match an entry
in vendor prefixes.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-10-07 11:48:02 -07:00
Tom Burdick a7c801fa66 boards: tdk_robokit1 jlink flasher support
Adds the needed JLink parameters and cmake includes to support flashing
and debugging the tdk_robokit1 with a segger jlink.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-10-07 12:44:52 -05:00
Andrzej Puzdrowski 15eeabcafb manifest: mcuboot update
- Added precise check of the image size.
- loader: Added post copy hook to swap function.
- Added Kconfig option for setting swap using move as the default
  swap algorithm.
- zephyr: fixed ram loading for ARM, with correct handling of
  the vector table when code has moved to RAM.

- imgtool: Added option to export public PEM.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-10-07 16:44:20 +00:00
Juha Ylinen c8a409d7d3 net: lwm2m: Use const data pointers in lwm2m_engine_set functions
lwm2m_engine_set functions use void data pointers. Change those to
to const void

Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
2022-10-07 16:43:51 +00:00
Robert Lubos b76c35d809 modules: mbedtls: Replace select statement with depends on for EC
Instead of using "select" on certain EC configurations, which is
considered unsafe for various reasons, use a "depends on" and rely on
the user to set a proper configuration in the config file.

Update the respective project configurations to comply with the new
configuration scheme.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-10-07 15:12:42 +02:00