Commit Graph

59668 Commits

Author SHA1 Message Date
xiezhanpeng3
2ce0c128f9 toolchain/ghs: Adapt .macro syntax for GHS compiler
The GHS compiler uses different .macro syntax. Without this change,
the GHS compiler reports error like:
[asarm] (error #2014) nuttx/arch/arm/src/armv8-r/arm_vectors.S 155: expected a register
  vstmdb \ out ! , { s0 - s31 }
---------^

And:
[asarm] (error #2179) nuttx/arch/arm/src/armv8-r/arm_vectors.S 141: unexpected token type (comma) encountered; expected type (char)
  .macro savefpu , out , tmp
-----------------^

Co-authored-by: Chengdong Wang <wangchengdong@lixiang.com>
Signed-off-by: xiezhanpeng3 <xiezhanpeng3@lixiang.com>
2025-11-14 01:49:09 +08:00
xiezhanpeng3
c9eeb4cb14 toolchain/ghs: change alignment syntax for GHS
The .align N syntax in GHS means the alignment is N Bytes. In GCC
compiler, it means 2**N Bytes. Therefore, .align 32 in GHS and
.align 5 in GCC are equivalent.

Co-authored-by: Chengdong Wang <wangchengdong@lixiang.com>
Signed-off-by: xiezhanpeng3 <xiezhanpeng3@lixiang.com>
2025-11-14 01:49:09 +08:00
xiezhanpeng3
e0e8a6e852 toolchain/ghs: _hyp_vector_start uses b . syntax for both GCC and ghs
The $+0x0 is not accepted by Ghs compiler. Therefore, we change it to a
more common syntax " b   ." for endless self loop.

Signed-off-by: xiezhanpeng3 <xiezhanpeng3@lixiang.com>
2025-11-14 01:49:09 +08:00
xiezhanpeng3
ecef24ea33 toolchain/ghs: greenhills compiler does not recognize .syntax unified
The GreenHills Compiler uses Unified Assembler Language by default and
it does not recognize .syntax unified instruction. Therefore, remove
them if GHS compiler is used.

Co-authored-by: Chengdong Wang <wangchengdong@lixiang.com>
Signed-off-by: xiezhanpeng3 <xiezhanpeng3@lixiang.com>
2025-11-14 01:49:09 +08:00
xiezhanpeng3
1d9e160f97 toolchain/ghs: add Greenhills compiler support for .type directive for arm-v8r
The GreenHills Compiler uses different grammer for the .type directive
in asm, this patch adds support for the grammer for arm-v8r.
Similar change for arm-v7r was done in pull request #12883.

Co-authored-by: Chengdong Wang <wangchengdong@lixiang.com>
Signed-off-by: xiezhanpeng3 <xiezhanpeng3@lixiang.com>
2025-11-14 01:49:09 +08:00
“duanqinshuo”
0b9c86905b arch/tricore: Fix specific definitions in the generic UART module
We found that specific chip pin definitions were used in the generic UART source file. Since pin definitions vary across different chips, the UART pin definitions have been moved to the corresponding chip-specific directory.

Co-authored-by: Chengdong Wang <wangchengdong@lixiang.com>
Signed-off-by: Qinshuo Duan <duanqinshuo@lixiang.com>
2025-11-14 01:48:17 +08:00
simbit18
f98d89874c boards/arm/kinetis: CMake added NXP TWR-K60N512 and TWR-K64F120M boards
CMake added boards:

  - NXP TWR-K60N512

 -  NXP TWR-K64F120M

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-11-13 11:34:01 -05:00
nuttxs
691cca4153 11_network.rst: Add a "Network Interfaces Overview" section and
reorganize the content structure:

- Add the new "Network Interfaces Overview" section
- Reorganize the document structure and optimize formatting

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-11-13 11:29:38 -03:00
wangchengdong
2440b4ef39 sched/sched: Fix nxsched_suspend() logic
nxsched_deliver_task() or nxsched_merge_pending() should only be
called when a context switch is required. This behavior is
independent of whether the current task is locked.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-13 21:01:18 +08:00
Antoine Juckler
d996c2e758 mtd/at25ee.c: Fix write check condition
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Fix writing till the very last byte of the memory

Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
2025-11-13 08:57:52 -03:00
Antoine Juckler
23de88e70e fs/fs.h: Add register_driver_with_size function
It acts as register_driver but also populates the inode size.
This allows to return a non-zero size when calling stat() on an eeprom
driver.

The conditions (CONFIG_PSEUDOFS_FILE or CONFIG_FS_SHMFS) for the
declaration of the inode size field have also been removed so that other
drivers can populate this field in the future.

Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
2025-11-13 08:57:52 -03:00
Antoine Juckler
934dfdf645 drivers/eeprom: Retrieve the geometry
Add EEPIOC_GEOMETRY IOCTL command to retrieve the
EEPROM geometry.

Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
2025-11-13 08:57:52 -03:00
hujun5
f1506c6212 fiq: fix some FIQ config in arm64/armv7-r/armv8-r
1. up_irq_save should not mask fiq if CONFIG_ARCH_HIPRI_INTERRUPT=y
2. up_irq_save should mask fiq if CONFIG_ARCH_TRUSTZONE_SECURE=y
3. up_irq_save should mask irq if CONFIG_ARCH_TRUSTZONE_SECURE=n
4. add up_secure_irq in arm64
5. add ARCH_HAVE_TRUSTZONE support for ARCH_CORTEX_R82

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-11-12 20:39:54 +08:00
Jani Paalijarvi
97c228c517 arch/arm64/src/imx9/imx9_flexspi_nor.c: Implement MTDIOC_RESET command
MTDIOC_RESET ioctl command executes "Reset Enable" and "Reset Memory"
commands to enter a power-on reset condition.

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2025-11-12 20:39:00 +08:00
Jani Paalijarvi
c793572c1c include/nuttx/mtd/mtd.h: Add MTDIOC_RESET ioctl
Define MTDIOC_RESET ioctl command for resetting flash memory.

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2025-11-12 20:39:00 +08:00
raiden00pl
3e30a93d1b boards/nucleo-h743zi: register TMPFS
register TMPFS for nucleo-h743zi

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-11-12 11:53:03 +01:00
trns1997
22bc630d9f drivers/kinetis/spi: Fix Kinetis DSPI transfers in non-FIFO mode.
Fix a transfer issue in the Kinetis DSPI driver when operating
with transmit and receive FIFOs disabled (`MCR[DIS_TXF]=1`,
`MCR[DIS_RXF]=1`). In this mode, the DSPI module behaves as a
simple double-buffered SPI interface without TX staging.

When FIFOs are disabled, `PUSHR` acts as a single 32-bit
command/data register. Partial (16-bit) writes to its upper or
lower halves can result in incomplete or corrupted transfers.
This patch ensures the full 32-bit packet is prepared and
written in a single operation.

* Resolves broken SPI transactions with LAN9252 (EasyCAT).
* Improves reliability in non-FIFO DSPI configurations.
* No impact on DMA or FIFO-enabled modes.

Signed-off-by: trns1997 <trns1997@gmail.com>
2025-11-12 11:24:03 +01:00
raiden00pl
922f950967 boards/x86_64/intel64/qemu-intel64: register TMPFS
register TMPFS for qemu-intel64

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-11-12 11:18:51 +01:00
simbit18
eb583704fe boards/arm/kinetis: CMake added NXP Freedom-K28F and Freedom-K66F boards
CMake added boards:

  - NXP Freedom-K28F

 -  NXP Freedom-K66F

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-11-11 14:04:23 -05:00
haitomatic
6b45617064 arch/risc-v/mpfs: Remove strict CAN frame data length check.
Some checks failed
Build Documentation / build-html (push) Has been cancelled
In MSS CAN transmit function, the check of net pkt data len is not neccessary. Since there are cases that the pkt len can exceed the expected 16 bytes of can_frame but the pkt is still valid. Such a case is when CONFIG_NET_CAN_RAW_TX_DEADLINE is enabled which has pkt len to become 32 bytes due to cmsghdr overhead.

Signed-off-by: haitomatic <hai.to@unikie.com>
2025-11-11 22:16:51 +08:00
simbit18
12cee023b2 boards/arm/kinetis: Added CMake build for NXP Freedom-K64F board
- CMake added board NXP Freedom-K64F

https://www.nxp.com/design/design-center/development-boards-and-designs/FRDM-K64F

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-11-11 22:15:52 +08:00
simbit18
eca3942320 arch/arm/src/kinetis: CMake build implemented for NXP Kinetis MCUs
- added NXP Kinetis MCUs

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-11-11 22:15:52 +08:00
hujun5
857fdad220 boards/arm/qemu/qemu-armv7a: add demo for gdbstub
Gdbstub support
===========
  The Qemu version must be above 9.2 to support two serial ports.

  One window:
  ./tools/configure.sh qemu-armv7a:gdbstub; make -j25
  qemu-system-arm -cpu cortex-a7 -nographic -machine virt,virtualization=off,gic-version=2 -net none -kernel ./nuttx  -serial mon:stdio -serial pty
  char device redirected to /dev/pts/26 (label serial1)
  nx_start: Entry
  uart_register: Registering /dev/console
  uart_register: Registering /dev/ttyS0

  Another window:
  gdb-multiarch nuttx -ex "target remot /dev/pts/26"
  GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git
  Copyright (C) 2024 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.
  Type "show copying" and "show warranty" for details.
  This GDB was configured as "x86_64-linux-gnu".
  Type "show configuration" for configuration details.
  For bug reporting instructions, please see:
  <https://www.gnu.org/software/gdb/bugs/>.
  Find the GDB manual and other documentation resources online at:
  <http://www.gnu.org/software/gdb/documentation/>.

  For help, type "help".
  Type "apropos word" to search for commands related to "word"...
  Reading symbols from nuttx...
  Remote debugging using /dev/pts/26
  gdb_get_registers (state=0x402052f8) at gdbstub/lib_gdbstub.c:1020
  1020              reg = state->running_regs;
  (gdb) c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-11-11 19:53:56 +08:00
hujun5
d94cb53d6c sched_lock: remove the check for whether tcb is NULL
Remove Redundant Checks

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-11-11 17:26:30 +08:00
wangchen
678164bf4e net_bufpool.c:when timeout value is zero,It don't break netlock
Resolve some timing issues caused by calling net_breaklock to release netlock in the function NET_BUFPOOL_TRYALLOC

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2025-11-10 22:30:37 -05:00
wangchengdong
9053b60eb2 Documentation: Add wd_start_next() API description
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Add documentation for wd_start_next() API,
    describing its purpose and usage.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-10 23:16:57 +08:00
wangchengdong
61c4c54bd3 Documentation: Add wd_restart_next() API description
Add documentation for the newly introduced wd_restart_next() API,
    describing its purpose and usage.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-10 23:16:57 +08:00
wangchengdong
07e05b8591 sched/wdog: Add wd_restart_next() for precise wdog restart upon expiration
This patch introduces wd_restart_next(), which enables precise and
    convenient watchdog restarts upon expiration. It is designed to be
    invoked within the watchdog expiration callback to facilitate accurate
    periodic events.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-10 23:16:57 +08:00
wangchengdong
387803e958 Documentation: Add wd_restart() API description
Add documentation for the newly introduced wd_restart() API,
    describing its purpose and usage.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-10 23:16:57 +08:00
wangchengdong
8696632abe sched/wdog: Add wd_restart() for convenient restart of a wdog
Introduce wd_restart() to allow restarting an existing watchdog
    with its previously configured callback and argument, making it
    easier to refresh or reuse preconfigured watchdog timers.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-10 23:16:57 +08:00
wangchengdong
71f53c6c74 sched/wdog: Inline wd_start() to improve performance
Move wd_start() to an inline function to reduce function call
    overhead and improve performance in time-critical watchdog operations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-10 23:16:57 +08:00
raiden00pl
44a924ab42 boards/stm32h7: add Arduino Portenta H7
Add initial support for Arduino Portenta H7.
For now only CM7 core is supported.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-11-10 18:13:47 +08:00
chao an
8847389886 style/FAR: remove FAR qualifier
N/A, remove FAR qualifier from non-pointer types

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-11-10 10:56:29 +01:00
hujun5
6088f6216b uart_pl011: "pl011_irq_tx_ready" and "pl011_txready" is reversed.
Some checks failed
Build Documentation / build-html (push) Has been cancelled
The implementation logic of "pl011_irq_tx_ready"
and "pl011_txready" is reversed.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-11-10 14:15:19 +08:00
Matteo Golin
d4c904d949 docs/applications/examples/fb: Add documentation to fb example
Included documentation for the framebuffer example, fb. This includes a
description of how the program works, what features it supports and
images of what the rendered output should look like if everything is
correct.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-11-10 13:48:23 +08:00
wangchengdong
de0aead39f sched/wdog: Fix wd_start() boundary check for WDOG_MAX_DELAY
The current implementation allows the delay passed to wd_start() to be
   equal to WDOG_MAX_DELAY. However, since clock_delay2abstick() internally
   increments the delay by one tick, using a delay equal to WDOG_MAX_DELAY
   will cause an overflow and make the clock comparison invalid.

   This patch fixes the issue by disallowing the delay to be equal to
   WDOG_MAX_DELAY.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-10 10:45:15 +08:00
Matteo Golin
00e287bb70 docs/raspberrypi-4b: Include information about new graphics support
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Add description of new graphics configuration, and indicate HDMI video
output support (with notes) in the supported peripherals table.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-11-09 16:48:14 -03:00
Matteo Golin
310a808d3d rpi4b/framebuffer: Introduce frame buffer support to the RPi4B
Introduces a very basic frame buffer driver implementation for the RPi4B
which is registered at startup and works with frame buffer graphics
examples (and LVGL). Graphics are displayed on the HDMI0 and HDMI1
output, depending which one is plugged into the display. I have not
tested using both at once, nor does the driver account for that. They
are both referred to as display 0, plane 0 since the RPi4B frame buffer
interface does not seem to have a way of distinguishing.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-11-09 16:48:14 -03:00
hujun5
aff64bb3dc arm64: add demo for gdbstub
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Gdbstub demo::
   The Qemu version must be above 9.2 to support two serial ports.

   One window:
   ./tools/configure.sh qemu-armv8a:gdbstub; make -j25
   qemu-system-aarch64 -cpu cortex-a53 -nographic -machine virt,virtualization=on,gic-version=3 -net none -kernel ./nuttx -serial mon:stdio -serial pty
   char device redirected to /dev/pts/27 (label serial1)
   - Ready to Boot Primary CPU
   - Boot from EL2
   - Boot from EL1
   - Boot to C runtime for OS Initialize

   Another window:
   gdb-multiarch nuttx -ex "target remot /dev/pts/27"
   GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git
   Copyright (C) 2024 Free Software Foundation, Inc.
   License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
   This is free software: you are free to change and redistribute it.
   There is NO WARRANTY, to the extent permitted by law.
   Type "show copying" and "show warranty" for details.
   This GDB was configured as "x86_64-linux-gnu".
   Type "show configuration" for configuration details.
   For bug reporting instructions, please see:
   <https://www.gnu.org/software/gdb/bugs/>.
   Find the GDB manual and other documentation resources online at:
   <http://www.gnu.org/software/gdb/documentation/>.

   For help, type "help".
   Type "apropos word" to search for commands related to "word"...
   Reading symbols from nuttx...
   Remote debugging using /dev/pts/26
   gdb_get_registers (state=0x403e1590) at gdbstub/lib_gdbstub.c:1020
   1020              reg = state->running_regs;
   (gdb) c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-11-09 22:45:26 +08:00
nuttxs
65e318421d netdb/lib_dnsdelserver.c: support delete the DNS server address
Some checks failed
Build Documentation / build-html (push) Has been cancelled
by index or address

 - dns_del_nameserver()
 - dns_del_nameserver_by_index()

Update the "DNS function" section in 11_network.rst, and create
the netlib API documentation in netlib/index.rst

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-11-08 16:17:40 -03:00
“duanqinshuo”
cc2cb394fa arch/arm: Solving the ghs compiler not recognizing 0b prefix representing binary
This patch solving the ghs compiler not recognizing 0b prefix representing binary

Signed-off-by: Qinshuo Duan duanqinshuo@lixiang.com
2025-11-09 00:12:14 +08:00
wangchengdong
f82f71d180 libs/libc: Fix Kconfig issue for memcpy and memset
Fix an issue on ARMv8-R where NEON is not supported.
    When NEON is disabled, the assembly-optimized implementations
    of memset and memcpy should not be used.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-07 13:04:20 +01:00
wangchengdong
190daef2bf sched/wdog: Use list_in_list() to detect active watchdogs
Use list_in_list() to determine whether a watchdog is active,
     eliminating the need to set the watchdog function pointer to NULL
     as an indicator of inactivity.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-07 10:30:53 +08:00
nuttxs
22a9228479 boards/xtensa: fix some unused variable build warning
src/esp32s3_lan9250.c:190:7: warning: unused variable 'i' [-Wunused-variable]

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-11-06 12:13:04 +01:00
wangchengdong
1217fcf907 sched/wdog: Improve wdog Precision
Currently, wd_timer() obtains the current systick
    from the input parameter, and the wdog processes
    the list without updating the systick value.
    This is not incorrect, as the systick should continue
    to increase while the watchdog is processing callbacks.
    This patch addresses the issue by retrieving the updated
    systick value after each watchdog node loop.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-06 13:26:58 +08:00
Karel Kočí
aa3cf8cb3a nuttx/can: report error and not EOF at the empty FIFO
The empty FIFO can happen only in two cases. Either there is some
inconsistency that made rx_sem ready but buffer is empty (that might
happen if multiple reads are blocked in parallel, or just due to the bug
in the logic), or if close is used. Until now the 0 would be returned
and thus EOF. The error is not EOF and actually it is still possible to
read afterwards. Thus we for sure should not signal EOF for the first
cause. The second cause for close matches the behavior that is expressed
even on glibc for some file descriptors (the waiting read will commonly
get error EINVAL there). We can't decide on the real cause of this
situation and thus we always report EIO error and thus generic
input/output error.

Signed-off-by: Karel Kočí <kkoci@elektroline.cz>
2025-11-05 20:45:05 +08:00
Karel Kočí
be40a105eb drivers/can: correctly unblock only one read at the time
The previous version of the code was posting the semaphore every time
the value was less or equal to the zero. In case there is read already
waiting on the semaphore the value will be -1. The first frame will post
the value to 0 and thus unblocking the waiting read. The read will take
frames out of FIFO. During that time if next frame is received it will
be placed to the FIFO but because rx_sem has value 0 at that time it
will be posted to value 1. Once read finishes the execution it will
check if there is something still in the FIFO and posts semaphore back
(expecting that the value is 0) thus increasing value to 2. Thus we end
up with read being unblocked once more triggering 'RX FIFO sem posted
but FIFO is empty.' error branch and returning zero (signaling EOF?).

The intuitive fix is to check the value of the semaphore before posting
it in the read's tail. This could have race condition case when
interrupt is delivered between nxsem_get_value and nxsem_post and
can_receive is called.

This fix instead uses the same condition to detect if semaphore must be
posted as read does. Thus we check if previously the FIFO was empty. We
post the semaphore on in case FIFO was initially empty, otherwise we
expect semaphore to be fully managed by can_read.

Signed-off-by: Karel Kočí <cynerd@email.cz>
2025-11-05 20:45:05 +08:00
Karel Kočí
b571d2e5e4 drivers/can: fix sending of RTR frames with nonzero DLC
The message passed to the write can have `cm.hdr.ch_rtr` set and if
nonzero DLC is specified in the frame then invalid number of bytes is
removed from the buffer as RTR frames do not have any data even when DLC
is nonzero.

This was tested on SAMv7 (mcan). With this change a custom RTR can be
sent.

Signed-off-by: Karel Kočí <cynerd@email.cz>
2025-11-05 20:45:05 +08:00
Karel Kočí
a19971f1bc drivers/can: protect against write buffer overrun
The message size is being calculated from the message itself. If
application sets value cm_hdr.ch_dlc greater than buflen (that is
size_t) then calculation in while condition underflows and multiple
messages are attempted to be sent.

This check prevents that by verifying that the message size that was
encoded in the dlc is not greater than indicated size of the buffer.

Signed-off-by: Karel Kočí <cynerd@email.cz>
2025-11-05 20:45:05 +08:00
Filipe Cavalcanti
3577254d9f boards/arm: remove custom MCUBoot version from defconfigs
Removing the custom MCUBoot hash from 5 defconfigs.
This custom hash is blocking the MCUBoot update on nuttx-apps due to
changes in source files.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-11-05 17:25:26 +08:00