Commit graph

6861 commits

Author SHA1 Message Date
Matteo Golin
0cb7bd7f76 wireless/lpwan/rn2xx3: Fix invalid sync word bug.
This commit resolves issue #16009, where a sync word of less than 64
bytes was printed as 0-padded hex. 0-padding is invalid for the RN2xx3
modules, so now it has been removed.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-04-20 16:55:45 -03:00
Matteo Golin
da982e113e drivers/sensors/lis2mdl: Fix SYSLOG call.
This call to syslog was missing the '%' in its format string, and also
was using the wrong format string (lu instead of d) to print the `cmd`
argument. It is corrected and the compiler warning resolved.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-04-20 16:54:47 -03:00
Jukka Laitinen
b5144afd03 drivers/video/vnc: Replace direct semcount access with nxsem_get_value
Use the dedicated nuttx internal interface for debugging semaphore value,
instead of accessing it directly.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-04-16 18:11:01 +08:00
zhangshoukui
927fe5bc2a drivers/serial/Kconfig: TTY_LAUNCH depends on SCHED_HPWORK
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-04-13 11:58:08 +08:00
Chongqing Lei
29da7fc824 wireless/bt_uart: Fix ACL data buffer length verification.
Driver now validates ACL provided buffer length agaist the size of
the data buffer which is defined by CONFIG_BLUETOOTH_UART_RXBUFSIZE.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-04-11 15:57:53 +08:00
chao an
4e1e833b05 drivers/rpmsg: correct crc16 catalogue to CRC-16/IBM
This is the pair implementation relative to the Linux kernel

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-10 11:45:26 +08:00
wangjianyu3
7ffa06a78d drivers/ft5x06: Remove wakeup and nreset check
Remove unused wakeup and nreset check of FT5X06.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-04 09:50:19 -03:00
Jani Paalijarvi
02c9030e88 drivers/bch: Add CONFIG_BCH_FORCE_INDIRECT
This implements similar functionality than CONFIG_FAT_FORCE_INDIRECT
because in some use cases (e.g. when CONFIG_BUILD_KERNEL) it is not possible to
write directly from user buffer.

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2025-04-03 16:21:51 +08:00
chao an
0bfb850b52 drivers/serial/uart_rpmsg: simplify initialization process of uart_rpmsg
Merge multiple heap allocate into one

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-02 20:56:01 +08:00
wangjianyu3
38652e19aa drivers/lcd/st7789: Support mirror V
Mirror X and V can rotate the screen 90 degrees.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-02 09:51:32 +08:00
liujp
c9fd44a0ec fix(bug): fix ft5x06_sample error
Signed-off-by: liujp <liujp@xiaomi.com>
2025-04-02 01:42:59 +08:00
wangjianyu3
c5afcd78f1 drivers/lcd/st7789: Send RAMCTRL if little endian
Send RAMCTRL command only when RGB data in little endian.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-02 01:03:48 +08:00
Daniel Byshkin
504f838577 sensors/nau7802: Add support for the NAU7802
This patch adds support for the NAU7802 24 bit ADC from Nuvoton.
Please read the documentation for more details.

Signed-off-by: Daniel Byshkin <online@bskdany.com>
2025-04-01 09:38:37 +08:00
wangjianyu3
f42b784349 drivers/lcd/st7789: Add option for RGB data endian
Big endian by default.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-31 10:06:45 -03:00
raiden00pl
c4f142e45c syslog: add an option to completely disable syslog logic
Add an option to completely disable syslog() and replace it with an empty functions.
This option can be useful for small systems when we don't have any logging support,
but compiler is not able to remove useless code.

This way the final image also won't contain the strings that are present in
syslog() calls when compiler optimization is enabled (for example from /boards
where syslog is often used instead of debug macros).

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-30 11:36:19 +08:00
yangsong8
48af14beca driver/serial: Check again the RX buffer, then check file flags
The UART driver (cdcacm...) might have buffered data received, Just continue
processing the RX queue if this happens. If not, then check the file or dev
flags.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-29 10:34:00 +08:00
zhangshoukui
0550355c92 drivers/mtd/mtd_cfi: Add MTDIOC_ERASESTATE
We need to give a default erase value when we register cfi flash for mtd devices
he pseudo-code is as follows:
register_cfi_driver(xxx)
find_mtddriver("xxx", &inode);
mtdconfig_register(inode->u.i_mtd);

https://github.com/Zhangshoukui/nuttx/blob/master/drivers/mtd/mtd_config.c#L1775C28-L1775C45

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-03-28 19:19:35 +08:00
yangsong8
e8f9570ffd driver/serial/cdcacm: config to enable or disable txbuf
To be compatible with the previous method, add a buf between cdcacm
and serial. Because when using usbreqbuf directly as the buf of serial,
the amount of data sent may be insufficient due to the limit of the
number of reqs. For example, when the number of reqs is 4, the number
of data send through cdcacm is 5, and each data is a separate USB
packet, if the host does not read in time, resulting in blocking send.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-28 08:52:42 +08:00
yangsong8
f0b52a8b2d driver/serial/cdcacm: config to enable or disable rxbuf
To be compatible with the previous method, add a buf between cdcacm
and serial. Because when using usbreqbuf directly as the buf of serial,
the amount of data received may be insufficient due to the limit of the
number of reqs. For example, when the number of reqs is 4, the number
of data received through cdcacm is 5, and each data is a separate USB
packet, which should require 5 reqs, resulting in the last number not
being received. If the application always waits for 5 numbers before
performing an operation, this will cause problems.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-28 08:52:42 +08:00
Tim Hardisty
3ad4ae503a drivers/mtd/gd55.c: fix uninitialised variables.
These caused runtime errors and compiler warnings.

Signed-off-by: Tim Hardisty <timh@jti.uk.com>
2025-03-27 02:16:48 +08:00
anjiahao
3844b43afe serial:gdbstub need enable irq
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-03-26 22:34:46 +08:00
stbenn
c4a84e30b7 driver/mtd: ramtron multi-device spi bus support
Adds a device ID to ramtron_initialize, which is stored in the ramtron_dev_s structure.
This ID is used when calling SPI_SELECT to board specific logic to allow chip select on the SPI bus.

This change is NOT backwards compatible, as it changes the function signature of ramtron_initialize.

This implementation is based on the handling of chip select in nuttx/drivers/mtd/sst26.c:sst26_initialize_spi().

Additional Changes:
  - Add MB85RS64V to ramtron supported parts list.
2025-03-26 19:26:01 +08:00
Javier Casas
e0b221016f driver/mtd/at45db.c: write to page without built-in erase
Using the FTL driver over a MTD flash device, when writing to flash, eventually the ftl_flush function is called and it does an erase (MTD_ERASE) and then the write (MTD_BWRITE). Currently, the at45db driver (at45db.c), uses a write command 0x82 ("Main Memory Page Program through Buffer 1 with Built-In Erase") that also performs a built-in erase before the write. In summary, each time a write to flash is performed, the page is erased twice before it is written, first in the FTL driver and then in the MTD driver.

This PR is to change the page writes to not use that built-in command.

Signed-off-by: Javier Casas <javiercasas@geotab.com>
2025-03-26 10:29:12 +08:00
wangjianyu3
b73d7f2922 drivers/ioexpander: Add support for PCA9557
Datasheet: https://www.ti.com/lit/ds/symlink/pca9557.pdf

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-25 15:46:09 -03:00
Tony Lin
1f2f910ccd drivers/analog/ads1115: Add support for the Texas Instruments ADS1115
This patch adds initial support for the Texas Instruments ADS1115 ADC.
Please read the documentation for more details.

Signed-off-by: Tony Lin <99093620+justapotato213@users.noreply.github.com>
2025-03-25 09:49:51 +01:00
SPRESENSE
64b97bda5d drivers/sensors: Add CXD5602PWBIMU driver for IMU Add-on board
Add CXD5602PWBIMU driver for IMU Add-on board.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-03-24 16:07:45 -03:00
yangsong8
a0a61ff345 driver/serial/cdcacm: Get the status of rx or tx buf by ioctl
In cdcacm, USB req buf is directly used as serial buf, so the getting
buf status operation in ioctl is different from the original serial.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-22 08:41:33 +08:00
Angus Jull
c7d72bc95c drivers/sensors/fakesensor: Add baro sensor type
Add a function `fakesensor_read_baro` that allows barometric data to be
read and published by fakesensor

Signed-off-by: Angus Jull <angusjull1@gmail.com>
2025-03-19 09:08:06 +01:00
chao an
bf73fbe774 sched: simplify call of get current tcb
Replace get current tcb method from nxsched_get_tcb(nxsched_gettid()) to this_task(),
change two function calls with inline function to improve performance:

FAR struct tcb_s *tcb = nxsched_get_tcb(nxsched_gettid());
FAR struct tcb_s *tcb = this_task();

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-03-18 00:22:37 +02:00
dongjiuzhu1
cfd359141f fs/drivers: Avoid causing a busy loop in the program due to context switching induced by sem_post.
examples:
There are two threads involved: thread A with a priority of 100 and
thread B with a priority of 101. Here's how they interact:

When thread A releases a semaphore, thread B is scheduled to execute
some code and may reacquire the semaphore. If no other tasks are ready,
thread A will be scheduled to run.
This continuous process can lead to a busy loop.

Thread A:                                                   Thread B:

while (nxsem_get_value(&priv->wait, &semcount) >= 0 &&  <---
       semcount <= 0)                                      |  2)context switch
  {                                  1)contex switch       |
    nxsem_post(&priv->wait);         ------------->     run some code and nxsem_wait again
  }

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-03-17 10:44:26 +01:00
wangjianyu3
0e71a944b9 drivers/thermal: Update state when temp is stable
Fix cooling state not decreasing error when the temperature is kept at low trip(stable, not dropping).

Test on "sim:thermal", log is from /proc/thermal/cpu-thermal and see thermal/thermal_dummy.c for trip point details.

e.g. The temperature decreasing from 71 to 65 and then kept.
       z:cpu-thermal t:71 t:1 h:16 l:0 c:fan0 s:16|16

     a. Without this patch, the cooling state of "fan0" will be kept at 15, even if the temperature is at a lower trip:
       z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:15|15
       ... ...
       z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:15|15

     b. With this patch, the cooling state of "fan0" was continually decreasing to zero according to current trip point:
       z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:15|15
       ... ...
       z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:0|0

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-17 09:21:52 +08:00
Matteo Golin
c009c386cc drivers/wireless/lpwan/rn2xx3: Fix SERIAL dependency
There is no 'UART' symbol to depend on, so this is updated to the
correct symbol, SERIAL.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-03-15 13:31:33 +01:00
yangsong8
9c55a19238 driver/syslog: add cdcacm channel
Use the CDCACM as a SYSLOG output device, send message to remote proc.
If there are more than one CDCACM devices, then a device minor number
may also need to be provided. Default: 0

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-10 13:43:54 +08:00
Matteo Golin
b9b505a2b2 wireless/lpwan: Add support for the RN903 and RN2483 family of LoRa
radio transceivers. This initial support includes transmit and receive
functionality and configuration and reading of radio parameters like
frequency and bandwidth.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-03-06 06:10:19 -03:00
Filipe Cavalcanti
5e52e75631 drivers/net: update format specifier on lan9250 driver
Fix print statement for uint8 and uint16 types.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-03-05 19:54:58 +01:00
yangsong8
9bfde6b934 drivers/syslog: add ramlog write multiple bytes for interrupt handler
make sc_write_force pointing to ramlog_write in struct syslog_channel_ops_s.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-05 13:47:05 -03:00
yangsong8
c497c5feb0 drivers/serial/cdcacm: Reduce one copy of data between serial and cdcacm framework
Data form serial framework will be written to usb reqbuf directly,
and data form cdcacm will be read form reqbuf directly.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-05 12:52:00 -03:00
yangsong8
7bad94a964 drivers/usbhost: recognize sim usb cdcacm composite device
In the USB interface descriptor of the cdcacm device, class:2 (CDC)
subclass:2 (ACM) protocol:0 (NONE) may appear. At this time, the
usb host does not match the correct protocol byte, which will cause
the device identification to fail.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-05 10:11:29 +01:00
Michal Lenc
66f464936a drivers/lcd/st7789: add option for SPI delay control
It is now possible to configure SPI delays for st7789 controller if
CONFIG_SPI_DELAY_CONTROL is set. Default values for SPI peripheral
may be too long or too short, therefore the display controller set
its own values as required. The default values in configuration
are taken from the reference manual, but it is possible they may
require tuning for different revisions or temperatures for
example.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-03-05 09:18:56 +01:00
yangsong8
24d947b7c1 ptmx: When alloc minor, skip the start addr if it has been used
The alloctab can be looped, if the first check the corresponding
bit is set, it will not continue to loop

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-04 09:14:25 +01:00
Bowen Wang
8762919325 drivers/rpmsgblk_server: fix the syslog format warning
misc/rpmsgblk_server.c:135:16: warning: format '%d' expects argument of type 'int', but argument 3 has type 'int32_t' {aka 'long int'} [-Wformat=]
  135 |           ferr("block device open failed, ret=%d\n", msg->header.result);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~
      |                                                                 |
      |                                                                 int32_t {aka long int}
misc/rpmsgblk_server.c:135:48: note: format string is defined here
  135 |           ferr("block device open failed, ret=%d\n", msg->header.result);
      |                                               ~^
      |                                                |
      |                                                int
      |                                               %ld
misc/rpmsgblk_server.c: In function 'rpmsgblk_close_handler':
misc/rpmsgblk_server.c:170:16: warning: format '%d' expects argument of type 'int', but argument 3 has type 'int32_t' {aka 'long int'} [-Wformat=]
  170 |           ferr("block device close failed, ret=%d\n", msg->header.result);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~
      |                                                                  |
      |                                                                  int32_t {aka long int}
misc/rpmsgblk_server.c:170:49: note: format string is defined here
  170 |           ferr("block device close failed, ret=%d\n", msg->header.result);
      |                                                ~^
      |                                                 |
      |                                                 int
      |                                                %ld

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2025-03-03 07:37:13 +08:00
Filipe Cavalcanti
fdb8e85525 drivers/audio/es8388: set proper format specifier macro for logging
Use PRIu32 instead of %d/%u for uint32_t to avoid build warnings on different architectures.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-03-01 06:37:30 -03:00
Filipe Cavalcanti
dcb74eba2e drivers/audio/es8311: set proper format specifier for logging
Use PRIu32 instead of %d/%u to we avoid build warning on different architectures.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-02-28 10:46:20 +01:00
Kevin Witteveen (MartiniMarter)
20ed2e689c drivers/wireless/lpwan/sx126x:
[Experimental]
This adds a driver for the SX126x (SX1261 and SX1262) LoRa chips.
All functions and definitions are coming directly from the DS SX1261-2 V2.1 datasheet.

Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
2025-02-27 16:03:18 -03:00
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