Commit graph

53919 commits

Author SHA1 Message Date
Marcin Niestroj d08c6ee113 drivers: net: ppp: fix removing CRC16 from packet
CRC16 was removed by simply decreasing length of the last fragment by 2.
This worked as long as last fragment was longer than 1 byte. If not,
then last fragment was corrupted (its length ended up being 65535),
leading to undefined behavior.

Fix CRC16 removal by utilizing recently introduced
net_pkt_remove_tail(), that properly handles multiple fragments.

Reported-by: Jim Paris <jim@jim.sh>
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2021-07-15 06:54:33 -04:00
Marcin Niestroj 1ce1d19bb5 net: pkt: introduce net_pkt_remove_tail()
Introduce a helper function for being able to remove any arbitrary
length from tail of packet. This is handy in cases when removing
unneeded data, like CRC once it was verified.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2021-07-15 06:54:33 -04:00
Pieter De Gendt aedc51aca8 drivers: flash: mcux flexspi nor: Fix write on arbitrary offset
If a write offset isn't a multiple of the nor page size, and the
length is too large to fit within a single page, it could wrap around
in that page.

Tested on i.MX RT1064 internal flash using NVS settings

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-07-15 06:47:53 -04:00
Krishna Mohan Dani dea03d4c2d boards/arm: nucleo_f207zg: Enabling true rng (Random Number Generator)
This commit enables true rng for nucleo_f207zg platform. This has been
tested with tests/drivers/entropy/api and is working as expected.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-07-15 06:46:18 -04:00
Krishna Mohan Dani 23e551ffde dts/arm: stm32: Adding rng (Random Number Generator)
This commit adds rng in stm32f2 dtsi.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-07-15 06:46:18 -04:00
Thomas Stranger 8a0940b581 tests: drivers: enable shtc3 build
Enable shtc3 sensor for build_all test

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-15 06:44:34 -04:00
Thomas Stranger d25d385145 drivers: sensor: sht3xd: use sys functions for crc and byteorder
replace custom crc8 with sys/crc8
use sys_put/sys_get helpers for byteorder specific operations

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-15 06:44:34 -04:00
Thomas Stranger 22c8d9973b drivers: sensor: shtcx: add driver supporting shtc1 and shtc3
Add driver for sensirion consumer humidity sensor line.
Supports shtc1 and shtc3, but only shtc3 is tested.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-15 06:44:34 -04:00
Manivannan Sadhasivam fa2d1ea422 drivers: spi: Use timeout for transfer completion
Instead of waiting forever for the SPI transfer to complete, let's use
a timeout value and bail out if elapsed. The timeout value logic is,

xfer_len/frequency + tolerance

Tolerance value can be modified using a Kconfig symbol,
CONFIG_SPI_COMPLETION_TIMEOUT_TOLERANCE. It defaults to 200ms.

Fixes: #33192

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2021-07-15 06:43:23 -04:00
Piotr Pryga a95457a984 Bluetooth: controller: df: Fixes truncated transmission of CTE
There was an issue with wrong length of CTE send in connectionless
mode, with periodic advertising PDUs. Radio peripheral was not
configured to send CTE with correct length while PDU had CTEInfo
field informing receiver that CTE is attached to the PDU.

Source of the problem was in ll_df_set_cl_cte_tx_enable function.

Order of parameters in ull_adv_sync_pdu_alloc was wrong.
ULL_ADV_PDU_HDR_FIELD_CTE_INFO was speficed as hdr_rem_fields.
Because of that extra_data, memory used to provide CTE configuration
to LLL, was not allocated. PDU content is prepared in ULL, so CTEInfo
field included correct information, while Radio was never configured
by LLL to send CTE.

ull_adv_sync_extra_data_set_clear received a pointer to hdr_data,
instead of a direct pointer to df_cfg structure. When extra_data
was allocated correclty, wrong CTE configuration was provided
copied there and LLL received invalid CTE length. It was different
than the length in PDUs CTEInfo field.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-07-15 11:39:13 +02:00
Michał Narajowski 78c222e56f doc: release-notes-2.7: Return value for opcode callback
Add release notes for Stable API Change in Mesh.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-07-15 11:34:52 +02:00
Michał Narajowski 29ae06dfac samples: Update Mesh opcode handlers
Add return values to opcode handlers and update message length
definitions.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-07-15 11:34:52 +02:00
Michał Narajowski ca53e86f67 Bluetooth: Mesh: Add msg length check for Cfg and Health models
According to spec we should ignore messages with incorrect msg size.
This patch adds a check to every opcode handler.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-07-15 11:34:52 +02:00
Michał Narajowski b9422ea9f3 Bluetooth: Mesh: Add return value for opcode callback
```
3.7.3.4 Message error procedure
When receiving a message that is not understood by an element, it shall
ignore the message.
Note: A message can be falsely identified as a valid message, passing
the NetMIC and TransMIC authentication using a known network key and
application key even though that message was sent using different keys.
The decryption of that message using the wrong keys would result in a
message that is not understood by the element. The probability of such a
situation occurring is small but not insignificant.
A message that is not understood includes messages that have one or more
of the following conditions:
• The application opcode is unknown by the receiving element.
• The access message size for the application opcode is incorrect.
• The application parameters contain values that are currently
Prohibited.
Note: An element that sends an acknowledged message that is not
understood by a peer node will not receive any response message.
```

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-07-15 11:34:52 +02:00
Alexandre Bourdiol cd881e0562 soc: arm: stm32l1: set voltage scaling to range1
Default Voltage scaling range selection (range2)
doesn't allow to configure Max frequency
switch to range1 to match any frequency

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-07-15 10:13:27 +03:00
Alexandre Bourdiol 3103fc8c38 soc: arm: stm32l0: set voltage scaling to range1
Default Voltage scaling range selection (range2)
doesn't allow to configure Max frequency
switch to range1 to match any frequency

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-07-15 10:13:27 +03:00
Erwan Gouriou 7650d917a2 drivers/clock_control: stm32: Fixes around LSE clock
Fix macro used in g4 file to enable LSE clock.
Then, to avoid no-op configurations, generate an error
when MSI Hardware auto calibration is selected but LSE
clock is not enabled.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-07-15 10:13:01 +03:00
Marcin Niestroj 84c5a469ab module: mbedtls: add shell module
Add mbedTLS specific shell module, which allows (for now) to show heap
allocation statistics.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2021-07-14 21:14:35 -04:00
Tahir Akram 608ad430f3 drivers: modem: RSSI measurement for PPP link
This PR addresses radio signal stength measurement during
and before PPP session. The PR provides provides facility
of readout for both +CSQ and +CESQ versions depending
upon the modems. This PR follows the idea of rssi readout
of PR#35496. Additionally, reliable Cell info update
is also ensured.

Signed-off-by: Tahir Akram <mtahirbutt@hotmail.com>
2021-07-14 21:06:30 -04:00
Aymeric Aillet ca5e56bdc7 boards: arm: rcar_h3ulcb: Enable I2C
Enable I2C driver for Renesas R-Car H3 boards.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2021-07-14 20:58:50 -04:00
Aymeric Aillet a915e0576b dts: arm: rcar_gen3_cr7: Add I2C support to DTS
Add I2C bus initial support to Renesas R-Car SoC series.
Both I2C2 & I2C4 buses are supported on R-Car H3 board.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2021-07-14 20:58:50 -04:00
Aymeric Aillet 573d77cff2 drivers: i2c: add Renesas R-Car driver
This patch add support for I2C on the Renesas R-Car.

This I2C hardware block can be found on various Renesas R-Car
SoC series.

It allows to perfom read and write on I2C buses in an
interrupt based way on R-Car Gen3 H3ULCB board.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2021-07-14 20:58:50 -04:00
Aymeric Aillet 7abb676697 dts: bindings: i2c: add Renesas R-Car I2C
Third generation R-Car series products have up to
seven I2C bus interfaces conformant with the
Philips Semiconductors (now NXP Semiconductors) I2C bus
(Inter-IC bus) specification.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2021-07-14 20:58:50 -04:00
Krzysztof Chruscinski 60210a6191 tests: lib: mpsc_pbuf: Add test case for max packet allocation
Add test for validating max packet allocation.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-07-14 19:58:39 -04:00
Martí Bolívar 15db98a400 dtlib: allow dangling aliases with DT(..., force=True)
As a first step towards being more forgiving on invalid inputs, allow
string-valued aliases properties that do not point to valid nodes when
the user requests permissiveness.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-07-14 19:51:46 -04:00
Martí Bolívar 176225db58 dtlib: add force DT kwarg
Modeled after dtc's --force option, the idea is this will try harder
and harder over time to produce an object despite malformed input.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-07-14 19:51:46 -04:00
Arvin Farahmand d0b9c03154 devicetree: Add _VARGS variants to _FOREACH_ marcos
`_FOREACH_` macros do not allow the caller to pass additional arguments
to the `fn`. A series of `_VARGS` variants have been added that allow
the caller to pass arbitrary number of arguments to the `fn`:

```
DT_FOREACH_CHILD_VARGS
DT_FOREACH_CHILD_STATUS_OKAY_VARGS
DT_FOREACH_PROP_ELEM_VARGS
DT_INST_FOREACH_CHILD_VARGS
DT_INST_FOREACH_STATUS_OKAY_VARGS
DT_INST_FOREACH_PROP_ELEM_VARGS
```

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-07-14 19:50:39 -04:00
Henrik Brix Andersen 2486b45098 tests: pm: power_mgmt_soc: enable testing on twr_ke18f
Enable the SoC power management test suite on the NXP TWR-KE18F
development board.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Henrik Brix Andersen c0f0fec903 boards: arm: twr_ke18f: enable cpu power-states
Enable CPU idle and stop power-states on the NXP TWR-KE18F development
board.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Henrik Brix Andersen caf9a62c5a dts: arm: nxp: ke1xf: add supported cpu power states
Add supported CPU power states for idle, stop, partial stop 1, and
partial stop 2.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Henrik Brix Andersen 316cb25db4 soc: arm: nxp: kinetis: ke1xf: add support for power management
Add power management support (runtime-idle and suspend-to-idle)
support for the NXP Kinetis KE1xf SoC series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Henrik Brix Andersen 7436432f2e soc: arm: nxp: kinetis: ke1xf: enable lptmr as timer
Enable the NXP Kinetis Low Power Timer (LPTMR) OS timer driver when
power management is enabled as the Arm SysTick timer cannot wake up the
KE1xF from deep sleep.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Henrik Brix Andersen 21806b569f drivers: timer: add NXP LPTMR timer driver
Add NXP Kinetis Low Power Timer (LPTMR) OS timer driver shim. Since the
LPTMR does not support asynchronous changes to the timer period, only
non-tickless mode is supported.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Henrik Brix Andersen 937c2c8dfd soc: arm: nxp: kinetis: ke1xf: keep the sirc running in low-power mode
Keep the Slow Internal Reference Clock (SIRC) running in low-power
mode.

This allows peripherals that needs to remain operative in low-power
mode to use the SIRC as clock source.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Henrik Brix Andersen a43f04e807 boards: arm: twr_ke18f: do not enable Arm SysTick driver by default
Do not enable the Arm SysTick driver by default. Instead, rely on the
default Kconfig settings for the Arm SysTick driver.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Henrik Brix Andersen 5fcb13aea3 soc: arm: nxp: kinetis: ke1xf: determine hw clock cycles/sec from dts
Determine the default CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC from devicetree
when using the Arm SysTick hardware timer.

When the NXP KE1xF SoC series is using the Arm SysTick as hardware
timer, the cycles/second will always be equal to the CPU core clock
frequency.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Henrik Brix Andersen b563f383df dts: arm: nxp: kinetis: ke1xf: add cpu nodelabel
Add nodelabel for cpu0 to allow referencing it in the board devicetree.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Gerard Marull-Paretas 84b8f5e62c drivers: display: ili9xxx: remove unnecessary casts
The config/data casts are not strictly necessary. Furthermore, config
was being casted to non-const.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-07-14 13:19:32 -05:00
Gerard Marull-Paretas 4d32558038 drivers: display: ili9xxx: use spi_dt_spec
Use the recently introduced struct spi_dt_spec to store SPI information
and operate with it.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-07-14 13:19:32 -05:00
Gerard Marull-Paretas 51e53ee73f drivers: display: ili9xxx: use gpio_dt_spec
Use the recently introduced struct gpio_dt_spec to store GPIO
information and operate with them.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-07-14 13:19:32 -05:00
Johann Fischer 0500ec214c drivers: usb_dc_mcux_ehci: use K_NO_WAIT in k_heap_alloc()
This is called in ISR context and timeout must be set
to K_NO_WAIT.

Reported-by: Pieter De Gendt <pieter.degendt@basalte.be>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-07-14 13:05:18 -05:00
Johann Fischer 8eeec634ea drivers: usb_dc_mcux_ehci: fix style
Fix style, two lines are indented too far.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-07-14 13:05:18 -05:00
Maureen Helm ae056a7300 soc: boards: Enable Segger RTT/SystemView on mimxrt1170_evk_cm7
Adds a devicetree chosen node to the mimxrt1170_evk_cm7 board to link
Segger RTT and SystemView sections in DTCM by default. Enables the AHB
clock while the CM7 is sleeping to allow debug access to the TCM.

Note that automatic RTT control block detection may not search the DTCM
address region, therefore you may need to manually set the RTT control
block address or search range in the Segger host tools (SystemView or
RTT Viewer). For example,

$ JLinkRTTViewer -ra 0x20000000

Tested with:
  - samples/subsys/shell/shell_module/
  - samples/subsys/tracing/

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-07-14 13:22:24 -04:00
Eduardo Montoya 72cc39d843 net: openthread: handle NONE level logs
`OT_LOG_LEVEL_NONE` has some uses within OpenThread but it is not
hanled in the Zephyr's platform implementation. This commit makes
use of those logs as `LOG_LEVEL_ERR` level.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2021-07-14 13:14:59 -04:00
Kumar Gala 629b270ac5 samples: jesd216: Exclude hifive1 board from sample
By default the hifive1 board doesn't enable the SPI controller that
the flash is on.  As such this test will not build on that platform
due to lack of a missing SPI bus controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-07-14 13:09:33 -04:00
Johann Fischer cee2eabfa4 modules: hal_nxp: replace Kconfig option USB with USB_DEVICE_DRIVER
Replace Kconfig option USB with USB_DEVICE_DRIVER.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-07-14 12:00:41 -05:00
Thomas Stranger 182221c982 tests: drivers: build_all: sensor: enable serial driver
Enable serial driver such that sensors commuicating via uart
can be added to this test(using the vnd,serial driver).

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-14 11:10:08 -05:00
Thomas Stranger 94f7ed356f drivers: serial: add a dummy driver for vnd,serial
This commit adds a serial dummy driver compatible to vnd,serial.
This is needed that devices can access the uart device in tests
like tests/drivers/build_all/... .

Add myself as codeowner to avoid complicance check failure.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-14 11:10:08 -05:00
Krzysztof Chruscinski f7efacf441 logging: log_backend_spinel: Add support for logging v2
Added support for logging v2 backend API in spinel backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-07-14 11:06:46 -05:00
Krzysztof Chruscinski 940a54c6f6 logging: log_backend_xtensa_sim: Add support for logging v2
Added support for logging v2 backend API in xtensa_sim.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-07-14 11:05:15 -05:00