Commit graph

64515 commits

Author SHA1 Message Date
Fabio Baltieri
f96b504d8d dts: bindings: fix various header file path
Fix various outdated documentation references to header file or
dt-bindings headers.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-20 19:22:20 -07:00
Fabio Baltieri
bd61ced760 twister: fix wrong flag name in the helpdoc
The flag --testcase-root has been renamed to --testsuite-root in

15bc98eb50 twister: rename TestCase -> TestSuite

Fix the --help text to reflect the change.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-20 19:22:20 -07:00
Fabio Baltieri
69a13bbb5d drivers: pwm_nrfx: fix incoherent config struct name
Fix the instance config structure name so that it's coherent with the
data one (missing underscore after the instance idx).

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-20 19:22:20 -07:00
Reto Schneider
cf30e38c46 fcb: Convert to Doxygen comment
Doxygen comments are introduced by a second start after the slash.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2022-05-20 19:21:32 -07:00
Aaron Massey
3f4159c5c7 gitignore: Ignore emacs temporary edit files
Emacs creates autosave and temporary files when editing.

These should be ignored by git.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2022-05-20 18:21:18 +02:00
Stephanos Ioannidis
e09f78a414 ci: doc-publish: Do not run for pull requests
GitHub Actions may trigger the `workflow_run` event type when the
pull request source branch name matches one of the branches specified
under `branches:`.

This commit updates the documentation publish workflow to skip when the
preceding event type is `pull_request`, in order to prevent pull
request documentation from being uploaded as main documentation.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-20 23:26:14 +09:00
Marek Pieta
903672c394 bluetooth: att: Fix L2CAP channel section order
The L2CAP channel section is sorted lexicographically. Make sure
that ATT fixed channel will be placed as the last one to ensure
that SMP channel is properly initialized before bt_att_connected
tries to send security request.

Fixes #45820

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2022-05-20 12:43:16 +02:00
Glauber Maroto Ferreira
01f4a64738 fix: boards: esp32: uart: pinmux assignment
Fix pinmux property values assigned to both UART1
and UART2 nodes.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-05-20 12:39:38 +02:00
Archie Atkinson
26d2c12884 doc: fixes errors pipes wiki entry
Moves the 'Flushing a Pipe' code example to the correct location
and section and re-adds the 'Suggested Uses' text missing
compared to v2.7.

Signed-off-by: Archie Atkinson <archie.atkinson@chiaro.co.uk>
2022-05-20 12:38:37 +02:00
Szymon Janc
6a9243c13e Bluetooth: Controller: LLCP: Fix handling of invalid DLE parameters
If peer sents invalid value in DLE request or response just ignore
those and keep using old values when calculating effective DLE.

This was affecting following qualification test cases:
LL/CON/PER/BI-10-C
LL/CON/PER/BI-11-C
LL/CON/PER/BI-12-C
LL/CON/CEN/BI-07-C
LL/CON/CEN/BI-08-C
LL/CON/CEN/BI-09-C

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-05-20 12:38:30 +02:00
Sjors Hettinga
2d824f4811 net: tcp: Removed copy of conn->unacked_len
In the function tcp_send_data, the variable conn->unacked_len in copied
into a local variable pos. This value is only used in one location and
used mixed with the original conn->unacked_len.

This fix removes pos and switches to use conn->unacked_len everywhere
to reduce the chance of confusion. This does not functionally change the
code.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2022-05-20 12:38:24 +02:00
Andy Ross
4b9a8a8471 tests/kernel/common: Extend nested_irq_offload case to do a context switch
Bug #45779 discovered an edge case with nested interrupts on Xtensa
where they might select an incorrect thread context to return to
instead of the (mandatory!) return to the outer interrupt context.

Cleverly adjust the nested_irq_offload to exercise this.  It now
creates a thread that it knows it will interrupt, then suspends that
thread from within the inner/nested interrupt.  This guarantees that
_current will be different on exit from the second interrupt, which is
the case that tripped up Xtensa.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-05-20 12:37:59 +02:00
Andy Ross
58eb132d06 arch/xtensa: Fix return context for nested interupts
The xtensa interrupt return path was forgetting to check the nested
interrupt state and calling into the scheduler to select the context
to which to return, which of course is completely wrong.  We MUST
return to the ISR we interrupted.

In fact in practice this was only visible in the case of a nested
interrupt that causes a context switch, otherwise the "interrupted"
argument just gets returned and things work.  In particular, it can
happen when the nested context is a fatal exception that aborts the
current thread, which is how this was discovered.  The timing required
to see this on live interrupts on real applications is likely to have
been extremely difficult to detect.

Fixes #45779

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-05-20 12:37:59 +02:00
Thomas Ebert Hansen
5d80dbd388 Bluetooth: controller: llcp: Fix terminate timer
Add the missing terminate timer for the ACL Termination procedure.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-05-20 12:37:49 +02:00
Krzysztof Chruscinski
2a2856e88e tests: kernel: workq: work: Fix potential race in the test
Test was setting up timer for 1 system tick and then work was
cancelled. It was assumed that work will be cancelled before
timer expires. This is the case for low frequency system clock
(e.g. qemu targets using 100Hz) but there are cases when system
clock has higher frequency (32kHz on nRF). In that case, timer
was occasionally expiring before cancellation and test was
randomly failing.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-05-20 12:37:18 +02:00
Flavio Ceolin
ac2e13b9a1 net: tcp: Fix possible buffer underflow
Fix possible underflow in tcp flags parse.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-05-20 12:36:42 +02:00
Sylvio Alves
8148449db0 soc: esp32: move libc strings in dram area
Move libc strings to RAM area so that ESP32
doesn't crash when flash cache is disabled

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-05-20 12:36:36 +02:00
Dylan Hung
7b340d26fb include: fix the size of IRQn_Type
IRQn_Type is compiled to int8_t if __NVIC_PRIO_BITS is not set.  It
implies the maximum postive value of the peripheral irq is 127.  This
would lead to an irq number turns into a nagtive value if it is greater
than 127.

For example:
The input argument `irq` of arch_irq_enable is 130. But the input
argument of NVIC_EnableIRQ becomes (IRQn_Type)130 = -126 and results
error.

```
void arch_irq_enable(unsigned int irq)
{
	NVIC_EnableIRQ((IRQn_Type)irq);
}
```

By adding a maximum IRQ number, the bit width of IRQn_Type is guaranteed
to cover all IRQ numbers of the system.

Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
2022-05-20 12:36:30 +02:00
Mulin Chao
0f18c4c4ab pinctrl: npcx: config pwm open-drain without enabling STORE_REG
Config pwm open-drain mode without enabling STORE_REG. This CL
collects all active PWM's base address and related index in an
array. Then, pinctrl driver configs its open-drain mode by
finding the corresponding 'channel' index.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2022-05-20 12:36:22 +02:00
Jose Alberto Meza
4e443dac34 soc: arm: microchip: mec172x: Enclose macro in brackets
Macro should be in brackets.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-05-20 12:35:37 +02:00
Jose Alberto Meza
d2361e8441 drivers: sensor: mchp_tach: Correct spelling header
Correct spelling in copyright.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-05-20 12:35:37 +02:00
Andy Ross
c64ac967a8 tests/kernel/fatal: Work around historical API misuse
This test was written to do a k_oops() in the main thread.  That's an
essential thread, and aborting it is actually a system panic now.  The
test was written contra the docs on this, but it worked fine for
years.

Just reflag the thread as a simple workaround rather than trying
anything fancy. This is a very simple test.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-05-20 12:34:30 +02:00
Andy Ross
fb613594c7 kernel/sched: Panic on aborting essential threads
Documentation specifies that aborting/terminating/exiting essential
threads is a system panic condition, but we didn't actually implement
that and allowed it as for other threads. At least one app wants to
exploit this documented behavior as a "watchdog" kind of condition,
and that seems reasonable.  Do what we say we're supposed to do.

This also includes a small fix to a test, which seemed like it was
written to exercise exactly this condition.  Except that it failed to
detect whether or not a system fatal error was actually signaled and
was (incorrectly) indicating "success".  Check that we actually enter
the handler.

Fixes #45545

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-05-20 12:34:30 +02:00
Erik Brockhoff
843a24924f Bluetooth: controller: llcp: terminate conn on conn update past instant
Terminate connection when Connection Update with instant in the past
Fix type re. win_offset calc in conn update ind pdu decoder
Remove feature bit on unsupported in peer

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-05-20 12:33:59 +02:00
Andries Kruithof
c2e07a304b Bluetooth: controller: llcp: send correct collision code
Upon collision either the error code for different procedure
collision or same procedure collision must be transmitted,
which is fixed in this PR. Previously always the error code
for same procedure collision was sent

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2022-05-20 10:29:46 +02:00
Chris Collins
ce84c782dc drivers: usb: device: stm32: fix disconnect-gpios configuration.
For some reason, rather than testing for the presence of
disconnect-gpios in the devicetree, the STM32 USB Device driver was
relying on a hidden Kconfig flag to be set.

This patch removes the Kconfig option completely and simply tests for
the DT property - if it's set, you obviously know what you're doing and
obviously need the pull-up GPIO behaviour.

Signed-off-by: Chris Collins <chris@realsimgear.com>
2022-05-19 11:28:38 -07:00
Stephanos Ioannidis
2d8c45c1e0 doc: Update to Zephyr SDK 0.14.2
Update the Getting Started Guide to point to the Zephyr SDK 0.14.2
release.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-19 11:26:06 -07:00
Stephanos Ioannidis
968d01732c ci: Update to Zephyr SDK 0.14.2
This commit updates the CI workflows to use the Zephyr SDK 0.14.2 for
building and testing Zephyr in the CI.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-19 11:26:06 -07:00
Stephanos Ioannidis
702677ebee ci: Switch to CI image 0.23.3
This commit updates the CI workflows to use the CI image 0.23.3, in
order to pull in the Zephyr SDK 0.14.2 and other minor enhancements
and bug fixes detailed in the docker-image release notes.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-19 11:26:06 -07:00
Jarno Lamsa
e0e9ec7714 doc: Add LwM2M engine state machine
The state machine depicts the states of the lwm2m engine
and the spawned RD client events that will be forwarded
to lwm2m client if it has registered a callback-function.
Most of the events are just informs for the client and the
RD client underneath works and recovers automatically from
most cases.

Signed-off-by: Jarno Lamsa <jarno.lamsa@nordicsemi.no>
2022-05-19 11:25:12 -07:00
Nickolas Lapp
521e093cde I2S_MCUX: Fixup I2S MCUX Audio PLL Rate Calculation and Reg Writes
This PR Fixes the Audio PLL Rate Calculation (there was an additional
divide / 8 which is not necessary and does not appear in similar
calculations in example code from the SDK).

Additionally, it adjusts the SAI .dtsi to more correctly configure the
mclk rate, and adds comments specifying what the regististers mean.

Signed-off-by: Nickolas Lapp <nickolaslapp@gmail.com>
2022-05-19 11:01:53 -05:00
Kevin Townsend
2dc866fa48 manifest: zscilib: Update zscilib for 3.1
Updates zscilib to support recent changes in zephyr
3.x, such as the `zephyr/` prefix on include files.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2022-05-19 09:46:26 -05:00
Vinayak Kariappa Chettimada
d84c5496a6 Bluetooth: Controller: Add Extended Advertising Type Validations
Add Extended Advertising Type validation when associated
Periodic Advertising is enable, and Extended Advertising
set is re-configured to other advertising types.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-19 16:05:35 +02:00
Piotr Pryga
364a8c2786 Bluetooth: Controller: df: CTE req not disabled if run in single shot
There is an error. CTE request control procedure can be run in single
shot or periodic mode. In case of run in single show, it is not
disabled after completion.

The code responsible for the disable was deleted by commit:
ac7d0506f88508e7440288c1ec4319a9f7d0ad44.

The cte_req.is_enabled should be set to zero if the CTE request
completes and cte_req.req_interval is zero.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:22:11 +02:00
Piotr Pryga
b9dcc3d4e4 tests: Bluetooth: df: Add missing conn handle assignment
There was missing assignment to a global variable that stores
connection handle. The value was always the same, hence it test
were not failing. The value was passed over from setup state
done for other tests. This change makes sure there is always
correct handle stored in global variable.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
5922b211c3 tests: Bluetooth: df: Add missing peer supported feature information
There was missing information about supported CTE response feature
by peer device. That caused a test_set_conn_cte_req_enable to fail.
The test expected that peer device supprots CTE response.

The missing information is added in a common code responsible for
connection object preparation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
f0e456dc50 tests: Bluetooth: df: Fix wrong max antenna switch pattern len config
Due to change in Kconfig CONFIG_BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN
the Kconfigs in tests were wrong and tests were not building.
The commit sets the max antenna switch pattern length to actual
maximum value.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
f35b22a541 tests: Bluetooth: llcp: cte_req: remove invalid rsp test
There is a test that verifies a behavior of CTE request control
procedure if receives LL_UNKNOWN_RSP. The expected behavior
is to terminate connection if that is response handling is
not implemented by a command. Other unexpected responses are
treated as new remote control procedures.

The CTE request has implemented handling of LL_UNKNOWN_RSP,
hence this particular test is no longer valid.

There is still open question how to handle other unexpected
reposne PDUs while waiting for LL_CTE_RSP. That is not defined
by BT 5.3. Core specification and not decided by community.

The test is removed to because it fails and blocks CI.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
9e6f566858 Bluetooth: Controller: llcp: Add handling of unexpe CTRL PDU by CTE req
There was missing code responsible for handling of unexpected response
for CTE request. The commit adds code that will terminate connection
in case a peer device reposnes with unexpected control PDU that is not
a remote procedure reques.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
3664e6ca68 tests: Bluetooth: Add missing NTF release
There were couple of test cases where Host notification object
was not released. The commit adds missing release calls.

Also commnets related with check if RX queue is empty were
changed to describe what is verified then.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
0dfb5fc5c8 tests: Bluetooth: cte_req: Enable not used test case
There was a test case that was never executed. It was not
added to a test suite in test_main. The commit adds the
test case.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
d6dc5bd282 tests: Bluetooth: cte_req: Add tests for handling LL_UNKNOWN_RSP
Add test that verify correct behavior of the CTE request procedure
in case of reception of LL_UNKNOWN_RSP PDU from peer device.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
2890f42545 Bluetooth: Controller: df: Fix CTE reqest proc enable if feat supported
The CTE request procedure should be enabled only if a peer supports
CTE response feature. That information can be obtained by feature
exchange procedure. If there were no feature exchange then CTE
request feature may be disabled if a peer responses with LL_UNKNOWN_RSP
for a CTE request.

The implementation of ll_df_set_conn_cte_req_enable was checking if
CTE response feature is supported only when there was feature exchange.
There was missing possibility to stop CTE request if a peer responded
with LL_UNKNOWN_RSP for an earlier CTE request.

The commit changes the implementation of ll_df_set_conn_cte_req_enable.
The CTE response feature check is moved to ull_cp_cte_req function,
because it belongs more to control procedure than to function that
handles Host request to start the procedure.
Second change is related with use of conn->llcp.fex.features_used.
It stores information about features supported by peer. It does
not depend on execution of the feature exchange control procedure.

By the way, there were removed else statement in ll_df_set_conn_cte_-
req_enable because it was not needed.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
40cdd65901 Bluetooth: Controller: llcp: add missing handling LL_UNKNOWN in CTE llcp
There was missing handling of LL_UNKNOWN_RSP in CTE request control
procedure.In case there is a pending CTE request and peer responses
with LL_UNKNOWN_RSP then Host should be notified with HCI_LE_CTE_-
Request_Failed event. The pending CTE request procedure should be
completed.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Emil Gydesen
78962268c2 samples: Bluetooth: Broadcast audio scan and adv data size increase
Increases the scan and adv data sizes to better support
the extended advertising data and periodic advertising
data (BASE).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-19 13:21:19 +02:00
Emil Gydesen
a263308cf2 samples: Bluetooth: Audio sample board files cleanup
Clean up some of the board specific configuration files.
Removed all CONFIG_BT_CTLR* configs from the nRF5340
appcore conf files as that does not compile the controller.

Ensured that the ISO buffer in the controller for
nRF52840 can contain SDUs from all BAP LC3 minimum
requirements, as the controller does not yet
support segmentation of SDUs.

Also fixed a few bad configurations (broadcast sink not
enabling the sync support etc.).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-19 13:21:19 +02:00
Krzysztof Chruscinski
468218a547 lib: os: cbprintf: Fix potential Coverity issue
Seen in some Coverity runs that it was complaining about unused
variable. Variables are used only in one path of _Generic.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-05-19 11:04:39 +02:00
Krzysztof Chruscinski
1fb8364c4c lib: os: cbprintf: Reduce stack usage when no optimization
Use single fixed size on stack array instead of compile time fitting.
When compiler is optimizing it can pick smallest array but with no
optimization there is an increased stack usage.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-05-19 11:04:39 +02:00
Krzysztof Chruscinski
99fb57652a soc: arm: nordic: Change tick rate for non-tickless kernel
Set SYS_CLOCK_TICKS_PER_SEC to 128 for non-tickless kernel.
Previously it was set to 32768 disregarding kernel mode and that
lead to too frequent interrupts in non-tickless mode (tick every
30 us). Change to smaller value.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-05-19 11:03:50 +02:00
Henrik Brix Andersen
4c504d3f5a manifest: update espressif HAL to not require ZEPHYR_BASE in env var
Update the espressif HAL to allow building without having ZEPHYR_BASE set
in the environment.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-05-18 11:02:26 -07:00