Commit graph

71993 commits

Author SHA1 Message Date
Dominik Ermel
7ed6775d02 mgmt/mcumgr: Fix MCUMGR_BUF_USER_DATA_SIZE selection for BT
Rounded up struct smp_bt_user_data takes 8 bytes; this fixes
static assert failing with message:
  CONFIG_MCUMGR_BUF_USER_DATA_SIZE not large enough to fit Bluetooth
  user data

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-11-10 13:30:12 +01:00
Jamie McCrae
dbd2176655 mgmt: mcumgr: fs_mgmt: Update hash/checksum supported command
Updates the hash/checksum supported command to use the new command
structure.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 12:34:39 +01:00
Jamie McCrae
4b70d4337f doc: release: 3.3: Add mcumgr stable API change
Adds details of the stable API change to mcumgr's callback system,
including a link to the migration guide.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 12:34:39 +01:00
Jamie McCrae
d5693ed464 doc: device_mgmt: callbacks: Add initial documentation
Adds the initial documentation describing the mcumgr callback
system and how to use it, including API reference and samples.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 12:34:39 +01:00
Jamie McCrae
c2b872b901 mgmt: mcumgr: os_mgmt: Switch to new event callback system
Switches to the new event callback system for the os_mgmt
functionality and removes the old code.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 12:34:39 +01:00
Jamie McCrae
986ea39512 mgmt: mcumgr: img_mgmt: Switch to new event callback system
Switches to the new event callback system for the img_mgmt
functionality and removes the old code.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 12:34:39 +01:00
Jamie McCrae
4e8fde15a3 mgmt: mcumgr: fs_mgmt: Switch to new event callback system
Switches to the new event callback system for the fs_mgmt
functionality and removes the old code.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 12:34:39 +01:00
Jamie McCrae
042ed0539b mgmt: mcumgr: Add access denied error code
Adds an access denied error code that can be used to signal to the
mcumgr client that the requested access to a specific resource or
command/functionality has been denied.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 12:34:39 +01:00
Jamie McCrae
6f75c99b8b mgmt: mcumgr: Rework event callback system
Reworks the event callback system to use a linked list to allow for
chained handlers and support passing a status back to the handler to
indicate if the request should be rejected or allowed. This also
removes the old base callback functionality.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 12:34:39 +01:00
Guillaume Gautier
bd5eea7a50 dts: bindings: ospi: Require STM32 OSPI clock-names binding
Following the modification of the STM32 OSPI driver, the clock-names
binding is now required

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2022-11-10 11:28:18 +00:00
Guillaume Gautier
2604951989 drivers: flash: Use dts to configure STM32 OSPI manager clock
Instead of calling __HAL_RCC_OSPIM_CLK_ENABLE() to enable the OSPI
manager clock, we now use a new clock binding in the dts.

In order to avoid confusion between the different clocks, the driver
is modified to select the clock based on their names instead of indexes.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2022-11-10 11:28:18 +00:00
Guillaume Gautier
59d6b94a40 dts: arm: st: Add clock names for all STM32 OSPI instances in dts
For all STM32 featuring octospi, clock-names are added to use them
instead of indexing for configuring the clock.
For U5 series, a third clock is added for the OSPI manager.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2022-11-10 11:28:18 +00:00
Guillaume Gautier
3352c2d42f doc: releases: Update release notes with stm32 rtc modification
Update release notes 3.3 with the different modifications brought
to the STM32 RTC counter including new functionality, deprecated
and removed Kconfig

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2022-11-10 11:27:49 +00:00
Guillaume Gautier
58f82bf243 drivers: counter: Remove unused Kconfig symbols for stm32 rtc
Remove a set of Kconfig symbols for configuring the RTC on STM32
that are no longer useful

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2022-11-10 11:27:49 +00:00
Guillaume Gautier
3bfc22ac73 drivers: counter: Add support for STM32 RTC source from dts
Add support for STM32 RTC source from dts

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2022-11-10 11:27:49 +00:00
Guillaume Gautier
dbbfff5002 boards: arm: Add RTC clock source for STM32 boards dts
For every board using an STM32, add the RTC clock source in its dts

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2022-11-10 11:27:49 +00:00
Guillaume Gautier
00504fd585 include: zephyr: dt-bindings: clock: Add RTC clk src defines for STM32
For all STM32 series, add some defines to select the RTC clock source.
This change is necessary to be able to select the RTC clock source in
dts instead of Kconfig

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2022-11-10 11:27:49 +00:00
Guillaume Gautier
a332ee3172 drivers: clock_control: clock_stm32: Add support for lse bypass
Add support for LSE bypass for all STM32 series

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2022-11-10 11:27:49 +00:00
Guillaume Gautier
a407c4e04e include: zephyr: drivers: clock_control: Add stm32 lse bypass
Add a define to get the value of the LSE bypass property from dts

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2022-11-10 11:27:49 +00:00
Guillaume Gautier
24680021b7 dts: bindings: clock: add bypass property to stm32 lse
For STM32 LSE clock, add LSE bypass property (defaulting to false)

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2022-11-10 11:27:49 +00:00
Gerson Fernando Budke
92ca06577f samples: usb: mass: Add support to TFM NS boards
This add TFM cmake definitions to build mass storage sample for non
secure firmware boards versions. The stm32l562e_dk_ns board was used
to demonstrate. It uses SDMMC/SD with TFM profile large. Tests were
conducted using a 2GB transflash card with FAT-32 partition.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-11-10 11:26:11 +00:00
Gerson Fernando Budke
151e145b44 boards: arm: stm32l562e_dk: Enable usb tags for tests
This enables usb and usb_device tag for tests. It explicitly disable
samples/subsys/usb/dfu for non-secure version of this board due to
building errors, which can be explored in future.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-11-10 11:26:11 +00:00
Jamie McCrae
82258f6c5c doc: release: 3.3: Add note on MCUmgr changes
Adds a note on changes needed to applications to update them for
changes introduced into MCUmgr.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 11:54:46 +01:00
Gregers Gram Rygg
c9e07fc385 drivers: flash: spi_nor: fix flash busy during init
After a soft-reset of the host controller the flash device is not reset.
This can cause the flash device to still be busy writing or erasing when
the host controller boots and initializes the flash. The often results
in errors and the flash device not being initialized.

This fix polls the status register until the WIP flag is off before
initializing the flash device.

Fixes #51713

Signed-off-by: Gregers Gram Rygg <gregers.gram.rygg@nordicsemi.no>
2022-11-10 11:11:11 +01:00
Jamie McCrae
f85eafe02c doc: release: 3.3: Add note on new fs_mgmt feature
Adds a note on the new fs_mgmt feature to query supported
hash/checksum types.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 11:10:03 +01:00
Jamie McCrae
379d23001f tests: mgmt: mcumgr: Add fs_mgmt_hash_supported test
Adds a test which checks that the fs_mgmt supported hash/checksum
functionality is working and returns the expected response.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 11:10:03 +01:00
Jamie McCrae
7f56c06ea8 doc: guides: device_mgmt: smp: fs: Add supported hash/checksum info
Adds information on the supported hash/checksum mcumgr command.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 11:10:03 +01:00
Jamie McCrae
77374b3857 mgmt: mcumgr: fs_mgmt: Allow querying supported hash/checksums
Adds a new mcumgr command for returning information on all supported
hash/checksum types that the firmware supports.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 11:10:03 +01:00
Jamie McCrae
2aca1242f7 mgmt: mcumgr: Fix Bluetooth transport issues
This fixes issues with the Bluetooth SMP transport whereby deadlocks
could arise from connection references being held in long-lasting
mcumgr command processing functions.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 11:08:52 +01:00
Jamie McCrae
7028d01544 mgmt: mcumgr: Update struct name in documentation
Replaces mgmt_hdr with smp_hdr in documentation to match changes in
code.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 11:08:26 +01:00
Jamie McCrae
f0669f845c mgmt: mcumgr: Replace mgmt_ctxt struct with smp_streamer
This replaces an intermediatory structure with a different one which
allows command functions to access the full contents of the streamer
structure that would be otherwise unavailable. This is a foundation
for allowing asynchronous mcumgr messages from the server.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 11:08:26 +01:00
Erwan Gouriou
9b7d3657c9 tests: clock_control: stm32h7_devices: Test perck domain config
Add a test dedicated to verify the perck domain clock configuration.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-11-10 09:30:09 +01:00
Erwan Gouriou
4a0032ddc1 drivers: clock_control: stm32_mux: Fix src clock configuration
In order to configure domain clock, clock_control_configure should be
used instead of clock_control_on which is only useful for bus clock gating.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-11-10 09:30:09 +01:00
Erwan Gouriou
cf84395f7b tests: clock_control: stm32h7_devices: Test perck configuration
When it needs to access perck clock speed, clock_control driver is using
LL API to read RCC registers and compute frequency.
We're using the exact same method to test the frequency and as a result
we were not able to detect that there was an issue when configuring this
clock.

Add a specific case to this test in order to verify perck domain clock if
perck is used in SPI clk configuration.

We're now able to detect issues (and test is failing).

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-11-10 09:30:09 +01:00
Erwan Gouriou
efd6fdb381 tests: clock_control: stm32: Enhance tests log messages
Perform some rework in messages displayed in case of failure to ease
readability:
- remove redundant information
- add missing information
- convert registers values to hex

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-11-10 09:30:09 +01:00
Erwan Gouriou
447c3df873 tests: clock_control: stm32h7_devices: Fix clock source check
Test was using "clock-names" property to query domain clock configuration.
This is not working since clock-names was removed in the last step of the
feature implementation and whole macro was always reporting DT_NO_CLOCK.

This issue went undetected because of an additional issue in the exception
case which was testing "zassert_true(1, .." instead of "zassert_true(0, .".

Fix both issues to make the test efficient again.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-11-10 09:30:09 +01:00
Nirosharn Amarasinghe
05940a8f66 tests: bluetooth: controller: restructured and update ISO-AL unit tests
-- Included TX tests
-- Re-factored to use FFF

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2022-11-10 09:29:42 +01:00
Nirosharn Amarasinghe
bd74d27614 Bluetooth: controller: Time wrapping point used in ISO-AL calculations
-- Handle time calculations across the point at which the controller's
   time information from the controller's clock will wrap (in the
   microsecond range)
-- Use wrapped time in all ISO-AL time calculations

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2022-11-10 09:29:42 +01:00
Théo Battrel
e9c542ab5b Bluetooth: Add the cryptographic toolbox function h8
Add to the cryptographic toolbox the h8 function, defined in the Bluetooth
Core Vol. 6, part E 1.1.1.

Also add test and SMP self test for this function. The data used for those
are from the Bluetooth Core.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2022-11-10 09:28:28 +01:00
Théo Battrel
f16738b62b Bluetooth: Move crypto toolbox functions from smp.c to their own files
Move functions defined in the Cryptographic toolbox of the Bluetooth
specification inside their own files in the following folder:
`zephyr/subsys/bluetooth/bt_crypto`. The functions were previously
implemented in `zephyr/subsys/bluetooth/host/smp.c`.

The cryptographic toolbox functions can now be accessed from outside of the
host.

In addition to that, tests for each cryptographic toolbox functions have
been added.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2022-11-10 09:28:28 +01:00
Ryan Erickson
12b4187092 lwm2m: swmgmt: fix observations not working for resources
The pointers to resource values should not be used
directly to update the values.
This will break observations if the server is trying to
observe changes during a software update.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-11-10 09:27:54 +01:00
Daniel Skatt
a94263784b gpio_mcp23sxx_fix: spi_msg and multiple inst
Fixed how data is read in mcp23sxx_read_port_regs
The data is now stored in an array to get the
actual data from spi

Signed-off-by: Daniel Skatt <daniel.skatt@gmail.com>
2022-11-09 15:55:39 -05:00
Daniel Skatt
f921ff1fc8 gpio_mcp23sxx_fix: spi_msg and multiple inst
Changed SPI message from 2 seperate to 1
Fixed problem using multiple instances

Signed-off-by: Daniel Skatt <daniel.skatt@gmail.com>
2022-11-09 15:55:39 -05:00
Ranjani Sridharan
2fb01e412f dma: dw: Fix return value in dw_dma_stop
Do not throw away the errors.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-11-09 21:42:13 +01:00
Pavel Vasilyev
1629a2f4d1 Bluetooth: Mesh: Fix net and app keys commands in shell
Fix net and app keys commands in shell

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-11-09 10:50:31 -06:00
Armin Brauns
2d56e4b41e dts: stm32f7: fix locations of stm32-temp-cal registers
The only supported device in the F7 family with temp-cal registers at
0x1FF07A2C is the stm32f723. All other devices use 0x1FF0F44C.

part               | DS#       | TS_CAL1     | TS_CAL2
-------------------|-----------|-------------|------------
722/723            | [DS11853] | 0x1FF0 7A2C | 0x1FF0 7A2E
745/746            | [DS10916] | 0x1FF0 F44C | 0x1FF0 F44E
750                | [DS12535] | 0x1FF0 F44C | 0x1FF0 F44E
756                | [DS10915] | 0x1FF0 F44C | 0x1FF0 F44E
765/767/768/769    | [DS11532] | 0x1FF0 F44C | 0x1FF0 F44E

[DS11853]: https://www.st.com/resource/en/datasheet/stm32f722ve.pdf
[DS10916]: https://www.st.com/resource/en/datasheet/stm32f746ng.pdf
[DS12535]: https://www.st.com/resource/en/datasheet/stm32f750v8.pdf
[DS10915]: https://www.st.com/resource/en/datasheet/stm32f756ng.pdf
[DS11532]: https://www.st.com/resource/en/datasheet/stm32f765zg.pdf

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2022-11-09 10:48:28 -06:00
Gaël PORTAY
a8ae2217e2 samples: modbus: print returned error code
This prints the returned error code, just like the other calls do.

Signed-off-by: Gaël PORTAY <gael.portay@gmail.com>
2022-11-09 10:46:02 -06:00
Martí Bolívar
b907f74326 runners: trace32: mypy fixes
Fixes for the following issues that a new version of mypy started
reporting recently:

runners/trace32.py:34: error: Incompatible default for argument
"startup_args" (default has type "None", argument has type
"List[str]") [assignment]

runners/trace32.py:137: error: Incompatible default for argument
"cfg" (default has type "None", argument has type "Path") [assignment]

runners/trace32.py:34: note: PEP 484 prohibits implicit Optional.
Accordingly, mypy has changed its default to no_implicit_optional=True

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-11-09 11:10:09 -05:00
Marco Argiolas
be4ee1edef drivers: sensor: sensor_shell: fix channel name collision
Channel SENSOR_CHAN_GAUGE_FULL_CHARGE_CAPACITY was returned in place of
SENSOR_CHAN_GAUGE_FULL_AVAIL_CAPACITY, due to their matching names.
Ensuring that the channel names are unique fixes the issue.

Signed-off-by: Marco Argiolas <marco.argiolas@ftpsolutions.com.au>
2022-11-09 09:44:27 -06:00
Adrian Bonislawski
728e387aa2 dts: xtensa: intel: fix alh instances
"alh0: alh1:" will create only one instance and this needs to be
reverted to original form with two instances

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-11-09 09:09:20 -06:00