This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit debb89e1aa954bcdb66caa1d76f4a6f1a7dcea1b
Author: xuxin19 <[email protected]>
AuthorDate: Fri Nov 20 09:54:42 2026 +0800

    Documentation: describe CMake support in refresh.sh and checkkconfig.py
    
    Document the new refresh.sh --cmake option and how the CMake refresh
    works, and update the checkkconfig.py help text for the -o/--out_dir
    option and for -s/--set, which now takes several CONFIG VALUE pairs.
    
    Signed-off-by: xuxin19 <[email protected]>
---
 Documentation/components/tools/checkkconfig.rst | 29 ++++++++++++++++++++-----
 Documentation/components/tools/refresh.rst      | 25 +++++++++++++++++++++
 2 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/Documentation/components/tools/checkkconfig.rst 
b/Documentation/components/tools/checkkconfig.rst
index 1ec768f9064..cc955e109a3 100644
--- a/Documentation/components/tools/checkkconfig.rst
+++ b/Documentation/components/tools/checkkconfig.rst
@@ -8,19 +8,25 @@ It can be used to check whether my config changes are what I 
expected.
 Help message::
 
   $ tools/checkkconfig.py -h
-  usage: checkkconfig.py [-h] -f FILE (-s CONFIG VALUE | -d DIFF)
+  usage: checkkconfig.py [-h] [-o OUT_DIR] -f FILE
+                         (-s CONFIG [VALUE ...] | -d DIFF)
 
-  optional arguments:
+  Simulate the effects of modifying CONFIG items in NuttX
+
+  options:
     -h, --help            show this help message and exit
+    -o OUT_DIR, --out_dir OUT_DIR
+                          Binary dir for CMake configured
     -f FILE, --file FILE  Path to the input defconfig file
-    -s CONFIG_XXX VALUE, --single CONFIG VALUE
-                          Analyze single change: CONFIG_NAME y/m/n
+    -s CONFIG [VALUE ...], --set CONFIG [VALUE ...]
+                          Analyze multiple changes: CONFIG_NAME1 y/m/n
+                          CONFIG_NAME2 y/m/n ...
     -d DIFF, --diff DIFF  Analyze changes from diff file
 
   example: ./tools/checkkconfig.py -f defconfig -s ELF n
 
   outputs:
-  Change report for ELF=n
+  Change report for config changes
   Config Option                            Old                  New
   ----------------------------------------------------------------------
   BINFMT_LOADABLE                          y                    n
@@ -41,3 +47,16 @@ it will bring about the following configuration linkage 
changes
 
 It can also parse diff files, which can be used to check the changes of 
multiple
 configs.
+
+``-s``/``--set`` accepts several ``CONFIG VALUE`` pairs, so the combined 
effect of
+multiple changes can be checked at once.  A value other than ``y``, ``m`` or
+``n`` is set as is, for example a number or a string::
+
+  $ ./tools/checkkconfig.py -f defconfig -s ELF y TASK_NAME_SIZE 16
+
+CMake builds keep the configuration in the build directory instead of the
+top-level NuttX directory.  Pass that directory with ``-o``/``--out_dir`` to
+analyze a CMake configuration::
+
+  $ cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja
+  $ ./tools/checkkconfig.py -o build -f build/.config -s ELF y
diff --git a/Documentation/components/tools/refresh.rst 
b/Documentation/components/tools/refresh.rst
index 81fcf6d6d2c..eba49b7360d 100644
--- a/Documentation/components/tools/refresh.rst
+++ b/Documentation/components/tools/refresh.rst
@@ -44,6 +44,8 @@ Help is also available:
         Do not prompt for new default selections; accept all recommended 
default values
      --nocopy
         Do not copy defconfig from nuttx/boards/<board>/configs to 
nuttx/.config
+     --cmake
+        Use CMake refresh target instead of make refresh to refresh the 
defconfig
      --help
         Show this help message and exit
      <board>
@@ -89,6 +91,23 @@ The steps to refresh the configurations and/or files given 
to ``refresh.sh`` are
 
 5. Restore the ``.config`` and ``Make.defs`` files from step 1.
 
+With the ``--cmake`` option, the configuration is refreshed with the CMake 
build
+instead, so it also works for board configurations that have no ``Make.defs``
+file.  For each configuration, ``refresh.sh``:
+
+1. Configures a temporary CMake build directory ``refresh/`` in the top-level
+   NuttX directory with ``cmake -B refresh -DBOARD_CONFIG=<config> -GNinja``.
+
+2. Runs ``cmake --build refresh -t refreshsilent``, which updates the
+   configuration with the default values and creates the new defconfig file.
+
+3. Copies the new defconfig file out of ``refresh/``, removes ``refresh/``, and
+   compares and saves the new defconfig file in the same way as the Make-based
+   refresh.
+
+The ``.config`` and ``Make.defs`` files in the top-level directory are not used
+or modified in this mode.
+
 
 Usage examples
 --------------
@@ -136,3 +155,9 @@ configuration subdirectory:
 .. code:: console
 
   $ ./tools/refresh.sh --defaults 
boards/arm/stm32f1/stm32f103-minimum/configs/nsh
+
+Update the `nsh` config from the ``qemu-armv7a`` board with the CMake build:
+
+.. code:: console
+
+  $ ./tools/refresh.sh --silent --cmake qemu-armv7a:nsh

Reply via email to