2111 Commits

Author SHA1 Message Date
Adwait Godbole
83c11b29a9 tools: fix make host_info flag parsing and config string escaping
Fix incorrect flag handling and string escaping in the `make host_info`
diagnostic target.

Previously, CFLAGS, CXXFLAGS, and LDFLAGS were passed in a form that caused
improper splitting and quoting, which resulted in malformed output and
incorrectly escaped configuration values such as CONFIG_APPS_DIR.

This change ensures that:
- Compilation flags are passed as proper shell strings
- Flags are split correctly using shlex
- Configuration values are escaped exactly once when generating sysinfo.h
- Parsed output matches the contents of the .config file

This change affects diagnostic output only and does not modify the NuttX
build process or generated binaries.

Signed-off-by: Adwait Godbole <adwaitngodbole@gmail.com>
2026-02-05 14:23:19 +01:00
wangzhi16
a06ac14988 tools/nxstyle: add phy62xx/uart.c into style white list
To skip the style issue:
Error: /home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/phy62xx/irq.c:194:5: error: Mixed case identifier found
Error: /home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/phy62xx/irq.c:196:5: error: Mixed case identifier found
Error: /home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/phy62xx/irq.c:199:5: error: Mixed case identifier found
Error: /home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/phy62xx/phyplus_wdt.c:61:28: error: Mixed case identifier found
Error: /home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/phy62xx/phyplus_wdt.c:104:2: error: Mixed case identifier found
Error: /home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/phy62xx/phyplus_wdt.c:162:50: error: Mixed case identifier found

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-02-02 21:17:20 +08:00
anjiahao
adddfc3bfd abi_check.py:Check ABI compatibility between different ELF versions.
1. The input consists of multiple static libraries and an ELF file. The tool searches
   for external APIs used by the static libraries, then locates these API function signatures
   in the ELF file, and outputs the results as a JSON file.
2. Using the first feature, with the static libraries unchanged,
   the tool can take a new ELF file and an old ELF file as input, output two JSON files,
   and compare the function signatures of functions with the same name in the two JSON files.
   The comparison includes return values, parameters, and if they are structures,
   it also compares the structure size, member offsets, member types, etc.
3.When the input is a single ELF file, the tool can check if structures with the same name have different members.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-28 18:32:39 +01:00
yukangzhi
9bda244be8 tools/parsetrace.py: Fix get_typesize bug in parsetrace.py
Some checks failed
Build Documentation / build-html (push) Has been cancelled
For the following code, we need to check 'type_attr.form'.
type_attr = DIE.attributes["DW_AT_type"]
base_type_die = dwarfinfo.get_DIE_from_refaddr(xxx)

When type_attr.form==DW_FORM_ref_addr, 'type_attr.value' means
global reference (across compilation units).

When type_attr.form==DW_FORM_ref4, 'type_attr.value' means
local reference (within the same compilation unit).

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-26 23:22:41 +01:00
liwenxiang1
9d5e83b411 gdbserver.py:add x86_64 arch
Add x86_64 support, we can use it to analysis of x86_64 crashes

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-24 23:31:43 +08:00
anjiahao
73aa7391a9 gdbserver.py: use lief inside of pyelftools to improve load speed
test:
an elf have 273MB, load symbol 32s to 2s

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-24 23:31:43 +08:00
anjiahao
3833dea6a4 gdbserver.py: if thread < 0, need set to 0
Fix unexpected thread values

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-24 23:31:43 +08:00
buxiasen
4063f4b207 tools/gdbserver: compatible with vscode, c command should cut from [2:
Fix use in vsocode

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-24 23:31:43 +08:00
anjiahao
218fe2c53b gdbserver.py:add unpack_data log info to debug
Improve debug

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-24 23:31:43 +08:00
hujun5
5051721298 sched/pthread: move pthread mutex from syscall to user-space
Move pthread mutex operations from kernel-space syscall
interface to user-space implementations
to reduce syscall overhead. Relocate mutex holder list
tracking from task control block (tcb) to
thread local storage (tls) to improve memory layout and
cache efficiency. Add helper macros for
conditional mutex implementations and update syscall
interface accordingly.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-22 12:40:49 -03:00
hujun5
a50737a75f tools/pynuttx/nxgdb: fix semaphore field access in debugging scripts
Fix incorrect direct access to semcount field by using val intermediate
field in memory pool and network stats debugging scripts. This corrects
the data structure navigation to match actual kernel semaphore layout.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-21 20:05:18 +08:00
xuxin19
98d4d887da msvc ci:change arm source to xpack
Try using Xpack to obtain the Windows toolchain to resolve CI/BB issues.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-21 19:19:39 +08:00
zhangyu117
4e40393cc4 arch/tricore: record trapinfo for coredump
use global var record trap type and reason info for coredump

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2026-01-15 16:09:13 -03:00
xuxin19
e9e9c76a76 cmake(enhance):include-style defconfig can modified via menuconfig
1. enhanced process_config.py script: supports both preprocess and postprocess modes

2. in preprocess mode: handles include formats and recursively records the include config tree structure to prepare for postprocess

3. In postprocess mode: compares the original file with menuconfig to identify non-#include items that should be written back

4. olddefconfig stores the original compressed include defconfig file at the very beginning

5. savedefconfig saves both the original file and the written back include defconfig

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-15 15:42:17 -03:00
zhangyu117
69ed5f54f3 tricore: remove up_set_current_regs/up_current_regs
add g_interrupt_context to to identify interruption context

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-01-15 11:37:12 +08:00
xuxin19
81d1126965 tools[feat]: add config check tool
[checkkconfig.py] is a tool that simulates the effects of modifying a CONFIG item,
Can be used to check whether my config changes are what I expected.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-14 17:50:18 +01:00
Huang Qi
8b3862d19b style: Fix case statement formatting in power management callbacks.
Remove unnecessary parentheses around case labels in switch statements
for power management callback functions. This fixes checkpatch style
violations for case statement formatting.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-01-10 12:59:14 -03:00
p-szafonimateusz
b88f86ba5d boards/citest: rename run scripts to run.sh
Executable files called "run" don't pass checkpath verification,
so we change the name to "run.sh"

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2026-01-04 09:40:12 -03:00
p-szafonimateusz
16d7fcb26c tools/testbuild.sh: export some variables for NTFC run script
export currently build configuration and path to artifacts
so these can be used by NTFC run script

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2026-01-04 09:40:12 -03:00
dongjiuzhu1
8c0850b0bd toos/scipts: add script to find symbol caller
Usage: ./tools/find_symbol_callers.sh <elf_file> <symbol_name> [source_root]

Examples:
  ./tools/find_symbol_callers.sh nuttx __aeabi_f2d
  ./tools/find_symbol_callers.sh nuttx malloc

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-31 08:47:23 -03:00
Laczen JMS
8896242b9d espressif: improve esp-hal-3rdparty handling
Reduce the downloads of esp-hal-3rdparty when using nxtmpdir to store
esp-hal-3rdparty and speedup compilation after `make distclean`.

Usage:
```
~/nuttxspace/nuttx/make distclean
~/nuttxspace/nuttx/./tools/configure.sh -l -S esp32-devkitc:nsh
~/nuttxspace/nuttx/make flash -j 8 ESPTOOL_PORT=/dev/ttyUSB0
~/nuttxspace/nuttx/picocom /dev/ttyUSB0 --baud 115200
```

Result:
```
load:0x40080000,len:30516
entry 0x40082880
*** Booting NuttX ***
dram: lma 0x00001020 vma 0x3ffb2020 len 0xe30    (3632)
iram: lma 0x00001e58 vma 0x40080000 len 0x7734   (30516)
padd: lma 0x00009598 vma 0x00000000 len 0x6a60   (27232)
imap: lma 0x00010000 vma 0x400e0000 len 0x11e50  (73296)
padd: lma 0x00021e58 vma 0x00000000 len 0xe1a0   (57760)
dmap: lma 0x00030000 vma 0x3f410000 len 0x2d3c   (11580)
total segments stored 6
WARNING: NuttX supports ESP32 chip revision >= v3.0 (chip is v1.0).
Ignoring this error and continuing because `ESP32_IGNORE_CHIP_REVISION_CHECK` is set...
THIS MAY NOT WORK! DON'T USE THIS CHIP IN PRODUCTION!

NuttShell (NSH) NuttX-12.8.0
nsh> uname -a
NuttX 12.8.0 edf89ddedd-dirty Dec 22 2025 09:21:37 xtensa esp32-devkitc
nsh>
Terminating...
```

Any new `make distclean` and configure for a different espressif device
no longer requires the downloading of modules or patching.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-12-27 11:38:13 +08:00
Luchian Mihai
172dd3959a docs/guides/lwl: move lwl's README.txt to lwl.rst
This PR moves the lwl's READEME.txt file to Documentation/guides/lwl.rst

Signed-off-by: Luchian Mihai <luchiann.mihai@gmail.com>
2025-12-23 15:20:06 +01:00
anjiahao
0e92053bd9 pynuttx:remove pthread_tcb_s cast
Just remove cast

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-22 17:55:45 +08:00
Tomasz 'CeDeROM' CEDRO
7069e77370 tools/nxtagspkgsfetch.sh: Fetch tags packages for NuttX and Apps.
This script downloads all NuttX RTOS and Application snapshot packages
from the upstream git repository based on the provided git tags list.
These are NOT official release packages as checkum will differ.

When launched from the local NuttX git repository clone the script will
obtain all available tags to be downloaded, otherwise list of tags needs
to be provided manually (or when just selected tag is required).
This script uses ``wget`` underneath, make sure this tool is installed.
Fetch log file is created with a timestamp in name next to the packages.

Having all tags packaged is important for changes comparison
between specific versions, testing a specific version, compatibility
checks, searching for a feature introduction timeline, etc.

Usage: `./nxtagspkgsfetch.sh [download_path] [tags_list_space_separated]`

You can provide optional download path (default `../../nuttx-packages`)
and tags list to get packages for (default all tags from local git clone).
When providing tags you also need to provide download path.

Documentation update contains new tool description (above).

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-12-17 08:12:44 -03:00
Filipe Cavalcanti
49d6177c68 espressif: automate build system for flash enc
Modifies Kconfig and build tools to support flash encryption
and E-Fuse burning when flash encryption is enabled.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-12-11 11:29:26 +01:00
Filipe Cavalcanti
3a74b82e09 arch/xtensa: flash encryption support for ESP32|S2|S3
Deprecates ESP32_STORAGE_MTD_ENCRYPT and ESP32_OTA_PARTITION_ENCRYPT options.
Add ESPRESSIF_SECURE_FLASH_ENC_ENABLED Kconfig option.
Updates SPI Flash driver to handle encryption automatically.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-12-11 11:29:26 +01:00
Filipe Cavalcanti
0835b345e8 arch/risc-v: flash encryption support for ESP32-C3|C6|H2
Add Kconfig option to enable flash encryption.
Default E-Fuse state is now VIRTUAL.
Modifies SPI Flash driver for encrypted operation.
Limitations:
- Requires MCUBoot
- Flash fully encrypted (no unencrypted MTD part. support)

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-12-11 11:29:26 +01:00
dependabot[bot]
dd5f562b58 build(deps): bump fonttools from 4.54.1 to 4.60.2 in /tools/pynuttx
Bumps [fonttools](https://github.com/fonttools/fonttools) from 4.54.1 to 4.60.2.
- [Release notes](https://github.com/fonttools/fonttools/releases)
- [Changelog](https://github.com/fonttools/fonttools/blob/main/NEWS.rst)
- [Commits](https://github.com/fonttools/fonttools/compare/4.54.1...4.60.2)

---
updated-dependencies:
- dependency-name: fonttools
  dependency-version: 4.60.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-10 22:43:44 +08:00
Yanfeng Liu
c38042941f arch/crt0.c: revert entry _start
This reverts crt0.c entry name to _start to fix LTO issue/17443,
needs apps/ side pull/3235.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2025-12-10 19:06:04 +08:00
simbit18
b749dfba23 ci/platforms: necessary changes for macos-15-intel and macos-14 Apple Silicon
macos-15-intel  and  macos-14 Apple Silicon
- bloaty()
   aligned with the latest version

macos-15-intel
 - avr_gcc_toolchain()
     Latest version not available for Intel,
     so it needs to be built from source, which takes over an hour.
     The latest version prebuilt for Intel is 9.4.0
     Added an workaround for installation.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-11-28 11:04:21 +08:00
simbit18
6161fececf tools/checkpatch.sh: Improved error display on GitHub
Some checks failed
Build Documentation / build-html (push) Has been cancelled
The improvement includes symbols that help employees visualise any errors detected during the PR check phase (check.yml).

Error ->  U+274C  Cross Mark
             https://en.wikipedia.org/wiki/X_mark

Checks pass -> ✔️ U+2714 Heavy Check Mark
             https://en.wikipedia.org/wiki/Check_mark

These characters are emojis that are recognized by the Unicode standards which define what each character represents.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-11-14 16:50:25 -03:00
wangchengdong
d8304979b4 tools/nxgdb: Add gdb and statenames for TSTATE_WAIT_EVENT
This patch add new taskstate entry in tools/pynuttx/nxgdb/thread.py
   and in sched_get_stateinfo.c/g_statenames for the new added task
   state: TSTATE_WAIT_EVENT

   test log is:
     nsh> ps
       PID  PPID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK            STACK    USED FILLED COMMAND
         0     0     0   0 FIFO     Kthread   - Ready              0000000000000000 0001008 0000196  19.4%  Idle_Task
         1     0     0 192 FIFO     Kthread   - Waiting  Semaphore 0000000000000000 0001984 0000016   0.8%  hpwork 0x70000100 0x7000014c
         2     0     2 100 FIFO     Task      - Running            0000000000000000 0002008 0000740  36.8%  nsh_main
         4     0     0 100 FIFO     Kthread   - Waiting  Event     0000000000000000 0000984 0000012   1.2%  event_wait_task

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-10-31 19:56:32 -03:00
trns1997
c705b278d1 cmake: Remove unused BUILD_OOTCPP guard from configuration.
Clean up the CMake configuration by removing the obsolete
`BUILD_OOTCPP` guard. This variable is no longer required
since out-of-tree build handling is now managed via the
enhanced `nuttx_add_subdirectory()` with EXCLUDE support.

* Simplifies CMake configuration command.
* Avoids redundant or unused build options.

Signed-off-by: trns1997 <trns1997@gmail.com>
2025-10-17 17:06:46 -03:00
Karel Kočí
29d44e5227 nxgdb: fix remote-register regular expression match
The code clearly expects the output of the 'maint print
remote-registers' to be indented by white-space character but at least
in my case it is not. This changes the match to consume any number of
white-space characters before it encounteres the register name.

Signed-off-by: Karel Kočí <cynerd@email.cz>
2025-10-16 12:48:31 +08:00
Filipe Cavalcanti
df6e5384fe arch/xtensa: update MCUBoot and virtual E-Fuse offset
Updates MCUBoot version and default address for virtual E-Fuse, depending
if MCUBoot is enabled.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-10-14 17:44:15 +08:00
simbit18
893cf19356 tools/ci/testlist: skip the build of <board>:cxxtest
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Problems downloading the uClibc++-0.2.5.tar.bz2 package

cURL error 60: SSL certificate expired

net::ERR_CERT_DATE_INVALID
Subject: cxx.uclibc.org

Issuer: R10

Expires on: 27 set 2025

This blocks the jobs:

- arm-12
- sim-02

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-28 12:47:09 -04:00
trns1997
d7b2df6d85 ci/cxx: Add out-of-tree build CI test.
Introduce a new CI test to validate out-of-tree builds
and prevent regressions in the `make export` workflow.
Specifically, this change adds `test-oot-build.sh` that:
* Builds NuttX using a selected configuration.
* Runs `make export` to generate the export package.
* Copies the `nuttx-export` to the OOT build project.
* Verifies that compilation and linking succeed.

Signed-off-by: trns1997 <trns1997@gmail.com>
2025-09-27 21:36:22 +08:00
simbit18
206d031bd5 tools/ci: Added CMake build for Raspberry Pi Pico on Windows Native
ci/platforms/windows.ps1 added:

  - pre-built picotool

  - pico-sdk

testlist/windows.dat:

  - Added the entry CMake,raspberrypi-pico:nsh

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-24 12:05:56 -03:00
simbit18
4c3dbed5b5 arm/rp2040: CMake build for Raspberry Pi RP2040 implemented
- CMake added board Raspberry Pi Pico

- Added the entry:

     CMake,raspberrypi-pico:bmp280

   to the file arm-06.dat.

- Moved the search for the Python 3 interpreter to the
  root CMakefile to avoid unnecessary repetition.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-24 14:42:27 +08:00
simbit18
ac47c9d41a ci/docker: add Raspberry Pi picotool and fix GN build
- Add prebuilt Raspberry Pi picotool

- fix GN build with:
     git checkout 5d0a4153b0bcc86c5a23310d5b648a587be3c56d

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-19 09:32:54 +08:00
trns1997
918505e13d build/export: Fix missing gnu-elf.ld copy and toolchain script.
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Fix missing `gnu-elf.ld` file copy during export generation
and update `toolchain.cmake` script to ensure proper toolchain
detection and configuration.
* Prevents build failures when exporting projects.
* Improves reproducibility of generated exports.

Signed-off-by: trns1997 <trns1997@gmail.com>
2025-09-14 10:44:51 +08:00
Matteo Golin
f8e5d07477 docs/codeowners: Add preliminary code owner file
This code owner file is auto-generated by the Python script in tools/
based off the git logs. It will allow new contributors to get better
auto-suggestions for which reviewers to request on their PRs. It also
creates an easy way to track down authors of certain NuttX subsystems
when refactors/changes are to be made.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-09-05 19:53:06 -04:00
wangchengdong
3629a3b5a1 tools/configure.sh: align tools/configure.sh with CmakeLists.txt
Add include patch to configure.sh when processing deconfig file to keep alignment with
 CmakeLists.txt

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-05 09:50:11 +08:00
Filipe Cavalcanti
42254ffcbe arch/risc-v: improve E-Fuse support for ESP32-C3|C6|H2
This commit fixes E-Fuse driver to get proper block and bit offset.
Also adds support for virtual and flash E-Fuses.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-09-03 09:01:44 -03:00
raiden00pl
4b1b3c58a0 tools/checkpatch.sh: fix check for HEAD commit
fix checkpath.sh usage for HEAD commit:

  ./tools/checkpatch.sh -c -u -m -g HEAD

regression after 93911d52a8

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-09-03 09:34:36 +08:00
raiden00pl
93911d52a8 tools/checkpatch.sh: check format for all commits in patch
If more than one commit is present in the patch, the commit format
must be checked separately for each commit in patch, otherwise not
all errors are detected.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-09-01 16:37:16 +02:00
raiden00pl
a6305fbf55 tools/checkpath.sh: check git commit format
check git commit format:

- line length less than 80 for commit title
- affected subsystem (detecting colon in commit title ":")
- Signed-off-by line
- blacklist [VELAPLATO-*, WIP:] string in commit body

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-08-29 22:25:18 +08:00
Côme VINCENT
c36d067603 tools/nix: move nix flakes to tools/
Some checks failed
Build Documentation / build-html (push) Has been cancelled
This commit moves the flake.lock and flake.nix files from root and
Documentation/ to the tools/ directory, according to @anchao's
suggestion in PR #16763.
Updates documentation to reflect this change.

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-28 10:04:01 +08:00
wangchengdong
be36d42da5 Cmake: add defconfig preprocess capability in Cmake build environment(recursively expand #include)
Add:
    cmake/nuttx_process_config.cmake
    tools/process_config.py

    Update nuttx/CMakeLists.txt to call process_config defined ini
    nuttx_process_config.cmake to process defconfig before actually using it
2025-08-25 20:30:16 +08:00
Niccolò Maggioni
86c466b6bc tools/rp{2040,23xx}: Ensure that picotool is found or built
Some checks failed
Build Documentation / build-html (push) Has been cancelled
The current logic failed silently on some systems, maybe because of a
different default shell? This resulted in builds that completed
successfully but generated invalid UF2 files, which were refused by
the uC bootloader.

Now the check is properly enforced and picotool is either found in
the $PATH or built from the pico-sdk source.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-22 00:30:28 +08:00