Commit Graph

64595 Commits

Author SHA1 Message Date
Daniel DeGrasse 75513ba632 dts: nxp: fix PM minimum residency and exit latency for rt11xx
Fix PM minimum residency time and exit latency for rt11xx to reflect
actual delays when entering and exiting low power modes.

Fixes #45750

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-25 14:20:27 +02:00
Szymon Janc b3de861d15 Bluetooth: Controller: Fix not clearing Static Random Address on reset
When host issue HCI Reset controller should clear LE Static Random
address. Otherwise controller may incorrectly use one from before
HCI reset insread of rejecting HCI commands.

This was affecting following qualification test cases:
HCI/CCO/BI-51-C
HCI/CCO/BI-53-C
HCI/CCO/BI-54-C
HCI/CCO/BI-56-C
HCI/DDI/BI-06-C
HCI/DDI/BI-07-C

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-05-25 14:20:21 +02:00
Marcin Niestroj 084aca1aa4 tests: socket: tls: check sendmsg() behavior for datagrams
Datagrams (for DTLS connection) need to be sent using single API call to
mbedTLS and should not result in sending each fragment in a separate
datagram. Check if that is the case, so allow only single fragment data to
be sent and expect an error when multiple fragments were passed to
sendmsg().

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-05-25 14:20:09 +02:00
Marcin Niestroj 900137ef32 net: sockets: tls: prevent sending fragmented datagrams with sendmsg()
Fragmented data passed to sendmsg() should be sent as a single datagram in
case of datagram sockets (i.e. DTLS connection). Right now that is not
happening now, as each fragment is sent separately, which works fine only
for stream sockets.

There is no mbedTLS API for 'gather' write at this moment. This means that
implementing sendmsg() would require allocating contiguous memory area at
Zephyr TLS socket level and copying all data fragments before passing to
mbedTLS library. While this might be a good option for future, let's just
check if data passed to sendmsg() API consists of a single memory region
and can be sent using single send request. Return EMSGSIZE error if there
are more then one data fragments.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-05-25 14:20:09 +02:00
Szymon Janc 42d461d3a2 Bluetooth: Controller: Fix HCI supported commands bitmask
This was affecting HCI/GEV/BV-01-C qualification test case.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-05-25 14:19:59 +02:00
Szymon Janc f0b6774191 Bluetooth: Controller: Fix validating PHY bitmask in HCI
At least one supported PHY bit shall be set and none of
non-supported or RFU bits should be set.

This was affecting HCI/DDI/BI-05-C qualification test case.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-05-25 14:19:41 +02:00
Georgij Cernysiov 3d035a71fe includes: shell: uart: fix legacy includes
Adds `zephyr/...` prefix to `smp_shell.h` include.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-25 14:19:28 +02:00
Gerard Marull-Paretas 8b8d7b99ce manifest: update lvgl revision
Latest revision fixes compilation of LVGL when
CONFIG_LEGACY_INCLUDE_PATH=n.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-25 14:19:18 +02:00
Andrzej Głąbek 69e9d977e5 boards: arduino_nano_33_ble: Fix board initialization code
This is a follow-up to commit 1b479d6a8a.

Use the `GPIO_OUTPUT_HIGH` flag instead of `GPIO_OUTPUT_INIT_HIGH`
as the latter does not actually configure the pin as an output
(it does not include `GPIO_OUTPUT`) what causes an assertion in
`gpio_pin_configure()` to fail.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-05-25 14:19:09 +02:00
Aleksander Wasaznik 1c872829f8 Bluetooth: Host: Update doc `user_data` type in `bt_gatt_discover_func_t`
Before this change, the doc on `bt_gatt_discover_func_t` gives the
impression that the type of `user_data` depends on `attr->uuid`. That is
partially incorrect. It is more accurate to say that the type depends on
the discovery type because that determines the ATT operation, which in
turn determines if the data is available.

Add documentation on `user_data` for the discovery type
`BT_GATT_DISCOVER_STD_CHAR_DESC`.

Add a hint `bt_gatt_discover_func_t` that `bt_gatt_read` can do a
different kind of attribute lookup, read-by-type, which may be
more convenient in some cases.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-05-25 13:15:54 +02:00
Piotr Pryga f3d460ff5a Bluetooth: Controller: df: Remove experimental for direction finding
Removes label experimental for direction finding feature in
Bluetooth Controller.

The feature stays disabled by default because it requires additional
dedicated hardware to be used. Besides that it significantly enlarges
amount of memory used by the Controller.

End user has to enable the feature explicitly by use of configuration
options.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-25 11:48:43 +02:00
Vinayak Kariappa Chettimada 0d7bd277a9 Bluetooth: Controller: Fix preempt timeout not skip first in pipeline
Fix preempt timeout scheduling to not skip first prepare in
pipeline when there are no previous preempt timeout
scheduled already.

Fix related to commit 27b8beaa22 ("Bluetooth: Controller:
Fix to handle relative short preempt timeout").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-25 11:14:58 +02:00
Piotr Pryga 729e4f5b1e Bluetooth: Controller: df: Fix check for max CTE num to sample or adv
Maximum number of CTE to be send in a periodic advertising chain is
limited by BT 5.3 Vol 4 Part E, section 7.8.80 and is 16.
Maximum number of samples CTE in a periodic advertising chain is
limited by BT 5.3 Vol 4 Part E, section 7.8.82 and is also 16.
Both values are limited by amount of memory reserved in Controller
by Kcofigs, respectfully: CONFIG_BT_CTLR_DF_PER_ADV_CTE_NUM_MAX and
CONFIG_BT_CTLR_DF_PER_SCAN_CTE_NUM_MAX.

Functions ll_df_set_cl_cte_tx_params and ll_df_set_cl_iq_sampling_enable
check limits against Bluetooth specification provided values.
That can end with memory overwrite if number of requested CTEs is
greater that number provided in configuration.

The commit changes mentioned functions to validate HCI commands
parameters against configuration values.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-25 11:09:48 +02:00
Piotr Pryga 1d89b271fb Bluetooth: Controller: llcp: Fix assert if reject while loc and rem pend
In case there are pending two control procedures: local and remote,
and remote device sends LL_REJECT_IND PDU then assertion happened.
ull_cp_rx function triggers assertion because LL_REJECT_IND is
considered as expected packet for all local and remote control
procedures.

That is not correct. It does not allow local procedure to handle
a response and stops a device on assert.

A remote device should not send LL_REJECT_IND PDU for locally initiated
control procedures, hence local device should not expect to receive
LL_REJECT_IND PDU to be expected one for pending remote control
procedure.

Remote device is allowed to send LL_REJECT_EXT_IND PDU for a locally
initiated control procedures. The LL_REJECT_EXT_IND PDU has a Reject-
Opcode that identifies rejected control procedure, hence is may be
expected by local device.

The commit provides changes that prevent the Controller assertion
in described case.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-25 11:09:38 +02:00
Piotr Pryga f3deccda91 Bluetooth: Controller: CCM read data to early when DF enabled on PHY 1M
CCM during on-the-fly decryption of a received packet starts decryption
when Radio triggers EVETNS_ADDRESS. In case there is possibility a
packet may include Constant Tone Extension, on-the-fly parsing of a
received packet for CTEInfo is enabled.

If there is a PHY 1M enabled the Radio stores received bits with a
delay, that is equal to time required to receive 3 bits. CCM TASKS_CRYPT
related with packet decryption should be delayed by the time the Radio
needs to store received data.

The commit provides changes required to delay start of the CCM
TASKS_CRYPT. It uses NRF_RADIO Bit counter feature. The Bit counter is
configured to trigger NRF_RADIO->EVENTS_BCMATCH on reception of 3rd bit.
The event is connected through PPI with CCM TASKS_CRYPT.

The PPI used is shared with Radio Rate override. That is possible because
direction finding feature is not allowed on PHY Coded and CCM needs a delay
only when used PHY 1M.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-25 11:09:15 +02:00
Piotr Pryga 6f7e58e347 Bluetooth: Controller: lll: Move packet setup after call to sw switch
lll_conn_rx_pkt_set function is called before one of radio_switch-
_complete_XXX functions calls in lll_peripheral.c. That prevents
lll_conn_rx_pkt to call any Radio setup related function that touches
NRF_RADIO->SHORTS. NRF_RADIO->SHORTS are assigned in radio_switch_-
complete_XXX functions, hence any change operation on the register done
before is overwritten.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-25 11:09:15 +02:00
Stephanos Ioannidis c534ae2947 ci: Run twister with forced color output
The GitHub Actions runner redirects the stdout and stderr console
outputs and, now that twister properly invokes the Colorama module
initialisation function, the color output is disabled when running the
twister in the CI.

This commit adds the `--force-color` option when invoking the twister
so that the ANSI color escape sequences are output even when the output
is redirected by the GitHub Actions runner (note that the web console
properly displays the color escape sequences).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-25 12:48:31 +09:00
Stephanos Ioannidis 39956ec835 twister: Add option to always force color output
Colorama, by default, strips out the color escape characters when the
output is redirected, and this may have an unintended consequence of
disabling color outputs when using a utility such as `tee` and in the
CI runners that redirect the stdout and stderr console outputs.

This commit adds a new command line option called `--force-color` to
always force the ANSI color escape sequence output even when the output
is redirected.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-25 12:48:31 +09:00
Yuval Peress 138f399e6c ztest: run clang-format on ztest_new.c
Clang-format was updated to allow 100 column lines.

Signed-off-by: Yuval Peress <peress@google.com>
2022-05-25 11:20:13 +09:00
Yuval Peress 52292da328 ztest: migrate error_hook tests to new API
Update the tests to use the new ztest API.

Signed-off-by: Yuval Peress <peress@google.com>
2022-05-25 11:20:13 +09:00
Yuval Peress 50fe971617 ztest: add userspace tests to base tests
Add a test that verifies that ZTEST_USER is actually being run in
user context.

Signed-off-by: Yuval Peress <peress@google.com>
2022-05-25 11:20:13 +09:00
Yuval Peress 86cadf9283 ztest: Fix userspace ztests in new API
Update the new API to use K_USER as the flags for both
CONFIG_USERSPACE and CONFIG_TEST_USERSPACE. Also, fix the linker
script to properly include the suites, tests, and rules.

Fixes #44108

Signed-off-by: Yuval Peress <peress@google.com>
2022-05-25 11:20:13 +09:00
Yuval Peress 0becb666ef linker: Add data sections to quemu_x86_tiny
The data sections generated by zephyr_linker_sources(DATA_SECTIONS ...)
was missing for the qemu_x86_tiny.

Signed-off-by: Yuval Peress <peress@google.com>
2022-05-25 11:20:13 +09:00
Tomislav Milkovic 3df84e6d55 lib: smf: fix include
Change include to angle brackets
Add zephyr/ prefix to include

Signed-off-by: Tomislav Milkovic <milkovic@byte-lab.com>
2022-05-25 11:14:18 +09:00
Georgij Cernysiov e8dece902f drivers: flash: stm32_ospi: fix includes
Adds `zephyr/...` prefix to `toolchain.h` include.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2022-05-25 11:13:40 +09:00
Anatol Ivanov cd4b6e1575 arch: arm: cortex_r: Fix MPU_RASR_S_Msk
Fix typo to match specification.

Signed-off-by: Anatol Ivanov <Anatoleech@mail.ru>
2022-05-25 11:13:17 +09:00
Martí Bolívar 54948e4108 .github: add workflows/bug_snapshot.yaml
This creates a new GitHub workflow that snapshots open bugs in a
compressed format that is convenient to extract for later analysis in
a Python script, using scripts/make_bugs_pickle.py.

The workflow is only run on demand. This allows us to run it during
the weekly release readiness meeting, right after we have finished the
initial bug triage for the week. That ensures that results are as
fresh and relevant as possible.

The resulting file is uploaded to S3; with the goal of enabling later
tracking and analysis.

Getting the analysis scripts themselves merged into Zephyr is left for
future work. This commit just allows us to get the data.

Co-authored-by: Stephanos Ioannidis <root@stephanos.io>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-24 18:48:03 +02:00
Martí Bolívar 78edc12c1b scripts: add make_bugs_pickle.py
This is a simple script which snapshots open bugs in the
zephyrproject-rtos/zephyr repository using the GitHub REST API.

It relies on the 'github' module, which is a de-facto standard for
accessing this API in Python:

  https://pygithub.readthedocs.io

We are already using this package in scripts/release/bug_bash.py, so
this is not a new dependency, even though it's a third party package
not available in the standard library.

The resulting bugs are stored in the standard library's 'pickle'
format, as a list of github.Issue.Issue objects. For more on pickle,
see:

  https://docs.python.org/3/library/pickle.html

I am choosing pickle because it is standard, easy to use, and we are
already using it in the build system to store the edtlib.EDT object
created by gen_defines.py. This is also therefore not a new
dependency (and even if it were, it's in the standard library).

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-05-24 18:48:03 +02:00
Martí Bolívar 8aaea6d200 scripts: add github_helpers.py
This is meant to be a place where we can store generic zephyr wrappers
around the de-facto standard github API for python.

The first 'customer' will be a script that snapshots our open bugs at a
particular point in time, which will be added in a later patch.

I think it's useful to factor this file out of there from the
beginning just to keep things clean, even though I don't have a second
customer in mind at the moment.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-24 18:48:03 +02:00
Stephanos Ioannidis b2c8f26e34 soc: npcx: scripts: Initialise Colorama during module load
This commit adds a call to the Colorama initialisation function during
the module execution so that ANSI color sequences are properly
converted to the relevant Win32 API calls on the Windows.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-24 09:00:16 -07:00
Stephanos Ioannidis e332ddb5b4 scripts: tracing: Initialise Colorama during module load
This commit adds a call to the Colorama initialisation function during
the module execution so that ANSI color sequences are properly
converted to the relevant Win32 API calls on the Windows.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-24 09:00:16 -07:00
Stephanos Ioannidis 847ff98bb3 scripts: dictionary: Initialise Colorama during module load
This commit adds a call to the Colorama initialisation function during
the module execution so that ANSI color sequences are properly
converted to the relevant Win32 API calls on the Windows.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-24 09:00:16 -07:00
Stephanos Ioannidis 2ee02f9dfa scripts: fpdiff: Initialise Colorama during start-up
This commit adds a call to the Colorama initialisation function during
the module execution so that ANSI color sequences are properly
converted to the relevant Win32 API calls on the Windows.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-24 09:00:16 -07:00
Stephanos Ioannidis aae454708d twister: Initialise Colorama during module load
This commit adds a call to the Colorama initialisation function during
the module execution so that ANSI color sequences are properly
converted to the relevant Win32 API calls on the Windows.

Note that the init function needs to be called per module, hence it is
also called in the `twisterlib.py`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-24 09:00:16 -07:00
Filip Kokosinski 70c978bb97 soc/riscv/sifive-freedom/fe310: use correct SYS_CLOCK_HW_CYCLES_PER_SEC
This commit introduces changes in three places in order to fix the
problem with timer-related tests on FE310-based boards:
* tests/kernel/sleep/kernel.common.timing
* tests/kernel/tickless/tickless_concept/kernel.tickless.concept
* tests/kernel/workq/work_queue/kernel.workqueue

The first change is the modification of the SYS_CLOCK_HW_CYCLES_PER_SEC
value back to 32768 Hz to match FE310's datasheet description.

The second change is CLINT frequency reduction in Renode simulation
model to 16 MHz to correspond with the oscillator frequency given by the
FE310's datasheet and the HiFive1 board schematic. This fixes the first
two tests.

The last change is reducing the MIN_DELAY define to 100. This causes the
RISC-V machine timer driver to update the mtimecmp register more often,
which in turn addresses the `work_queue/kernel.workqueue` problem with
work items finishing prematurely, causing the above-mentioned test to
fail.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-05-24 08:58:43 -07:00
Anas Nashif 88d4299d88 scripts: fpdiff: iterate on namespaces
Iterate on 3 main namespace to avoid collision in identifiers sharing
the same name at the top level when creating the diff.

Fixes #44940

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-24 08:57:55 -07:00
Maciej Perkowski 4830cbd802 samples: spi: bitbang: Fix missing pass conditions
The sample did not have defined pass condition and was failing
due to a timeout. Add harness: consol and an explicit regex matching
the sample's output so it can pass on a hw. In addition, a requirement
for a gpio_loopback fixture was added to the sample.yaml.

fixes: #45229

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2022-05-24 08:57:12 -07:00
Francois Ramu aab52048f1 tests: drivers: watchdog testing on stm32 iwdg and wwdg
Configure the testcase.yaml to execute watchdog testcase
wdt_basic_api on each IWDG and WWDG on all the stm32 boards
With two generic stm32 .overlay files as extra config :
one wdg is tested when the other is disabled.
Removing from board overlay.
Giving the list of boards else non-stm32 ones could try building

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-24 08:55:16 -07:00
Francois Ramu cd87ff04ff dts: arm: stm32u5 and mp1 declare wwdg node instances
Overload the IWDG first instance declaration
to align with other stm32 mcus.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-24 08:55:16 -07:00
Francois Ramu 6c268ff93c dts: arm: stm32h7 declare wwdg and iwdg node instances
Overload the IWDG and WWDG first instance declaration
to align with other stm32 mcus.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-24 08:55:16 -07:00
Francois Ramu 5865d13117 dts: arm: stm32l5 Invalid wwdg interrupt priority
Set the priority of the wwdg instance to 6
else a build error happens :
static assertion failed: "Invalid interrupt priority.
Values must not exceed IRQ_PRIO_LOWEST"

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-24 08:55:16 -07:00
Guo Lixin 1160994dfb tests: error_hook: remove filter and define testcases in yaml file
1.Remove filter to allow platforms(e.g. qemu_x86) supporting
CONFIG_ARCH_HAS_USERSPACE run testcases when userspace is disabled.

2.Define all testcases in the yaml for consistency and issue parsing
them during setup.

Signed-off-by: Guo Lixin <lixinx.guo@intel.com>
2022-05-24 08:54:49 -07:00
Erwan Gouriou be217004a1 boards: stm32h7: Update openocd runner to specify target handle
Openocd scripts for STM32H7 SoCs use _CHIPNAME.cpu{0|1} as
target handle.
Specify this thanks to new openocd runner option '-target-handle'.

This is required to allow thread awareness debugging on these targets.

Fixes #45778

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-24 08:52:16 -07:00
Erwan Gouriou 4d073a755d scripts: west: openocd runner: Add an option to specify target handle
Provide a way to specify the openocd target script handle used to
describe the core target.
In most target scripts '_TARGETNAME' is used, but it can happen that
'_TARGETNAME.foo' or '_CHIPNAME.bar' is used, specially on SoCs subject
to multicore.

Today, this option is required to enable rtos thread awareness,
using '$_TARGETNAME configure -rtos Zephyr' command, which is generated
by this runner.
It could be useful for similar needs in future.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-24 08:52:16 -07:00
Erwan Gouriou af483c37fc drivers/clock_control: stm32u5: Wrong bus check in _get_rate()
Checking that provided pclken->bus fits bus range in
clock_control_get_rate() is wrong as it could actually be a source
clock and hence not belong to this range.
Also, this kind of check is just not needed since this function should
not be used before call to clock_control_on() or clock_control_configure()
which do the required verification.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-24 08:51:52 -07:00
Sylvio Alves e8b5e05d51 west.yml: fix bluetooth adapter variable definition
When newlibc is enabled, memcpy_chk fails due to
overflow when testing destination address length.
This updates the source and destination range defintion
so that it works as expected.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-05-24 08:51:21 -07:00
Emil Gydesen 12eda22dfe samples: Bluetooth: Fix bad info->flags check in unicast_server
The check did not properly check the info->flags as a bitfield,
and thus never decoded the data.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-24 08:50:07 -07:00
Tomislav Milkovic fc7598fa04 drivers: can: can_stm32h7: Fix min timings
Assertions in can_mcan failed because the driver expects values
strictly greater than 0

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-05-24 08:49:41 -07:00
Tomislav Milkovic 2fd83ad24b boards: arm: stm32h7b3i_dk: Enable CAN peripheral and transceiver
Add CAN transceiver to board DTS
Enable CAN peripheral and set correct pinctrl config in board DTS
Add CAN support in board yaml file
Modify board documentation

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-05-24 08:49:41 -07:00
Carles Cufi 35a00551a8 doc: Bluetooth: Document the services APIs
The Bluetooth documentation was missing all the Doxygen API information
regarding the standard services implemented in the Host. Import the
Doxygen API doc in a single page.

Fixes #42520.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-05-24 17:49:17 +02:00