remove litex,sys-clock-frequency from litex,clk,
because we already define that in the clock-frequency of cpu0.
This can be accessed via
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
PR #63973 namespaced generated headers with zephyr/, including generated
syscall headers.
Since then, some new generated syscall header includes have been added
without the zephyr/ prefix, breaking builds when
CONFIG_LEGACY_GENERATED_INCLUDE_PATH is disabled.
This commit adds the zephyr/ prefix to includes for generated syscall
headers where it has been missed.
Signed-off-by: Ben Marsh <ben.marsh@helvar.com>
ESP32-S2 Wi-Fi clock is not initialized properly, causing
instability when scanning or connecting to a SSID.
Fixes#74899Fixes#74417
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
The 14/12-bit variants (AD5692R/AD5691R) require the data to be in the
upper bits of the two byte data field of the write command. See table 12
and the associated footnotes in the AD5693R/AD5692R/AD5691R/AD5693
datasheet.
Signed-off-by: Brett Witherspoon <brett@witherspoon.engineering>
Fix a build error when CONFIG_SPI_ASYNC is set.
The issue was detected by CI
```
spi_xlnx_axi_quadspi.c: In function 'xlnx_quadspi_isr':
spi_xlnx_axi_quadspi.c:489:21: error: 'ctx' undeclared
489 | if (ctx->asynchronous) {
| ^~~
```
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Fix the busy wait in the MDIO driver that was causing timing
problems in systems with real time requirements performing tasks
more frequently than about a millisecond.
Restructure the code to be less redundant and change the busy wait
kconfig to microseconds instead of millliseconds. Also actually signal
to the mdio driver that it can use the interrupt instead of busy
waiting, this seems to have been forgotten.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Set the remote address of received sockets.
This is necessary for services that rely on the remote address.
DNS relies on the remote address to be set properly.
Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
The CMSDK watchdog hardware only supports a single timeout channel.
Return the documented error if more than one timeout is requested to be
installed.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The previous calculation was multiplying the timeout in milliseconds
by the clock frequency, giving a cycle count 1000x larger than it should
be.
Fix the calculation and rename `reload_s` to `reload_cycles`, as the
cycle count is what this actually contains.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The intention here appears to be to return an error. Use an early return
to implement this.
Signed-off-by: Brett Witherspoon <brett@witherspoon.engineering>
Remove the reset vector setting from driver layer,
the reset vector is more suitable to be set at the board layer.
Signed-off-by: Kevin Wang <kevinwang821020@google.com>
In order to decouple the read request from its implementation, we need
to be able to yield to potential lower-priority threads, which is not
possible with k_yield() itself. As such, using RTIO Consume semaphore
enables us to achieve this.
This patch also refactors blocking API (sensor_read) to also block upon
consumption, so as not to require RTIO_SUBMIT_SEM enabled.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
- enabled GPT(PWM) peripheral for sleep/deepsleep mode in init_pwm()
- Fixed: undefined behaviour when using k_sleep()
Signed-off-by: Devansh Tanna <devansht0210@gmail.com>
c8d8dce755 introduced a regression whereby driver config should hold
module device pointer, except it didn't.
This commit adds module_dev to the driver config.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
When multiple devices are on the bus, and no slave matches
the sent rom, the master receives only ones.
This should be handled explicitly and the error reporting
should not rely on the crc mismatch of the scratchpad.
Note: Make sure that the sensor configuration is loaded to the
eeprom (copy scratchpad), otherwise the resolution will not match
the expectations in case a node looses power and recovers.
As in that case the configuration will not be applied again.
Also the sensor may still report the power on reset value
of +85°C just after the sensor powered up.
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
After each read of the scratchpad the crc of the data
is checked and in case of a mismatch an error is returned.
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
- Move the content of the header file into the source file,
and drop unnecessary includes.
- Also, drop the bus access function.
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
An off by one error in the channel range check results in an out of
bound access to the channel lookup array.
Signed-off-by: Brett Witherspoon <brett@witherspoon.engineering>
The existing configuration of the ESP32 UART FIFO thresholds
was fixed, leading to inefficiencies in handling
Modbus RTU packages exceeding this size.
This commit introduces two new Kconfig options,
allowing users to adjust the esp32 fifo thresholds as needed.
fixes#74311
Signed-off-by: Omer Gozderesi <omer.gozderesi@enda.com>
config: esp32: configurable UART FIFO thresholds
The existing configuration of the ESP32 UART FIFO thresholds
was fixed, leading to inefficiencies in handling
Modbus RTU packages exceeding this size.
This commit introduces two new Kconfig options,
allowing users to adjust the esp32 fifo thresholds as needed.
fixes#74311
Signed-off-by: Omer Gozderesi <omer.gozderesi@enda.com>
Right now AT+CIPSTART command is called with both "remote port" and "local
port" being set to the same number. This means that for outgoing UDP
traffic (e.g. when resolving DNS or when reaching out some application
server with CoAP over UDP) always the same outgoing port is used. Such
behavior is wrong, since by default a random outgoing port should be used.
Reusing the same port confuses server implementation that is reached out,
since especially in context of DTLS over UDP, outgoing port defines TLS
context/session to be used. Such servers often ignore TLS packets from new
sessions (e.g. after device reboot) and result in failed DTLS connection
attempts.
Commit dbf3d6e911 ("drivers: esp_at: implement bind() and recvfrom() for
UDP sockets") added support for "server-side listening" for incoming
traffic on UDP sockets, which introduced broken behavior of using the same
remote and local port.
In esp_bind() implementation assign newly intorduced 'src' member, instead
of reusing 'dst'. Don't call AT+CIPSTART yet at this stage, as in case of
connect() Zephyr syscall esp_bind() (via bind_default() helper function) is
called implicitly to assign random generated local port, so remote port is
yet to be assigned. Check in esp_recv() whether socket was already
connected (i.e. esp_connect() was called) and if not, invoke
AT+CIPSTART (via _sock_connect()) to start listening on "server-side" UDP
socket.
This patch fixes broken behavior of always reusing the same local port for
outgoing UDP traffic. Instead, randomly generated (by Zephyr net_context
subsys) local port is used. Additionally bind() and recvfrom()
implementation (to handle server-side UDP sockets) is improved, so that
binding to 0.0.0.0 (on any interface) is possible.
Fixes: dbf3d6e911 ("drivers: esp_at: implement bind() and recvfrom() for
UDP sockets")
Fixes: 424ea9f5e4 ("drivers: wifi: esp_at: do not connect socket on
bind(INADDR_ANY)")
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Increase the default TX thread stack size for the CAN loopback driver from
256 to 512 bytes as the former has shown to be too little when using the
loopback driver on real hardware.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Previously both temperature and pressure were updated regardless of
which one was requested.
Fixes CID: 392519, GH: 74779.
Fixes CID: 392497, GH: 74777.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
During initialization, zero is returned if an unexpected device ID is
read because the returned variable is not written to after a previous
non-zero check. Return -EIO instead to indicate an error occurred.
Detected with the following Coccinelle script:
@@
identifier I;
@@
*if (I) {
...
return ...;
}
if (...) {
... when != I
when any
* return I;
}
Signed-off-by: Jared Kangas <kangas.jd@gmail.com>
In case where the system is overloaded, net stack buffer
could fail to allocate next packet. That scenario requires
wifi internal Wi-Fi driver to free current rx buffer. This is
currently not being called. This fixes it by making sure
esp_wifi_internal_free_rx_buffer() is called in all scenarios.
Fixes#63043
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Converts the `<inf> i2c_ll_stm32_v2: I2C TIMING` message
displayed by the driver to a LOG_DBG. Also makes an actual
error message a LOG_ERR instead of a LOG_DBG.
Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
RTIO expects the CHAINED flag to be set when ordering of operations is
important. The callbacks in the icm42688 stream handling were not
chained into, meaning the callbacks would have occured immediately
rather than *after* the SPI reads/writes.
Update all the spi transactions to chain into the desired callbacks in
the driver.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Updated nxp lpadc driver, because the phandle type property
'nxp,reference-supply' was removed, and a new phandle-array
type property 'nxp,references' added.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
When CONFIG_NET_STATISTICS=y is enabled, build fails
due to wrong interface pointer.
Fixes#75515
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Fixes: #75390
A wrong bit mask (wrong: IOMUXC_SW_PAD_CTL_PAD_PUS_MASK = 0x8) was used.
That bit mask is for PUE/PUS-type gpio registers, but this is the
section for registers with alternative PULL (PDRV) type layout.
Right bit mask: IOMUXC_SW_PAD_CTL_PAD_PULL_MASK
Signed-off-by: Nils Larsen <nils.larsen@posteo.de>
Don't zero initialise the static data structure, as statics are
explicitly initialised to 0 per the C standard, and checkpatch normally
complains about the pattern.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Return the documented error if `wdt_install_timeout` is called after
`wdt_setup`, instead of triggering the state assertion inside of
`nrfx_wdt_channel_alloc`.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Return an error code if `wdt_feed` is called before `wdt_setup`, instead
of triggering the state assertion inside of `nrfx_wdt_channel_feed`.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Target SSID buffer might not be NULL terminated, so use memcpy() instead of
strncpy() for copying it from temporary (AT response fragment) buffer.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Close file descriptor returned by accept() in error path of
nsos_adapt_accept(), so that file descriptor is not leaked.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>