We support search directory structure as follows:
Current directory
stm32/configs/common
stm32/common/configs
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
To solve the issue of carrying object files from previous builds,
Matias changed the archiving process to re-archive libapps.a on every compilation,
if libapps.a carries more object files, incremental compilation will waste too
many time in re-archiving, compared with the previous implement, this is a degradation
of the build system. Referring to mature engineering projects such as cmake, if there
is configuration or source file changed, the best solution should be to reconfigure
the environment.
Revert this PR to ensure the compilation speed during incremental compilation.
| commit 34b34e2d45 (tag: nuttx-20200914-172150)
| Author: Matias N <matias@protobits.dev>
| Date: Fri Sep 11 22:31:38 2020 -0300
|
| Fix: ensure archive files do not carry object files from prior builds
|
| In some cases, when NuttX configuration changes and this makes the
| object list used to build one of the .a libraries change as well,
| since the command used to build it is "ar crs" and this simply appends
| the list of object files, the library could still include object
| files from prior builds. This commit modifies the ARCHIVE macro to
| erase the .a file if it already exists.
|
| Since in some cases this behavior was actually expected (object
| files from a subdirectory were appended to a library created one
| level above) I added a ARCHIVE_ADD which works as ARCHIVE did.
|
| This change should greatly improve behavior of building after
| configuration changes.
Testing:
sim:nsh
-------------------------------
| Patched | Current
-------------------------------
|$ time make | $ time make
|real 0m1.270s | real 0m1.728s
|user 0m0.971s | user 0m1.276s
|sys 0m0.363s | sys 0m0.530s
-------------------------------
Private project (20+ 3rd library needs archive to libapps.a)
-------------------------------
| Patched | Current
-------------------------------
|$ time make | $ time make
|real 0m21.181s | real 0m39.721s
|user 0m14.638s | user 0m24.837s
|sys 0m6.919s | sys 0m14.394s
-------------------------------
Signed-off-by: chao an <anchao@xiaomi.com>
'rcS' will case files that has duplicate name been replaced.
so on the Mac platform we use 'q' instead of 'r' to achieve an
effect similar to '-P'
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
Some function names in C++ may fail to parse, and no filtering is required here.
(anonymous namespace)::pool::free(void*) [clone .constprop.0]
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This patch modify the script to update only the boards configs
of an specific chip or only the boards of an specific architecture.
Examples:
refresh.sh add custom board verify
custom board:
$ ./tools/refresh.sh --silent ../../xxx/configs/ap
$ ./tools/refresh.sh --silent /yyy/xxx/configs/ap
$ ./tools/refresh.sh --silent yyy/xxx/configs/ap
Signed-off-by: dengwenqi <dengwenqi@xiaomi.com>
Additional information here:
- no code logic change, just add type hint
- make the code easy to work with
- minor python3 requirement without any complex type feature
Signed-off-by: renweibo <renweibo@xiaomi.com>
since it fail to install on ubuntu 22.04:
ERROR: failed to solve: process "/bin/sh -c pip3 install CodeChecker" did not complete successfully: exit code: 1
Error: buildx failed with: ERROR: failed to solve: process "/bin/sh -c pip3 install CodeChecker" did not complete successfully: exit code: 1
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
+ brew install u-boot-tools
==> Fetching dependencies for u-boot-tools: openssl@3
==> Fetching openssl@3
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.1.2-1
Already downloaded: /Users/runner/work/nuttx/nuttx/sources/tools/homebrew/downloads/d235bbcbe9c405bfbe837454515b9cb2793542891a2050e5948a94f596e2a51e--openssl@3-3.1.2-1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/blobs/sha256:2bea791e9eacc59e0a9099065f3229afaf2b68a9b7b3136ec508103985b1176c
Already downloaded: /Users/runner/work/nuttx/nuttx/sources/tools/homebrew/downloads/d082c3abe2fd32b11d857fb7111adc0fc02a0b345044c07f2e7db7160f15300e--openssl@3--3.1.2.ventura.bottle.1.tar.gz
==> Fetching u-boot-tools
==> Downloading https://ghcr.io/v2/homebrew/core/u-boot-tools/manifests/2023.07.02
Already downloaded: /Users/runner/work/nuttx/nuttx/sources/tools/homebrew/downloads/5e0a4a2e6eda6e1dc965b8523549685de4c2da7f1c68d8431bbd7c536642bfee--u-boot-tools-2023.07.02.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/u-boot-tools/blobs/sha256:bfd54176e94ffd2ad380ab7cbd25e091afe9338b17343881cd957f5f6c30d5ed
Already downloaded: /Users/runner/work/nuttx/nuttx/sources/tools/homebrew/downloads/8ce6e97fdea98c1581ffe5f52ccd876f3cbf373da9a70f889948b5c888528402--u-boot-tools--2023.07.02.ventura.bottle.tar.gz
==> Installing dependencies for u-boot-tools: openssl@3
==> Installing u-boot-tools dependency: openssl@3
==> Pouring openssl@3--3.1.2.ventura.bottle.1.tar.gz
Error: Could not symlink bin/openssl
Target /usr/local/bin/openssl
is a symlink belonging to openssl@1.1. You can unlink it:
brew unlink openssl@1.1
To force the link and overwrite all conflicting files:
brew link --overwrite openssl@3
To list all files that would be deleted:
brew link --overwrite --dry-run openssl@3
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Instead of setting kernel/user space instruction and data ROM as
hard-coded values on linker, set them according to the max size
of the kernel image set by CONFIG_ESP32S3_KERNEL_IMAGE_SIZE. This
is done by making KIROM, UIROM, KDROM and UDROM dependent on the
kernel size value. Also, override CONFIG_NUTTX_USERSPACE config
according to CONFIG_ESP32S3_KERNEL_IMAGE_SIZE by using a custom
PREBUILD definition.
Add PREBUILD definition and `prebuild` recipe to call it before
the `mkconfig` tool, at the beginning of the build process. This
`prebuild` step enables running CPU/board-specific operations
before building the firmware, like tweaking or overriding configs
that need to be set after the board configuration.
support arch:
sim x86
sim x86_64
arm32 all series
If we need to support more architectures in the future,
just add the 'g_tcbinfo' of the corresponding architecture
support thread command:
1. thread <id>
switch thread
2. info thread
list all thread info
3. thread apply [all | id list] command
like this:
thread apply all bt
thread apply all bt full
thread apply 1 2 4 bt
thread apply all info r
4. nxsetregs
Set registers to the specified values.
Usage: nxsetregs [regs]
Etc: nxsetregs
nxsetregs g_current_regs[0]
nxsetregs tcb->xcp.regs
Nxsetregs g_pidhash[0].tcb->xcp.regs
Default regs is g_current_regs[0],if regs is NULL,
it will not set registers.
Because NuttX enters exception_common during a crash,
this assembly function manipulates the stack pointer (sp),
causing GDB to be unable to trace back to the first context of the crash.
Instead, it shows the context of the interrupt stack. By using nxsetregs,
it is possible to forcefully set the first context to
the one before the interrupt occurred.
Notice:
Switching threads is achieved by setting registers,
so registers need to be restored before continue,
please use 'c' to continue instead of 'continue'
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
according to https://github.com/apache/nuttx/pull/7903
it was to fix "the macOS runners occasionally failing".
cython issue workaround seems more important because it always fails.
1. Update all CMakeLists.txt to adapt to new layout
2. Fix cmake build break
3. Update all new file license
4. Fully compatible with current compilation environment(use configure.sh or cmake as you choose)
------------------
How to test
From within nuttx/. Configure:
cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja
cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja
cmake -B build -DBOARD_CONFIG=sabre-6quad/smp -GNinja
cmake -B build -DBOARD_CONFIG=lm3s6965-ek/qemu-flat -GNinja
(or full path in custom board) :
cmake -B build -DBOARD_CONFIG=$PWD/boards/sim/sim/sim/configs/nsh -GNinja
This uses ninja generator (install with sudo apt install ninja-build). To build:
$ cmake --build build
menuconfig:
$ cmake --build build -t menuconfig
--------------------------
2. cmake/build: reformat the cmake style by cmake-format
https://github.com/cheshirekow/cmake_format
$ pip install cmakelang
$ for i in `find -name CMakeLists.txt`;do cmake-format $i -o $i;done
$ for i in `find -name *\.cmake`;do cmake-format $i -o $i;done
Co-authored-by: Matias N <matias@protobits.dev>
Signed-off-by: chao an <anchao@xiaomi.com>