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>
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>
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>
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>
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>
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>
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>
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>
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>
```
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
`_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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
`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>
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>
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>
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>