Commit graph

58211 commits

Author SHA1 Message Date
Filipe Cavalcanti
2ff8199d90 documentation: update docs on ADC support for Espressif devices
Add documentation for ADC on RISC-V and Xtensa Espressif devices.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-04-17 13:56:40 +08:00
Filipe Cavalcanti
238a5250f6 boards/risc-v: ADC support on Espressif devices
Adds adc defconfig and board support for: esp32c3-generic, esp32c6-devkitc and esp32h2-devkit.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-04-17 13:56:40 +08:00
Filipe Cavalcanti
643b3586c3 boards/xtensa: ADC support on Espressif devices
Adds adc defconfig and board support for: esp32-devkitc, esp32s2-saola-1 and esp32s3-devkit.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-04-17 13:56:40 +08:00
Filipe Cavalcanti
55fbf93c9c arch/risc-v: ADC support for ESP32-C3|C6|H2
Add common source for ADC that supports ESP32-C3|C6|H2.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-04-17 13:56:40 +08:00
Filipe Cavalcanti
99099a1a9d arch/xtensa: ADC support on ESP32|S2|S3
Add common ADC source for ESP32|S2|S3.
Remove legacy ADC from ESP32S3.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-04-17 13:56:40 +08:00
Tiago Medicci Serrano
a0cc89349f boards/xtensa/esp32: Fix the SPI Flash MTD block device number
This commit fixes the SPI flash MTD block device number if OTA's
partitions are present. In this case, the OTA partitions are
registered first and the corresponding MTD block device drivers
are assigned with the numbers corresponding to those partitions.
Then, the additional SPI flash partition should consider that when
registering its own corresponding MTD block device driver.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-17 13:48:46 +08:00
Carlos Sanchez
d976c66edf net: use bps units for bitrate in SocketCAN interfaces.
This makes units compatible with what Linux uses for SocketCAN bitrate
and allows representing usual Single Wire Can (SAE J2411) usual bitrates
of 33333 and 83333 bps.

Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
2025-04-16 11:07:27 -03:00
simbit18
7af6b8c63d arch/arm/src/armv6-m/CMakeLists.txt: fix undefined reference to `up_show_cpuinfo'
Aligned Cmakefile with Make.defs PR #10132

fix

FAILED: nuttx
C:\WINDOWS\system32\cmd.exe /C "cd . && D:\nx20250410\tools\gcc-arm-none-eabi\bin\arm-none-eabi-gcc.exe  --specs=nosys.specs   -Wl,--print-memory-usage -Wl,--entry=__start -nostdlib -Wl,--gc-sections -Wl,--cref -Wl,-Map=nuttx.map @CMakeFiles\nuttx.rsp -o nuttx && cd ."
D:/nx20250410/tools/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: fs/libfs.a(fs_procfscpuinfo.c.obj): in function `cpuinfo_read':
D:/rp2040/nuttx/fs/procfs/fs_procfscpuinfo.c:160:(.text.cpuinfo_read+0xa): undefined reference to `up_show_cpuinfo'

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-04-16 21:25:55 +08:00
Tiago Medicci Serrano
0cec2bd662 arch/risc-v/espressif: Bump common source version
This commit bumps common source version for RISC-V-based Espressif
SoCs on NuttX. Specifically, this solves an issue regarding SPI
flash frequency selection on ESP32-C6.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-16 21:25:38 +08:00
Tyler Bennett
1f53575192 arch/arm/stm32h5: GPDMA Hardware files
Add the hardware register definition file for the GPDMA peripheral.
This is necessary to support implementing dma driver in the future.

Also adds skeleton arch dma header that includes the hardware file.

Signed-off-by: Tyler Bennett <tbennett@2g-eng.com>
2025-04-16 21:16:24 +08:00
Carlos Sanchez
8f1d670a83 arch/arm/src/stm32h7: unassigned ret variable in SIOCSCANBITRATE.
This problem was introduced in https://github.com/apache/nuttx/pull/16199

Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
2025-04-16 18:11:33 +08: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
Tiago Medicci Serrano
40c6af6dec Revert "libs/libc/semaphore: Fix DEBUGASSERTS"
This reverts commit 300992203a to
fix a problem with `esp32-devkitc:blewifi`, which fails to boot up
if `CONFIG_DEBUG_ASSERTIONS=y`.

Introduced by https://github.com/apache/nuttx/pull/16176 with the
following description:

> The DEBUGASSERTS in nxsem_wait and nxsem_trywait are
non-functional, they don't check anything. These were broken in
previous commits.

The above statements are not valid. Originally, there was no
problem calling `nxsem_trywait` from the interrupt and the
`DEBUGASSERT` simply checked a corner case: if ran from the
interrupt context, the current (interrupted) task may be the idle
task. This case is allowed only if called from an interrupt and
that's what the original commit checks with:

```
  DEBUGASSERT(!OSINIT_IDLELOOP() || !sched_idletask() ||
              up_interrupt_context());
```
2025-04-16 10:10:56 +08:00
Tyler Bennett
1b08c1d522 arch/arm/stm32h5: organize peripheral Kconfig selection
Added menus for usart, I2C, and SPI selection to make the peripheral selection submenu easier to navigate.

Added DMA1 and DMA2 selection options.

Signed-off-by: Tyler Bennett <tbennett@2g-eng.com>
2025-04-16 10:08:45 +08:00
anjiahao
28ad852a6c arch/xtensa:add crt0 to initialize environment
we use crt0 inside of start hook in pr https://github.com/apache/nuttx/pull/16154, so xtensa also need add it.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-04-16 01:24:57 +08:00
Mathieu David
7281d91fbc Support ethernet without MDIO & MDC lines 2025-04-16 01:22:24 +08:00
Serg Podtynnyi
8ac09bcf3d arch/arm/rp23xx: Fix IRQ prioritize
Fixes the reg addresses that were copied from armv6 rp2040 to the actual
armv8 spec

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-04-16 01:19:43 +08:00
Serg Podtynnyi
5ddc67b129 arch/arm/rp23xx: Fix PWM registers access
Fix offset alignment and correct the PWM enable register name

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-04-15 17:02:37 +08:00
Julian Oes
96fef53ee9 stm32h7: enable Ethernet for STM32H7X7XX 2025-04-15 15:14:09 +08:00
Joshua Lange
9643ee78aa arch/arm/stm32h5: Fix i2c compiler warnings.
Add missing break statements to i2c driver to avoid complaints from compiler.

Signed-off-by: Tyler Bennett <tbennett@2g-eng.com>
2025-04-15 10:56:23 +08:00
Joshua Lange
1c4ac3dfe7 arch/arm/stm32h5: copy bss and initialized data before configuring any hardware
Some hardware configurations require bss and data initialization before being called.

Signed-off-by: Tyler Bennett <tbennett@2g-eng.com>

Fix nxstyle errors
2025-04-15 10:56:01 +08:00
Joshua Lange
3d848810b7 arch/arm/stm32h5: Add USART6 serial driver config.
Adds Kconfig options to select UART6 for the STM32H5, and updates the architecture files accordingly.

Signed-off-by: Tyler Bennett <tbennett@2g-eng.com>
2025-04-15 10:55:30 +08:00
Joshua Lange
78f35c836c arch/arm/stm32h5: Fix ADC internal channel configuration.
Properly configure internal channels on STM32H5 ADC when selected

Signed-off-by: Tyler Bennett <tbennett@2g-eng.com>
2025-04-15 10:54:33 +08:00
Carlos Sanchez
dd53c34722 net/netdev: Change SIOCSCANBITRATE to require interface down.
Previously, SIOCSCANBITRATE brought the iterface up to ensure changes
where immediately applied. This was confusing, see
https://lists.apache.org/thread/g8d0m6yp7noywhroby5br4hxt3r4og2c
Now SIOCSCANBITRATE fails is interface is up.
All existing SocketCAN drivers updated.

Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
2025-04-15 01:59:57 +08:00
Angelo Rison K
732d811ea9 added cmakelists to tm4c123g-launchpad 2025-04-15 01:59:35 +08:00
zhangshoukui
2a38ce37d7 boards/Kconfig: BOARDCTL_APP_SYMTAB Add depends on LIBC_EXECFUNCS
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-04-13 11:58:08 +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
Abhishek Choithani
7ff199331e Documentation: fix typo in comments 2025-04-11 22:31:30 +08:00
stbenn
3abdec8af1 arch/arm/stm32h5: implement flash driver for progmem
H5 implementation of functions defined in include/nuttx/progmem.h.
The driver supports a subset of the flash peripheral functions.
  - Assumes non-secure memory accesses. Does not check for memory protection mechanisms.

References implementation in arch/arm/src/stm32h7/stm32h743xx_flash.c
2025-04-11 11:20:19 -03:00
simbit18
97155ae09d [nxstyle] fix Relative files path
fix Relative file path does not match actual file.
2025-04-11 20:59:33 +08:00
Tiago Medicci Serrano
d7dabc90f6 arch/risc-v/espressif: Disable esptool's stubs for ESP32-C3
This commit disables the esptool's stubs when flashing ESP32-C3
(`CONFIG_ESPRESSIF_ESPTOOLPY_NO_STUB=y`) if the serial/JTAG console
is enabled (`CONFIG_ESPRESSIF_USBSERIAL=y`).

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-11 16:20:13 +08:00
Tiago Medicci Serrano
d69f349787 arch/risc-v/espressif: Fix bug with usbconsole and DEBUG_FEATURES
This commit fixes a bug on the `usbconsole` defconfigs for
Espressif's RISC-V SoCs when the serial/JTAG is used and the
Kconfig macro `DEBUG_FEATURES` is enabled. This config enables the
`showprogress` macro during start-up. Previously, `riscv_lowputc`
function was used by this macro, but it is not suitable for the
serial/JTAG console. Instead, use the `esp_rom_printf` function
that is suitable for both serial/JTAG and UART consoles.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-11 16:20:13 +08:00
Jukka Laitinen
1645f4ac10 arch/mpfs/usb: Align usb_ctrlreq_s properly to 32-bit boundary
The alignment of the ctrlreq was correct by luck, and was broken
when the spinlock was added to the structure. In non-smp configurations
spinlock_t is currently 8-bits, causing wrong alignment of the
ctrlreq structure.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-04-11 16:19:37 +08:00
Jukka Laitinen
300992203a libs/libc/semaphore: Fix DEBUGASSERTS
The DEBUGASSERTS in nxsem_wait and nxsem_trywait were non-functional, they
didn't check anything.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-04-11 16:13:06 +08:00
stbenn
1e8977c079 arch/arm/stm32h5: DTS Hardware Files
Add hardware register definitions for the digital temperature sensor (DTS) peripheral on the STM32H5.
2025-04-11 15:58:20 +08:00
Chongqing Lei
05358e6dd0 wireless/bt_hcicore: Fix H4 header and data buffer length verification.
Driver now validates data and H4 header length against CONFIG_IOB_BUFSIZE.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-04-11 15:57:53 +08:00
Chongqing Lei
08c239dcd1 wireless/bt_hcicore: Fix buffer type confusion on missing response.
Fix possible stack corruption on missing command response.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-04-11 15:57:53 +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
52482219c8 libc/elf: rename modlib to libelf
Renaming "modlib" to "libelf" is more in line with the implementation content,
which makes it easier for individual developers to understand the capabilities of this module.

CONFIG_LIBC_MODLIB -> CONFIG_LIBC_ELF

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-11 09:43:22 +08:00
raiden00pl
1b9e6a8563 boards/nucleo-c092rc: add minimal NSH configuration
add minimal NSH configuration for nucleo-c092rc

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-10 22:37:13 +08:00
raiden00pl
e474569472 boards/nucleo-c071rb: add minimal NSH configuration
add minimal NSH configuration for nucleo-c071rb

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-10 22:37:13 +08:00
raiden00pl
8bdb13a31d boards/arm: add nucleo-c092rc board support
add nucleo-c092rc board support

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-10 22:37:13 +08:00
Ville Juven
6707715916 arch/risc-v: PANIC() on system call crash
If a process causes a fatal error when it's running a system call, the
whole system should crash as the crash originated from the kernel.

Do this by running the PANIC() branch, if task is in syscall.

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2025-04-10 22:36:02 +08:00
zhangshoukui
69597ec486 arch/sim: Add i2s setup and shutdown interface
This interface is required if you want to open an i2c node directly on the sim
12b4340b00

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-04-10 18:10:54 +08:00
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