Commit graph

57385 commits

Author SHA1 Message Date
zhanghongyu
70489fe56b net/tcp_timer: remove tcp_callback(TIMEOUT) when accept conn timeout
when accept conn timeout, only accept conn itself should handle the event
(send TCP_RESET), and there is no need to notify the listening conn.
otherwise, the server's poll will return with POLLERR and POLLHUP.
this may cause some applications to execute incorrect logic in the future.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-01-10 02:04:37 +08:00
YAMAMOTO Takashi
a76cdfda47 rv-virt:citest64: bump CONFIG_INIT_STACKSIZE
Fix crashes with "popen" example.

```
dump_tasks:    PID GROUP PRI POLICY   TYPE    NPX STATE   EVENT      SIGMASK          STACKBASE  STACKSIZE      USED   FILLED    COMMAND
dump_tasks:   ----   --- --- -------- ------- --- ------- ---------- ---------------- 0x800525e0      2048      1016    49.6%    irq
dump_task:       0     0   0 FIFO     Kthread -   Ready              0000000000000000 0x80056550      2032      1168    57.4%    Idle_Task
dump_task:       1     0 224 RR       Kthread -   Waiting Semaphore  0000000000000000 0x80057500      1968       768    39.0%    hpwork 0x80051470 0x800514b8
dump_task:       2     0 100 RR       Kthread -   Waiting Semaphore  0000000000000000 0x80057e48      1960       720    36.7%    lpwork 0x80051400 0x80051448
dump_task:       3     3 100 RR       Task    -   Waiting Semaphore  0000000000000000 0x80058ca0      3024      3008    99.4%!   nsh_main
dump_task:       4     4 100 RR       Task    -   Ready              0000000000000000 0x8005a2f0      2000      1376    68.8%    popen
riscv_exception: EXCEPTION: Load access fault. MCAUSE: 0000000000000005, EPC: 000000008000594e, MTVAL: fffffffffffffffc
riscv_exception: PANIC!!! Exception = 0000000000000005
```
2025-01-10 02:01:21 +08:00
hujun5
8fd4bea2ba segger: rm spin_lock_irqsave(NULL) in drivers/segger/config/SEGGER_RTT_Conf.h
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-09 23:52:55 +08:00
Huang Qi
cfd0cc0d1a Remove duplicate includes across multiple files
This commit cleans up redundant header file includes throughout the codebase.
 The changes include:

 - Removing duplicate #include directives that were present in the same file
 - Consolidating includes that were split across multiple lines unnecessarily
 - Removing unused includes that were no longer needed
 - Fixing some formatting issues with includes

 The changes improve code organization and maintainability by:
 - Reducing unnecessary dependencies
 - Making include dependencies more explicit
 - Following consistent include patterns
 - Removing dead code

 No functional changes are made - this is purely a code cleanup commit.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-09 23:30:23 +08:00
jerryslhao
bb4eb12fa3 arch/arm/stm32:add stm32g4 spi driver.
Signed-off-by: jerryslhao <jerryslhao@gmail.com>
2025-01-09 09:25:10 +01:00
Huang Qi
a8ba833cde Documentation: Add Rust integration guide for NuttX
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Add a new guide documenting how to integrate Rust with NuttX, including:
- Prerequisites and supported platforms
- Setup instructions for Rust toolchain
- Required NuttX configurations
- Example build and run instructions for RISCV32 target

The guide provides an experimental but working example of running
a Rust application on NuttX using the rv-virt:nsh board.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-09 15:43:10 +08:00
nuttxs
cb980cc977 arch/esp32s3_partition: Read data from SPI Flash
at designated address (with decryption)
2025-01-09 07:52:40 +08:00
raiden00pl
b3120e535b arch/arm/stm32{|f0l0g0|f7|h5|h7}/i2c: raise compilation error when configuration is invalid
Raise compilation error when I2C configuration is invalid.
It's better to catch invalid clock configuration during compilation instead of
producing binary that doesn't work as expected anyway.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-01-09 07:49:39 +08:00
wangmingrong1
11d54b34a7 Revert "mm_heap: double malloced memory default alignment (4 -> 8, 8 -> 16)"
This reverts commit 3e971d2e6d.
2025-01-09 00:00:11 +08:00
Huang Qi
00794b92c4 arch/risc-v: Improve LLVM CPU type detection with findstring
Use findstring instead of direct equality checks for LLVM_CPUTYPE
conditions to better handle ARCHCPUEXTFLAGS that may contain additional
ISA extensions. This makes the CPU type detection more robust when
dealing with extended instruction sets while still ensuring the required
base ISA extensions are present.

For example, ARCHCPUEXTFLAGS="imc_zicsr_zifencei" will now correctly
match as sifive-e20 rather than failing the exact match check.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-08 23:58:19 +08:00
Ville Juven
ae9815a888 riscv_cpustart.c: Change CPU start related traces to sinfo
Like all other platforms do.
2025-01-08 23:57:34 +08:00
YAMAMOTO Takashi
c0eaf12661 esp32s3_wifi_adapter.c: Fix a deadlock
Fixes: https://github.com/apache/nuttx/issues/15314
2025-01-08 23:56:43 +08:00
wangjianyu3
8282ed9ab0 drivers/sensors/gnss: Macro UINT8_MAX for maximum value of uint8_t crefs
libs/libc/gnssutils/minmea/minmea.h:17:#include <stdint.h>

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-08 22:50:03 +08:00
hujun5
428c2bfb91 Remove duplicate code
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-08 22:48:12 +08:00
YAMAMOTO Takashi
0b960de1e0 sim:citest: Bump the nsh line length
One of the test scripts tries to send a very long command
(166 characters, [1]), which is immediately truncated by NSH.
I guess it isn't the intention of the test.

[1] 1bcaacd5cc/tools/ci/testrun/script/test_framework/test_cmocka.py (L50-L55)
2025-01-08 21:13:54 +08:00
Huang Qi
40bd8f9ad4 arch/risc-v: Make CPU index handling based on ARCH_RV_CPUID_MAP
This patch refactors the CPU index handling in the RISC-V architecture to be based on the ARCH_RV_CPUID_MAP configuration.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-08 13:48:00 +02:00
cd83dc1317 CI: Increase CI Jobs to 100% for Complex PRs
This PR increases the CI Jobs for Complex PRs from 50% to 100%, as explained here:
- https://github.com/apache/nuttx/issues/15451#issuecomment-2576576664
2025-01-08 15:05:18 +08:00
jerryslhao
1bcaacd5cc arch/arm/stm32: fix stm32g4 enable pll code.
In the file stm32g474xxxx_rcc.c, the enable PLL
code, according to the intent of the comment,
wants to keep the reserved bit, but the code
clears the reserved bit.

Signed-off-by: jerryslhao <jerryslhao@gmail.com>
2025-01-08 10:41:22 +08:00
hujun5
fabf4a5142 fix compile error
Error: /github/workspace/sources/nuttx/include/nuttx/spinlock_type.h:57:3: error: unknown type name 'atomic_t'
368   57 |   atomic_t owner;
369      |   ^~~~~~~~
370Error: /github/workspace/sources/nuttx/include/nuttx/spinlock_type.h:58:3: error: unknown type name 'atomic_t'
371   58 |   atomic_t next;
372      |   ^~~~~~~~

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-08 09:28:58 +08:00
hujun5
9d5ecc29d0 Revert "SEGGER_RTT_Conf.h: rm spin_lock_irqsave(NULL) in drivers/segger/config/SEGGER_RTT_Conf.h"
This reverts commit 5e7c640976.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-08 09:28:58 +08:00
Tiago Medicci Serrano
154a91c323 Documentation: Update Python documentation for socket module
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Update Python documentation after supporting Python's socket module
to reflect the commands used to run the RISC-V QEMU.
2025-01-08 09:27:25 +08:00
Tiago Medicci Serrano
6469e30671 rv-virt/python: Enable Python's socket module on defconfig
Enables the Python's socket module. This allows applications to be
built to interact with POSIX-compatible sockets.
2025-01-08 09:27:25 +08:00
Daniel P. Carvalho
ba32b61d2e arch/arm/stm32/: Fix I2C driver for STM32G4 devices. 2025-01-07 23:45:59 +08:00
Daniel P. Carvalho
3f3e6dd9b8 arch/arm/stm32/: Added enable/disable to timer low level ops. 2025-01-07 23:32:06 +08:00
YAMAMOTO Takashi
e5ac1c620e sim: Disable chained fixups for sim_macho_init.c
This is a workaround for https://github.com/apache/nuttx/issues/15208

Tested with:
    macOS 15.2
    x86-64
    Xcode 16.2
2025-01-07 23:28:30 +08:00
Zhe Weng
3e62be8361 net: Enable dynamic allocation of tcp/udp/ipfwd buffer by default
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-01-07 22:00:21 +08:00
Zhe Weng
50b3ab7671 net/bufpool: Call init automatically on alloc
Note: Initialize function of protocols (tcp, udp, pkt, etc.) are kept empty.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-01-07 22:00:21 +08:00
Zhe Weng
f702f1705f net/bufpool: Use SEM_INITIALIZER to init sem
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-01-07 22:00:21 +08:00
Filipe Cavalcanti
407a62a33a boards/xtensa: update Make.defs for linker scripts on ESP32|S2 2025-01-07 21:58:09 +08:00
Filipe Cavalcanti
91511ae280 boards/xtensa: merge MCUBoot and Simple Boot linker scripts on ESP32|S2 2025-01-07 21:58:09 +08:00
zhangshoukui
aef24f5f3c rename lib_pathbuffer to lib_tempbuffer
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-01-07 21:54:33 +08:00
rongyichang
553406e801 drivers/video: add BRGA8888 support for goldfish gpu fb
Some checks are pending
Build Documentation / build-html (push) Waiting to run
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2025-01-07 21:47:56 +08:00
Gao Feng
f64a48f4e5 cxx: size and un-size functions should be defined in one file
fix error when "-Werror=sized-deallocation" is enabled.

refer to https://timsong-cpp.github.io/cppwp/n4861/new.delete,
displace the default versions defined by the C++ standard library.
2025-01-07 21:45:59 +08:00
wangmingrong1
c5655d5a11 arm64/tbi: Unified TBI flags for MTE and software kasan
The TCMA flag is not critical, it will be set separately in "arm64_mte.c"

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-07 21:44:18 +08:00
Jani Paalijarvi
dd4ee256c3 arch/risc-v/src/mpfs/mpfs_ethernet.c: Set correct return value
Return error in case of mpfs_i2cbus_initialize() failure.

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2025-01-07 21:42:00 +08:00
Jani Paalijarvi
e1fb0b30c4 drivers/net/ksz9477.c: Check return values in init
Check that writes to configuration registers success.

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2025-01-07 21:42:00 +08:00
simbit18
0641e6f287 [DOC] implementation/simulation.rst: Removed the execute permissions. 2025-01-07 21:40:40 +08:00
simbit18
aaef87e5b6 Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
2025-01-07 21:39:50 +08:00
wangjianyu3
350f396aa5 drivers/sensors/gnss: Fix integer overflow error
CID 1309501: (#1 of 1): Overflow constant (INTEGER_OVERFLOW)
overflow_const: Expression upper->crefs, which is equal to 255, where enable ? 1 : -1 is known to be equal to -1, overflows the type that receives it, an unsigned integer 8 bits wide.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-07 21:38:17 +08:00
buxiasen
7e0e4dea75 arm/irq.h: fix ARCH_ARM7TDMI missing up_getusrsp after move to irq.h
Causing c5471evm/httpd ci break.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-01-07 14:29:32 +08:00
Gao Feng
55da7d89b5 xtensa/esp32s3: porting of spi_flash_chip_generic_write_encrypted from ESP-IDF 2025-01-07 12:18:43 +08:00
Kyle Wilson
4bd2c0443b Preliminary add of fdcan source files.
Some checks are pending
Build Documentation / build-html (push) Waiting to run
Adding source files to the fdcan branch based on identical register set. These files should mostly just work.

Removed references to FDCAN3. H5 only has 2 FDCAN interfaces.

Add basic FDCAN Kconfig

FDCAN Kconfig options

Added various options for FDCAN mode, FDCAN bitrate, clock selection and division, and timing.

Added bit timing config options (nominal and data). Added stm32h56xxx pin mappings.

Fixed Data Bit Timing. Pulled in STM32H5_FDCAN_PDIV_VALUE. Added stm32_fdcan.c to Make.defs. Added DBITRATE to Kconfig

Clock source changes to FDCAN

Moved the setting of the clock source to the stm32h5xx_rcc.c file. Added notes to stm32_fdcan.c that STM32_FDCAN_FREQUENCY and STM32_FDCAN_PDIV should be set in board.h

Change STM32H5_FDCAN_PDIV to STM32_FDCAN_PDIV

Updated Kconfig to match G4 implementation. Removed stm32_fdcan_sock for now.

Removed FDCAN3 from stm32_fdcan.h

incomplete changes for bit timning

Set NBRP and DBRP registers based on STM32H7 FDCAN socket algorithm.

Added board file for initializing 1 can device. Will update later to initialize second device.

Fixed ifdefs. Changed STM32 to STM32H5.

Add some can testing changes.

Added option to configure bit timing, with automatic bit timing set as default.

Style fixes

Fixed FDCAN2 and memory access issues

FDCAN2 msgram offset was wrong by 1 word (4 bytes). I removed the + 4 at the end of the definition. This fixed the issues with fdcan2. Also changed ifdefs when setting ESI, FDF, and BRS bits. When CAN FD was used, this resulted in the first command after the endif (the setting of dest at line 2325) being skipped because it was included in the else block when it shouldn't have. This resulted in exceptions. Adjust ifdefs fixes this problem. Other minor fixes.

Restoring board files to upstream versions. These files will be pulled in later in a separate pull request. stm32h5_fdcan_test branch created for this.

Fixed Queue Mode Transmit

The can driver checks the TFFL bits in the TXFQS register. In Queue mode, this always returns 0. As a result, fdcan_txempty was always returning false, which resulted in no transmissions. This code fixes that.

Add stm32h5 fdcan chardriver to Make.defs
2025-01-07 01:05:23 +08:00
Eren Terzioglu
6eabe35a60 esp32[h2]: Fix esp32h2 get mac address issue 2025-01-07 01:03:44 +08:00
Eren Terzioglu
5e2fc181c2 tools/Unix.mk: Add host_info target to print nxdiag output
Nxdiag examples scripts  modified to print system information
without building and flashing nxdiag application to get report
about system without reflash or reconfigure.
2025-01-07 01:03:44 +08:00
hujun5
57e54b399b sched: remove all spin_lock_irqsave(NULL)
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-06 23:11:44 +08:00
hujun5
4e563e3a86 SEGGER_RTT_Conf.h: rm spin_lock_irqsave(NULL) in drivers/segger/config/SEGGER_RTT_Conf.h
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-06 23:07:58 +08:00
hujun5
62566734a4 rp23xx_pio.c: rm spin_lock_irqsave(NULL) in arch/arm/src/rp23xx/rp23xx_pio.c
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-06 23:07:58 +08:00
hujun5
57ca4e1789 up_rtc_gettime: add spinlock to protect up_rtc_gettime
reason:
We have removed the critical section protection
for the up_rtc_gettime function in common code.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-06 23:07:58 +08:00
buxiasen
89455bc9a1 arch: up_getusrsp change to inline and implement in irq.h
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-01-06 23:03:05 +08:00
buxiasen
1358942132 arch/tricore: move tricore_csa2addr from internal.h to arch.h
Make up_getusrsp possible move to irq as depends on tricore_csa2addr

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-01-06 23:03:05 +08:00