'bw' parameter in 'lora config' command has a range of 0 to INT8_MAX.
However possible values of 'bw' (125, 250, 500) don't fit this range
and we need to extend it to 0 to INT16_MAX.
This fix has been tested on custom board with STM32L4 and SX1276.
Signed-off-by: Petr Sharshavin <sharshavin@mail.ru>
Calling for can_stop() method was not emptying FIFOs
and tx_msgq.
Resetting TX FIFO to empty it.
Emptying tx_msgq with "ENETDOWN" return code.
Fixes#50546
Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
Make sure MFD driver for nPM6001 gets built, and, that watchdog driver
comes later in the init sequence.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Make sure MFD driver for nPM6001 gets built, and, that GPIO driver comes
later in the init sequence.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add an API-less MFD driver for nPM6001. In this case, the MFD device
driver doesn't expose any API as plain I2C API is used within other
device drivers (regulator, GPIO, watchdog). This driver just initializes
some device properties.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Introduce the skeleton for multi-function device drivers. This driver
class is inspired by the same class found in Linux. Multi-function
devices expose multiple functionalities, for example, a LED driver,
regulator, GPIO controller, etc. The MFD driver class serves as a kind
of "parent" device where common functionality can be managed: bus
access, IRQ sharing, initialization code, etc.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Using EM2 or deeper sleep states (where HF clocks are off) requires
special care if BLE radio is used, since BLE radio relies on that clock,
and its power/clock requirements need to be taken into account
On SiLabs, radio PM is implemented as part of RAIL blob, which relies
on sl_power_manager HAL service. I've implemented SoC PM
state changes using sl_power_manager instead of emlib, and added
call to RAIL PM initialization in Gecko HCI driver.
Signed-off-by: Roman Dobrodii <rdobrodii@antmicro.com>
Before BURTC is initialized, clock to its APB CSR file is stopped, so
any attempt to read BURTC regs results in BusFault. However,
many parts of Zephyr may call sys_clock getters even before sys_clock
driver itself is initialized. This change adds support for that:
sys_clock_elapsed() and sys_clock_cycle_get_32() simply return 0
if BURTC is not init yet.
Signed-off-by: Roman Dobrodii <rdobrodii@antmicro.com>
The common init priority is a leftover from a previous implementation.
Remove it as it's not used.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Over time, some non-standard concepts and extensions were introduced
into the stack (in KConfig, in drivers, in the internal API and into the
implementation) which makes introduction of additional standard-
compliant extensions like TSCH (and others) unnecessarily difficult.
To introduce extensions like TSCH it is required for the IEEE 802.15.4
stack to become more structurally aligned with the standard again which
will be the focus of some of the upcoming preparatory changes.
One way to check and prove standard compliance is to reference the
standard from within the source code. This change therefore introduces
inline references to the IEEE 802.15.4-2020 standard wherever possible.
Deviations from the standard are documented with TODO or deprecation
labels to be addressed in future changes.
In the future, new code introduced to the IEEE 802.15.4 stack should
be documented and reviewed for standard-compliance to avoid further
divergence. Most importantly:
* MAC/PHY configuration (via net mgmt, radio API, devicetree or
KConfig) should always be directly linked to well-defined MAC/PHY
PIB attributes if visible to the MAC API or the end user.
* Net management/shell/radio API commands should have a documented
reference to the corresponding MLME action from the standard.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Functions nrf_802154_serialization_error and
nrf_802154_sl_fault_handler shall never return.
However `__ASSERT()` might expand to an empty instruction
CONFIG_ASSERT=n and is not enough to stop execution.
Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
Add STM32C0 SOC to combined interrupt config in order to
make it support the I2C driver.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
Add a new regulator driver for Analog Devices ADP5360. While it is a MFD
device, only support for BUCK/BUCKBOOST regulators is added in this
patch.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
If an operational amplifier is used on the DAC output it is
preferrable to disable the DAC output buffer.
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Make it possible to be able to change speed and duplex for the
STM32H7xx and API_V2 from the configuration settings.
This exists for the non-STM32H7x already today, so this is basically
copying the code for the other STM32's.
Please note that ST has a series incompability. For F1 and F2,
the duplex settings are named ETH_MODE_FULLDUPLEX respective
ETH_MODE_HALFDUPLEX. For F4, H7 and F7 the duplex settings are named
ETH_FULLDUPLEX_MODE respective ETG_HALFDUPLEX_MODE.
This should really be queried from the PHY (as previous programmer have
written in the code). But while waiting for a proper PHY solution,
this is intended as a stop-gap solution.
Signed-off-by: Stefan Petersen <spe@ciellt.se>
Since aadca692b3
the board code already sets the stdout/err buffering,
even if there is no console driver;
So there is no need to set it also in the console driver.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
It is possible that stm32_clock_control_init function is started
when the image is chain-loaded and hardware clocks are already
initialized to some state (PLL1).
Currently due to an assert in get_startup_frequency function
(which will trigger k_fatal_halt) the boot will stop on the
early stage if CONFIG_ASSERT=y. This is reproducible for example
with standalone MCUboot and TF-M with MCUboot.
Fixed by adding support for HSE and PLL1 clock sources at
get_startup_frequency.
Signed-off-by: Denis Mingulov <denis@mingulov.com>
Add VREF+ sensor driver and DT node definition.
This driver allows determining the actual voltage applied to an SoC's
VREF+ pin, by comparing the VREFINT internal bandgap voltage reference
with its factory calibration data.
In packages where VREF+ is bonded to VDDA, this permits direct measurement
of VDDA voltage.
Signed-off-by: Kenneth J. Miller <ken@miller.ec>
Logic was wrong when testing if a slave is still attached. And i2c
driver was never disabled.
Test if one of the two slave_cfg pointer is not NULL to return
immediately.
Signed-off-by: Vincent Geneves <vgeneves@kalray.eu>
Since the introduction of the second slave address support, slave_cfg
pointer may be NULL when entering slave event function.
It happens when both targets are registered and then the first one is
unregsitered.
Test the pointer vs NULL before using it.
Signed-off-by: Vincent Geneves <vgeneves@kalray.eu>
Without this change, there's a difference between what the V2 Ethernet
HAL claims to be its capabilities in eth_stm32_hal_get_capabilities()
and what is actually enabled when CONFIG_ETH_STM32_HW_CHECKSUM is
disabled. This difference somehow causes the checksum in outgoing
packets to become 0, and hence seems to break networking at least on
some PHYs.
This commit disables HW checksums by default even when V2 driver is in
use, and this hence fixes networking when CONFIG_ETH_STM32_HW_CHECKSUM
is disabled.
This fixes#57629.
Signed-off-by: Ole Morten Haaland <omh@icsys.no>
Introduce DesignWare ARC Data Fusion IP Subsystem(DFSS) SPI
driver for ARC boards, i.e. EMSDP, which uses DW SPI to controll
SPI-Flash and DFSS SPI to connect external devices. Both drivers
share most source code, but DFSS uses ARC auxiliary registers.
Move FIFO depth setting to device tree.
Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
Renesas Renesas SmartBond(tm) have two ADC blocks:
GPADC and SDADC.
This change adds drivers for both.
Each ADC supports only one channel setup, drivers allow
to have multiply channels in sequence. Switching
between ADC sources in done in software.
GPADC has 10 bit resolution (accuracy can be increase
with oversampling). Values up to 3.6V can be measured
on selected pins. V30 and VBAT1 can also be measured.
SDADC has 14 bit resolution and can take measurements
from 8 pins (single of differential) and VBAT.
Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
This is a follow-up to commit 223cc3c6bd.
When a peripheral pin is disconnected, the pinctrl driver should skip
applying of GPIO configuration, as there is no pin number available in
such case, but due to an incorrect check, it actually did not skip it
and used an incorrect pin number for that. In nrfx prior to 3.0.0, this
caused an assertion failure, but because of a fallback routine, things
could still work in most cases (when assertions were disabled) as that
GPIO configuration was just applied to P0.31. Hence the bug was not
discovered until now. In the recent nrfx, this causes a null pointer
dereference, so always a crash.
This commit corrects the mentioned check and also uses the term "psel"
instead of "pin" where it is possible that the value is not a correct
pin number, in the hope of preventing a similar problem in the future.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Until now iterable sections APIs have been part of the toolchain
(common) headers. They are not strictly related to a toolchain, they
just rely on linker providing support for sections. Most files relied on
indirect includes to access the API, now, it is included as needed.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The i2c_npcx_controller does not actually implement the i2c API, that's
implemented in the port driver and the controller one is in support of
that. This means there's no need to use the I2C specific instance
define, as that would end up adding the stats structure that would never
get used.
This was originally added in 7b1349cfe6.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Status readback has been added in the latest silicon revision.
.port_get_raw and .port_toggle_bits are now supported
Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
Replace memcpy usage in write since it is not linked to non-external
flash which might cause read-while-write issues.
Move the function that invalidated the data cache inside the critical
section to avoid context switch before it is invalidated.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Check memc_flexspi_is_running_xip before calling
memc_flexspi_set_device_config in hyperflash init.
This aligns with the nor flash driver.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Hyperflash write operations resulted in invalid writes. This commit
fixes the issue by temporarily lowering the clock during writes.
This aligns with the mcux-sdk-examples.
Fixes https://github.com/zephyrproject-rtos/zephyr/issues/53855
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Add a function to update the flexspi bus clock. This is
needed when write operations are done to the hyperflash.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Driver was based on can_sam. SAMC21 has only 1 interrupt for one
can "output", so can interrupt has to executes two lines of
interrupts.
CAN is configured to use OSC48M clock via GLCK7. GLCK7 is set
by divider configured from dts.
Signed-off-by: Kamil Serwus <kserwus@gmail.com>
Looks like a copy/paste error when copying runtime to empty to runtime
to full. Fixing so that we're assigning to the right union member.
Signed-off-by: Peter Rowley <perowle@microsoft.com>
The buffer registers (chemistry, manufacturer name, device name) were
not implemented. Implemented by adding a new api interface for
retrieving buffer properties. fuel_gauge_get_block_property has been
added, and uses a memory buffer allocated in the app in order to
store the fuel gauge information.
Signed-off-by: Peter Rowley <perowle@microsoft.com>