Commit graph

58596 commits

Author SHA1 Message Date
simbit18
6fc5b3e9dc 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-27 21:44:19 +08:00
simbit18
a7e5bd936a drivers/segger/CMakeLists.txt: Aligned Cmake with Make
Segger SysView has been upgraded to version V3.5.6
https://github.com/apache/nuttx/pull/13847

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-06-27 21:41:39 +08:00
Alin Jerpelea
50b22575e9 Documentation: add NuttX-12.10.0 release notes
Add release notes for 12.10.0 release

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2025-06-27 19:21:21 +08:00
nuttxs
a741cd3975 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-24 09:47:58 -03:00
halyssonJr
2e208be9bf Modify type to avoid compilation warning. 2025-06-24 09:47:12 -03:00
Kerogit
c241137c51 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-23 20:34:17 +08:00
Kerogit
ea93ddfc08 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-23 20:34:17 +08:00
Kerogit
be6a7f7cfb drivers/serial/serial: typo fix in comment
Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-06-23 20:34:17 +08:00
chao an
215bfbb849 audio/comp: fix build warning caused by invalid return value
audio/audio_comp.c:958:14: warning: returning ‘int’ from a function with return
                                    type ‘struct audio_lowerhalf_s *’ makes pointer
                                    from integer without a cast [-Wint-conversion]
  958 |       return -EINVAL;
      |              ^

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-06-23 20:33:40 +08:00
chao an
d4bbb99804 drivers/mtd: fix compile warning
mtd/mtd_rwbuffer.c:42:
mtd/mtd_rwbuffer.c: In function 'mtd_erase':
mtd/mtd_rwbuffer.c:189:9: warning: format '%zx' expects argument of type 'size_t', but argument 3 has type 'long long int' [-Wformat=]
  189 |   finfo("block: %08zx nsectors: %zu\n",
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  190 |         (intmax_t)block, nsectors);
      |         ~~~~~~~~~~~~~~~
      |         |
      |         long long int
mtd/mtd_rwbuffer.c:189:21: note: format string is defined here
  189 |   finfo("block: %08zx nsectors: %zu\n",
      |                 ~~~~^
      |                     |
      |                     unsigned int
      |                 %08llx
mtd/mtd_rwbuffer.c: In function 'mtd_ioctl':
mtd/mtd_rwbuffer.c:298:21: warning: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
  298 |               finfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  299 |                     geo->blocksize, geo->erasesize, geo->neraseblocks);
      |                     ~~~~~~~~~~~~~~
      |                        |
      |                        uint32_t {aka long unsigned int}
...

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-06-23 20:33:33 +08:00
chao an
250388f8d0 syslog/rpmsg: disable force put char to lower putc
if rpmsg triggers force flushing when the master core provides lower putc,
characters will be duplicated caused by SYSLOG_DEFAULT also send the char to lower half.
in this PR, we disable force put char to lower putc if CONFIG_SYSLOG_DEFAULT is enabled

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-06-23 20:33:26 +08:00
Matteo Golin
f232028f6b sensors/nau7802: Fix format warning
Silence format string warning by adding missing '%' sign.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-06-23 20:33:19 +08:00
George Poulios
03f7f59fa8 arm64/imx9: Support & configure RGMII-ID on RTL8211F
For the RTL8211F PHY, configuration of RX/TXDLY was missing.
At least on my i.MX93 EVK, this is necessary for transmission
to work (RXDLY defaults to true on the PHY).

This commit brings support for RGMII internal delay configuration
(on or off for both directions) and enables it on the i.MX93 EVK
board. The introduced Kconfig is set to default to 'n', to avoid
breaking the functionality of other, out-of-tree boards based on
i.MX93, running the RTL8211F PHY, or to avoid introducing
unnecessary code on boards running other PHYs.

Configuration of internal delay on other PHYs is not
implemented, and results in a warning (but no error).

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-06-23 20:33:12 +08:00
George Poulios
e540fae8b3 arm64/imx9: Add missing ENET1 RGMII TXC pin muxing
MUX_ENET1_TXC was missing from both the EVK board
definition and the IO muxing configuration function
of the ENET1 driver. As a result, transmission does
not work (unless the muxing is set by default in some
board? -not the case with EVK). This commit adds the
configuration and adds the definition to i.MX93 EVK.

WARN: other, out-of-tree i.MX93 boards need to define
MUX_ENET1_TXC accordingly, otherwise build will break.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-06-23 20:33:12 +08:00
George Poulios
51252aef91 boards/imx93-evk: Tidy up board.h ENET1 section
i.MX93 EVK board.h had an unmatched #endif directive
accidentally matching the top-level header file guard.
It also had a dual definition of BOARD_ENET1_PHY_LIST
with the same values. None of these issues affect the
functionality, as they ended up (almost) with equivalent
end result.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-06-23 20:33:12 +08:00
wangjianyu3
ea3ce977ec fs/vfs: check buffer count and pointer for iovec
There are iovecs provided by user such as readv().

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-23 20:33:05 +08:00
wangjianyu3
409ee4cad4 fs/vfs: check if all iov_base are accessible
Check if all `iov_base` are inside accessible address space.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-23 20:33:05 +08:00
dongjiuzhu1
49ebc4598f net/utils: avoid unalign access g_tcp_connections_buffer
the address is 0x3c270203, cause unaligned access usage Fault
(gdb) p g_tcp_connections
$1 = {pool = 0x3c270203 <g_tcp_connections_buffer> <error: Cannot access memory at address 0x3c270203>,
prealloc = 8, dynalloc = 1, nodesize = -376, sem = {semcount = 32767, flags = 0 '\000',
waitlist = {head = 0x0, tail = 0x0}}, freebuffers = {head = 0x0, tail = 0x0}}

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-06-23 20:32:57 +08:00
Kerogit
97260d9280 arch/avr: fix atomic load functions from arch_atomic.c
For AVR, atomic functions generated by LOAD macro turn into load surrounded
by up_irq_save and up_irq_restore. The generated code was incorrect as can
be seen from disassembly of __atomic_load_4:

in   r18, 0x3f ; store interrupts enabled flag
cli            ; disable interrupts
out  0x3f, r18 ; restore the flag
movw r30, r24  ; copy parameter (address) to pointer register
ld   r22, Z    ; indirect load to return value registers
ldd  r23, Z+1
ldd  r24, Z+2
ldd  r25, Z+3
ret            ; return

The interrupts are disabled to be immediately re-enabled, the load only takes
place after that.

Both up_irq_save and up_irq_restore are defined in inline assembly. Other
architectures (x86/486, Risc-V) mark this assembly with clobbers: memory.
Doing the same thing for AVR alleviates the problem:

in      r18, 0x3f ; store interrupts enabled flag
cli               ; disable interrupts
movw    r30, r24  ; copy address
ld      r22, Z    ; load
ldd     r23, Z+1
ldd     r24, Z+2
ldd     r25, Z+3
out     0x3f, r18 ; restore interrupts enabled flag
ret               ; return

Besides compiling the code and checking the assembly, this was tested
with a custom stress application on AVR128DA28.

Assembly of up_irq_enable is marked in the same way with regards to clobbers.

This patch also removes two functions that are not called from anywhere
(up_irq_disabled, putsreg)

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-06-23 20:32:50 +08:00
raiden00pl
6e2ef4c0aa arch/stm32f0l0g0/stm32_tim.c: fix compilation when TIM6/TIM7 is missing
Fix compilation when TIM6/TIM7 is missing for stm32-m0.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-06-23 20:32:42 +08:00
SPRESENSE
e283e40c6b fs/smartfs: Fix a fatal bug about sector writing after seek
When writing to the next sector after the forward position has been written
by seek, the old sector buffer is used, which may corrupt the file system.
Therefore, the sector buffer must always be updated after a writing by seek.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-06-23 20:32:33 +08:00
Filipe Cavalcanti
075addd840 arch/risc-v: decouple common source for Espressif's MCUBoot port
Decouples the NuttX build from the MCUBoot common source on RISC-V Espressif
devices. Allows using different branches for each.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-06-23 20:32:03 +08:00
Filipe Cavalcanti
e15e6820ca arch/xtensa: decouple common source for Espressif's MCUBoot port
Decouples the NuttX build from the MCUBoot common source on Xtensa
devices. Allows using different branches for each.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-06-23 20:32:03 +08:00
raiden00pl
4f39f79a61 boards/nucleo-f446re: fix adc example
fix adc example for nucleo-f446re:

- the second ADC channel should be different from first channel
- enable ADC SCAN mode so we get convertion on CH0 and CH1
- disable software trigger from application, we use hardware triggering
from timer

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-06-23 20:31:57 +08:00
ouyangxiangzhen
0a22cccfa8 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-23 20:31:47 +08:00
xuxin19
9cc3e7126e 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-23 20:31:43 +08:00
halyssonJr
3e1cc62c71 fix framebuffer config resolution. 2025-06-23 20:31:36 +08:00
Matteo Golin
a8a57dd0c9 docs/conf.py: Fix missing nuttx_versions
Add `nuttx_versions` back into the `html_context` variable after it was
re-defined in #16440 to include more options. This fixes the failing
Pphinx autobuild.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-06-23 18:40:07 +08:00
wushenhui
9653e5d6d7 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 18:38:50 +08:00
Tiago Medicci Serrano
3f42b383d1 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-23 18:38:45 +08:00
Tiago Medicci Serrano
0814c20115 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-23 18:38:45 +08:00
Tiago Medicci Serrano
ef39cffe63 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-23 18:38:45 +08:00
Anthony Tran
c3cccf7d43 riscv qemu-rv: fix kernel mapping by enabling CONFIG_MM_KMAP in knsh defconfig 2025-06-23 18:37:30 +08:00
Niccolò Maggioni
37380d2fbd docs: Add missing CFLAGS to the ELF guides
As reported in apache/nuttx-apps#1828

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-06-23 18:37:14 +08:00
simbit18
174781dbf4 arch/risc-v/src/qemu-rv/CMakeLists.txt: removed repeated addition of the file qemu_rv_userspace.c
9897ef3cdb/arch/risc-v/src/qemu-rv/CMakeLists.txt (L44)

aligned with the make.def file

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-06-23 18:35:57 +08:00
Ville Juven
a9819bf319 mcx-nxxx: Add LPI2C driver for mcx-nxxx architecture
This adds a LPI2C driver for the mcx-nxxx chip, and the necessary board
definitions for the frdm-mcxn236 evaluation kit.

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2025-06-23 18:35:38 +08:00
simbit18
2423b27911 arch/arm/src/mcx-nxxx/CMakeLists.txt: Aligned Cmake with Make
Aligned Cmakefile with Make.defs PR #16469

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-06-23 18:35:18 +08:00
Michal Lenc
14cc35a870 arch/arm/src/samv7/sam_serial_spi.c: set correct SPI mode during init
Bitfield CPHA has to be set to run SPI in mode 0. This is a default mode,
therefore it should be set during the peripheral initialization.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-06-23 18:34:58 +08:00
Morten Fyhn Amundsen
3ca8a0ae1c Documentation: Fix a typo in scheduler docs
Removed a repeated word. Self-explanatory.

Signed-off-by: Morten Fyhn Amundsen <morten.f.amundsen@scoutdi.com>
2025-06-23 16:43:43 +08:00
Matteo Golin
ef04b4ccb6 boards/avr/atmega: Added Elegoo Mega2560r3 board support
Preliminary support for the Elegoo Mega2560r3 board by Elegoo with NSH
configuration.
2025-05-31 00:29:18 +08:00
dependabot[bot]
5bcf42e962 build(deps): bump codelytv/pr-size-labeler from 1.10.2 to 1.10.3
Bumps [codelytv/pr-size-labeler](https://github.com/codelytv/pr-size-labeler) from 1.10.2 to 1.10.3.
- [Release notes](https://github.com/codelytv/pr-size-labeler/releases)
- [Commits](https://github.com/codelytv/pr-size-labeler/compare/v1.10.2...v1.10.3)

---
updated-dependencies:
- dependency-name: codelytv/pr-size-labeler
  dependency-version: 1.10.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-30 10:34:23 -03:00
T. L.
29e6d4f96e Documentation/drivers/analog/adc/ads1115: Add missing documentation for ioctl
This commit adds the missing documentation for the ioctl command ANIOC_ADS1115_READ_CHANNEL.

Signed-off-by: Tony Lin <99093620+justapotato213@users.noreply.github.com>
2025-05-29 22:03:43 -04:00
Peter van der Perk
7104a51411 arch/arm/imxrt: rt117x fix TCM/OCRAM ECC backdoor access
FlexRAM peripheral was incorrectly clocked and turned during
M7 sleep. This patch fixes clock setting and ensure that clock
stays on during M7 for backdoor access from for example eDMA
2025-05-30 08:51:46 +08:00
Matteo Golin
40ec988502 arduino-mega2560: Fix incorrect RAM_START address
Fixes an incorrect RAM_START address, which should be 0x800200 for SRAM.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-05-29 16:24:06 -03:00
Matteo Golin
557c83cea3 avr/atmega: Resolve memory corruption preventing boot
Resolve memory corruption issue where the memory values to be loaded
from flash to sram at boot contained incorrect values. Also added a
KEEP() guard around `.vectors` to prevent debug stripping from removing
them, as suggested by KR.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-05-29 16:24:06 -03:00
Matteo Golin
b49b62a733 analog/ads1115: Speed up channel measurement delays
The ADS1115 driver uses the `nxsig_usleep()` function to sleep for a
65us delay, but with a 1ms tick resolution and the context-switching
overhead, this is much more than 1ms. Introducing `up_udelay` (even with
a larger duration because of the unreliability of busy-waiting) speeds
up sampling noticeably.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-05-29 15:23:06 +08:00
Theodore Karatapanis
c6f4310331 arch/arm64/imx9: Guard EL3-only features when booting at EL1
Boards that run the i.MX9 bootloader at EL1 must not touch EL3-only
configuration. Add Kconfig guards so that:

* DDR training (IMX9_DDR_TRAINING)
* FIQ decode support (ARM64_DECODEFIQ)

are selected only when ARCH_ARM64_EXCEPTION_LEVEL == 3.

Code in arm64_chip_boot() is also guarded with ARCH_ARM64_EXCEPTION_LEVEL == 3

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-05-28 14:39:55 -03:00
robert
df058b462e Bluetooth SMP: added support for Legacy pairing (MITM) with passkey
#   1: .codespellrc
  #  /home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:307: afte ==> after
   # /home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:405: multipled ==> multiplied
    #/home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:416: multipled ==> multiplied
    #/home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:432: provies ==> provides, proves
    #/home/runner/work/nuttx/nuttx/nuttx/include/nuttx/uorb.h:1173: subcribers ==> subscribers
    #Error: Process completed with exit code 1.
2025-05-28 21:49:08 +08:00
Matteo Golin
ab756e8dd7 net/tcp: Fix keep-alive implementation
The TCP keep-alive implementation would send the probes and abort the
connection correctly, but without waking up the affected socket and
marking the connection as aborted. This patch from zhhyu7 in #16447
resolves the issue.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-05-28 10:18:17 -03:00
raiden00pl
302ceb701b include: fix Private Types banners
unify Private Types banners according to NuttX coding standard

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-28 10:17:15 +08:00