Commit graph

58694 commits

Author SHA1 Message Date
simbit18
1f98d90825 drivers/sensors/CMakeLists.txt: Aligned Cmake with Make
Add:
    Adafruit NAU7802 ADC sensor
    MCP9600 Thermocouple Amplifier
    Maxim MAX31865

Removed repeated addition of the Rohm BH1749NUC Color Sensor

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-06-25 20:40:15 +08:00
halyssonJr
3ecdcf556e add lcd suport 2025-06-24 16:29:00 +08:00
Filipe Cavalcanti
2ddfab618b documentation: update docs on SDMMC for ESP32|S2|S3 2025-06-24 08:08:55 +08:00
Filipe Cavalcanti
02dae3e5eb boards/xtensa: add SDMMC SPI defconfig to ESP32|S2|S3 boards
Adds a defconfig for SDMMC over SPI to the following boards:
esp32-devkitc, esp32s2-saola-1 and esp32s3-devkit.

Renames the defconfig name for:
esp32-lyrat and esp32-wrover-kit.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-06-24 08:08:55 +08:00
Filipe Cavalcanti
aedce4c648 boards/xtensa/esp32: use common board source for SDMMC
Deletes board specific sdmmc implementation in favor of a common source and header file.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-06-24 08:08:55 +08:00
Filipe Cavalcanti
452292159b boards/xtensa: support SDMMC over SPI on ESP32-S2|S3
Adds support for SDMMC over SPI on ESP32S2 and ESP32S3.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-06-24 08:08:55 +08:00
halyssonJr
ba38432a0e Modify type to avoid compilation warning. 2025-06-24 07:49:36 +08:00
Xiang Xiao
c9dc89142c fs: Move inotify.c from fs/notify/ to fs/vfs/
and merge fs/notify/notify.h into fs/vfs/vfs.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-06-23 18:17:10 -03:00
Xiang Xiao
1ea0ae8073 fs/vfs: Rename lock.h to vfs.h
vfs.h will contain other internal functions in the future

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-06-23 18:17:10 -03:00
halyssonJr
4193fe6e2b add support to a new board : esp32s3-8048s043. 2025-06-24 01:10:49 +08:00
nuttxs
26e02700dd netdb/lib_dnsquery.c: In the IPv6 or IPv4 dns_query_callback() block,
if dns_recv_response() fails, dns_bind() is called again at try_stream to
create a new socket. However, the original socket descriptor sd isn't closed

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-06-23 11:56:15 -03:00
halyssonJr
21e8bfaab4 Modify types uint32_t to size_t 2025-06-23 20:34:24 +08:00
wangjianyu3
2424b12857 fs/procfs: fix output format of fd info
Refered to PRINTF(3), the [v]snprintf returns the number of characters
printed (excluding the null byte used to end output to strings).

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-23 20:31:24 +08:00
kywwilson11
04c4f5d229 Initial commit for STM32G0 dma support. Added DMA mux mappings. Added Kconfig for enabling DMA2. Added basic defines for number of channels and mux channels in dma_v1mux.
Added subclasses of STM32G0 (such as STM32G07X) to Kconfig for use in dmamux driver. Added definitions to stm32g0_dmamux.h. Added configuration of number of dma and dmamux channels.

Added missing dma mappings for stm32g0.

Remove reserved defines.

Formatting fixes.

Added DMA2 IRQ mappings for STM32G0B and STM32G0C. Changed STM32_DMAMUX_BASE to STM32_DMAMUX1_BASE to align with stm32_dma_v1mux.c and C0 defines.

Provide correct mapping for ADC1_DMA_CHAN. Add STM32F0L0G0_HAVE_ADC1_DMA to STM32G0.

Add support for continuous mode to the ADC. Also added support to set smp1 and smp2 in board.h, as well as smpsel.

Removed unnecessary selects of STM32F0L0G0_STM32G0. Changed board level files to properly define A0-A3 on nucleo-g0b1re.

Add new Kconfig changes.

Made combined configs for STM32G0. Ex. STM32G0BX for STM32G0B0 and STM32G0B1.

Fixed defines and references in Kconfig and stm32_dma_v1mux.c

Defined adc_sampletime_write and adc_sampletime_set. Changed adc_sample_time_s structure to be much simpler. Old way made no sense. You can only have 2 sample times, so defining one for each channel makes no sense. The new adc_sample_time_s contains smp1, smp2, and smpsel. Also define ADC_HAVE_SMPR_SMP2 for STM32C0.

Added adc_sampletime_write and adc_sampletime_set. Altered adc_sample_time_s structure to be more appropriate for g0 and c0. Only two sample times can be defined. Added rcc support for DMA2.

Added defconfig for nucleo-g0b1re:adc_dma config.

Restore correct Kconfig from my original branch

Removed redundant ifdefs. If we select for G0 and C0, we know they have SMP2. Fixed formatting.

Formatting feedback. Aligned columns in irq and dma headers.
2025-06-23 15:46:28 +08:00
wushenhui
6a9a835d6f risc-v/mmu: Fix map_region() for incorrect page table setup when vaddr is unaligned
When the vaddr parameter passed to map_region() is not aligned to the page directory,
it causes incorrect address mapping for later regions.

For example, in the sv32 case, `PGPOOL` started at `0x80a00000` with a size of `1024*4096B`,
leading to page table errors for the range `0x80c00000~0x80e00000`.

This patch fixes the issue by ensuring map_region() correctly handles unaligned vaddr cases.

Signed-off-by: wushenhui <wushenhui@xiaomi.com>
2025-06-23 15:44:39 +08:00
halyssonJr
74ce16da5c fix framebuffer config resolution. 2025-06-23 09:49:31 +08:00
Xiang Xiao
bc4041db60 libc: Move stdio/README to Documentation/components/libs/libc/stream.rst
follow up this change:
commit 84dc88730c
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Mon Jun 9 14:39:03 2025 +0800

    libc: Move stream printf/scanf from libc/stdio to libc/stream

    to keep all related code in one place

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-06-22 17:07:41 -03:00
Tiago Medicci Serrano
b3712797fa Documentation/rv-virt: Add entries for nsbi[|64] defconfigs
This commit adds entries for the `rv-virt:nsbi[|64]` defconfigs in
the `rv-virt` board documentation page.
2025-06-22 14:57:11 +08:00
Tiago Medicci Serrano
14af1c6ef7 boards/risc-v/qemu-rv: Add missing section on ld-nuttsbi.script
Fix an issue regarding the `rv-virt:nsbi` defconfig, which wasn't
booting properly because `sbi_set_mtimecmp` failed to get the
mtimecmp's register address when evaluating `g_mtimecmp`. This
variable, which should be located at the `.noinit` section, wasn't
being set accordingly by the linker script, ending up on `bss
section which is zero-initialized, overwriting its value previously
set by `sbi_init_mtimer`.
2025-06-22 14:57:11 +08:00
Tiago Medicci Serrano
a98f7a1045 arch/risc-v: Fix debugging syscall info
This commit fixes an issue when `CONFIG_DEBUG_SYSCALL_INFO=y`: the
`cmd` variable doesn't exist (instead, `regs[REG_A0]` represents
the syscall command directly. Also, it fixes the parameter for
`up_dump_register`, as `tcb` is a pointer here. By applying these
fixes, debugging syscall info is now possible again.
2025-06-22 14:57:11 +08:00
simbit18
9f84695ef7 CI checkpatch: fix cvt2utf not found and add check of all necessary tools
check.yml:
   added missing cvt2utf installation
tools/checkpatch.sh
   Added checking all necessary tools and installation info  (more user-friendly)
2025-06-21 21:15:54 +08:00
wangjianyu3
db1a14adac docs/esp32s3-devkit: update doc for fastboot
Update doc for fastboot USB and TCP network transport.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-21 04:21:29 +08:00
wangjianyu3
1c7da08b94 boards/esp32s3-devkit: update config for fastboot
Initializing configuration for Fastboot TCP network device.

esp32s3-devkit:fastboot     : Fastboot TCP and USB transport enabled
esp32s3-devkit:fastboot_usb : Fastboot USB transport enabled only
esp32s3-devkit:fastboot_tcp : Fastboot TCP transport enabled only

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-21 04:21:29 +08:00
wangjianyu3
fee314f3d1 docs/szpi-esp32s3: update doc for fastboot
Update doc for fastboot USB and TCP network transport.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-21 04:21:29 +08:00
wangjianyu3
af36267762 boards/szpi-esp32s3: update config for fastboot
Initializing configuration for Fastboot TCP network device.

lckfb-szpi-esp32s3:fastboot     : Fastboot TCP and USB transport enabled
lckfb-szpi-esp32s3:fastboot_usb : Fastboot USB transport enabled only
lckfb-szpi-esp32s3:fastboot_tcp : Fastboot TCP transport enabled only

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-21 04:21:29 +08:00
Alan Carvalho de Assis
578d62b480 tools: Modify refresh.sh to support update all configs from a board
This modification will simplify the case where the developer wants
to update all board configs from a specific board.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-06-21 04:21:10 +08:00
Martin Vajnar
0c9931cc99 espressif[risc-v|xtensa]: Check events when reading PCNT counter value
Previously, if an event was generated in hardware after taking spin
lock it was not correctly accounted for in current reading cycle.

Now, we check for events and compensate count accordingly.

Signed-off-by: Martin Vajnar <martin.vajnar@gmail.com>
2025-06-20 20:51:49 +08:00
Martin Vajnar
907b487eb7 arch/xtensa/src/common/espressif/esp_pcnt.c: counter accumulation fix
Port fix from risc-v code. Providing original description:

Even when enabled, the PCNT counter doesn't accumulate into the 32-bit value.
Instead, a value in range [PCNT_LOW_LIMIT, PCNT_HIGH_LIMIT] is always returned.
This is due to interrupt events associated with limit overflows are disabled on the periphery,
therefore the ISR responsible for the accumulation never gets called.

Fixed by enabling the associated interrupt events.

Signed-off-by: Martin Vajnar <martin.vajnar@gmail.com>
Original-fix-by: michal matias <mich4l.matias@gmail.com>
2025-06-20 20:51:49 +08:00
Lingao Meng
6c1020204a sched: assert: Print Stack pointer value when not within the stack
When Stack pointer value not within the stack, the default methon ignored,
while will be discard this information for debug.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2025-06-20 09:51:39 +08:00
Xiang Xiao
d266bfaca1 libc: lib_bsprintf reuse var instead value for string
to simplify the code logic

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-06-20 09:48:39 +08:00
Xiang Xiao
4b8a738141 libc/stream: Add support for lib_scanf
This commit adds support for the `lib_scanf` function, which
is a stream-oriented version of the `scanf` function.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-06-20 09:48:39 +08:00
Kerogit
a3f8b55143 drivers/serial/serial: prevent race conditions on 8-bit architectures
Some code paths in drivers/serial/serial.c load head and tail values
of receive and transmit circular buffers with interrupts enabled,
making it possible that the interrupt handler changes the value.
As noted in the code, this is safe as long as the load itself is atomic.

That is not true for 8bit architectures which fetch the 16-bit values
using two load instructions. If interrupt handler runs between those
two instructions and changes the value, the read returns corrupted data.

This patch introduces CONFIG_ARCH_LDST_16BIT_NOT_ATOMIC configuration
option which is automatically selected for AVR architecture. Based
on this option, head and tail values are reduced to 8-bit length
so the read remains atomic.

Patch was tested by building on rv-virt:nsh - disassembly of functions
from serial.c showed no difference which is correct as Risc-V does
not need to protect reads of these values. There should be no impact
for architectures that do not set the new configuration option.

It was also tested by by custom echo application running on AVR128DA28.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-06-19 10:01:24 -03:00
Kerogit
b5ccd54dd6 drivers/serial/serial: fix race condition in flow control
This patch fixes calculation of nbuffered value if
CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS is set. Volatile variable that
can be changed in interrupt handler was used in a condition which
branched the calculation into two paths. Precisely timed interrupt
could make the branch that was taken the incorrect one.

Patch was tested by building on AVR DA/DB chip.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-06-19 10:01:24 -03:00
Kerogit
c6c71b0beb drivers/serial/serial: typo fix in comment
Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-06-19 10:01:24 -03:00
wangjianyu3
acc067e4f1 docs/qemu-armv8a: add doc for fastboot tcp
Add document for fastboot TCP network device.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-19 10:10:01 +08:00
wangjianyu3
bb1cc40159 arm64/qemu: add config for fastboot tcp
Initialize configuration for fastboot TCP network device.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-19 10:10:01 +08:00
xuxin19
8dd49d2fac cmake(bugfix):fix VERSION genarator strip error in CMake build
fix genarate include/nuttx/version.h
define CONFIG_VERSION_STRING "12.5.1
" missing closing quote
^~~~~~~~~~~~~~~~~~~~~~
define CONFIG_VERSION_MAJOR 12

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2025-06-18 15:45:30 -04:00
wangjianyu3
759d6fa782 gitignore: add more vim swap files
1. Ignore "tags" files for all directories.

2. Add more vim swap files(".swo", ".swn").

    https://vimdoc.sourceforge.net/htmldoc/recover.html

    - If this file already exists (e.g., when you are recovering from a crash) a
      warning is given and another extension is used, ".swo", ".swn", etc.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-18 15:44:51 -04:00
simbit18
2e5160ed0d [Kconfig] Fix Kconfig style
Remove spaces from Kconfig
Add TABs
Add comments
2025-06-18 18:56:39 +02:00
simbit18
3cc7b29866 tools/testbuild.ps1: Windows fix the redirect error stream
Windows cmake fix the redirect error stream
2025-06-18 23:14:18 +08:00
kywwilson11
6c1781d523 Added more granular Kconfig options for STM32G0 line. Added CRS and HSI48 defines to get Nuttx to compile.
Minor formatting change

Change G0CX to G0C1 in Kconfig

Change HAVE_DAC to HAVE_DAC1
2025-06-18 10:31:08 -03:00
ouyangxiangzhen
a0aa654c70 sched/wqueue: Fix windows compilation errors.
This commit fixed windows compilation errors `struct
lp_wqueue_s/hp_wqueue_s has an illegal zero-sized array`.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-06-18 13:57:20 +02:00
Xiang Xiao
025af9d281 libc: Merge lib_vsprintf from lib_libsprintf.c into lib_libvsprintf.c
since all other printf variants in lib_libvsprintf.c

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-06-18 09:24:38 +08:00
Xiang Xiao
84dc88730c libc: Move stream printf/scanf from libc/stdio to libc/stream
to keep all related code in one place

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-06-18 09:24:38 +08:00
Matteo Golin
3b6648c742 docs/syslogd: Update syslogd docs to reflect implementation
The documentation for `syslogd` is now updated to reflect its use of
`posix_spawn` to run the daemon in the background.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-06-18 01:34:22 +08:00
Tyler Bennett
54b7bf6e36 ADC Hardware register file updated for G0
First commit of ADC for G0. Have it working basically. Need to make changes regarding adccmn stuff.

Added changes to make stm32_adc.c compatible with both G0 and other families.

Add oversampling support. This is for G0 and L0. Add ADC oversampling to Kconfig. Use adccmn_modifyreg for all, updated hw file to accomodate G0.

Style fixes. Move init of oversampling to a function, and call it if OVERSAMPLE is configured.

Limited changes to stm32_bringup.c

Style fixes to hardware/stm32_adc.h

Changed nucleo-g0b1re to run at 64 MHz. Fixed errors in clock setup. Added defines for setting up ADC clock.

Added code for STM32G0 ADC clock configuration.

Added adc_ckmode_cfg function. ckmode bits were previously neglected, assuming async clock to ADC was used. Added other feedback from pull request #16500.

Added feedback from pull request #16500.

Changed format of STM32F0L0G0_HAVE_ADC_OVERSAMPLE config.

Removed FARs from ioc_set_oversample.

Fixed formatting of helps in Kconfig. Adjusted spacing on help content.

Simplified adc_common_cfg. CCR_PRESC relies on board.h

Fixed formatting

Add ADC pinmaps for stm32g0
2025-06-17 21:25:39 +08:00
Xiang Xiao
99bd3d0f73 libc/stream: Fix the typo error
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-06-17 20:58:13 +08:00
yangao1
99303e9493 note/notestream: Call lib_fileoutstream_open in notefile_register
follow up fileoutstream change

Signed-off-by: yangao1 <yangao1@xiaomi.com>
2025-06-17 20:58:13 +08:00
yangao1
c560db04a6 stream/fileoutstream: Add open interface for coredump
Signed-off-by: yangao1 <yangao1@xiaomi.com>
2025-06-17 20:58:13 +08:00
yangao1
47dd21c3c1 stream: Add fileinstream support
This commit introduces a new fileinstream implementation
in the NuttX stream library.

Signed-off-by: yangao1 <yangao1@xiaomi.com>
2025-06-17 20:58:13 +08:00