Commit graph

58267 commits

Author SHA1 Message Date
chao an
59da455fea libs/libc/crc16: Separate implementation of crc16xmodem from crc16
keep default crc16 catalogue for CRC-16/XMODEM

Mapping crc16 implement to crc16xmodem

crc16     -> crc16xmodem
crc16part -> crc16xmodempart

- CRC-16/ACORN, CRC-16/LTE, CRC-16/V-41-MSB, XMODEM, ZMODEM
poly: 0x1021 initial seed: 0x0000, xor output: 0x0000

: width=16
: poly=0x1021
: init=0x0000
: refin=false
: refout=false
: xorout=0x0000
: check=0x31c3
: residue=0x0000
: name="CRC-16/XMODEM"

https://reveng.sourceforge.io/crc-catalogue/16.htm#crc.cat.crc-16-xmodem

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-10 16:47:28 +08:00
YAMAMOTO Takashi
b59373b270 littlefs_open: sync the file only when O_TRUNC is specified
Because sync is a rather expensive operation.

While I'm here, improve the comment after the recent discussion
in https://github.com/apache/nuttx/pull/2913.

IMHO, we should not perform the sync even for O_TRUNC.
But I'm not going to propose the change for now.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-04-10 14:38:18 +08:00
chao an
db91b3b53c nuttx/compiler: add support of deprecated attribute
Warning about usage of deprecated features.

since __deprecated__ is a compiler built-in macro, so we define the deprecated with "deprecated_function"

Break log:

| /usr/include/x86_64-linux-gnu/sys/cdefs.h:355:65: error: missing ')' after "__has_attribute"
|   355 | #if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__deprecated__)
|       |                                                                 ^
| /usr/include/x86_64-linux-gnu/sys/cdefs.h:355:51: error: missing binary operator before token "("
|   355 | #if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__deprecated__)
|       |                                                   ^~~~~~~~~~~~~~

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-10 14:34:57 +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
Rodrigo Sim
d240577543 boards/xtensa/esp32s3 Add initial support to Seeed Studio XIAO ESP32S3
This commit introduces initial support for the Seeed Studio XIAO ESP32S3
board. Two  configurations are available: 'usbnsh' provides basic NuttShell
(NSH) access over USB, while 'combo' adds support for GPIOs and onboard
LED in addition to NSH.
2025-04-10 10:52:05 +08:00
simbit18
b52c122f2c tools/host_info_dump.py: fix UnboundLocalError: local variable 'vendor_specific_module_path' referenced before assignment
fix

Traceback (most recent call last):
  File "/home/ubuntu20042/nuttxspace/nuttx/tools/host_info_dump.py", line 575, in <module>
    header = generate_header(args)
  File "/home/ubuntu20042/nuttxspace/nuttx/tools/host_info_dump.py", line 466, in generate_header
    sys.path.append(os.path.abspath(vendor_specific_module_path))
UnboundLocalError: local variable 'vendor_specific_module_path' referenced before assignment
make: *** [tools/Unix.mk:644: host_info] Error 1
2025-04-10 06:43:01 +08:00
anjiahao
c9a150781c arch/arm64: remove unrecognized command-line option
aarch64-none-elf-gcc: error: unrecognized command-line option '-mlong-calls'

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-04-09 23:07:29 +08:00
anjiahao
3411e5c6db arm:elf module need long call aviod jump addr over length
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-04-09 23:07:29 +08:00
anjiahao
422c43949a binfmt:use crt0 inside of starthook
test:
1.use mps3-an547 build helloxx as module and run it
2.use qemu-armv7a:knsh test kernel build helloxx and run it

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-04-09 23:07:29 +08:00
anjiahao
297a1cb1fe armv7a:need initialize constructor and destructor on crt0
The C++ constructor and destructor need to be executed in crt0

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-04-09 23:07:29 +08:00
Beat Küng
ac2078a8bf fs/procfs: fix potential null pointer access in procfs_opendir
Some entries have the opendir function set to NULL, for example
g_mount_operations.

A null pointer dereference can be triggered by an
opendir("/proc/fs/blocks") for example.

Signed-off-by: Beat Küng <beat-kueng@gmx.net>
2025-04-09 11:50:35 -03:00
raiden00pl
0de4bd7938 boards/stm32f0l0g0: unify liker scripts
Unify liker scripts for all stm32f0l0g0.

This fixes crash due to unaligned access to rodata for these boards.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-09 20:05:27 +08:00
Tiago Medicci Serrano
05e63e31c4 arch/xtensa/espressif: Fix ESP32-S2 SPI flash frequency selection
This commit fixes the SPI flash frequency selection for ESP32-S2,
enabling the Kconfig macros to be selected when ESP32-S2 SoC is
enabled. Please note that this was recently changed to make it
compatible with already existing SPI flash Kconfig macros for ESP32
and ESP32-S3 and it introduced this regression for ESP32-S2.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-09 14:00:08 +08:00
Rodrigo Sim
39a992b0b1 Documentation: Add Seeed Studio XIAO ESP32S3 Board
This commit adds the documentation for Seeed Studio XIAO
ESP32S3 board. This includes examples for gpios and user leds.
2025-04-09 13:59:49 +08:00
Eren Terzioglu
8a835dd545 arch/xtensa: Remove legacy I2S implementation for esp32[-|-s2|s3]
Remove legacy I2S implementation without breaking defconfigs for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-04-08 22:53:58 +08:00
Eren Terzioglu
dd7ac7e57d boards/xtensa: Remove legacy I2S implementation for esp32[-|-s2|s3]
Remove legacy I2S implementation without breaking defconfigs for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-04-08 22:53:58 +08:00
Eren Terzioglu
02110fdb54 Documentation/esp32s3: Add I2S defconfig documentation
Add I2S defconfig documentation to esp32s3-devkit board

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-04-08 22:53:58 +08:00
Eren Terzioglu
97ff8906e4 arch/esp[s2|s3]: Update common layer version
Update common layer version of Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-04-08 22:53:58 +08:00
Eren Terzioglu
22601e2074 boards/esp32[s2|s3]: Add common I2S board layer support
Add common I2S board layer support for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-04-08 22:53:58 +08:00
Eren Terzioglu
873a6319bb arch/esp32[s2|s3]: Add common I2S arch layer support
Add common I2S arch layer support for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-04-08 22:53:58 +08:00
Eren Terzioglu
fd4914b953 arch/xtensa/esp32[s3]: Add more dma functions
Add dma function to use peripheral more efficiently

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-04-08 22:53:58 +08:00
Ville Juven
850cfb545a Revert "includes/nuttx: fix _SCHED_GET(T/P/PP)ID definition issue"
This reverts commit 9369b75ee5.

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2025-04-08 22:53:10 +08:00
Ville Juven
04e760b1c2 sched/gettid: Move thread ID to TLS
There is no need for a gettid() syscall, as the thread ID is stable through
the life of the process. It is safe to put a copy of TID to TLS. This way
a user processes can access TID quickly via its own stack, instead of
having to use an expensive syscall.

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2025-04-08 22:53:10 +08:00
chenxiaoyi
b3567fe964 xtensa/esp32s2: enable sysclk and deassert reset signal for uart1
The uart1 is found be in reset state, and the sysclk is not enabled
for it.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2025-04-08 22:44:59 +08:00
Jukka Laitinen
84cb21791f libc/semaphore: Read semaphore value by using NXSEM_COUNT macro
We should not access semaphore internals directly outside sched/semaphore.

Just read it via the NXSEM_COUNT macro provided.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-04-08 16:12:17 +08:00
Tiago Medicci Serrano
9967593009 boards/esp32s3-devkit: Update ESP32-S3's WROOM-2-N32R8V defconfigs
The defconfigs that select the ESP32-S3's WROOM-2-N32R8V module
contains an octal SPI flash chip and a octal SPIRAM module.
This commit updates the defconfig to avoid errors while booting the
device.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-08 14:44:38 +08:00
Tiago Medicci Serrano
622355b5c3 arch/xtensa/esp32s3: Fix bug regarding SPI flash operation mode
SPI flash operation modes - Dual Output (dout), Dual I/O (dio),
Quad Output (qout), Quad I/O (qio) and Octal (opi) were not being
properly selected. This commit fixes this behavior and the device
is now able to boot and initialize the proper SPI flash mode.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-08 14:44:38 +08:00
raiden00pl
b81c4d3aa6 boards/nucleo-c071rb: add watchdog support
boards/nucleo-c071rb: add watchdog support and enable IWDG for jumbo configuration

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-07 23:28:47 +08:00
raiden00pl
5d66f2c973 arch/stm32f0l0g0: add support for IWDG and WWDG
add IWDG and WWDG support for stm32f0l0g0.

ported from arch/stm32.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-07 23:28:47 +08:00
Jukka Laitinen
4b14b206db sched: Replace direct semaphore value access with nxsem_get_value
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-04-07 16:29:57 +08:00
Jukka Laitinen
cd84da8714 sched/pthread: Set the protocol of underlying semaphore to SEM_TYPE_MUTEX in pthread_mutex_init
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-04-07 16:29:57 +08:00
liujp
32c5667d5d Optimize double buffering implementation
optimize the implemented dual buffer support to avoid compilation errors on other development boards.

Signed-off-by: liujp <liujp@xiaomi.com>
2025-04-07 16:28:30 +08:00
liujp
e421e2c9e5 arch/arm/stm32h7: add support for STM32H750B
modify the compilation configuration of stm32h7, add compilation options for stm32h750.

Signed-off-by: liujp <liujp@xiaomi.com>
2025-04-07 16:28:30 +08:00
liujp
c309c452d6 boards/arm/stm32h7: add support for stm32h750b-dk board
Support for development using STM32H750B-DK, including configuration of onboard memory, flash, etc., and configuration of LVGL runtime environment has been added.

Signed-off-by: liujp <liujp@xiaomi.com>
2025-04-07 16:28:30 +08:00
wangjianyu3
0a74293f11 boards/szpi-esp32s3: Remove FAR qualifier
Remove FAR qualifier for szpi-esp32s3.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-07 16:26:16 +08:00
wangjianyu3
25443a37ee boards/szpi-esp32s3: Set default backlight for LCD
Set default brightness of LCD backlight to about 10%.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-07 16:26:16 +08:00
Kye Morton
a8b862396e arch/arm: Add CMakeLists for the stm32l4 architecture.
boards/arm: Add CMakeLists for the nucleo-l476rg.

Adds CMakeLists files for the STM32L4 architectures
and one of the development boards. Files are adapted
from the similar STM32F7 boards, but built to reflect
the existing Make.defs.

Signed-off-by: Kye Morton <pryre.dev@outlook.com>
2025-04-07 12:10:40 +08:00
chao an
53836fc18a libs/libc/crc16: add support of CRC-16/ANSI(aka CRC-16/IBM)
Compatible CRC16 with Linux Kernel:
https://github.com/torvalds/linux/blob/master/lib/crc16.c

- CRC-16/CCITT, CRC-16/CCITT-TRUE, CRC-16/KERMIT
poly: 0x8005 (0xA001) initial seed: 0x0000, xor output: 0x0000

: width=16
: poly=0x8005
: init=0x0000
: refin=true
: refout=true
: xorout=0x0000
: check=0xbb3d
: residue=0x0000
: name="CRC-16/ARC"

https://reveng.sourceforge.io/crc-catalogue/16.htm#crc.cat.crc-16-arc

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-07 12:10:05 +08:00
Alin Jerpelea
2d7cf5e5b1 Documentation: add NuttX-12.9.0 release notes
Add release notes for 12.9.0 release

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2025-04-07 10:47:06 +08:00
Rodrigo Sim
b28bb29bf9 boards/arm/stm32f401rc-rs485: Add support to BMP180 Sensor
This commit adds support for the BMP180 sensor on the
STM32F401RC-RS485 board and updates the board documentation
accordingly. It also enables the BMP180 UORB driver in the
STM32 common logic.

Signed-off-by: Rodrigo Sim <rcsim10@gmail.com>
2025-04-07 10:45:05 +08:00
chao an
921ffc7319 libs/libc/crc16: move crc16 table to rodata
move crc16 table from data to rodata

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-07 09:02:01 +08:00
chao an
4e2f6eabb3 libs/libc/crc16: add some comments for crc16ccitt
The search table of ccitt should describe more algorithm details:

- CRC-16/CCITT, CRC-16/CCITT-TRUE, CRC-16/KERMIT
initial seed: 0x0000, xor output: 0x0000

: width=16
: poly=0x1021
: init=0x0000
: refin=true
: refout=true
: xorout=0x0000
: check=0x2189
: residue=0x0000
: name="CRC-16/KERMIT"

https://reveng.sourceforge.io/crc-catalogue/16.htm#crc.cat.crc-16-kermit

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-07 09:02:01 +08:00
raiden00pl
c061bb08c4 boards/arm: add nucleo-c071rb support
add nucleo-c071rb support

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-05 11:23:40 -03:00
raiden00pl
57d1dee7e1 arch/arm: add stm32c0 support
add stm32c0 support

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-05 11:23:40 -03:00
Tiago Medicci Serrano
80559890ff espressif: Simplify the selection of the SPI flash frequency
This commit simplifies the selection of the SPI flash frequency for
Espressif SoCs by using a standardized Kconfig-defined macro.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-05 11:26:32 +08:00
Tiago Medicci Serrano
1e8250d918 boards/xtensa/esp32s3: Move some .bss sections to the external RAM
This commit moves some internal libraries' .bss sections to the
external PSRAM chip, freeing internal memory for other usages. Note
that it is necessary to update `esp32s3-devkit:python` defconfig
otherwise it would fail to build.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-05 11:24:58 +08:00
raiden00pl
23ef48e673 arch/stm32f0l0g0/stm32_adc.c: fix ADC calibration
Fix and enable ADC calibration. The ADC voltage regulator must be
enabled and regulator start-up time must be respected.

tested on nucleo-c071rb and b-l072z-lrwan1

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-05 11:23:47 +08:00
Jinliang Li
d5db7d1cee libc/arm: optimize crc32/crc32c for arm
Optimize crc32 standard(poly:0x04C11DB7) and crc32
castagnoli(poly:0x1EDC6F41) with arm crc32 extension instructions.

For example, crc32 standard caculates(lookup crc32 table) 1812 bytes data,
reduced the time from 118 us to 14 us through optimization.

Performance improved ~700%

Signed-off-by: Jinliang Li <lijinliang1@lixiang.com>
2025-04-04 09:51:50 -03:00
wangjianyu3
586d216a40 boards/szpi-esp32s3: Add support for FT5X06
Add support for FT5X06 touchscreen driver.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-04 09:50:19 -03: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