Commit graph

2154 commits

Author SHA1 Message Date
Xiang Xiao
2c9f91526a board: enable LTO on g431 nsh boards and fix LTO link with toolchain switch
For boards b-g431b-esc1/nsh, nucleo-g431kb/nsh and nucleo-g431rb/nsh,
the `.data` section of nuttx.elf overflows the 128 KB flash region by a
few hundred bytes on default GNU EABI builds:

    arm-none-eabi-ld: nuttx section `.data' will not fit in region `flash'
    arm-none-eabi-ld: region `flash' overflowed by 296 bytes

Enabling CONFIG_LTO_FULL=y in the corresponding defconfigs brings flash
usage back below the 128 KB limit (~93%).

Additionally, fix arch/arm/src/cmake/gcc.cmake so that when LTO is
enabled it always uses the gcc-ar / gcc-nm / gcc-ranlib wrappers, not
just when CONFIG_ARM_TOOLCHAIN_GNU_EABI is also set.  CI tooling (via
tools/testbuild.sh) configures cmake first, then flips the toolchain
choice in .config with kconfig-tweak before running `cmake --build`.
With the previous "ARM_TOOLCHAIN_GNU_EABI && !LTO_NONE" guard the
regen step would switch to plain `ar` for the .a files, even though the
linker driver picked at configure time is still arm-none-eabi-g++ and
the object files contain GCC LTO IR.  The result was a flood of
"undefined reference to `printf' / `free' / `puts' ..." link errors
when running tools/testbuild.sh -A -N -R on the *_CLANG variants.

Now that we are inside gcc.cmake the toolchain is unambiguously GCC,
so dropping the redundant CONFIG_ARM_TOOLCHAIN_GNU_EABI conjunct keeps
the LTO-aware ar wrappers in place across kconfig-tweak toolchain
switches.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-19 16:21:28 +08:00
ImBonkers
be30590504 arch/arm/stm32n6: Add STM32N6 chip support.
Introduce minimal chip support for the STMicro STM32N6 family
(Cortex-M55, ARMv8.1-M with TrustZone and FPU), sufficient to bring
up an NSH console over USART1.

Scope (deliberately minimal first drop):

  - Chip selector ARCH_CHIP_STM32N6 wired into arch/arm/Kconfig and
    chip-name mapping ("stm32n6").
  - Sub-Kconfig under arch/arm/src/stm32n6 with the STM32N657X0 chip
    selector and a single user-selectable USART (USART1).
  - Boot path: stm32_start with a naked dispatcher that clears the
    boot-ROM MSPLIM/PSPLIM stack limits before any compiler-emitted
    prologue, then runs vector relocation and SRAM-only heap init.
    The chip runs entirely in the Secure state; SAU is left in its
    reset configuration.
  - PLL1-based clock tree fed from HSI64 targeting 200 MHz CPU, with
    USART1 kernel-clock routed to HSI for a predictable BRR that is
    independent of any later clock change.
  - Low-level USART driver with full serial framework support.
    stm32_serial.c is adapted from arch/arm/src/stm32h5/stm32_serial.c
    (sibling ARMv8-M Mainline port with the same USART IP), stripped
    of DMA-RX, LPUART, the per-USART2..5 plumbing, RS-485 driver-enable,
    TIOCSINVERT/SWAP and HALFDUPLEX paths.
  - SysTick system timer.
  - GPIO, PWR and RCC helpers.

TrustZone, MPU, I/D-cache and Helium (MVE) are left disabled to
minimise bring-up surface; these will be added in follow-up patches
alongside the drivers that need them.

Signed-off-by: ImBonkers <samuelnlinden@pm.me>
2026-05-18 14:50:29 -03:00
Agnimitra sasaru
7a04cddb78 build: clean previous compiled files after menuconfig updates
Fixes #16151. Compares .config state before and after kconfig-mconf and triggers 'make clean' if the configuration was modified to prevent orphaned object files.

Signed-off-by: Agnimitra sasaru <158492301+HyphenAlpha456@users.noreply.github.com>
2026-05-18 22:00:05 +08:00
Jiri Vlasak
f8289b2e29 tools: Update note about first line of a block
When checking the first line of a block, the returned value is
incremented by one.

This commit updates doc to explain why.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-05-18 21:53:54 +08:00
Liam Hickey
13ba91a33f arch/*/src/Makefile: Avoid uncessary relinking of the nuttx binary.
The goal is to only execute recipes when there is an actual change in
the prerequisites.

There are several issues which cause the nuttx binary target to be
re-made every time the top level make is run.

1. Previously the target nuttx$(EXEEXT), was used, but make resolved
this in the relative directory make -C $(ARCH_SRC), and couldn’t find
it (need an absolute path: `$(TOPDIR)/..).

2. The .tmp prerequisite for nuttx was always deleted

3. libboard's recipe had a sub-make which may or may not update that
target. This was a phony target, and was therefore always considered out
of date.

These issues were causing the nuttx recipe to be run every make, which
was hiding some missing prerequisites:

1. the .config is a prerequisite for the .tmp target
2. libapps.a (and other linklibs) are pre-requisites for nuttx

Changes:

The changes are only in the build system, and only for arm.

Track nuttx$(EXEEXT) via vpath so Make knows when it's already up to
date without an explicit path. Add $(TOPDIR)/.config as a dependency
to the linker script preprocessing so config changes trigger
re-preprocessing.

Keep the .tmp linker script on disk (clean already removes it) so
timestamp-based dependency checking works across builds. These .tmp
files need to be added to the gitignore or the CI will complain.

Use FORCE pattern for board/libboard to ensure it's always checked
but use the actual library file as the link dependency so nuttx is
only re-linked when library content changes. Add staging libs as
dependency to nuttx link rule so changed app libs trigger re-link.

Signed-off-by: Liam Hickey <williamhickey@geotab.com>
2026-05-18 09:33:58 +02:00
simbit18
6f46d0e932 ci/platform: Fix the “Repository not found” error for kconfig-frontends
MSYS2
Fix
Repository not found
https://bitbucket.org/nuttx/tools.git

Now use URL https://github.com/patacongo/tools

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-05-17 07:44:48 +08:00
Daniel Fanache
8b988e8bd9 tools/Config.mk: eval compiler include-prefix detection only once
Three `export VAR ?= $(shell ...)` assignments cause GNU make to
re-run the embedded ${shell ...} every time the variable is exported
to a recipe's environment.  That spawns `tools/incdir` and
`tools/define` once per recipe, serialised through the master make
thread, which adds per recipe overhead to multi-job builds.

Wrap each with `ifeq ($(origin VAR),undefined)` + `:=` so the shell
call runs once at parse time while preserving the override semantics
of `?=`.

Measured impact on a 20-core build host is a ~26% speedup of wall
time.

Signed-off-by: Daniel Fanache <dan@rts.ro>
2026-05-12 16:34:52 +08:00
Serg Podtynnyi
9c1b2e12ce tools:mksyscall fix compilation warning
mksyscall.c:145:19: warning: initialization discards ‘const’ qualifier
from pointer target type [-Wdiscarded-qualifiers]
  145 |   char *pactual = strchr(arg, '|');
      |                   ^~~~~~
Change to use const char* on pointers

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2026-05-09 09:42:58 +08:00
Peter Bee
7771cbd0d0 sim: fix mkallsyms for Objective-C symbols on macOS
/Library/Developer/CommandLineTools/usr/bin/c++filt: error: unknown argument '-['

Signed-off-by: Peter Bee <bijunda@bytedance.com>
2026-05-08 19:51:39 +08:00
simbit18
9035fba275 ci/testlist/risc-v-02.dat: Added boards build with CMake
-  Boards build by CMake

    esp32c3-xiao

    esp32-c3-zero

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-22 06:22:36 +08:00
simbit18
ce7326bf14 testbuild.sh: CMake Added -DNXTMPDIR
- It is now possible to create folder for third-party packages in CMake as well. (Aligned with Make)

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-22 06:22:36 +08:00
Lup Yuen Lee
3e570aa219 CI: Remove corrupted downloads for build retry
We have implemented CI Build Retry for mitigating Download Failures. But right now it will reuse any Corrupted Downloads (instead of deleting them), which will cause CI Build Retry to fail repeatedly: https://github.com/apache/nuttx/actions/runs/24611381081/job/71966407518#step:10:627

```
Ignored files: system/argtable3/v3.2.0.7402e6e.tar.gz
gzip: stdin: not in gzip format
make[3]: *** [Makefile:76: argtable3] Error 2
```

This PR proposes to change `git clean -fd` to `git clean -xfdq`. This will remove any Corrupted Downloads, preventing their reuse for CI Build Retry:

```bash
## Simulate a corrupted download for argtable3
$ tools/configure.sh qemu-armv8a/netnsh
$ Downloading v3.2.0.7402e6e.tar.gz--argtable3
## Press Ctrl-C to stop the build

## `git clean -fd` won't remove the corrupted download
$ cd ../apps
$ git clean -fd
$ find . -name "v3.2.0.7402e6e.tar.gz"
./system/argtable3/v3.2.0.7402e6e.tar.gz

## `git clean -xfdq` removes the corrupted download
$ git clean -xfdq
$ find . -name "v3.2.0.7402e6e.tar.gz"
## Corrupted download is deleted correctly
```

`git clean -xfdq` is also found in the same testbuild script, so we are using it consistently:

12e8f92a28/tools/testbuild.sh (L286-L291)

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2026-04-19 14:21:58 +08:00
simbit18
de87075134 tools/CMakeLists.txt: Add mkpasswd binaries
- Add mkpasswd binaries

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-16 01:45:48 +08:00
Lup Yuen Lee
12e8f92a28 CI: Retry build upon failure
In Jan-Feb 2026: NuttX CI hit a [record high usage of GitHub Runners](https://github.com/apache/nuttx/issues/17914), exceeding the limit enforced by ASF Infrastructure Team. We analysed the PRs and discovered that most GitHub Runners were wasted on __(1) Failure to Download the Build Dependencies__ for DTC Device Tree, OpenAMP Messaging, MicroADB Debugger, MCUBoot Bootloader, NimBLE Bluetooth, etc __(2) Resubmitting PR Commits__:

- [Video: Analysing the Most Expensive PR](https://youtu.be/swFaxaTCEQg)
- [Video: Second Most Expensive PR](https://youtu.be/uSpQkzBogEw)
- [Video: Third Most Expensive PR](https://youtu.be/J7w1gyjwZ1w)
- [Video: Most Expensive Apps PR](https://youtu.be/182h8cRpfvI)
- [Spreadsheet: Most Expensive PRs](https://docs.google.com/spreadsheets/d/1HY7fIZzd_fs3QPyA0TX7vsYOjL86m1fNOf1Wls93luI/edit?gid=70515654#gid=70515654)

Why would __Download Failures__ waste GitHub Runners? That's because Download Failures will terminate the Entire CI Build (across All CI Jobs), requiring a restart of the CI Build. And the CI Build isn't terminated immediately upon failure: NuttX CI waits for the CI Job to complete (e.g. arm-01), before terminating the CI Build. Which means that CI Builds can get terminated 2.5 hours into the CI Build, wasting 2.5 elapsed hours x [7.4 parallel processes](https://lupyuen.org/articles/ci3#live-metric-for-full-time-runners) of GitHub Runners.

This PR proposes to __Retry the Build for Each CI Target__. NuttX CI shall rebuild each CI Target (e.g. `sim:nsh`), upon failure, up to 3 times (total 4 builds). Each rebuild will be attempted after a Randomised Delay with Exponential
Backoff, initially set to 60 seconds, then 120 seconds, 240 seconds. The rebuilds will mitigate the effects of Intermittent Download Failures that occur in GitHub Actions. (And eliminate developer frustration)

If the build fails after 3 retries: Subsequent CI Targets will __not be allowed to rebuild__ upon failure. This is to prevent cascading build failures from overloading GitHub Actions, and consuming too many GitHub Runners.

Note that NuttX CI shall retry the build for __Any Kind of Build Failure__, including Download Failures, Compile Errors and Config Errors. We designed it simplistically due to our current constraints: (1) Lack of CI Expertise (2) NuttX CI is Mission Critical (3) Legacy CI Scripts are Highly Complex. To prevent Compile Errors and Config Errors: We expect NuttX Devs to [Build and Test PRs in Our Own Repos](https://github.com/apache/nuttx/issues/18568), before submitting to NuttX.

What about __Resubmitting PR Commits__ and its wastage of GitHub Runners? We also require NuttX Devs to [Build and Test PRs in Our Own Repos](https://github.com/apache/nuttx/issues/18568), before resubmitting to NuttX. GitHub Runners will then be charged to the developer's quota, without affecting the GitHub Runners quota for Apache NuttX Project. We plan to [Kill All CI Jobs](https://youtu.be/182h8cRpfvI?si=MmAuwLISZPPMoqDq&t=1479) for PRs that have been switched to Draft Mode. We'll monitor this through the [NuttX Build Monitor](https://github.com/apache/nuttx/issues/18659).

Modified Files:

`tools/testbuild.sh`: We introduce a New Wrapper Function `retrytest` that will call the Existing Function `dotest`, to build the CI Target and retry on error.

`Documentation/components/tools/testbuild.rst`: Updated the `testbuild.sh` doc with the Retry Logic.

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2026-04-15 12:30:17 +02:00
simbit18
9fd11a01d5 tools/Unix.mk: fix Untracked files defconfig.tmp-e on macOS
fix

On branch fix_sim_mac
Your branch is up to date with 'origin/fix_sim_mac'.

Untracked files:
	defconfig.tmp-e

nothing added to commit but untracked files present

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-15 17:10:22 +08:00
Abhishek Mishra
ab6b1fd6f9 !build: add build-time password generation with mkpasswd tool.
Introduce mkpasswd, a pure-C host tool for generating encrypted password
files at build time using TEA encryption. This enables secure,
credential-free firmware images while allowing build-time password
configuration.

Changes:
* Add mkpasswd.c host tool for TEA-based password hashing and encryption
* Integrate mkpasswd into Make build system (tools/Makefile.host)
* Add CMake support for mkpasswd compilation and ROMFS passwd generation
* Add CONFIG_BOARD_ETC_ROMFS_PASSWD_* configuration options to Kconfig
* Implement credential exclusion from defconfig to prevent password leaking
* Update savedefconfig.cmake to strip sensitive credentials
* Fix mkdir() portability for Windows Native builds (CONFIG_WINDOWS_NATIVE)
* Change default username from "admin" to "root" (POSIX convention)
* Improve build-failure error message with full menuconfig navigation path

BREAKING CHANGE: Boards enabling CONFIG_BOARD_ETC_ROMFS_PASSWD_ENABLE
must set CONFIG_BOARD_ETC_ROMFS_PASSWD_PASSWORD to a non-empty string
of at least 8 characters. The build now fails with an explicit error if
this config is left empty. To fix: run 'make menuconfig' and navigate to:
  Board Selection --->
    Auto-generate /etc/passwd at build time --->
      Admin password

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-04-14 16:06:30 +08:00
simbit18
944ba20a69 tools/ci: Added esptool for Windows Native
- Added esptool for Windows Native

- Added build for esp32-c3-zero

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-13 23:55:10 +08:00
simbit18
f20084225e ci/platforms/linux.sh: bump Espressif esptool
- Bump Espressif esptool 5.2.0

   #18696

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-10 14:34:28 -03:00
simbit18
c585e97a1b ci/platforms/ubuntu.sh: bump Espressif esptool
- Bump Espressif esptool 5.2.0

   #18696

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-10 14:34:28 -03:00
simbit18
f8621bc0a1 ci/platforms/darwin_arm64.sh: bump Espressif esptool
- Bump Espressif esptool 5.2.0

   #18696

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-10 14:34:28 -03:00
simbit18
8500421d97 ci/platforms/darwin.sh: bump Espressif esptool
- Bump Espressif esptool 5.2.0

   #18696

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-10 14:34:28 -03:00
Filipe Cavalcanti
46d2b59666 tools/ci: upgrade esptool on CI Dockerfile
Upgrades esptool from v4.8.dev4 to v5.2.0, enabling support for newer chips.
Also adds 'upgrade pip' to allow this upgrade.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-04-09 22:56:42 +08:00
zhangyuan29
895a9423ee tools/mksyscall: fix union illegal type for cast
Some compilers (e.g., Tasking) do not allow forced type casting of
unions. When CONFIG_ARCH_TOOLCHAIN_TASKING is enabled, replace the
direct cast with memcpy to copy the union parameter into a local
variable, avoiding the illegal cast while preserving the correct
behavior. Other compilers still use the original cast approach.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2026-04-08 18:38:39 +08:00
Piyush Patle
13d0e64ee6 style: fix checkpatch issues after debug.h move
Fixed copespell errors, for CI sucess!

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-07 07:50:06 -03:00
Filipe Cavalcanti
b5b7e8f72e arch/espressif: add flash encryption support on CMake
Add support for burning flash encryption E-Fuses on target.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-04-02 13:16:54 +08:00
Filipe Cavalcanti
e59604bbe6 tools/espressif: add support for target flashing using CMake
Support flashing target using cmake --build <build> -t flash.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-04-02 13:16:54 +08:00
Filipe Cavalcanti
ed217f8f3f arch/risc-v: add CMake support for Espressif RISC-V devices
Adds CMake build support. Touches arch and board at the same time to avoid
creating a commit that is not able to build.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-04-02 13:16:54 +08:00
likun17
6123cc3cbe nuttx/arch/risc-v/src/common/espressif: add 32MB flash size option
Add ESPRESSIF_FLASH_32M Kconfig option and the corresponding
esptool flash size mapping in Config.mk to support boards with
32MB NOR flash.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-03-30 16:46:29 +02:00
trns1997
219a5ce09e build/cmake/stdlib: guard include/cxx by LIBMINIABI, fix div_t conflict
include/cxx contains NuttX's mini C++ ABI shims and must only be added
to the include path when CONFIG_LIBMINIABI is selected.  tools/Config.mk
was adding it unconditionally for every non-LIBCXX/non-UCLIBCXX build,
and the platform.cmake files for arm, arm64, risc-v, x86_64 and tricore
were adding it inside the CONFIG_LIBCXXTOOLCHAIN block.

With an unpatched downloaded ARM GNU Toolchain, <cstdlib> uses
newlib's stdlib.h, defining div_t as an anonymous struct.  A later
inclusion of NuttX's stdlib.h via <cstdio>->stdio.h->kmalloc.h then
redefines div_t with struct tag div_s, causing a conflicting declaration
error.

Guard the div_t/ldiv_t/lldiv_t definitions in stdlib.h with
redefinitions when a toolchain stdlib.h was already processed.

Also fix lldiv_s members typed as long instead of long long.

Signed-off-by: trns1997 <trns1997@gmail.com>
2026-03-29 16:45:29 -03:00
Tiago Medicci Serrano
c64b95ccbf ci: split xtensa jobs into three separate jobs (instead of two)
This is necessary because new defconfig were recently added to
Xtensa-based Espressif SoCs and the build job may exceed 2 hours.
In order to avoid increasing job timeout, a specific job for each
supported SoC (ESP32, ESP32-S2 and ESP32-S3) was created instead.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2026-03-28 06:14:34 +08:00
Huang Qi
e3eeaefd6d style: Fix "the the" typo across the codebase.
Fix 269 occurrences of duplicate "the" word typo found in 209 files
across source code, header files, and configuration.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-03-23 11:07:49 +01:00
simbit18
71709d487b tools/ci/testlist: skip the build of bl602evb:elf
This bl602evb:elf configuration has caused job risc-v-01 to fail on several occasions.

riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory

https://github.com/apache/nuttx/pull/17792

Added -bl602evb:elf to the risc-v-01.dat file to skip the build.

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-03-18 15:23:28 -04:00
Xiang Xiao
fe217e533b tools/stackusage.py: use toolchain binaries instead of Python libraries
Replace pyelftools and capstone Python library dependencies with
subprocess calls to standard toolchain binaries (readelf, objdump,
addr2line). This eliminates all external Python package requirements,
removes manual DWARF parsing, and reduces the code from 818 to 563
lines.

Works with both GNU and LLVM toolchains via the -p/--prefix option:
  -p arm-none-eabi-  (GCC cross-compiler)
  -p llvm-           (LLVM/clang toolchain)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-03-17 11:26:44 -03:00
simbit18
76fe46a6db tools/testbuild.sh: Added a break to the dotest Blacklist and CMake loop
Added break to the dotest Blacklist and CMake loop: it stops at the first match instead of continuing unnecessarily.

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-03-17 10:28:48 +08:00
zhangyu117
72be575b1a arch/tricore: support tc4evb board.
add new chip named tc4xx and board tc4evb

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-03-10 10:38:19 +01:00
Tiago Medicci Serrano
cda4af9f00 arch/risc-v/espressif/esp32p4: Support ESP32-P4 on NuttX
This commit adds support for the Espressif's RISC-V-based ESP32-P4
chip along with its ESP32-P4-Function-EV-Board board.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2026-03-09 21:40:25 +01:00
Arjav Patel
a1b13c99f7 tools/checkpatch.sh: Enhance stdin support for patch checking
- Added functionality to read patch content from stdin when using the '--stdin' option with the '-p' flag.
- Updated usage instructions to clarify the new stdin option for patch checks.
- Improved error handling for unsupported combinations of options.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-03-09 11:08:52 +08:00
Arjav Patel
1d514dab1a github/workflows/check.yml: Enhance checkpatch for breaking change labels
- Updated the check workflow to conditionally include a '-b' option for breaking change enforcement based on PR labels.
- Modified the checkpatch script to support reading commit messages from stdin when using the '-m -g' flags.
- Improved usage instructions to clarify the new stdin option for commit message checks.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-03-09 11:08:52 +08:00
Arjav Patel
56f0da2efe tools/checkpatch.sh: Add support for breaking change commit message enforcement
- Introduced a new flag '-b' to enforce breaking change format in commit messages.
- Added checks to ensure that breaking change commits start with '!' and contain 'BREAKING CHANGE:' in the body before 'Signed-off-by'.
- Updated usage instructions to reflect the new breaking change option.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-03-09 11:08:52 +08:00
p-szafonimateusz
9ab5781856 CI: allow ntfc tests for cmake builds
allow ntfc tests for cmake builds

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2026-03-03 20:54:12 +08:00
Arjav Patel
e2f3950d45 libc: add support for C23 stdbit.h with bit manipulation macros
- Introduced Kconfig options for stdbit.h, allowing architecture-specific and generic implementations.
- Added new documentation for stdbit.h, detailing its usage and configuration.
- Updated CMake and Makefile to handle the inclusion of stdbit.h based on configuration settings.

This enhances the NuttX library with optional C23 bit manipulation utilities, improving functionality for architectures that support it.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-03-02 09:09:40 -03:00
guoshengyuan1
2dae11461d nxgdb: change the symbol g_statenames to nxsched_get_stateinfo::g_statenames
I0680e48d8ff8847c8712e1a54efe32d320e7c84d changes the scope of the symbol definition.
So nxgdb needs to synchronize this modification.

Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2026-03-02 08:06:18 -03:00
Lars Kruse
2cca9a2bdf pynuttx: update
Commit 6ed4ea63d renamed the function `mm_initialize` to
`mm_initialize_heap`.

This caused the pynuttx modules (e.g. `mm dump`) to be missing.

Signed-off-by: Lars Kruse <devel@sumpfralle.de>
2026-03-02 10:25:21 +08:00
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
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