Commit graph

6994 commits

Author SHA1 Message Date
Matteo Golin
044879e7a3 sensors/lis2mdl: Create a UORB driver for the LIS2MDL magnetometer. 2025-01-28 16:34:17 +08:00
Daniel Jasinski
9e64505f8d build: CMake fix for sim:btuart
bt_bridge.c file was missing in nuttx/drivers/wireless/bluetooth.

Signed-off-by: Daniel Jasinski <jasinskidaniel95szcz@gmail.com>
2025-01-27 08:24:37 +08:00
simbit18
5c02379548 Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
2025-01-23 23:01:54 +08:00
hujun5
b49f4286fb spinlock: Due to semantic inconsistency, remove/rename some functions with the _wo_note suffix.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-23 19:58:49 +08:00
chao an
5de6f7f6fd serial/uart_ram: update lower buffer offset if previous send completes
UART RAM will have probabilistic bubble time during continuous transmission.
Update the offset after sending to avoid this problem.

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-23 18:14:48 +08:00
chao an
45f2a4b2cb drivers/rpmsg_port_uart: remove debug message of datalen
datalen message after file_read is always 0

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-23 18:14:16 +08:00
Michal Lenc
d9270f9ea8 bch: add BIOC_DISCARD ioctl that discards cached sector
This forces the bch layer to read the sector from the physical device
instead of using the cached values. It is necessary to call when the
device is updated from the different source than bch, for example
erased by the MTD ioctl command.

It also has to invalidate readahead buffer from FTL if option
CONFIG_DRVR_READAHEAD is set.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-01-23 02:35:46 +08:00
wangjianyu3
4211ce3212 drivers/rpmsg: update format string
The `file_write()` may return negative `errno`.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-22 23:18:36 +08:00
chao an
ada75b0b93 drivers/rpmsg: fix compiler warning
In file included from nuttx/drivers/rpmsg/rpmsg_port_uart.c:27:
nuttx/drivers/rpmsg/rpmsg_port_uart.c: In function ‘rpmsg_port_uart_send_connect_req’:
nuttx/drivers/rpmsg/rpmsg_port_uart.c:219:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  219 |       rpmsgerr("Send connect request failed, ret=%d\n", ret);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                         |
      |                                                         ssize_t {aka long int}
nuttx/drivers/rpmsg/rpmsg_port_uart.c:219:51: note: format string is defined here
  219 |       rpmsgerr("Send connect request failed, ret=%d\n", ret);
      |                                                  ~^
      |                                                   |
      |                                                   int
      |                                                  %ld
nuttx/drivers/rpmsg/rpmsg_port_uart.c: In function ‘rpmsg_port_uart_send_connect_ack’:
nuttx/drivers/rpmsg/rpmsg_port_uart.c:235:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  235 |       rpmsgerr("Send connect ack failed, ret=%d\n", ret);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                     |
      |                                                     ssize_t {aka long int}
nuttx/drivers/rpmsg/rpmsg_port_uart.c:235:47: note: format string is defined here
  235 |       rpmsgerr("Send connect ack failed, ret=%d\n", ret);
      |                                              ~^
      |                                               |
      |                                               int
      |                                              %ld

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-22 16:54:14 +08:00
chao an
0ffb0b716e drivers/iovec: revert vector io implement from loop/null/zero driver
basic driver does not need such complex wrapper

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-22 11:29:39 +08:00
Matteo Golin
1d205e9ae2 sensors/mcp9600: Converted MCP9600 legacy driver to UORB driver as per suggestions on PR #15525. 2025-01-21 09:09:43 +08:00
paolo
11e3b8167c This patch fix mcp23x08 support. Issue #15592 2025-01-21 01:59:25 +08:00
Ville Juven
c3b2910178 drivers/video/fb.c: Replace sem_getvalue with nxsem_getvalue
Because sem_getvalue modifies errno.
2025-01-20 23:55:26 +08:00
lipengfei28
82cf59bff5 arch/arm64: use UP_DSB, UP_DMB, UP_ISB as barrier standard API
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-01-20 20:13:07 +08:00
lipengfei28
2d1af01d44 mem barrier: use UP_DMP UP_DSP as barriers standard API
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-01-20 20:13:07 +08:00
Neo Xu
afe90db5c4 gdbstub: change send buffer to const char
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2025-01-20 20:07:13 +08:00
dongjiuzhu1
e7f38fe6fa drivers/sensor: add new sensot type to align android sensor type
new sensor type:
SENSOR_TEMPERATURE
SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED
SENSOR_TYPE_GYROSCOPE_UNCALIBRATED
SENSOR_TYPE_MAGNETIC_FILED_UNCALIBRATED

refs:
https://cs.android.com/android/_/android/platform/hardware/libhardware/+/
0e67aa0caee9500b61b9c1c8b6e5cab18301364c:include_all/hardware/sensors-base.h

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-01-20 19:57:42 +08:00
chao an
0e1214d89a syslog/intbuffer: fix spinlock deadlock
just read the code, still have the deadlock after below change:

| commit 3b6f463ce2
| Author: chenrun1 <chenrun1@xiaomi.com>
| Date:   Tue Dec 31 14:31:46 2024 +0800
|
|     syslog_inbuffer:Fixed the lock reentry issue in single core + spinlock scenario
|
|     Summary:
|       When spinlock.h is enabled in a single-core scenario, spinlock reentry and exceptions may occur when spin_lock_irqsave_wo_note is used in syslog_add_intbuffer
|
|     Signed-off-by: chenrun1 <chenrun1@xiaomi.com>

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-20 17:42:40 +08:00
liuhongchao
1e2c002a10 nuttx: add open and close callback functions for the mouse.
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2025-01-17 09:19:18 +08:00
liuhongchao
6bfec7e822 nuttx: Open mouse/touch/keyboard options can be configured
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2025-01-17 09:19:18 +08:00
liuhongchao
41688a8f13 nuttx: Support for rpmsgdev custom ioctl
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2025-01-17 09:19:18 +08:00
liuhongchao
6dbd355c1f nuttx: Support for the mouse ioctl interface
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2025-01-17 09:19:18 +08:00
Matteo Golin
c15b900a88 sensors/sht4x: Converted SHT4X driver to UORB framework. 2025-01-17 09:08:21 +08:00
Tim Hardisty
acd7e44cad Add GD55 QSPI NOR Flash support 2025-01-17 09:07:22 +08:00
chenrun1
0c97296f39 syslog_intbuffer:fix build warning
CC:  mqueue/msgsnd.c syslog/syslog_intbuffer.c: In function 'syslog_flush_internal':
syslog/syslog_intbuffer.c:99:14: warning: unused variable 'flags' [-Wunused-variable]
   99 |   irqstate_t flags;
      |              ^~~~~

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-15 23:30:00 +08:00
chenrun1
3b6f463ce2 syslog_inbuffer:Fixed the lock reentry issue in single core + spinlock scenario
Summary:
  When spinlock.h is enabled in a single-core scenario, spinlock reentry and exceptions may occur when spin_lock_irqsave_wo_note is used in syslog_add_intbuffer

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-15 23:30:00 +08:00
Pavel Pisa
46c3f354b3 drivers/can: ctucanfd the first round of fixes - mainly for char dev
Corrected CAN FD messages sending in character driver mode.
Assign CAN FD format flag in reception of CAN FD messages.
Corrected some defines mismatches.

The code has been tested in QEMU

qemu-system-x86_64 -m 2G -enable-kvm -smp 1 \
  -cpu host,+pcid,+x2apic,+tsc-deadline,+xsave,+rdrand \
  -kernel nuttx/nuttx \
  -nographic -serial mon:stdio \
  -object can-bus,id=canbus0-bus \
  -object can-host-socketcan,if=can0,canbus=canbus0-bus,id=canbus0-socketcan \
  -device ctucan_pci,canbus0=canbus0-bus,canbus1=canbus0-bus

The overall state of this third party CTU CAN FD driver in NuttX
is far from ideal. It would worth to consult and follow more
closely our Linux kernel driver and even better RTEMS CAN/CAN FD
stack design

  https://canbus.pages.fel.cvut.cz/#cancan-fd-subsystem-and-drivers-for-rtems

Signed-off-by: Pavel Pisa <pisa@fel.cvut.cz>
2025-01-15 13:47:04 +01:00
Matteo Golin
36507cc7b2 drivers/sensors: Wrote a driver for the MCP9600 thermocouple amplifier. 2025-01-14 23:04:18 +08:00
YAMAMOTO Takashi
00010089b8 drivers/serial/serial.c: adapt to the iovec-based api
This would fix readv/writev issues mentioned in
https://github.com/apache/nuttx/pull/12674.
(only for this specific driver though. with this approach,
we basically have to fix every single drivers and
filesystems.)

Lightly tested on the serial console, using micropython REPL
on toywasm with esp32s3-devkit:toywasm, which used to be
suffered by the readv issue.
2025-01-14 20:18:21 +08:00
YAMAMOTO Takashi
30ad31e9d7 uio api tweaks
* Make readv/writev implementations update struct uio
  This can simplify partial result handling.

* change the error number on the overflow from EOVERFLOW to EINVAL
  to match NetBSD

* add a commented out uio_offset field. I used "#if 0" here as
  C comments can't nest.

* add a few helper functions

Note on uio_copyfrom/uio_copyto:
although i'm not quite happy with the "offset" functionality,
it's necessary to simplify the adaptation of some drivers like
drivers/serial/serial.c, which (ab)uses the user-supplied buffer
as a line-buffer.
2025-01-14 20:18:21 +08:00
YAMAMOTO Takashi
2749510413 Update a few comments after the recent readv/writev changes 2025-01-14 20:18:21 +08:00
chenzihan0416
2db0b69335 Update goldfish_sensor_uorb.c 2025-01-14 16:44:13 +08:00
chenzihan1
c41c726161 goldfish sensor add get_info interface
Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2025-01-14 16:44:13 +08:00
hujun5
299136bdc7 rptun_bmp: add remote_cpu to rptun_secure_init
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-14 13:34:35 +08:00
hujun5
1600a44d69 rptun_secure:change rptun_secure to rptun_bmp
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-14 13:34:35 +08:00
hujun5
eb2608209a sched_note_wdog: add c_section
reason:
the external critical section protection has been removed.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-14 12:29:29 +08:00
jerryslhao
f1b7d7d641 drivers/sensors/bmi088: add driver for Bosch BMI088 IMU
This adds a driver for the Bosch BMI088 IMU sensor.
The driver supports spi.

Signed-off-by: jerryslhao <jerryslhao@gmail.com>
2025-01-14 10:29:48 +08:00
chao an
849081d348 drivers/note: fix typo falgs and align local name to irq_mask
Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-14 08:37:45 +08:00
yaojiaqi
43797ea6cc drivers/timers/watchdog: add watchdog timer notifier chain
Add support for watchdog timer notifer chain so that users
can customize the callback function when the watchdog timer
times out which enabled by Auto-monitor

Signed-off-by: yaojiaqi <yaojiaqi@lixiang.com>
2025-01-12 11:15:42 +08:00
rongyichang
39780fdae1 drivers/vhost-rng: fix compile error in vhost-rng.
vhost/vhost-rng.c:154:9: error: too few arguments to function 'virtio_create_virtqueues'
  154 |   ret = vhost_create_virtqueues(hdev, 0, 1, vqnames, callback);

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2025-01-12 00:06:12 +08:00
rongyichang
ee2f3df2ff drivers/vhost: fix compile error while get vhost status.
vhost/vhost.c: In function 'vhost_status_driver_ok':
vhost/vhost.c:86:20: error: too few arguments to function 'virtio_get_status'
   86 |   uint8_t status = vhost_get_status(hdev);

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2025-01-12 00:06:12 +08:00
Jukka Laitinen
575c608be8 drivers/usbdev/cdcacm.c: Fix a crash in cdcacm if usbdev gets unregistered while client calls close for the tty
Make sure that the cdcacm is disconnected before the usbdev gets unregistered.

Also, check if the device is connected or not in cdcuart_txempty (uart_txempty). Otherwise there may be a crash during uart_tcdrain, called in tty close path, if the usbdev unregistration happens during the loop.

This issue can be triggered by monitoring the cable connection status in one thread, sending BOARDIOC_USBDEV_DISCONNECT if the usb cable is detached. In another thread close the ttyACM.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-01-10 21:14:55 +08:00
chenzihan1
724797e05c goldfish_sensor_uorb.c: add set_interval for goldfish sensor
Added the ability to set sampling rate for goldfish

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2025-01-10 04:31:29 +08:00
hujun5
8fd4bea2ba segger: rm spin_lock_irqsave(NULL) in drivers/segger/config/SEGGER_RTT_Conf.h
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-09 23:52:55 +08:00
Huang Qi
cfd0cc0d1a Remove duplicate includes across multiple files
This commit cleans up redundant header file includes throughout the codebase.
 The changes include:

 - Removing duplicate #include directives that were present in the same file
 - Consolidating includes that were split across multiple lines unnecessarily
 - Removing unused includes that were no longer needed
 - Fixing some formatting issues with includes

 The changes improve code organization and maintainability by:
 - Reducing unnecessary dependencies
 - Making include dependencies more explicit
 - Following consistent include patterns
 - Removing dead code

 No functional changes are made - this is purely a code cleanup commit.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-09 23:30:23 +08:00
wangjianyu3
8282ed9ab0 drivers/sensors/gnss: Macro UINT8_MAX for maximum value of uint8_t crefs
libs/libc/gnssutils/minmea/minmea.h:17:#include <stdint.h>

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-08 22:50:03 +08:00
hujun5
fabf4a5142 fix compile error
Error: /github/workspace/sources/nuttx/include/nuttx/spinlock_type.h:57:3: error: unknown type name 'atomic_t'
368   57 |   atomic_t owner;
369      |   ^~~~~~~~
370Error: /github/workspace/sources/nuttx/include/nuttx/spinlock_type.h:58:3: error: unknown type name 'atomic_t'
371   58 |   atomic_t next;
372      |   ^~~~~~~~

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-08 09:28:58 +08:00
hujun5
9d5ecc29d0 Revert "SEGGER_RTT_Conf.h: rm spin_lock_irqsave(NULL) in drivers/segger/config/SEGGER_RTT_Conf.h"
This reverts commit 5e7c640976f7fdd77c2230909bf24eafcff26d12.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-08 09:28:58 +08:00
rongyichang
553406e801 drivers/video: add BRGA8888 support for goldfish gpu fb
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2025-01-07 21:47:56 +08:00
Jani Paalijarvi
e1fb0b30c4 drivers/net/ksz9477.c: Check return values in init
Check that writes to configuration registers success.

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2025-01-07 21:42:00 +08:00