Commit graph

6955 commits

Author SHA1 Message Date
Alan Carvalho de Assis
934b7b4bf5 drivers/lcd/st7735: Don't define st7735_rdram if write only mode
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-07-29 08:18:30 -03:00
Matteo Golin
b0760dceb6 drivers/sensors/l86xxx: Use uORB GNSS lower-half
Changes the implementation of the L86xxx driver to use the
gnss_lowerhalf driver implementation, simplifying this driver's logic.
It also fixes the `read_line` function which would early return on `\r`,
as well as adding some retries for response checking and better mutex
locking.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-07-28 10:46:55 +02:00
Matteo Golin
da72df9ab6 drivers/sensors/l86xxx: Fix kernel crashes on failed registration
Sometimes this driver will boot when the serial port is of the wrong
baud rate, and it cannot set the correct baud rate or verify
communication. This commit prevents registration if any settings fail to
be set, and also prevents the kernel thread from setting the L86 to
enabled (this is done only by the uORB upper half).

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-07-25 10:48:55 +08:00
simbit18
d7a05dfcc6 drivers/segger: Add a kconfig to override Segger SystemView target sources version
update:
    CMakeLists.txt
    Make.defs
    Kconfig

It allows the same version of SystemView target sources to be used for CMake and Make, to avoid discrepancies in the future.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-07-22 23:21:31 +08:00
Michal Lenc
e96ef8abe3 drivers/ioexpander/icjx.c: reconfigure icjx after undervoltage
According to a reference manual, VCC and VDD undervoltage
and VDD burst leads to the reset of all registers.
Therefore we have to reconfigure the expander to make
it functional again.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-07-18 12:08:39 -03:00
George Poulios
589c0e13b8 drivers/misc/optee: Cache coherency when MMU is disabled
When the MMU is disabled (CONFIG_ARCH_USE_MMU=n) the
data passed back and forth with the TEE needs to be
synced from/to the cache, otherwise we get random data
in either world.

Fix this by cleaning before a call and invalidating after.
This has to be done both on the optee msg arg, and the shm
buffers therein. Cleaning and invalidating the page list
used to describe non-contiguous shm buffers did not seem
mandatory in my tests, but common sense says that it should
be, so we do that too.

This fix does not apply to the optee msg arg of the socket
transport (optee_socket.c), as that one _should_ be handled
by the socket send/recv methods. It does apply to all shm
buffers though, regardless of transport.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-07-16 15:35:00 +08:00
jingfei
c3e87dd3d1 drivers/fs: Control the behavior of FTL by passing oflags during the open process.
To save more space (equivalent to the size of one erase sector of
MTD device) and to achieve faster read and write speeds, a method
for direct writing was introduced at the FTL layer.
This can be accomplished simply by using the following oflags during
the open operation:

1. O_DIRECT. when this flag is passed in, ftl internally uses
   the direct write strategy and no read cache is used in ftl;
   otherwise, each write will be executed with the minimum
   granularity of flash erase sector size which means a
   "sector read back - erase sector - write sector" operation
   is performed by using a read cache buffer in heap.

2. O_SYNC. When this flag is passed in, we assume that the
   flash has been erased in advance and no erasure operation
   will be performed internally within ftl. O_SYNC will take
   effect only when both O_DIRECT and O_SYNC are passed in
   simultaneously.

3. For uniformity, we remapped the mount flag in mount.h and
   unified it with the open flag in fcntl.h. The repetitive
   parts of their definitions were reused, and the remaining
   part of the mount flag redefine to the unused bit of open
   flags.

Signed-off-by: jingfei <jingfei@xiaomi.com>
2025-07-16 14:11:41 +08:00
jingfei
a6fdbc538b Revert "ftl: should pre-allocate eblock for car case"
This reverts commit 20fcdcf905f279a9c4527be399a90590f458db1f.
The reason is that the erase buffer isn't always used in most cases.

Signed-off-by: jingfei <jingfei@xiaomi.com>
2025-07-16 14:11:41 +08:00
Alan Carvalho de Assis
54b2381c42 drivers/input: Create Single Button Multi Actions
This commit creates a sbutton device that uses a single button to
create a keyboard driver that returns TAB or ENTER depending how
long the user keeps the button pressed.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-07-15 18:39:59 -03:00
Daniel Byshkin
c51f749f9a /drivers/sensors/nau7802: Added frequency control
Added controls to the NAU7802 so that a user can change the frequency via orb_set_frequency/orb_set_interval
2025-07-15 09:39:57 +08:00
Daniel Byshkin
4030eb892e drivers/analog/ads1115.h: Add ioctl for conversion trigger
Since the ADS1115 has a relative slow conversion rate, this additional
ioctl command makes it possible to trigger a conversion before reading
the reading the conversion result, allowing the user to perform other
computation in between instead of waiting for the conversion time to
complete. It improves sampling time.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-07-14 10:22:33 -04:00
SPRESENSE
a20ac0fe7c sensors/bmi160: Fix a bug sensor_time is truncated
Fix a bug that sensor_time resolution is lost by bit shift.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-09 09:50:18 +02:00
SPRESENSE
be5c90716c sensors/bmi270: Fix a bug sensor_time is truncated
Fix a bug that sensor_time resolution is lost by bit shift.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-09 09:50:18 +02:00
Matteo Golin
6ae3cc9082 drivers/sensors/l86xxx: Make some dependency patches and update documentation
This commit removes the termios dependency of the command to set fix
rate. It makes the MINMEA dependency present in the Kconfig options for
the driver, and it also adds a retry limit to the boot message
verification of 3 times. The documentation has been updated to reflect
the correct signature for the registration function and fix some
formatting.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-07-09 09:45:21 +02:00
p-szafonimateusz
880c8e5d26 drivers/net: add IGB network card support
Add support for Intel IGB type of network cards.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-08 10:02:15 +02:00
Elias Hawa
0ce9e82d73 drivers/sensors: add Quectel L86-XXX GNSS uORB sensor driver 2025-07-07 21:18:15 -03:00
Joshua Lange
d5eda10cad drivers/leds: Add support for KTD2052
This commit adds support for the KTD2052 LED driver chip.

Signed-off-by: Tyler Bennett <tbennett@2g-eng.com>
2025-07-07 09:49:51 -03:00
wangjianyu3
770d4a6c86 drivers/input/ft5x06: Adapt to touchscreen frame
Calling touch_register() to register touchscreen driver instead of
registering generic driver.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-07-07 08:46:58 -03:00
wangjianyu3
ed1384fc81 driver/touchscreen: Add support for mirror/swap
Add support for mirror/swap coordinates.
There are some touchscreen drivers not support mirror or swap coordinates.
For example, drivers/input/ft5x06 does not support mirror.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-07-07 08:46:58 -03:00
wangjianyu3
9f6666b75b driver/touchscreen: add custom open/close
Add custom open/close for lower to init/deinit device.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-07-07 08:46:58 -03:00
p-szafonimateusz
bba1741421 drivers/net/{e1000|igc}: align descriptors to 8
A descriptor ring length must be aligned to 128, one descriptor is 16B length,
so we can provide this condition with the appropriate number of descriptors

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-03 21:57:02 +08:00
p-szafonimateusz
5a9530855c drivers/net/{e1000|igc}: drop TX packets if TX ring is full
drop TX packets if TX ring is full, so we don't overwrite
not handled TX descriptors

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-03 21:57:02 +08:00
p-szafonimateusz
0f537dcb97 drivers/net/{e1000|igc}: fix reinit for RX/TX rings
Descriptor head is managed by HW and should not be modified by SW unless:
1. device is after a reset
2. device is before enabling TX or RX

Also set correct tail for RX which should point at the end of ring
(descriptor ring is zero-indexed).

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-03 21:57:02 +08:00
p-szafonimateusz
bdde180d7a drivers/net/{e1000|igc}: disable TX by modify only TX enable bit
disable TX by modify only TX enable bit, otherwise we lose TX configuration

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-03 21:57:02 +08:00
p-szafonimateusz
0a8ef045ab drivers/net/{e1000|igc}: update link status when card is enabled
Update link status in case link status interrupt is missing.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-03 21:57:02 +08:00
p-szafonimateusz
7a8ac49836 drivers/net/{e1000|igc}: do not touch RX/TX rings when link status change
Do not reset RX/TX rings when link status change.
This can break internal card state which is impossible to recovery.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-03 21:57:02 +08:00
p-szafonimateusz
bccee707d6 drivers/net/{e1000|igc}: reset RX/TX rings after RX/TX disabled
reset RX/TX rings **after** RX/TX are disabled to make sure the rings are
not used by hardware when software modify rings state.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-07-03 21:57:02 +08:00
f4e8def270 drivers/net/Kconfig: Move NET_IGC_TXDESC and NET_IGC_RXDESC to NET_IGC menu 2025-07-03 00:16:24 +08:00
zhongzhijie1
3d37e85b13 Remove minread para in btuart_read.
In file_read(), asynchronous reading is supported, so partial reads and the minread parameter are no longer needed.

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2025-07-01 09:06:43 -03:00
zhongzhijie1
4a4ad26474 Support bt H4_ISO packet parsel in bt_uart_shim driver.
In btuart_rxwork, There is no case for parsel HCI data of ISO type, but there are corresponding processes in the SIM and vendor driver code.

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2025-07-01 09:06:43 -03:00
zhongzhijie1
d81a28097a btuart_read and returned the correct value.
When the nread return value < 0, if the total length ntotal that has been read is > 0, the function returns ntotal; otherwise, it returns the nread error code.

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2025-07-01 09:06:43 -03:00
zhongzhijie1
386dbfa449 Refactored the btuart_rxwork function to improve data reception stability.
Read as much data as possible initially, then process each packet individually. Defined the read buffer within the structure and added a rx_len variable to indicate the current read offset. After processing each complete packet, leftover data is moved to rxbuf[0] and rx_len is reduced by the length of the processed packet. The next packet process will start from rxbuf[0] after the read ends at new rxbuf[rx_len].

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2025-07-01 09:06:43 -03:00
wangmingrong1
c6da553788 kasan: kasan_reset_tag rename kasan_clear_tag
The clear tag is more explicit than the reset tag.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-30 18:19:38 +08:00
michal matias
c5a3089e87 drivers/net: Add support for the NCV7410 10BASE-T1S MAC-PHY
This commit adds driver for the Onsemi NCV7410 10BASE-T1S
Ethernet MAC-PHY.

Signed-off-by: michal matias <mich4l.matias@gmail.com>
2025-06-28 08:49:46 -03:00
dongjiuzhu1
224dc48a95 drivers/serial: fix the issue of the refs count for filep being zeroed out by utilizing dup2
file_open will clear filep, include f_refs

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-06-26 09:31:14 -03:00
simbit18
7d5b9cbb96 drivers/serial: Fix Kconfig style
Remove spaces from Kconfig
Add TABs
2025-06-26 02:30:46 +08:00
simbit18
22c02963ac drivers/segger/CMakeLists.txt: Aligned Cmake with Make
Segger SysView has been upgraded to version V3.5.6
https://github.com/apache/nuttx/pull/13847

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-06-25 22:20:39 +08:00
ouyangxiangzhen
d9bbdeb6fe spinlock: Better recursive spinlock implementation.
This commit provided a better recursive spinlock implementation with
less memory-overhead and better performance.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-06-25 22:13:00 +08:00
simbit18
1f98d90825 drivers/sensors/CMakeLists.txt: Aligned Cmake with Make
Add:
    Adafruit NAU7802 ADC sensor
    MCP9600 Thermocouple Amplifier
    Maxim MAX31865

Removed repeated addition of the Rohm BH1749NUC Color Sensor

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-06-25 20:40:15 +08:00
halyssonJr
21e8bfaab4 Modify types uint32_t to size_t 2025-06-23 20:34:24 +08:00
Kerogit
a3f8b55143 drivers/serial/serial: prevent race conditions on 8-bit architectures
Some code paths in drivers/serial/serial.c load head and tail values
of receive and transmit circular buffers with interrupts enabled,
making it possible that the interrupt handler changes the value.
As noted in the code, this is safe as long as the load itself is atomic.

That is not true for 8bit architectures which fetch the 16-bit values
using two load instructions. If interrupt handler runs between those
two instructions and changes the value, the read returns corrupted data.

This patch introduces CONFIG_ARCH_LDST_16BIT_NOT_ATOMIC configuration
option which is automatically selected for AVR architecture. Based
on this option, head and tail values are reduced to 8-bit length
so the read remains atomic.

Patch was tested by building on rv-virt:nsh - disassembly of functions
from serial.c showed no difference which is correct as Risc-V does
not need to protect reads of these values. There should be no impact
for architectures that do not set the new configuration option.

It was also tested by by custom echo application running on AVR128DA28.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-06-19 10:01:24 -03:00
Kerogit
b5ccd54dd6 drivers/serial/serial: fix race condition in flow control
This patch fixes calculation of nbuffered value if
CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS is set. Volatile variable that
can be changed in interrupt handler was used in a condition which
branched the calculation into two paths. Precisely timed interrupt
could make the branch that was taken the incorrect one.

Patch was tested by building on AVR DA/DB chip.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-06-19 10:01:24 -03:00
Kerogit
c6c71b0beb drivers/serial/serial: typo fix in comment
Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-06-19 10:01:24 -03:00
yangao1
99303e9493 note/notestream: Call lib_fileoutstream_open in notefile_register
follow up fileoutstream change

Signed-off-by: yangao1 <yangao1@xiaomi.com>
2025-06-17 20:58:13 +08:00
liwenxiang1
81f27bd602 drivers/segger:Add config option to allow defining the macro as variable
we are using segger RTT protocol over shared memory for two core log/trace: one is NuttX another Linux/Windows. But the base address of shared memory can only be known at runtime, so we change SEGGER_RTT_UNCACHED_OFF from macro to global variable, and update to the correct g_segger_offset after the shared memory is initialized by:
g_segger_offset = (uintptr_t)ishmem - (uintptr_t)&_SEGGER_RTT;

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2025-06-16 14:56:06 +08:00
Jukka Laitinen
42b1ac90fb drivers/segger: Change SEGGER_RTT_LOCK into rspinlock
The SEGGER_RTT_LOCK needs to be recursive, otherwise system will
deadlock in SMP

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-06-15 00:07:26 +08:00
liwenxiang1
2fa5811f7c drivers/segger:Replace the included header file
The trunk branch fails to compile

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2025-06-15 00:07:26 +08:00
liwenxiang1
525fcb4a45 drivers/segger: move g_segger_lock to segger.c
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2025-06-15 00:07:26 +08:00
Matteo Golin
4ccc3d4c96 drivers/syslog: Add RFC 5424 protocol support
Initial implementation of RFC 5424 support (syslog protocol). Allows
users to force-format the syslog output in a RFC 5424 compatible way,
making NuttX systems 'originators' that are able to interface with
syslog 'collectors' and 'relays' (useful for logging to syslog servers).

In addition to regular formatting options for syslog output, users can
also add structured data (currently only timeQuality is implemented,
assuming no sync and no timezone is no known). Facilities and severities
now also follow RFC 5424. Support for additional features (like
more sdata elements, msgid, etc.) will need to be built into the syslog
implementation if desired.
2025-06-13 20:26:57 +08:00
dongjiuzhu1
cf1e92e5a2 driver/optee: fix compile break
update api name accroading to new implementation.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-06-13 20:14:48 +08:00