Commit graph

6817 commits

Author SHA1 Message Date
chao an
c782131c5f syslog/rpmsg_server: fix build break if enable SYSLOG_RPMSG/SYSLOG_RPMSG_SERVER
syslog/syslog_rpmsg_server.c:66:13: error: conflicting types for 'syslog_rpmsg_write';
      have 'void(const char *, size_t,  const char *, size_t)' {aka 'void(const char *, unsigned int,  const char *, unsigned int)'}
   66 | static void syslog_rpmsg_write(FAR const char *buf1, size_t len1,
      |             ^~~~~~~~~~~~~~~~~~
In file included from syslog/syslog_rpmsg_server.c:36:
nuttx/include/nuttx/syslog/syslog_rpmsg.h:51:9: note: previous declaration of
  'syslog_rpmsg_write' with type 'ssize_t(const syslog_channel_t *, const char *, size_t)' {aka 'int(const struct syslog_channel_s *, const char *, unsigned int)'}
   51 | ssize_t syslog_rpmsg_write(FAR syslog_channel_t *channel,
      |         ^~~~~~~~~~~~~~~~~~

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-25 10:51:37 +01:00
Michal Lenc
425ddc7f72 lcd/st7789: fix incorrect buffer count for 3 wire RAM write
If st7789_wrram is called with count = 1, then the entire buffer should
be sent. However, in 3 wire mode, the driver has to send the buffer
row by row because of additional data flag. The number of rows (count)
can't be ST7789_YRES in this case, but only the number of rows in
the buffer (this is write size / row size , where row size is
ST7789_XRES * ST7789_BYTESPP). This also applies only if we want to
write size larger than row size, because st7789_putrun allows to
write just a part of a row.

This fixes the incorrect behavior of the display in 3 wire mode if
the display is split into more buffer writes (as in LCD driver for
example, FB driver did not face this issue).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Co-authored-by: Martin Krasula <krasula@atlas.cz>
2025-02-24 09:51:13 +01:00
wangjianyu3
9f85eaf3cb drivers/thermal: Fix work not queued after getting temperature fails
The work will be stopped after get_temp() fails.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-02-22 07:56:21 -03:00
Filipe Cavalcanti
b542be4a14 drivers/net: change format specifiers macros on lan9250 driver
This fixes build warnings when different archs are used.
Simply changes "lx" to "PRIx32" when using uint32_t.
2025-02-21 11:29:48 -03:00
Matteo Golin
a76d63646f drivers/sensors/ms56xx: Use nxsig_usleep for long delays.
Change use of `up_udelay()` to `nxsig_usleep()` on the 10ms delays for
better performance.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-02-20 11:12:13 -03:00
Matteo Golin
8de9dd9515 drivers/sensors/lsm6dso32: fixed byte read command to include start.
This is required to meet the communication requirements as per the
LSM6DSO32 datasheet. It doesn't cause issues on some MCUs (RP2040), but
prevents successful reads on others (STM32).

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-02-19 15:21:08 -03:00
lijing.ly
6bd191e7e0 drivers/rpmsg/Kconfig: Add SPI dependency for RPMSG_PORT_SPI
If SPI dependency is not set, the following warning will be generated during compilation:

[109/1450] Building C object drivers/CMakeFiles/drivers.dir/rpmsg/rpmsg_port_spi.c.o
/data/code/nuttxspace/nuttx/drivers/rpmsg/rpmsg_port_spi.c: In function ‘rpmsg_port_spi_exchange’:
/data/code/nuttxspace/nuttx/drivers/rpmsg/rpmsg_port_spi.c:233:3: warning: implicit declaration of function ‘SPI_EXCHANGE’ [-Wimplicit-function-declaration]
  233 |   SPI_EXCHANGE(rpspi->spi, txhdr, rpspi->rxhdr,
      |   ^~~~~~~~~~~~
[1450/1450] Pac SIM with dynamic libs in nuttx.tgz

Signed-off-by: lijing.ly <lijing.ly@bytedance.com>
2025-02-19 14:52:22 -03:00
JianyuWang
1e7532c381 drivers/thermal: Break loop if matching active trip point
Co-authored-by: Donny(董九柱) <70748590+Donny9@users.noreply.github.com>
2025-02-16 11:22:41 -03:00
wangjianyu3
fef1a0702d drivers/thermal/dummy: Add another passive cooling device
For case that CPUFreq was not enabled.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-02-16 11:22:41 -03:00
wangjianyu3
0b633946c0 drivers/thermal: Add support for passive trip point
Spliting `THERMAL_NORMAL` to `THERMAL_ACTIVE` and `THERMAL_PASSIVE`,
to support different update intervals for thermal zone.

Active/Passive from [kernel.org](https://www.kernel.org/doc/Documentation/devicetree/bindings/thermal/thermal.txt):

  * Cooling device nodes

  Cooling devices are nodes providing control on power dissipation. There
  are essentially two ways to provide control on power dissipation. First
  is by means of regulating device performance, which is known as passive
  cooling. A typical passive cooling is a CPU that has dynamic voltage and
  frequency scaling (DVFS), and uses lower frequencies as cooling states.
  Second is by means of activating devices in order to remove
  the dissipated heat, which is known as active cooling, e.g. regulating
  fan speeds. In both cases, cooling devices shall have a way to determine
  the state of cooling in which the device is.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-02-16 11:22:41 -03:00
Alan Carvalho de Assis
5a6e5a8fb4 serial: Add struct serial_icounter_s and CONFIG_SERIAL_TIOCGICOUNT
This commit add support to the serial_icounter_s struct used with
TIOCGICOUNT to report U[S]ART errors such as frame, parity, overrun,
etc.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-02-14 18:24:47 +01:00
Matteo Golin
576a9990c5 drivers/sensors/lsm6dso32: Fixed typo in device address registration.
The valid addresses should be 0x6a and 0x6b, not 0x6c. Now the device
can be registered with the correct addresses without failing the
assertion.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-02-14 10:37:21 +01:00
hujun5
f22b93b337 sched/spin_lock: rename raw_spin_lock to spin_lock_notrace
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-02-13 20:48:15 +08:00
Michal Lenc
99c7b64072 mtd/w25q: ensure the correct behavior if erase sector fails
Function w25qxxxjv_erase wasn't correctly handling an error in
w25qxxxjv_erase_sector call and was returning success even on failure.
Moreover this change does not immediately return EBUSY but waits for
the previous operation to finish. If the timeout is significant (more
than erase time of the entire flash), then it returns EBUSY.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-02-13 10:02:06 +08:00
Matteo Golin
729f8a75f7 drivers/sensors: Added uORB driver for LSM6DSO32 IMU.
Adds support for the LSM6DSO32 IMU by STM using the uORB framework. This
only contains limited support for the I2C interface, interrupt and
polling driven measurement and standard modes of operation (high
performance ODRs). Features like interrupts besides DRDY, filtering,
gesture recognition and acting as a bus master are not implemented.
2025-02-12 10:44:15 -03:00
zhaohaiyang1
e657b35720 nuttx/can: Modify poll logic to bind can_reader_s and pollfd.
For clearing some variables corresponding with the pollfds of the felip in can_close API, we modify poll logic by binding can_reader_s and pollfd.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2025-02-12 10:28:21 -03:00
dongjiuzhu1
34bde7b80a qemu/armv7a: register cfi flash
search the device tree and register cfi flash

test flowchart:
mount -t littlefs -o autoformat /dev/cfi-flash1 /data
fstest -m /data

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-02-11 17:23:44 +08:00
zhengyu9
2c4285d9ac mtd/mtd_cfi: cfi flash bind to mtd interface
Bind cfi flash driver with the existing mtd interface

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-02-11 17:23:44 +08:00
zhengyu9
ac019bbfa2 drivers/mtd: cfi-flash driver
Realization of cfi-flash driver.
Add the interfaces of intel and amd command sets.

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-02-11 17:23:44 +08:00
simbit18
71a221708c [Kconfig] Fix Kconfig style
drivers\sensors\Kconfig

Remove spaces from Kconfig files
Add TABs
2025-02-10 17:08:16 -03:00
chao an
7e96b0d934 drivers/devicetree: fix typo FDT_PCI_PREFTCH -> FDT_PCI_PREFETCH
should be FDT_PCI_PREFETCH

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-10 15:47:05 -03:00
chao an
b001b61401 rptun/ivshmem: RPTUN_IVSHMEM should depends on DEV_SIMPLE_ADDRENV
fix build break:

ld: drivers/libdrivers.a(rptun_ivshmem.c.obj): in function `rptun_ivshmem_get_resource':
nuttx/drivers/rptun/rptun_ivshmem.c:215:(.text.rptun_ivshmem_get_resource+0xfc): undefined reference to `simple_addrenv_initialize'
ld: openamp/libmetal/lib/libmetal.a(io.c.obj): in function `metal_io_phys_to_offset_':
nuttx/openamp/libmetal/lib/system/nuttx/io.c:112:(.text.metal_io_phys_to_offset_+0xc): undefined reference to `up_addrenv_pa_to_va'

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-07 17:40:38 +08:00
Michal Lenc
cde21ae8bf w25qxxxjv: fix missing QSPI locking
There was a missing QSPI locking for w25qxxxjv_get_die_from_addr
function. We can't have the lock directly in w25qxxxjv_get_die_from_addr
because the function is called from already locked function
w25qxxxjv_erase_sector.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-01-30 13:49:46 +08:00
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