Commit graph

2042 commits

Author SHA1 Message Date
zhongzhijie1
8c4343c28b tools/checkpatch.sh: add -x option to auto-format Python files.
Currently only .py files are supported. Non-Python files will report "format not implemented".

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2025-07-07 23:43:41 +08:00
Antoine Juckler
eea2975b36 tools/process_config.sh: Fix sed errors
Ignore commented-out lines when deleting repeated defines in defconfig

Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
2025-07-03 09:41:56 -03:00
wangmingrong1
3648e5db3f gcov: Refactoring the implementation framework of gcov
All implementations of gcov are sunk to the kernel implementation
1. Support three dump modes: serial port output, single file output, standard output

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-07-03 00:17:58 +08:00
Filipe Cavalcanti
e57d2a5247 arch/risc-v: update lower-half drivers for ESP32-C3|C6|H2 2025-06-30 22:40:26 +08:00
Serg Podtynnyi
0883d664c4 ci/docker: bump risc-v toolchain
Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-06-28 17:54:52 +08:00
wangmingrong1
ecd6a1db1a ci/arm64: Enhance CI inspection
1. nsh_fiq: arm64 clang makefile
2. nsh_gicv2: arm64 clang cmake

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-27 20:44:41 +08:00
Filipe Cavalcanti
1a5f051fbf ci: update ESP32 Xtensa compiler version
Updates ESP32, ESP32S2 and ESP32S3 compiler version to 14.2.0 of 20241119.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-06-27 20:41:43 +08:00
simbit18
9f84695ef7 CI checkpatch: fix cvt2utf not found and add check of all necessary tools
check.yml:
   added missing cvt2utf installation
tools/checkpatch.sh
   Added checking all necessary tools and installation info  (more user-friendly)
2025-06-21 21:15:54 +08:00
Alan Carvalho de Assis
578d62b480 tools: Modify refresh.sh to support update all configs from a board
This modification will simplify the case where the developer wants
to update all board configs from a specific board.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-06-21 04:21:10 +08:00
simbit18
3cc7b29866 tools/testbuild.ps1: Windows fix the redirect error stream
Windows cmake fix the redirect error stream
2025-06-18 23:14:18 +08:00
xuxingliang
28b2e01c22 nxgdb: fix style issue
Fix style issue reported after upgrading flake8 to 7.2.0

1 file would be left unchanged.
/home/nuttx/tools/pynuttx/nxgdb/utils.py:237:5: F824  is unused: name is never assigned in scope
    global g_type_cache
    ^
/home/nuttx/tools/pynuttx/nxgdb/utils.py:294:5: F824  is unused: name is never assigned in scope
    global long_type
    ^

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-06-13 20:37:04 +08:00
chenzhijia
341292064d nxgdb/utils.py: Fix source gdbinit.py script error report
Registering NuttX GDB commands from /home/mi/code/stable_oh2/nuttx/tools/pynuttx/nxgdb
set pagination off
set python print-stack full
"handle SIGUSR1 "nostop" "pass" "noprint"
Load macro: /tmp/6024dea73606400ae39a7b7da42cecbf.json
Please pip install debugpyIgnore module: elf, error: 'NoneType' object has no attribute 'code'
Traceback (most recent call last):
  File "/home/mi/code/stable_oh2/nuttx/tools/pynuttx/nxgdb/_init_.py", line 54, in init_gdb_commands
    module = importlib.import_module(f"{_package_}.{m}")
  File "/usr/lib/python3.10/importlib/_init_.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/mi/code/stable_oh2/nuttx/tools/pynuttx/nxgdb/elf.py", line 35, in <module>
    CONFIG_ARCH_USE_SEPARATED_SECTION = has_field("struct module_s", "sectalloc")
  File "/home/mi/code/stable_oh2/nuttx/tools/pynuttx/nxgdb/utils.py", line 488, in has_field
    return get_type_field(obj, field) is not None
  File "/home/mi/code/stable_oh2/nuttx/tools/pynuttx/nxgdb/utils.py", line 267, in get_type_field
    while t.code in (gdb.TYPE_CODE_PTR, gdb.TYPE_CODE_ARRAY, gdb.TYPE_CODE_TYPEDEF):
AttributeError: 'NoneType' object has no attribute 'code'
No symbol g_version found in memory, skipping version check

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2025-06-13 20:37:04 +08:00
xuxingliang
00304a18ed nxgdb/fs: fix exception when failed to parse symbol
Parse struct fields to determine array length.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-06-13 20:37:04 +08:00
dongjiuzhu1
7927c8d105 tools/pynuttx: update fs.py base on new structure fd and file
Update the Python script based on the PR "Separate file
descriptors from file descriptions" in fs/vfs.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-06-12 18:12:42 +08:00
dongjiuzhu1
9ca5c1d9c6 fs/file: unify prefix f_ for member locked
update locked to f_locked

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-06-12 18:12:42 +08:00
Alin Jerpelea
895154881c tools/doreleasenotes: remove deprecater API
remove old API since github removed deprecated API support

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2025-05-27 20:34:54 +08:00
Lars Kruse
e5b675d4dc refactor: fix spelling in private field names
Fix some misspelled field names.
These field names seem to be used only in private contexts.
Thus, the probability of external code accessing these fields is very
low.
In the rare case of external usage, compile time errors will easily
direct users to the new field name.
2025-05-24 09:44:22 -03:00
raiden00pl
442bc1c041 tools/nxstyle.c: fix defined but not used warning
fix defined but not used warning from CI:

  Warning: nxstyle.c:767:13: warning: ‘backslash_to_slash’ defined but not used [-Wunused-function]
    767 | static void backslash_to_slash(char *str)

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-23 11:26:07 -03:00
simbit18
889a26db1d tools/ci/testlist/arm-05.dat: removed missing entries
Removed from the arm-05.dat file the entries:

CMake,nrf52832-dk:buttons
CMake,nrf52832-dk:wdog

CMake,nrf52840-dk:adc
CMake,nrf52840-dk:buttons
CMake,nrf52840-dk:pwm
CMake,nrf52840-dk:qspi
CMake,nrf52840-dk:timer

present in the jumbo configuration

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-05-23 09:29:43 +02:00
Lars Kruse
f4cc2c2628 tools/checkpatch: avoid repeated output of codespell configuration filename 2025-05-23 10:48:41 +08:00
Lars Kruse
3ce85ca54e style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
simbit18
8776147783 tools/Config.mk: add -DHAVE_STRNDUP=1
In all POSIX environments (Linux, Cygwin, MSYS2, macOS)
strndup() function is  available.

add HOSTCFLAGS += -DHAVE_STRTOK_C=1 -DHAVE_STRNDUP=1

Required after PR #16396

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-05-20 08:29:05 +08:00
simbit18
3b27b44435 tools/nxstyle.c: fix error Relative file path on Windows Native
fix
error: Relative file path does not match actual file

Windows paths are different from Unix.

Added:

realpath replacement macro.

 my_strndup() Implementation of strndup() for Windows Native.

backslash_to_slash() Replace backslashes \ to forward slashes /. Used to verify the relative path of a file.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-05-19 22:30:49 +08:00
simbit18
91027563fa tools/CMakeLists.txt: Improvements to CMakeLists.txt file
More aligned to the tools/Makefile.host file

Added:
The option() command  It provides a way to enable or disable targets of the project based on the user's preference.

Default
option(NUTTX_INCLUDE_ALL_TOOLS "Build all NuttX Host Tools" ON)

Checking host system for compilation options.

Tools configure, mkconfig, mksymtab and mkversion.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-05-17 16:09:20 +08:00
Lars Kruse
4568110d63 fix misspelled names in locally scoped code
These misspelled words are used in strictly local scopes.
Renaming these variables should not cause any problems.
2025-05-15 10:12:12 +08:00
George Poulios
2799cba36b tools/nxstyle.c: Whitelist libteec mixed case symbols
Whitelist all symbols starting with "TEEC_" and a few
entire struct field names from tee_client_api.h.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-13 10:14:01 +08:00
Kerogit
22df1ed2ab tools: add permitted mixed case suffixes to nxstyle
Newer AVR chips (DA/DB family) use mixed-case constants in header
file defining constants for I/O register values (provided
by manufacturer.)

Based on mailing list discussion, this patch adds some
of the lowercase suffixes used (the less prevalent constants
are then redefined in NuttX.)
2025-05-08 15:58:18 +08:00
Alan Carvalho de Assis
7b3aad198e ci/testlist: Don't build breadxavr board 2025-05-08 15:58:18 +08:00
simbit18
4245db2c47 tools/ci/testlist/sim-01.dat: skip build sim:can for macOS
macOS can compilation is not currently supported

[SocketCAN - Controller Area Network](https://www.kernel.org/doc/html/latest/networking/can.html)
 [Linux-CAN / SocketCAN ](https://github.com/linux-can/can-utils)

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-05-08 02:59:31 +02:00
chao an
d07bed3e6b tools/process_config: remove unused unnecessary printing
Too much unnecessary printing that meaningless to non-builder developers

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-05-05 23:49:16 +08:00
Lars Kruse
10c3930279 fix(udhcpc): missing interface name in log message
The mis-referenced variable probably did not cause an error, but simply
led to an empty string instead of the real network interface name.
2025-05-05 09:32:31 +08:00
Serg Podtynnyi
4c52f2dbeb tools: Update Unix.mk and savedefconfig.cmake for CONFIG_ARCH_BOARD_COMMON
Preserve CONFIG_ARCH_BOARD_COMMON in savedconfig

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-05-02 09:30:34 -03:00
Valentyn Korniienko
43b29a0547 Fixed empty line handling process_config.sh
This commit fixed empty line handling in the config file for being able to used KConfig-based defconfigs with the empty lines in them
2025-05-02 09:27:44 -03:00
Tim Hardisty
ed0c18c66c drivers/video/fb.c: Add startup splashscreen option
Adds Kconfig-selected splashscreen options used when the driver is first registered

* Includes a new Python script in ./tools to create RLE bitmap files
* Includes default NS logo btimaps in 320x320, 160x160 and 80x80 resolutions along with their PNG files

Signed-off-by: Tim Hardisty  timh@jti.uk.com>
2025-04-30 06:38:05 -03:00
chao an
52482219c8 libc/elf: rename modlib to libelf
Renaming "modlib" to "libelf" is more in line with the implementation content,
which makes it easier for individual developers to understand the capabilities of this module.

CONFIG_LIBC_MODLIB -> CONFIG_LIBC_ELF

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-11 09:43:22 +08:00
simbit18
b52c122f2c tools/host_info_dump.py: fix UnboundLocalError: local variable 'vendor_specific_module_path' referenced before assignment
fix

Traceback (most recent call last):
  File "/home/ubuntu20042/nuttxspace/nuttx/tools/host_info_dump.py", line 575, in <module>
    header = generate_header(args)
  File "/home/ubuntu20042/nuttxspace/nuttx/tools/host_info_dump.py", line 466, in generate_header
    sys.path.append(os.path.abspath(vendor_specific_module_path))
UnboundLocalError: local variable 'vendor_specific_module_path' referenced before assignment
make: *** [tools/Unix.mk:644: host_info] Error 1
2025-04-10 06:43:01 +08:00
Tiago Medicci Serrano
622355b5c3 arch/xtensa/esp32s3: Fix bug regarding SPI flash operation mode
SPI flash operation modes - Dual Output (dout), Dual I/O (dio),
Quad Output (qout), Quad I/O (qio) and Octal (opi) were not being
properly selected. This commit fixes this behavior and the device
is now able to boot and initialize the proper SPI flash mode.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-08 14:44:38 +08:00
Tiago Medicci Serrano
80559890ff espressif: Simplify the selection of the SPI flash frequency
This commit simplifies the selection of the SPI flash frequency for
Espressif SoCs by using a standardized Kconfig-defined macro.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-05 11:26:32 +08:00
Tiago Medicci Serrano
b388b84af6 arch/risc-v/esp32h2: Set the default SPI flash frequency to 64MHz
The default frequency for the SPI flash chip on ESP32-H2 is 64MHz.
Although it was being set to 48MHz, this isn't a valid value. The
device, however, must be flashed using 48MHz when 64MHz is set.
2025-04-02 09:53:27 +08:00
zhangshoukui
82273b1cf5 tools/ci/testrun/script/test_framework/test_cmocka: skip Skip failed cases
[BUG] CI Test sim:citest fails intermittently for Linux sim-01 nuttx#16088
https://gist.github.com/lupyuen/849562eaf87b93411098c96ada4d43c5

nsh> cmocka --skip test_case_posix_timer|test_case_oneshot|write_default|read_default|burst_test|gpiotest01|test_playback.*|test_interaction.*|test_stress.*|test_capture.*
Cmocka Test Start.
Missing <source>
Usage: cmocka_driver_block -m <source>
Where:
  -m <source> Block device or mtd device mount location.
...
[ RUN      ] drivertest_pm
[  ERROR   ] --- 0 != 3
[   LINE   ] --- drivertest_pm.c:199: error: Failure!
[  FAILED  ] drivertest_pm
[==========] tests: 1 test(s) run.
[  PASSED  ] 0 test(s).
[  FAILED  ] tests: 1 test(s), listed below:
[  FAILED  ] drivertest_pm
...
[ RUN      ] drivertest_posix_timer
[  ERROR   ] --- 2019 is not within the range [1990, 2010]
[   LINE   ] --- drivertest_posix_timer.c:162: error: Failure!
[  FAILED  ] drivertest_posix_timer
[==========] tests: 1 test(s) run.
[  PASSED  ] 0 test(s).
[  FAILED  ] tests: 1 test(s), listed below:
[  FAILED  ] drivertest_posix_timer

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-03-28 11:19:59 +01:00
Huang Qi
0873d88f11 tools/espressif: Improve version checking by subprocess
Summary:
- Replace version checking logic using pkg_resources and importlib with a subprocess call to `esptool.py version`
- This change enhances compatibility with esptool installed via pipx and simplifies the version retrieval process

Impact:
- No functional changes; the script continues to prompt for installation if esptool is not found
- Increases maintainability by reducing dependency on Python version checks

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-03-27 02:26:47 +08:00
yangao1
ded5a6aae5 nxgdb/dmesg.py:add use gdb dump rpmsg_syslog
(gdb) dmesg
RAM log:
[01/06 02:27:05] [ 1] [cp] reset mode:1
...
[01/06 02:27:05] [ 1] [cp] Dump board_reset backtrace:
[01/06 02:27:05] [ 1] [cp] sched_dumpstack: backtrace| 1: 0x10a0d880 0x10a0a78e 0x10a0d8b6 0x10a0f29e 0x10a0f182
[01/06 02:27:05] [ 1] [cp] Time: Mon Jan  6 02:27:05 2025
---END of RAMLOG

RPMSG syslog:
dumpstack: backtrace|10: 0x10a0d880 0x10a0a78e 0x10a110de 0x10a3a482 0x10a3c4fa 0x10a23358 0x10a4aaee 0x10a34a7c
[01/06 02:27:05] [ 1] [cp] sched_dumpstack: backtrace|10: 0x10a2330a 0x10a0f1f4
[01/06 02:27:05] [ 1] [cp] sched_dumpstack: backtrace|11: 0x10a0d880 0x10a0a78e 0x10a110de 0x10a3a482 0x10a15152 0x10a0f182
[01/06 02:27:05] [ 1] [cp] sched_dumpstack: backtrace|15: 0x10a0d880 0x10a0a78e 0x10a0d8b6 0x10a174d0 0x10a3a482 0x10a3c4fa 0x10a222ee 0x10a18c66
[01/06 02:27:05] [ 1] [cp] Time: Mon Jan  6 02:27:05 2025
---END of RPMSG SYSLOG---

Signed-off-by: yangao1 <yangao1@xiaomi.com>
2025-03-27 02:18:37 +08:00
simbit18
d7681cc815 CI: Improved speed to build nuttx on MSYS2 job
After MSYS2 updated the package on GitHub
there was a slowdown in building NuttX in the MSYS2 job.

It went from an average of 6 minutes to 10 minutes !!!

The purpose of this PR is to speed up the build to decrease the usage of the Windows runner.

Modified Files
tools/ci/cibuild.sh

tools/sethost.sh

make olddefconfig -j 4 -> make olddefconfig
workaround for remove
  Cleaning...
  Configuring...
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-03-26 22:35:19 +08:00
simbit18
34c4b15b4d tools/ci: Added CI system on Windows Native
This PR adds support for the CI system for native Windows as well. It allows you to build NuttX on GitHub and test it locally for Windows users.

With these CI tools with PowerShell scripts, it is possible to build NuttX for Windows Native using (for now only) Cmake + Ninja with the same logic as the CI system with Bash scripts.

This allows the msvc job to be used not only with the simulator (currently only with Visual Studio 17 2022), but also with other architectures using the same Windows runner to get more coverage and avoid future breakage.
As with the other jobs, we use artifacts to save the compilation result at the end of the workflow execution (previously for the simulator it was not done).

The proposed solution is based on the following additions and modified:

Modified Files
buildyml -> only CI Jobs MSVC

New Files in tools/
ci/cibuild.ps1 -> Added Powershell script for Run the CI Builds
ci/platforms/windows.ps1 -> Added Powershell script for installing toolchains and tools.
testlist/windows.dat -> Target (Add sim (msvc), risc-v arm)
tools/testbuild.ps1

We tested the NuttX build on GitHub and locally.

How we build on GitHub and test locally.

Locally
cd .\nuttx\tools\ci\

.\cibuild.ps1 -n -i -A -C -N .\testlist\windows.dat

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-03-19 19:59:44 +08:00
Tomasz 'CeDeROM' CEDRO
5ad4667a63 tools/checkpatch: Use gmake on BSD, make otherwise.
* BSD has its own BSD Make that is incompatible with GNU Make.
* When BSD is detected use (gnu) gmake in place of (bsd) make.
* This fixes nxstyle build inside tools/checkpatch.sh.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-03-19 09:09:32 +01:00
Tomasz 'CeDeROM' CEDRO
3eddfe51fa tools/bdf-converter: Fix loop termination condition.
Changing readingbitmap from bool to int, initializing it to the number
of bitmaps allocated, decrementing it each time a bitmap is consumed,
and using it as the termination condition for the while loop,
ensures that loop termination does not depend on data from the file.

Note: Patch provided by Nathan Hartman.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-03-18 10:12:23 -03:00
Ari Kimari
4bfbe82a3e arch/arm64/imx9: Support for imx9 edgelock enclave
Moved imx9 edgelock enclave (ELE) handling from imx9_trdc.c to own imx9_ele.c file.
Add some new messages to ele API.
Updated ele fw version to 1.3.0.
Fix channel bug on imx9_ele_sendmsg() and imx9_ele_receivemsg()

Signed-off-by: Ari Kimari <ari.kimari@tii.ae>
2025-03-17 21:35:25 +02:00
Tiago Medicci Serrano
e4ca1a2de9 CI: Move esp32s3-devkit:python from xtensa-02.dat to xtensa-03.dat
This prevents CI from testing esp32s3-devkit:python automatically,
avoiding it to be overloaded. Manual testing can be triggered to
test xtensa-03.dat.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-03-08 06:49:23 -03:00
simbit18
4877e33058 tools/mksyscall: fix 106: Unexpected end of line: "FAR char * co"
line 106 exceeds the 256 character limit

106: Unexpected end of line: "FAR char * co"
make[1]: *** [makefile:108: .context] Error 4
make[1]: Leaving directory 'C:/nxtest/nuttx/syscall'
make: *** [tools/Win.mk:468: syscall\.context] Error 2

fixed tools/csvparser.h from

to

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-03-08 12:39:24 +08:00
fd6d804623 tools/nxstyle: handle case statement
fix nxstyle so it throw error if case statement is not on new line
2025-02-21 16:26:41 -05:00