Commit Graph

73828 Commits

Author SHA1 Message Date
Guillaume Gautier 45b0804550 tests: drivers: counter: counter_basic_api: src: Fix STM32 RTC device
Commit fd65800 introduced a regression for the counter_basic_api test for
STM32 by using a Silabs Gecko Kconfig to enable the STM32 RTC.
This commit uses the proper STM32 Kconfig for the RTC instead.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-01-09 10:14:06 +01:00
Marti Bolivar c3d39d9573 doc: application development: adjust creation section hierarchy
The 'Creating an Application' section has existed for several years
and predates the introduction of the example-application repository.

It's still a good reference, but it's not really the easiest way to
make an applications any more. Judging by experience watching users
ask questions and receive support on Discord, the example-application
repository is serving its purpose as a better 'pre-cooked' starting
point.

Adjust the hierarchy so that there's a single, parent section about
creating applications, which has using example-application as one
alternative, and doing it by hand as a less-recommended option. Add
more text on exactly what you need to do with example-application to
get something you can actually use.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-01-08 19:51:47 +01:00
Marti Bolivar 873b63109b doc: application: improve example-application section
The 'Example Application' text is similar to but not the same as the
name of the repository, which is example-application. Use the name of
the repository instead. This is easier to search for and plants seeds
in people's memory about where to find it on GitHub.

Add more cross references.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-01-08 19:51:47 +01:00
Marti Bolivar 82ed21d9e7 doc: application: improve application types section
Add more cross-references to the overview and make a few other
improvements. In particular, adapt to David Kinder's recommended
style (lowercase 'zephyr' for the repository, capitalized 'Zephyr' for
the more general software distribution).

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-01-08 19:51:47 +01:00
Marti Bolivar c1d31734f9 doc: application: clean up overview
A few things are stale or missing:

- Using the term 'kernel' is outdated at this point. It's been years
  since Zephyr was just a kernel, and we now include many modules as
  well as our internal subsystems and driver layers. Make that clearer
  in the overview.

- Devicetree overlays are a basic piece of zephyr applications and
  they're worth highlighting at this introductory place as well. Note
  that neither app.overlay or prj.conf are actually required to be
  present, so if we're mentioning prj.conf here, we might as well
  mention app.overlay too.

- Explain the basic purpose of and differences between Kconfig
  fragments and DT overlays.

Clean up some other language and provide some more cross references.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-01-08 19:51:47 +01:00
Marti Bolivar 20b1c56572 doc: application: make default app a workspace app
It is well known that putting your application inside the west
workspace where zephyr is installed, i.e. defining a workspace
application, makes it easier to use west build, since you don't have
to juggle setting ZEPHYR_BASE appropriately.

Therefore, recommend doing thing this way, while leaving a hint about
how to do something else.

The current state of affairs where the application is assumed to be in
$HOME/app is longstanding and precedes the introduction of west to
zephyr, and I think it's overdue for the page to get with the times
and use conventions that work well with west: our reference
application has been a workspace application for almost 2 years at
this point.

Create a new meta-variable <app> to describe the location of the
application to keep things short and make it clearer that the actual
location on the file system doesn't matter as long as things are set
up properly.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-01-08 19:51:47 +01:00
Erwan Gouriou af0576b7ea drivers: flash: stm32: Remove useless Kconfig
SOC_FLASH_STM32_V1 is not used anymore.
Remove it

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-08 19:49:12 +01:00
Erwan Gouriou cc1601fde7 driver: flash: stm32: Use compat information to select file to build
Now that compatible is directly linked with driver version,
use DT compat based Kconfig flag to build the correct flash driver
version.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-08 19:49:12 +01:00
Erwan Gouriou 306f4d0bbc dts: stm32: flash: Get all series using same driver to use same compat
Compat "st,stm32f1-flash-controller" is now used by all series using
F1x flash driver.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-08 19:49:12 +01:00
Erwan Gouriou a934cce35b drivers: flash: stm32: Rename v1 driver into f1x
Instead of introducing a vX driver version, use series name.
With this commit F0, F1, F3, L0 and L1 series are using F1 flash driver.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-08 19:49:12 +01:00
Daniel DeGrasse a3f2d2bbde tests: drivers: adc: add support for RT595 to ADC API test
Enable support for RT595 in ADC API testcase

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-01-08 19:48:54 +01:00
Daniel DeGrasse 64ff9aa4d2 samples: drivers: adc: add support for RT595
Add support for RT595 evk to adc driver sample. RT595 uses external
reference voltage, which is set to 1.8V on this board.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-01-08 19:48:54 +01:00
Daniel DeGrasse 46aec6dbea boards: arm: mimxrt595_evk add adc support
Add ADC support for RT595 EVK, with channels 0 and 8 connected via
pin control.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-01-08 19:48:54 +01:00
Daniel DeGrasse 29c53f4f6a drivers: adc_mcux_lpadc: add clock setup for RT5xx SOC
Add clock setup code for RT5xx series SOC to LPADC driver

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-01-08 19:48:54 +01:00
Erik Brockhoff 2f61771948 Bluetooth: controller: consider host ctrl feature bits in feat exchange
Host controlled feature bits were not considered in feature exchange
procedure. This is fixed.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2023-01-08 19:48:38 +01:00
Erwan Gouriou c5ab922f50 drivers: hci: stm32wb: Use clock_control driver for clock configuration
Instead of relying on STM32Cube API, use clock_control framework
for clock configuration inside this driver.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-08 19:48:27 +01:00
Erwan Gouriou 561fd80180 dts: stm32wb: Add a node for stm32wb rf
Purpose of this node is only to provide a way to configure RF
clock using device tree and clock_control driver.

Default configuration is reproducing existing hard-coded configuration.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-08 19:48:27 +01:00
Erwan Gouriou c83bc0539c include: dt-bindings: clocks: stm32wb_clock: Add RFWKP_SEL()
Add macros and defines related to the ability to select RFWK domain
clock.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-08 19:48:27 +01:00
Erwan Gouriou f3e788e84e drivers: hci: stm32wb: Refactor c2_reset()
In preparation of the introduction of dt configured clock in this
driver, refactor clock related clocks.
- remove start_ble_rf()
- Move  IPCC clock activation in c2_reset()

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-08 19:48:27 +01:00
Erwan Gouriou 079a43d9f8 drivers: hci: stm32wb: LSE clock configuration not required
As long as LSE clock is set in device tree, configuration will be
done in clock control driver, no need to do it here.
Besides, remove back up domain related code as this is also already
handled in clock_control driver.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-08 19:48:27 +01:00
Erwan Gouriou 52b9724a88 drivers: hci: stm32wb: LSI is not an allowed clock for BLE RF.
Remove code related to LSI used as clock source for RF wakeup,
it isn't a valid clock source.
Also don't disable LSI when LSE is selected.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-08 19:48:27 +01:00
Erwan Gouriou f1dfeff282 drivers: hci: stm32wb: Don't mess with RTC Clock source
No reason to update RTC clock source in this driver.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-08 19:48:27 +01:00
Aaron Massey c4be38dec1 fuel_gauge: sbs_gauge: Enable MFR ACC write
Update the SBS Gauge driver that implements the fuel_gauge API to implement
a set_property function allowing the writing of an SBS word to the
manufacturer access register per the SBS spec.

Includes an update to the SBS Gauge emulator and SBS fuel gauge tests to
weakly verify the code runs.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2023-01-08 19:48:12 +01:00
Aaron Massey 48d5b6c1f1 emul: Correct emul_sbs_gauge to allow SBS word r/w
Fix SBS I2C transfer emulation to accept reads and writes of 16 bit words
as defined by the SBS spec. This change is tested by a following commit
that implements writing and subsequently reading a written SBS property.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2023-01-08 19:48:12 +01:00
Aaron Massey f5d269538b fuel_gauge: Add writable mfr access prop
Add fuel_gauge_set_property function to the fuel gauge API with starting
writable property of SBS specific manufactuer access.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2023-01-08 19:48:12 +01:00
Aaron Massey c0762d003a fuel_gauge: Implement sbs gauge read for mfr acc
Implement and weakly test fetching the manufacturer access word from an SBS
compatible fuel gauge.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2023-01-08 19:48:12 +01:00
Aaron Massey db60e08604 fuel_gauge: Add readable mfr access prop
Add the SBS manufactuer access as a fuel gauge readable property.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2023-01-08 19:48:12 +01:00
Emil Gydesen 57218eee31 Bluetooth: Host: Add BT_CONN_INTERVAL_TO_US
The macro BT_CONN_INTERVAL_TO_MS was used a fair amount
of places, but it often was used with integers. This meant
that sometimes the resulting (integer) value would be
incorrect, as something like 7.5ms interval would not
be properly stored as a integer in millisecond units.

Adding BT_CONN_INTERVAL_TO_US allows users to still use
integers to store the result, but in a more accurate unit.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-08 19:47:03 +01:00
Peter Johanson 8a29ed9092 drivers: adc: Fix ADC tests for new RP2040 board.
Fix ADC tests with new SparkFun Pro Micro RP2040 board.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2023-01-08 19:32:59 +01:00
Peter Johanson e8aeea6d5d boards: arm: Add sparkfun_pro_micro_rp2040 board
Add `sparkfun_pro_micro_rp2040` board with `sparkfun,pro-micro` header.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2023-01-08 19:32:59 +01:00
Flavio Ceolin 05d3b57851 doc: security: Disclose CVE information
Add information about CVE-2022-2993

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-01-07 21:34:33 +01:00
Joakim Andersson 3c4783042e manifest: Update TF-M to use upstream patch for MBedTLS build warnings
Update TF-M version which remove the downstream patch and replaces it
with the upstream TF-M patch for masking MBedTLS build warning of
unused const variable.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2023-01-06 22:33:37 +09:00
Emil Gydesen 8d86fa0125 Bluetooth: Audio: Add support for encrypted broadcast
Add support for adding a broadcast code to the broadcast
source.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-01-06 10:35:25 +00:00
Emilio Benavente 9b1b68657c tests: drivers: i2s: Combined merged the test files into main
Since main was only registering the Test Suite, it made since
to combine the actual tests into one file instead of having
an empty file to initialize the test.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-01-06 10:34:45 +00:00
Emilio Benavente 3ffc64a92d tests: drivers: i2s: ZTest ordering issue fix
The test was executing the expected functions
out of order. I have created a config functions
and explicitly declared them to be setup functions
for this ZTest framework.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-01-06 10:34:45 +00:00
Emilio Benavente d4cfc35b8d tests: drivers: i2s: Fix Label Property issue
The I2S Speed test attempted to find a device
via the Label Property of the node. I have updated
the code to search for the nodelabel instead.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-01-06 10:34:45 +00:00
Emilio Benavente fdad738cff tests: drivers: i2s: Adding overlays to I2S supported boards
Adding overlay files that give an alias name to the
i2s node that is equivalent to the alias in the
i2s speed test.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-01-06 10:34:45 +00:00
Krzysztof Chruscinski a326f05b93 tests: logging: log_api: Fix test_log_arguments case
Test had by accident an early return and after removal case was failing
in certain configurations. It was failing because set of long messages
was not fitting into the logging buffer used in the test. Fixed the
test by adding more frequent processing between the messages.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2023-01-05 18:28:33 -05:00
Peter Mitsis 42db096d28 kernel: resolve static analysis false positives
At least one static analysis tool is flagging a potential NULL
derefence in sys_clock_announce()'s tick processing loop where the
routine 'first()' is concerned. In practice, this does not occur as
...

  1. The code in question is protected by a spinlock.
  2. 'first()' does not change the contents of anything.

The code has consequently been tweaked to prevent similar such false
positives in the future.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-01-05 18:23:04 +00:00
Erwan Gouriou 69cc659c92 boards: stm32: fix --reset argument for stm32cubeprogrammer runner
stm32cubeprogrammer runner takes a --reset-mode argument to specify the
type of reset used in the flashing process.
Though, argparse default configuration in python allows shortened command
arguments and it happened that --reset was used on most boards instead
of --reset-mode.
This argparse configuration is being changed in order to prevent shortened
command  args (see #53495). As a consequence all board configs using
--reset should be updated to use the full length version.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-01-05 11:16:03 -06:00
Robert Lubos 3fd0801a49 net: ipv4: Fix packet leak with IPv4 autoconf
The IPv4 autoconfiguration feature relies on the fact, that autoconf
ARP packets are always prepared by the ARP module. After recent ARP
refactoring though that could no longer be the case due to packet
queueing mechanism. This could lead to net pkt leaks in the autoconf
module.

Fix this by skipping the pending packet queue for autoconf packets.
Since for autoconf ARP requests there's no really a pending packet
to queue, it can be safely avoided. This results in the ARP request
being always sent for the autoconf case, preventing the packet leak.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-01-05 14:39:17 +00:00
Juha Ylinen 5e4eeb104d net: lwm2m: Verify data buffer size in lwm2m_engine_set()
Check data buffer size and return error if
     * buffer size is too small for opaque or string data type
     * buffer size is not equal to res data length when data type
       is fixed size

Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
2023-01-05 14:39:01 +00:00
Andrei Emeltchenko e8f0e66bc4 tests: libc: Fix "unused" type of warnings
Follow example several lines below and fix warnings from static tools.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-01-05 08:00:09 -05:00
Mariusz Skamra 8cd6c55d96 Bluetooth: audio: ascs: Fix possible race condition
This fixes possible ASE state race condition. The notification is sent
immediately once the ASE state changed that eliminates a situation where
the state was changed by user action (API function call) when the state
was not yet notified to the remote Unicast Client.

Fixes: BAP/USR/SCC/BV-158-C
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-01-05 12:43:32 +01:00
Pascal Brogle 60bf310aae net: lwm2m: fix senml cbor object link encoding
use text format instead of tlv format

Signed-off-by: Pascal Brogle <pascal.brogle@husqvarnagroup.com>
2023-01-05 12:43:24 +01:00
Juha Heiskanen a70f420b2b net: lib: Patch file for generated code fix
Patch for generated lwm2m senml-cbor.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2023-01-05 12:43:24 +01:00
Juha Heiskanen d939c79af1 net: lib: LwM2M SenML-Cbor regenrated files update
Patched and fixed regenerated code.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2023-01-05 12:43:24 +01:00
Juha Heiskanen 637c9bbf95 net: lib: regenerate cbor code using zcbor
with the updated cddl for object links.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2023-01-05 12:43:24 +01:00
Pascal Brogle 547c3063b9 net: lwm2m: support senml cbor object link
use "vlo" map key

Signed-off-by: Pascal Brogle <pascal.brogle@husqvarnagroup.com>
2023-01-05 12:43:24 +01:00
Chris Wilson 18d47316ed drivers: clock_control: esp32: fix cpu_freq divisor typo.
Current divisor is 10000000 (should be 1000000).

For example, ESP32_CLK_CPU_240M / 10000000 == 24 MHz (incorrect).

Signed-off-by: Chris Wilson <christopher.david.wilson@gmail.com>
2023-01-05 12:43:17 +01:00