Commit graph

56297 commits

Author SHA1 Message Date
Julien D'ascenzio
ca7899afa9 drivers: spi: stm32: Fix forever lock when configure failed
On transceive, if the SPI configure failed, the SPI wasn't release.

Signed-off-by: Julien D'ascenzio <julien.dascenzio@paratronic.fr>
2021-09-20 10:17:56 -04:00
Vinayak Kariappa Chettimada
a9a01d4cb7 Bluetooth: Controller: Fix missing reset of Periodic Sync Create
Fix missing reset of Periodic Sync Create when HCI Reset is
performed.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-20 12:26:51 +02:00
Vinayak Kariappa Chettimada
29ae143a10 Bluetooth: Controller: Refactor out initiator reset
Refactor out the initiator reset implementation into a
function.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-20 12:26:51 +02:00
Jamie McCrae
e937dde3ca boards: arm: bl654_usb: Fix name and identifier
Fixes identifier to use Laird Connectivity name

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-09-20 06:17:29 -04:00
Jamie McCrae
73eaf92065 boards: arm: bl654_usb: Fix offset load
Fixes applications not building for offset 0x1000

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-09-20 06:17:29 -04:00
Gerson Fernando Budke
e5ef9ca7a5 samples: net: echo_server: Decrease buffer for atsamr21_xpro
From 2.4 to 2.7 the net samples pair echo-server/client increase the
SRAM requirements. This adjusts example features to free necessary SRAM
to run example.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-09-20 06:01:12 -04:00
Robert Lubos
88c06aeb24 net: lwm2m: Fix IPSO Push Button counter incrementation
The Counter resource in the IPSO Push Button object was incremented
silently by the post write handler of the State resource. This prevented
the resource from being marked as updated, effectively preventing
the engine from sending notifications to observers.

Fix this, by setting the new counter value with `lwm2m_engine_set_u64()`
instead. This will update the resource value, and trigger the engine to
send notifications if needed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-20 05:59:28 -04:00
Martí Bolívar
008c384c4b boards: rename thingy53_nrf5340_cpuappns
Change the 'ns' suffix to '_ns' for consistency with other boards.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-20 05:57:24 -04:00
Martí Bolívar
b98c8bf4a5 boards: rename sparkfun_thing_plus_nrf9160ns
Change the 'ns' suffix to '_ns' for consistency with other boards.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-20 05:57:24 -04:00
Martí Bolívar
41e87ae688 boards: rename nrf9160_innblue22ns
Change the 'ns' suffix to '_ns' for consistency with other boards.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-20 05:57:24 -04:00
Martí Bolívar
c6c42d42ea boards: rename nrf9160_innblue21ns
Change the 'ns' suffix to '_ns' for consistency with other boards.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-20 05:57:24 -04:00
Martí Bolívar
5854bc3a48 boards: rename circuitdojo_feather_nrf9160ns
Change the 'ns' suffix to '_ns' for consistency with other boards.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-20 05:57:24 -04:00
Christopher Friedt
b57293d6e6 Revert "board: Added board support package for Nucleo_F446ZE"
This reverts commit 0d53844714.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-09-20 05:50:34 -04:00
Ron Smith
9fa1f6edca tests: uart_async_api: Correct DMA channels on atsamr21_xpro board
This commit corrects the DMA channels for the asynchronous
UART API testing support on the SAM R21 Xplained Pro board.

Signed-off-by: Ron Smith <rockyowl171@gmail.com>
2021-09-19 19:31:25 -04:00
Ron Smith
dd3a3318ec dts: atmel: sam0: Add clarification on dma-cells property
Add clarification to the dma-cells property explaining the purpose
of each cell.

Signed-off-by: Ron Smith <rockyowl171@gmail.com>
2021-09-19 19:31:25 -04:00
Ron Smith
683dbc4573 drivers: serial: uart_sam0: Fix async tx done event triggering to early.
uart_sam0_dma_tx_done callback triggers when the last byte
is transferred from the tx sram buffer to the sercom DATA register.
However the byte has yet to be transmitted completely which can lead to
incorrect event handling if UART_TX_DONE is expected to signal
the end of transmission.

Signed-off-by: Ron Smith <rockyowl171@gmail.com>
2021-09-19 19:31:25 -04:00
Ron Smith
a0d92453d8 drivers: serial: uart_sam0: move err_check methodout of if guard
Fixes a compile error for the err_check function not being found if
if CONFIG_UART_INTERRUPT_DRIVEN is not enabled.

Signed-off-by: Ron Smith <rockyowl171@gmail.com>
2021-09-19 19:31:25 -04:00
Ron Smith
4f9ac180b4 drivers: dma: dma_sam0: change sam0 DMA to higher priority init.
fixes peripheral drivers such as async uart that rely on dma being
ready failing because dma is not initialized yet.

Signed-off-by: Ron Smith <rockyowl171@gmail.com>
2021-09-19 19:31:25 -04:00
Tom Owen
0d53844714 board: Added board support package for Nucleo_F446ZE
Includes support for USB, CAN, ADC, DAC, and Arduino GPIO Map.
Future could support: ETM Trace (if Zephyr supports it), QSPI, FMC, DCMI

Initially based on closest BSP for the same SoC: nucleo_f446re
Extra peripherals added based on closest BSP for nucleo-144 board:
 nucleo_f429zi
Checked against nucleo-144 schematic
Documentation updated as best as I could
Arduino compatible pinmux for SPI, UART and I2C via Zio header

Tested:
  USB Device mode (samples/subsys/usb/console)
  Console via ST-link usart3 (samples/hello_world)
  user LEDs (samples/basic/blinky)
  scripts/twister --device-tests -p nucleo_f446ze
Not tested but should work: SPI, I2C, CAN, ADC, DAC
Not working yet: Quad-SPI (missing in dts/arm/st/f4/stm32f4.dtsi)

Co-authored-by: Alexandre Bourdiol
 <50730894+ABOSTM@users.noreply.github.com>
Signed-off-by: Tom Owen <tom.owen@zepler.net>
2021-09-18 09:15:45 -04:00
Katsuhiro Suzuki
981d10f232 dts: riscv: fix irq number of UART and SPI for SiFive FU740
This patch fixes wrong PLIC irq number of UART and SPI for SiFive
FU740 on HiFive Unmatched. Use samples/subsys/console/echo for
testing.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
2021-09-18 09:15:15 -04:00
Francois Ramu
97c031822b drivers: adc: stm32 disable the ADC before setting the Oversampling
On those STM32 series, setting of this feature is conditioned to
the ADC state: it is allowed to set/reset the oversampler (OVSE bit)
and set the Oversampling ratio (OVSR bits) in the ADC_CFGR2 register
only when ADC is disabled or enabled without conversion on going.
Then is the ADC re-enabled.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-09-18 09:02:31 -04:00
Francois Ramu
572ab24241 drivers: adc: stm32 disable the ADC before setting the Resolution
On those STM32 series, setting of this feature is conditioned to
the ADC state: it is allowed to write the Data resolution (RES bits)
in the ADC_CFGR1 register only when ADC is disabled (ADEN=0).

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-09-18 09:02:31 -04:00
Aymeric Aillet
affae9b6bf tests: enable supported tests for h3ulcb
Adding test for features that are now available on h3ulcb.
We are ignoring isotp tests because of the internal loopback
implementation of the R-Car CAN controller which is sending
Rx isr before sending the Tx isr, totally confusing the Zephyr
ISOTP state machine and causing false positive.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2021-09-18 09:02:16 -04:00
Emil Gydesen
bcc819028f Bluetooth: ISO: Add ISO tx callback struct array
Add an array similar to the bt_conn (ACL/L2CAP)
tx sent callback, and initialize it.

This increases the number of bt_conn_tx available
such that ISO does not take any of "L2CAP's" buffers,
but also ensures that the sent callback is called
for a broadcast iso only build.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-18 06:30:07 -04:00
Naiyuan Tian
1f99a0ca18 tests: threads: fix uninitialized scalar variable
In the file variable val is not initialized,
causing the variable stack_ptr, pos, points to uninitialized data.
Initialize the variable val according to the code and commits.

Fixes #37916

Signed-off-by: Naiyuan Tian <naiyuan.tian@intel.com>
2021-09-17 22:30:50 -04:00
Christopher Friedt
1af1052d28 release: Zephyr 2.7.0-rc2
Set version to 2.7.0-rc2

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-09-17 20:49:03 -04:00
Anas Nashif
0f0cb1a5aa tracing: percepio: update to v4.5.1
A bug fix release with many zephyr with the most significant being a
workaround for the RTT issue we had in the previous release, fixing
the locking problem which could
result in garbled data when using high frequency processors.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-09-17 20:21:16 -04:00
Anas Nashif
aebb4b5ed6 samples: i2c: fram: use node label instead of alias
Add more coverage by not using aliases and directly use node label.

Fixes #38154

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-09-17 20:18:47 -04:00
David Leach
a50a16e710 MAINTAINERS: Update NXP platforms maintainer
Maureen Helm is moving on from NXP so moving David Leach to
NXP platforms maintainer.

Signed-off-by: David Leach <david.leach@nxp.com>
2021-09-17 20:09:49 -04:00
NingX Zhao
ca4c71ca02 tests: thread: Add an initialization
Add an initialization to the global variable to make sure testcases
can be ran correctly.

Signed-off-by: NingX Zhao <ningx.zhao@intel.com>
2021-09-17 10:30:54 -04:00
Carles Cufi
1325edff48 Bluetooth: hci: Align terms with the Bluetooth v5.3 spec
The new inclusive naming terminology changes in v5.3 of the Bluetooth
specification affect the HCI layer, so apply all relevant changes to
align with it.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-17 16:05:01 +02:00
Carles Cufi
9454b871c4 doc: release notes: Fix typo in 2.7 release notes
It's "PERIPHERAL" not "PERIPHAL".

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-17 16:05:01 +02:00
Carles Cufi
04c012613a Bluetooth: hci: Remove AMP-related macros
AMP functionality was removed from the v5.3 specification. Remove
AMP-related macros since they no longer map to anything in the spec
itself.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-17 16:05:01 +02:00
Vinayak Kariappa Chettimada
417647f057 Bluetooth: Controller: Fix extended header data be zero-length array
Fix the definiion of Common Extended Payload Format data
field in the PDU definitions to be zero-length array,
because PDU size are configurable and to avoid allocations
being made using these PDU structs.

Corrected the extended scan response length check code to
use the correct define instead.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-17 14:30:27 +02:00
Vinayak Kariappa Chettimada
14b369eda8 Bluetooth: Controller: Fix to use ticks_drift for duration calculation
Fix Extended Advertising stop on duration by using the
ticks_drift which now includes the random delay and any
ticker rescheduling of advertising radio events due to
collision with other radio events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-17 14:30:07 +02:00
Vinayak Kariappa Chettimada
19fe102862 Bluetooth: Controller: Propagate ticks_drift in the ticker callback
The ticker `ticks_drift` is propagated via the ticker
elapsed callback, in order to provide necessary information
to correctly calculate total elapsed durations by states and
roles that use ticker extensions to mitigate scheduling
collisions by drifting within a permitted window.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-17 14:30:07 +02:00
Vinayak Kariappa Chettimada
b01b5f6786 Bluetooth: Controller: Fix indentation in ticker interface file
Fix indentations in the ticker interface file.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-17 14:30:07 +02:00
Mahesh Mahadevan
a90c4c38a1 drivers: disk: Fix USDHC driver to return 0 on success
The function usdhc_board_access_init was returning a non-zero
value as the variable "ret" is also used to store the GPIO
level for card-detect.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-09-17 08:12:22 -04:00
Robert Lubos
be7faf7c08 net: http: Fix HTTP_DATA_FINAL notification
HTTP_DATA_FINAL was incorrectly notified in case Content Length field
was present in the HTTP respone - in such case it was set for every
response fragment, not only the last one.

Fix this by relying on `message_complete` flag instead of
`http_should_keep_alive()` function to determine whether to notify
HTTP_DATA_FINAL or not. As the HTTP parser calls the
`on_message_complete()` callback in either case (response is chunked or
not), this seems to be a more reasonable apporach to determine whether
the fragment is final or not.

Additinally, instead of calling response callback for
`on_body`/`on_message_complete` separately, call it directly from
`http_wait_data()` function, after the parsing round. This fixes the
case when headers were not reported correctly when the provided buffer
was smaller than the total headers length, resulting in corrupted data
being reported to the user.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-17 08:12:00 -04:00
Anas Nashif
55c3dde322 twister: fix json reporting of build only tests
Tests are reported as skipped if they are only being built. Fix this by
checking for the correct status.

Fixes #37475

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-09-17 08:11:01 -04:00
Dhruva Gole
8dcfa913d0 boards: Arduino Nano BLE 33: Update documentation
This commit mainly aims to fix the blinky example path and also brings
minor improvements in other areas like adding example path for Linux so
that new users will know exactly what or where to look for.

Signed-off-by: Dhruva Gole <goledhruva@gmail.com>
2021-09-17 11:56:35 +02:00
David Leach
fb5192656a drivers: eth: mcux: Fix PTP clock init priority dependency
The net_core device initialization has a subtle dependency
on the PTP clock initialization. Adding a Kconfig and set
it to a priority level less than net_core. This will ensure
the initialization sequence.

Fixes #38571

Signed-off-by: David Leach <david.leach@nxp.com>
2021-09-17 10:56:35 +02:00
Robert Lubos
81595ed4db net: lwm2m: Fix binary to float32_value_t conversion
The helper function to conver 32-bit binary float value to
float32_value_t incorrectly identified the "hidden" bit, resulting in
invalid conversion when TLV encoding was used to write a resource
(the output value was divided by 2).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-16 19:04:52 -04:00
Robert Lubos
36a72dd101 net: lwm2m: Fix JSON write handling
There were several issues preventing JSON format writes to work
correctly:

1. The formatter wrongly assumed that Base Name and Relative Name values
   read from the message are NULL terminated, which in result could give
   invalid results when combining them.
2. The formatter wrongly assumed that Relative Name is always present,
   which is not always the case. In result, it failed to parse messages,
   which contained full path in their Base Name Field
3. There were no boundaries check when reading JSON variable name/value,
   which could lead to buffer overflow in case malformed data was
   received.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-16 19:04:52 -04:00
Robert Lubos
a98d47b8eb net: lwm2m: Fix JSON floating point handling
Just like plain text, JSON parser ignored leading zeros after decimal
point, giving invalid results. Fix this in a similar way as for the
plain text.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-16 19:04:52 -04:00
Robert Lubos
20a4d181e1 net: lwm2m: Fix plain text floating point handling
Floating point parser for plain text format was parsing floats wrongly,
ignoring leading zeros after decimal points.

Fix this, by reusing atof32() function, already avaialbe in a different
part of the engine, which did the parsing correctly.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-16 19:04:52 -04:00
Robert Lubos
b6f69a6df1 net: lwm2m: Align float handling with specification
According to the specificaion, resources are not predefined to use 32 or
64 bit floating point numbers, but should rather accept any of them (as
indicated by the size of the TLV in the message). This lead to issues
for instance with Eclipse Leshan LWM2M server, where Leshan sent 64-bit
value, while Zephyr expected 32-bit, making it impossible to write
the resource.

Therefore, unify the float usage to 32-bit float representation and fix
the TLV parsing functions, to accept values sent as either 32 or 64 bit
float.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-16 19:04:52 -04:00
Robert Lubos
9cdc1bb944 net: sockets: tls: Fix TLS POLLHUP notification
The `poll()` function did not report POLLHUP if the peer ended the DTLS
session, making it impossible to detect such event on the application
side.

On the other hand, TLS erroneusely reported POLLHUP along with each
POLLIN event, as the 0 returned by the `recv()` socket call was
wrongly interpreted (it was expected to get 0 in return as 0 bytes were
requested).

Fix this by introducing a helper function to process the mbedtls context
and verify if new application data is pendingi or session has ended.
Use this new function in the poll handler, instead of a socket `recv()`
call, to remove any ambiguity in the usage, for both TLS and DTLS.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-16 18:14:33 -04:00
Robert Lubos
d0affeff69 net: sockets: tls: Return ENOTCONN when DTLS client session ends
Notify the application when DTLS client session ends by returning
ENOTCONN on such event. Additionally, reset the mbed TLS session
structures, allowing to reinstante the session on the next send() call.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-16 18:14:33 -04:00
Robert Lubos
b999c47424 net: sockets: tls: Fix incorrectly used errno codes
ECONNABORTED was returned in case tls_mbedtls_reset() function for
resetting session failed, which can be caused by memory shortage. Return
ENOMEM instead.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-16 18:14:33 -04:00