Commit graph

1946 commits

Author SHA1 Message Date
yinshengkai
0413d74f31 libs: add gcov framework support
In devices without storage media, you can export data to the
command line and then generate the corresponding gcda file

It can save the result output by calling __gcov_info_to_gcda
The usage is similar to:
https://gcc.gnu.org/onlinedocs/gcc/Freestanding-Environments.html#Profiling-and-Test-Coverage-in-Freestanding-Environments

Usage:
 ./tools/configure.sh qemu-armv7a:nsh
Modify the configuration
+CONFIG_COVERAGE_ALL=y
+CONFIG_COVERAGE_MINI=y
+CONFIG_SYSTEM_GCOV=y
Run:
qemu-system-arm -cpu cortex-a7 -nographic -smp 4 \
     -machine virt,virtualization=off,gic-version=2 \
     -net none -chardev stdio,id=con,mux=on -serial chardev:con \
     -mon chardev=con,mode=readline -kernel ./nuttx/nuttx -semihosting -s | tee gcov.txt
./nuttx/tools/gcov_convert.py -i ./gcov.txt
./nuttx/tools/gcov.sh -t arm-none-eabi-gcov

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-11-22 19:08:08 +08:00
Jouni Ukkonen
74cdb53027 tools/imx9: Add norimage support to bootloader
Fetch fspi header and fcb generation script,
using mkimage generate nor bootable image.
compile bootloader using -mstrict-align

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-22 18:53:21 +08:00
Zhe Weng
5ec2c97424 tools/gdb: Supports args and help for netstats
(gdb) help netstats
Network statistics
    Usage: netstats [iob|pkt|tcp|udp|all]

    Examples: netstats - Show all stats
              netstats all - Show all stats
              netstats iob - Show IOB stats
              netstats tcp udp - Show both TCP and UDP stats

(gdb) netstats iob pkt
IOB:       size    ntotal     nfree     nwait nthrottle
           1518        72        72         0        40

Packets:   IPv4   IPv6    TCP    UDP   ICMP ICMPv6
Received     12     20      2     10      0      0
Dropped       0     20      0      0      0      0
  VHL         0      0      -      -      -      -
  Frag        0      0      -      -      -      -
  Chksum      0      -      0      0      -      -
  Type        -      -      -      -      0      0
  Proto       0      0      -      -      -      -
Sent          4      0      4      0      0      0
  Rexmit      -      -      2      -      -      -

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-11-22 13:38:23 +08:00
Zhe Weng
d0884828ed tools/gdb: Add TCP in netstats
(gdb) netstats
IOB:       size    ntotal     nfree     nwait nthrottle
           1518        72        70         0        38
<...>
TCP Conn:  st flg ref tmr uack nrt       txbuf       rxbuf+ofo           local_address        remote_address
0           4  61   1   3    0   0     0/16384    28/16384+0            10.0.1.2:11315        10.0.1.1:5001

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-11-22 13:38:23 +08:00
Zhe Weng
395090284a tools/gdb: Add UDP in netstats
(gdb) netstats
IOB:       size    ntotal     nfree     nwait nthrottle
           1518        72        70         0        38
<...>
UDP Conn:  flg       txbuf       rxbuf         local_address        remote_address
0           41     0/16384     0/16384              :::19279         fc00::1:5001
1           41     0/16384     0/16384              :::19280         fc00::1:5001
2           41     0/16384     0/16384              :::19281         fc00::1:5001
3           41     0/16384     0/16384              :::19282         fc00::1:5001
4           41     0/16384     0/16384              :::19283         fc00::1:5001
5           41     0/16384     0/16384         0.0.0.0:19284        10.0.1.1:5001
6           41     0/16384     0/16384         0.0.0.0:19285        10.0.1.1:5001
7           41     0/16384     0/16384         0.0.0.0:19286        10.0.1.1:5001
8           41     0/16384     0/16384         0.0.0.0:19287        10.0.1.1:5001
9           41     0/16384     0/16384         0.0.0.0:19288        10.0.1.1:5001

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-11-22 13:38:23 +08:00
Zhe Weng
1c884ee230 tools/gdb: Add packet statistic in netstats
Unlike NuttX's one, we use decimal instead of hexadecimal, because other
stats may all use decimal.

(gdb) netstats
IOB:       size    ntotal     nfree     nwait nthrottle
           1518        72        72         0        40

Packets:   IPv4   IPv6    TCP    UDP   ICMP ICMPv6
Received    137     43      0     49     88      0
Dropped       0     43      0      0     74      0
  VHL         0      0      -      -      -      -
  Frag        0      0      -      -      -      -
  Chksum      0      -      0      0      -      -
  Type        -      -      -      -     74      0
  Proto       0      0      -      -      -      -
Sent      11481  11542      0  17223     27      4
  Rexmit      -      -      0      -      -      -

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-11-22 13:38:23 +08:00
Zhe Weng
4ff0447027 tools/gdb: Add net.py and netstats command
Only support IOB stats now, may add socket status later.

(gdb) netstats
IOB:       size    ntotal     nfree     nwait nthrottle
           1518        72        72         0        40

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-11-22 13:38:23 +08:00
xuxingliang
992d5e0127 tools/gdb: add info shm command
(gdb) info shm
  /var/shm/xms:bq-325-1044165565 memsize: 1536000, paddr: 0x41de3970
  /var/shm/xms:bq-325-2123092606 memsize: 1536000, paddr: 0x41f5a9a8
  /var/shm/xms:fakemq-325-1835096569 memsize: 12, paddr: 0x420d19e0
(gdb)

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-22 12:30:12 +08:00
xuxingliang
4e2ad314d7 tools/gdb: avoid building a full list
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-22 12:30:12 +08:00
yangao1
ab3aa41f39 tools/gdb/fs.py: add print fdinfo,modify the print format
Execute fdinfo or fdinfo -p pid.

(gdb) fdinfo
PID: 0
FD  OFLAGS  POS   PATH                  BACKTRACE
0   3       0     /dev/console          0x4028ff0c <sched_backtrace+48>                 /home/neo/projects/vela2/nuttx/sched/sched/sched_backtrace.c:105
                                        0x402888f8 <file_allocate_from_tcb+236>         /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:615
                                        0x402979d0 <nx_vopen+104>                       /home/neo/projects/vela2/nuttx/fs/vfs/fs_open.c:326
                                        0x40297ad4 <nx_open+116>                        /home/neo/projects/vela2/nuttx/fs/vfs/fs_open.c:449
                                        0x40291eb4 <group_setupidlefiles+28>            /home/neo/projects/vela2/nuttx/sched/group/group_setupidlefiles.c:75
                                        0x4028df94 <nx_start+628>                       /home/neo/projects/vela2/nuttx/sched/init/nx_start.c:651
                                        0x4028119c <arm64_boot_primary_c_routine+16>    /home/neo/projects/vela2/nuttx/arch/arm64/src/common/arm64_boot.c:205

1   3       0     /dev/console          0x4028ff0c <sched_backtrace+48>                 /home/neo/projects/vela2/nuttx/sched/sched/sched_backtrace.c:105
                                        0x40289574 <file_dup3+248>                      /home/neo/projects/vela2/nuttx/fs/vfs/fs_dup2.c:177
                                        0x40288b88 <nx_dup3_from_tcb+176>               /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:314
                                        0x40288c64 <nx_dup2_from_tcb+16>                /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:901
                                        0x40288c88 <nx_dup2+28>                         /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:924
                                        0x40291ec4 <group_setupidlefiles+44>            /home/neo/projects/vela2/nuttx/sched/group/group_setupidlefiles.c:84
                                        0x4028df94 <nx_start+628>                       /home/neo/projects/vela2/nuttx/sched/init/nx_start.c:651
                                        0x4028119c <arm64_boot_primary_c_routine+16>    /home/neo/projects/vela2/nuttx/arch/arm64/src/common/arm64_boot.c:205

2   3       0     /dev/console          0x4028ff0c <sched_backtrace+48>                 /home/neo/projects/vela2/nuttx/sched/sched/sched_backtrace.c:105
                                        0x40289574 <file_dup3+248>                      /home/neo/projects/vela2/nuttx/fs/vfs/fs_dup2.c:177
                                        0x40288b88 <nx_dup3_from_tcb+176>               /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:314
                                        0x40288c64 <nx_dup2_from_tcb+16>                /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:901
                                        0x40288c88 <nx_dup2+28>                         /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:924
                                        0x40291ed0 <group_setupidlefiles+56>            /home/neo/projects/vela2/nuttx/sched/group/group_setupidlefiles.c:117
                                        0x4028df94 <nx_start+628>                       /home/neo/projects/vela2/nuttx/sched/init/nx_start.c:651
                                        0x4028119c <arm64_boot_primary_c_routine+16>    /home/neo/projects/vela2/nuttx/arch/arm64/src/common/arm64_boot.c:205

Signed-off-by: yangao1 <yangao1@xiaomi.com>
2024-11-22 12:30:12 +08:00
zhengyu9
136b7065b7 gdb tools: print inode info
go through each inode and print its structure info
in the form like below:
├── i_name: bin, i_ino: 51
│   i_parent: , i_peer: data, i_child: , i_crefs: 1, i_flags: 3
│   ......(other info)
│   ├── i_name: audio, i_ino: 5
│   │   i_parent: dev, i_peer: binder, i_child: mixer......

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
2024-11-22 12:30:12 +08:00
zhengyu9
fab9670857 gdb tools: mount command
support mount command in gdb, print mount information
test result:
/bin type binfs
/data type hostfs
/etc type romfs
/proc type procfs
/resource type hostfs
/tmp type tmpfs

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
2024-11-22 12:30:12 +08:00
Neo Xu
1518f8bdb8 tools/gdb: fix type and comments
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-11-21 23:08:55 +08:00
anjiahao
cd78de7c63 memleak:Add reminder information
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-21 23:08:55 +08:00
anjiahao
b507a57158 thread.py: fix bug that ARM-A TCB info register offset is discontinuous
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
0f1e2cc7dc tools/gdb: make it compatible with older gdb
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
anjiahao
f53869f86f memleak:use global symbol to search all global variables
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-21 23:08:55 +08:00
anjiahao
8575f11e1e memdump.py:use import_check inside of once_init
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-21 23:08:55 +08:00
anjiahao
e71d45ce86 utils.py:support import check and requirements.txt
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-21 23:08:55 +08:00
buxiasen
bf2d6a3554 tools/gdb/memdump: add biggest/orphon dump.
information prefer from gdb to python class

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
fc0f7365bb tools/gdb: fix import error for certain gdb
For the prebuilt arm-none-eabi-gdb, there's no python builtin module
available.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
de5f70b3c8 tools/gdb: remove 'Nx' prefix for unique commands
1. Remove Nx prefix for nuttx unique commands.
2. Add docstring for most of the commands in order to show help message.
3. Add 'init_once' method for Memmap command. The prerequisite is checked the moment it's used.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
3a46b6e6af tools/gdb: cache gdb.Type result
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
1d25eed55c tools/gdb: fix CONFIG_SMP_NCPUS could be none
The macro could be eliminated by optimization.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
715c3ab079 tools/gdb: fix notification suppress not working
"on" string is always in the word 'notification'. Should use "is on" instead.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
ad1be85be7 tools/gdb: catch exception when there's no selected frame
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
bbf51ba071 tools/gdb: no need to read the whole memory firstly
Read the whole memory costs additional time. When the number memory nodes is
small, test on qemu shows that read memory directly is faster.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
12783c031c tools/gdb: only define c and s when thread comands enabled
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
yinshengkai
b81212e96f tools/gdb: Add memory fragmentation rate calculation
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
9dbf58f1be tools/gdb: optimize memleak speed
1. Avoid to_bytes by using memoryview directly.
2. No need to call gdb to cast to char *.
3. Cache the memory data without invoke gdb in every iteration.
4. Do code cleanup.

memleak speed improved from 261.93 seconds to 29.9 seconds for x4b
usecase.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
4e067fd762 tool/gdb: use second inferior to get symbol
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
yinshengkai
614e07c8f0 tools/gdb: supports generating memory map images
Display all memory nodes in a picture, which can be used to help analyze memory fragmentation

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
2f8c9070c5 tools/gdb: use native thread command
For coredump, gdb-stub, the thread command is natively supported.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
anjiahao
089877c693 memleak:support use gdb to catching absolute memory leaks
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-21 23:08:55 +08:00
Peter Bee
c0f776dbc3 follow upstream change & fix minor things
Signed-off-by: Peter Bee <pbjd97@gmail.com>
2024-11-20 16:32:05 -03:00
Marco Casaroli
dac3f315a1 uf2 2024-11-20 16:32:05 -03:00
Neo Xu
edc410f26f format code to pass CI
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-11-20 09:04:22 +08:00
buxiasen
96a3bc2b5c tools/gdb: fix if restore_regs failed script abort
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
eded2017d4 memdump.py:Enhance the printing function of memdump
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
477f7b92ee tools/gdb/memdump.py:fix mempool memory traversal missing nodes
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
xuxingliang
8264c05c15 tools/gdb: use f string where possible
misc update.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-20 09:04:22 +08:00
Gao Jiawei
06d640a677 implement ps nx shell utility for ez debugging with GDB
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-11-20 09:04:22 +08:00
Gao Jiawei
e31fe0fb55 add custom command and APIs for retrieving/displaying stack statistics
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-11-20 09:04:22 +08:00
Gao Jiawei
8edb9283ba trivial modification on the utility module
1. add get macro related inteface, for now we have't fully implemented
the way to expand and evalute macros at runtime. We just deal with some macros that can be expand and evaluate into essential constants that will be needed later.
2. rearrange utility functions in a different order
3. reimplment the get register API to make it more commonly used

Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-11-20 09:04:22 +08:00
Gao Jiawei
76db3c8939 enable stack trace printing on excpetion
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
e0bea987d1 gdb python plugin:support dump list member
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
daac426f79 gdb python plugin:add hexdump command support
hexdump useful to debug

format such as:

(gdb) hexdump 0x0062fd30 500
0062fd30  73 68 6f 77 5f 76 61 72 69 61 62 6c 65 3a 20 45  show_variable: E
0062fd40  52 52 4f 52 20 56 61 72 69 61 62 6c 65 3d 25 73  RROR Variable=%s
0062fd50  20 68 61 73 20 74 68 65 20 77 72 6f 6e 67 20 76   has the wrong v
0062fd60  61 6c 75 65 0a 00 6f 73 74 65 73 74 5f 6d 61 69  alue..ostest_mai
0062fd70  6e 2e 63 00 73 68 6f 77 5f 76 61 72 69 61 62 6c  n.c.show_variabl
0062fd80  65 3a 20 45 52 52 4f 52 20 56 61 72 69 61 62 6c  e: ERROR Variabl
0062fd90  65 3d 25 73 20 68 61 73 20 61 20 76 61 6c 75 65  e=%s has a value
0062fda0  20 77 68 65 6e 20 69 74 20 73 68 6f 75 6c 64 20   when it should
0062fdb0  6e 6f 74 0a 00 73 68 6f 77 5f 76 61 72 69 61 62  not..show_variab

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
635e324e9a gdb/thread.py:simplify the logic of nxsetregs
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
wangmingrong
8eb1047595 gdb python tools: fix command "info thread" echo error
Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
eccd26a162 gdb/thread.py:Print colorful
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
5aaa31337a gdb/thread.py:fix a bug when use 'up' then use 'thread'
Python Exception <class 'gdb.error'>: Attempt to assign to an unmodifiable value.
Python Exception <class 'gdb.error'>: Error occurred in Python: Attempt to assign to an unmodifiable value.
Error occurred in Python: Error occurred in Python: Attempt to assign to an unmodifiable value.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
2292a36983 gdb/thread.py:change show gdb index/tid/pid format
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
852e683fa3 python/gdb:fix use thread command on running task bug
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
ligd
5c939d8140 gdb: devide tid & pid, add holder logout when waiting mutex
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-11-20 09:04:22 +08:00
raiden00pl
7e42ca2538 boards/stm32: split nucleo-f4x1re into separate boards
Split nucleo-f4x1re into nucleo-f401re and nucleo-f411re.
These are separate boards and should be in separate directories as it's
done for all other nucleo boards in NuttX
2024-11-19 13:28:42 +01:00
hujun5
19b4911d7f arch: remove up_current_regs in common code
reason:

When entering an exception or interrupt, there are two sets of registers:
one is the "running regs", which we need to save,
and the other is the "ready to running regs", which we may soon use.
For consistency in logic, we can always store the "running regs" in the regs field of g_running_tasks,
otherwise it may lead to errors in the storage location of the "running regs."

When we need to access the "running regs," we should uniformly retrieve them from the regs field of g_running_tasks.

As the next step, we will rename the set_current_regs/up_current_regs functions
for each architecture to more appropriate names, solely for the purpose of identifying interrupts.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-15 18:25:35 +08:00
wangmingrong1
17ce9b86c1 gcov: Correct existing gcov configuration
1. add CONFIG_COVERAGE_ALL to replace CONFIG_SCHED_GCOV_ALL
2. Correct all SCHED_GCOV, SCHED_GCOV_ALL

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-15 01:05:16 +08:00
xuxin19
d2a7e454bb build(qemu):add a qemu compilation configuration with application
enable various types of common applications and libraries, and enable CMake CI checks.
To avoid regression issues in the build system

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-14 22:50:49 +08:00
anjiahao
6554ed4d66 get g_tcbinfo just use elf memory
g_tcbinfo is const data, thus elf memmory is more reliable than other
method in case of corruption etc.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-14 13:30:34 +08:00
xuxingliang
c5276f4244 gdbserver.py: add arm64 support
Use struct.unpack_from to eliminate the need to specify data size.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-14 13:30:34 +08:00
xuxingliang
3bfeddcbdd gdbserver.py: add back 64bit support
Original code from https://github.com/apache/nuttx/pull/12469

Accidently removed during merge.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-14 13:30:34 +08:00
Davi Diogo
d6a73a46e8 riscv/espressif/bootloader/mcuboot: Sign image with MCUBoot version
Add version signature to MCUBoot compatible image on espressif RISC-V architecture

Signed-off-by: Davi Diogo  <eng.davidiogo@gmail.com>
2024-11-13 20:28:17 +01:00
wangmingrong1
1d1ef52d1a arm/mps: Add a gcov functional testing configuration for mps-clang
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-13 05:33:00 +08:00
wangmingrong1
e3917e2f09 libbuitin/compiler_rt: Supports separate builtin rt.builtins or rt.profile
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-12 16:12:53 +08:00
f566c1a940 sim: Build quickjs with CMake 2024-11-12 12:10:42 +08:00
simbit18
2464b3207d [darwin] CI macos-14 : updated toolchains for macOS Apple Silicon
added shell script darwin_arm64.sh  for macOS Apple Silicon

updated toolchains for macOS on Apple Silicon
- arm64
- aarch64
- xpack-riscv
- xtensa-esp32
2024-11-12 00:08:38 +08:00
wangjianyu3
f41b0d00fd tools/rp2040: Building picotool if necessary
Improved
  1. The pre-installed "picotool" should not depend on `PICO_SDK_PATH`

  2. Perhaps we should compile "picotool" from `PICO_SDK_PATH` if it was not found in $PATH

Tests
  1. The "picotool" is pre-installed or built from `PICO_SDK_PATH`

     LD: nuttx
     Generating: nuttx.uf2
     Done.

  2. `PICO_SDK_PATH` is specified but "picotool" is not installed

     LD: nuttx
     Building: picotool
     Generating: nuttx.uf2
     Done.

  3. Neither "picotool" nor `PICO_SDK_PATH` are installed/specified

     LD: nuttx
     PICO_SDK_PATH/picotool must be specified/installed for flash boot

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-11 10:38:58 +08:00
wangmingrong1
f59edf8645 libbuiltin/Makefile: Modify the libbuiltin makefile to standard
1. bin and kbin folders are dynamically generated
2. Context comes before depend, so the bin and kbin folders are created in the context construction phase. When the depend process comes, each library is downloaded, and a relative bin/xxx and kbin/xxx directory is created for each library to place files. This is to prevent duplicate file names.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-10 10:19:58 +08:00
wangmingrong1
6dd313939f makefile/build: Delete unnecessary bin and kbin folders
1. Calling CLEAN on these folders did not have any effect
2. bin,kbin will be created during the context construction process

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-10 01:18:26 +08:00
simbit18
5080ab7818 tools/ci/platforms/darwin.sh: Port NuttX CI Job to macOS-14
also  runs old CI Job macOS-13
2024-11-08 01:45:46 +08:00
simbit18
9bdc776b30 msys2: fix make[3]: warning: jobserver unavailable: using -j1.
fixed this error for msys2

====================================================================================
Configuration/Tool: nucleo-l152re/nsh,CONFIG_ARM_TOOLCHAIN_GNU_EABI
2024-11-05 06:12:26
------------------------------------------------------------------------------------
  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.
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.
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.
2024-11-06 02:00:32 +08:00
xuxin19
480471f46c sim:support sim elf and dynamic libs package in post build
use the dynamic library .so of the binding compilation environment,
and then modify the dynamic loader of elf at runtime to run sim elf across system versions

1.add post-build for sim build
2.collect dynamic .so and dynamic interpreter
3.add execution script for the entire package sim elf

change text-segment to 0x50000000
because patchelf will modify the .dynamic section in elf,
the upward alignment of elf will be less than 0x3fffffff,
which will cause asan shadow memory overlap error

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-06 01:56:44 +08:00
simbit18
3c4053a385 macos : fix “sed: -I or -i may not be used with stdin”
tools/Unix.mk
added $(call DELFILE, .config.backup)

tools/process-config.sh
sed-i -> sed -i.backup
2024-11-04 22:40:29 +08:00
xuxin19
1fb8a64299 cmake:add cmake host tool mkdeps incdir
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-31 17:55:13 +08:00
haopengxiang
417f5f425b tools/mkdeps: increase MAX_BUFFER from 16384 to 65536
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2024-10-31 08:55:07 +08:00
xuxin19
92dddcda8a tools/refresh.sh:skip config check on debug configs
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-30 22:14:40 +08:00
xuxin19
4595f9388f tools/Unix.mk:make incdir precedence over other targets
Make.defs need incdir at the very beginning.
fix error such as `make menuconfig` `make oldconfig` etc.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-30 22:14:40 +08:00
wangmingrong1
8461f0ea54 clang: Support compiling rt.profile library
1. Since the implementation of gcov has changed since clang17, versions before clang17 need to use the libunwind.a file

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-30 17:10:23 +08:00
wangmingrong1
e3d7d23618 gcov: Fix typographical errors
1. CONFIG_ARCH_COVERAGE has been replaced by CONFIG_SCHED_GCOV
2. Delete the SIM-specific GCOV_ALL configuration and change it to a universal configuration for all architectures

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-30 14:45:23 +08:00
yezhonghui
27685aa179 Fix config repeat define in include deconfig mode
Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2024-10-30 12:29:56 +08:00
anjiahao
2dcd300a3c coredump.py:bug fix python file not have rename
tmpfile.rename(args.output)
    ^^^^^^^^^^^^^^
AttributeError: '_io.BufferedRandom' object has no attribute 'rename'. Did you mean: 'name'?

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-30 12:29:22 +08:00
wangmingrong1
240dc3d5e1 mps/clang: Add a defconfig for mps to support clang compilation
1. Enable compiler_rt library builtin function

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-28 22:19:58 +08:00
wangmingrong1
e174d73cd9 clang:libclang_rt.builtins-xxx.a supports builtin
1. enable CONFIG_BUILTIN_COMPILER_RT  to built libclang_rt.builtins-xxx.a and no longer use the compiler's built-in
2. Modify clang version acquisition to get two decimal points
3. It has been ported to support four architectures: ARM, ARM64, RISCV, and x86_64, among which ARM has been validated

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-28 16:38:45 +08:00
chao an
73c032d594 tools/nxstyle: add phy62xx/uart.c into style white list
To skip the style issue:
arch/arm/src/phy62xx/uart.c:59:15: error: Mixed case identifier found
arch/arm/src/phy62xx/uart.c:64:2: error: Mixed case identifier found
arch/arm/src/phy62xx/uart.c:65:2: error: Mixed case identifier found
arch/arm/src/phy62xx/uart.c:70:2: error: Mixed case identifier found
arch/arm/src/phy62xx/uart.c:71:2: error: Mixed case identifier found
arch/arm/src/phy62xx/uart.c:75:2: error: Mixed case identifier found
arch/arm/src/phy62xx/uart.c:77:7: error: Mixed case identifier found

Signed-off-by: chao an <anchao@lixiang.com>
2024-10-26 13:21:29 +08:00
c4d754f135 CI: Split the targets in sim-01 and add sim-03
This PR splits the CI Build Job sim-01 and adds sim-03:

Before the Split: Simulator Jobs take up to 1.5 hours to complete
- sim-01 (1 hour 31 mins): adb, citest, lvgl, matter
- sim-02 (28 mins): posix_test, sqlite

After the Split: Simulator Jobs will complete within 1 hour
- sim-01 (58 mins): adb, citest
- sim-02 (35 mins): lvgl, matter
- sim-03 (28 mins): posix_test, sqlite

This will help us comply with the ASF Policy for GitHub Actions, as explained here: https://github.com/apache/nuttx/issues/14376
2024-10-22 08:55:20 +08:00
Tiago Medicci Serrano
39c7ef0a26 tools/esp32s3/Config.mk: fix "printf:`\': invalid format character"
The error was introduced by #14393, which was intended to fix this
line for MacOS. This commit makes this line dependent on the host
OS to avoid any compilation errors.
2024-10-22 08:54:15 +08:00
raiden00pl
6657f2abb7 boards/arm/stm32f7: separate nucleo-144 board into individual boards
nucleo-144 combines 3 different ST boards. This approach is inconsistent with
the support for the rest of the nucleo boards, where each board is in separate folders.
Also nucleo-144 is no longer reserved for STM32F7 chips but other families also use this format.

After this commit nucleo-144 is divided into 3 boards:

- nucleo-f746zg
- nucleo-f767zi
- nucleo-f722ze
2024-10-21 09:23:44 +08:00
9c1e0d3d64 CI: Split the Build Jobs for Arm64 and x86_64
This PR creates the new CI Build Jobs `arm64-01` and `x86_64-01`. The new jobs will split and offload the Arm64 and x86_64 Build Targets from `other`. This will reduce our usage of GitHub Runners, to comply with the ASF Policy for GitHub Actions. (Recently we see more PRs for Arm64 and x86_64)

Before the Split: Simple PRs (One Arch and/or One Board) for Arm64 and x86_64 require almost 1 hour for CI Build
- `other` (57 mins): AVR, SPARC, x86, PinePhone, QEMU Arm64, QEMU x86_64

After the Split: Simple PRs for Arm64 and x86_64 will complete under 30 mins
- `other` (24 mins): AVR, SPARC, x86
- `arm64-01` (29 mins): PinePhone, QEMU Arm64
- `x86_64-01` (9 mins): QEMU x86_64

To skip more unnecessary builds: Our Build Rules `arch.yml` shall ignore the label "Area: Documentation", so that a Simple PR + Docs is still a Simple PR. Previously we experienced longer CI Build Times, just because we added docs to our Simple PR. (Now our PR shall be built exactly like a Simple PR)

The updated CI code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-20 09:49:13 +08:00
cuiziwei
9614e1fed5 Add GCCVER define to Toolchain.cmake
Since GCCVER will also be used in the toolchain, it needs to be defined in advance.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-19 14:32:08 +08:00
simbit18
791d7c97d0 cmake: Renamed savedefconfig with refreshsilent
Renamed savedefconfig -> refreshsilent name more consistent with the refresh stage for cmake on github.

Added new savedefconfig to fix
https://github.com/apache/nuttx/issues/14281
2024-10-18 22:14:50 +08:00
xuxingliang
53d90c8205 tools/checkpatch: fix isort doesn't return error
Flag --diff will output the changes content.
Flag --check-only will return exit code. It can be used together with --diff.

Run isort again to format the code in place, to make the behavior same as before.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-18 21:30:13 +08:00
YAMAMOTO Takashi
0d57e3dba6 tools/esp32s3/Config.mk: fix "unterminated call to function" error
this # would be parsed by make as a start of a comment.
2024-10-18 20:47:28 +08:00
Alejandro Aguirre
d762427ec9 tools: fix parsetrace.py output
- Fix usage of non-existing variable `args.out`.
- Fix dump trace not writing to the output file.
- Fix path provided through `-o` getting ignored.

Signed-off-by: Alejandro Aguirre <alejandro.aguirre@midokura.com>
2024-10-18 10:29:48 +08:00
Xiang Xiao
c6aed84638 tools: Rename apps-or-nuttx-Make.defs to Make.defs
follow the same pattern as other Make.defs files

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-17 07:55:02 +08:00
anjiahao
7c37a46f69 gdbserver:skip load symbol if use logfile as input
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 08:01:28 +08:00
anjiahao
ddf44def10 gdbserver:fix bug when use arm-a coredump addr mismatch
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 08:01:28 +08:00
anjiahao
a1ff878bed gdbserver:Special processing xtensa architecture
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 08:01:28 +08:00
Filipe Cavalcanti
5592145dc7 tools/espressif: add esptool version check to Espressif build system 2024-10-15 20:42:57 +02:00
xuxingliang
143b265d11 tools: make isort and black formatters to work together
Config multi line output to mode 3, so isort and black can agree with
each other:
```
3 - Vertical Hanging Indent

from third_party import (
    lib1,
    lib2,
    lib3,
    lib4,
)
```

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-15 01:08:53 +08:00
xuxingliang
01cce0c544 tools: exit with error if py needs to format
Make CI fail if format not pass.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-15 01:08:53 +08:00
cuiziwei
7246533aeb Unify the definition of GCCVER and remove duplicate code.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-13 11:41:22 +08:00
Marco Casaroli
83455a3fa1 ci: skip config
since this config requires bootloader, we skip it
2024-10-13 11:19:51 +08:00
Marco Casaroli
890bdcd3d3 feat(esp32s3-devkit): add qemu image option 2024-10-13 11:19:51 +08:00
wangmingrong1
c9db6e8173 CI: CI Docker adds Python package installation
1. Add Python tool 'install CI' to MSYS2 platform
2. CI Python Add Package Construction

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-13 02:25:29 +08:00
Bowen Wang
c86f4d66da tools/showsize.sh: support pass custom nuttx executable
Use showsize.sh to show custom elf file top10 size
tools/showsize.sh vela_ap.elf
tools/showsize.sh vela_audio.elf

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-13 02:11:12 +08:00
ligd
90afe58ad7 tools/configure.sh: add relative path
support #include "../ap/defconfig" in defconfig

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-12 14:27:58 +08:00
anjiahao
e5f9b42ea0 binfmt/libelf:Remove libelf implementation [2/2]
this commit is part two, all logic move to modlib, so we can remove it.
and change all use defconfig

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
lipengfei28
9f170a36e3 white list: add cJSON
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-12 09:30:06 +08:00
yinshengkai
cac90afe79 Revert "sim/note: add note related configuration"
This reverts commit 154cb4a860.
2024-10-11 21:30:19 +08:00
yinshengkai
154cb4a860 sim/note: add note related configuration
Ensure that CI can cover all note code

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-11 11:55:17 +08:00
yinshengkai
656baa2a12 tools/Unix.mk: allow defconfig to overwrite old config
When using include command in defconfig, it is necessary to support overwriting the configuration in other files

kconfig-conf only prints warnings, but does not return errors

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-11 02:40:58 +08:00
yinshengkai
ec691cc5e4 tools: prasetrace.py supports parsing syslog
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-11 01:30:11 +08:00
yinshengkai
fbaa7b29f4 tools/gcov: ignore lcov error
When some coverage files cannot be parsed correctly,
skip the current error file and continue to generate coverage report

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 22:55:46 +08:00
yinshengkai
7516da1650 tools: gcov.sh supports generating device-side code coverage
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 22:55:46 +08:00
80d03cb296 CI: Split the RISC-V Build Jobs into smaller jobs
To speed up the CI Workflow, this PR splits the CI Build Jobs for RISC-V into smaller jobs. Each job will now complete within 1 hour.

Before the PR: There are 2 jobs for RISC-V, each requiring more than 1.5 hours
- `risc-v-01` (1 hour 42 mins): BL602, Ox64, ESP32-C3 / C6 / H2
- `risc-v-02` (1 hour 41 mins): K230, Icicle, QEMU, RV32M1-Vega

After the PR: The build is spread across 6 jobs for RISC-V, each job completes within 1 hour
- `risc-v-01` (19 mins): BL602, Ox64
- `risc-v-02` (44 mins): ESP32-C3
- `risc-v-03` (45 mins): ESP32-C6, ESP32-H2
- `risc-v-04` (31 mins): K230, Icicle
- `risc-v-05` (41 mins): QEMU CITest
- `risc-v-06` (38 mins): Rest of QEMU, RV32M1-Vega

Following the same convention as the Arm32 Build Jobs, the above jobs are sorted by Target Name. Performance of the RISC-V Build Jobs is discussed in https://github.com/apache/nuttx/issues/13775
2024-10-10 08:44:02 +08:00
yinshengkai
034af29aab arch: adjust gcov configuration name
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-09 21:27:47 +08:00
anjiahao
fa59adde40 Simplify BOARD_MEMORY_RANGE initialization logic
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-09 15:41:48 +08:00
xuxin19
2cfd0783bc tools/mkdeps.c:add options for gen full path object target
Check g_altpath. If only the CURRENT path is included,
the obj target use its own full path, otherwise just use the filename.

add default value current path for obj-path.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-09 14:21:47 +08:00
xuxin19
a27655a5a6 checkpatch.sh:Fix checking for wrong cmake files
patches ending with cmake should be checked.
Currently, any non-cmake files containing cmake keywords will be checked.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-09 14:17:14 +08:00
c74206a982 CI: Split the Build Job arm-05 into multiple smaller jobs
CI Build Job `arm-05` (runtime 2 hours) has become the Performance Bottleneck for CI Workflow. That's because `arm-05` builds too many targets for nRF, RP2040, SAM 3, SAM A and SAM D. This PR splits `arm-05` into multiple smaller jobs, to reduce the CI Build Duration.

Before the PR: `arm-05` is overloaded, build requires 2 hours
- `arm-05` (2 hours): nRF, RP2040, SAM 3, SAM A, SAM D
- `arm-06` (56 mins): STM32 [a-m]*

After the PR: `arm-05` is offloaded (to `arm-06` and `arm-07`), completes within 1 hour
- `arm-05` (47 mins): nRF
- `arm-06` (1 hour): Reserve for RP2040 exclusively
- `arm-07` (1 hour 15 mins): SAM 3, SAM A, SAM D, STM32 [a-m]*

Build Jobs are sorted by Target Name. So we cascade the changes and rename the Build Jobs: `arm-07` becomes `arm-08`, `arm-08` becomes `arm-09` etc. Then `arm-13` becomes a new job `arm-14`. (Which we added to `build.yml`)

Performance of `arm-05` is discussed in https://github.com/apache/nuttx/issues/13775 and https://github.com/apache/nuttx/issues/12773
2024-10-09 13:45:26 +08:00
anjiahao
fb176c02ca gdb/thread.py:Remove dependence on g_current_regs
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-08 23:55:59 +08:00
Xu Xingliang
4ed506d6ab board/coredump: add option to use base64 stream
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-10-08 22:33:19 +08:00
xuxingliang
18d5ae20f5 drivers/segger: add heap data plot
Add heap current used to note.
Plot it in segger sysview data plot.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-07 17:34:59 +08:00
simbit18
b3107a1f1b tools/testbuild.sh: Improved speed in the skipping phase 2024-10-03 08:59:04 +08:00
Neo Xu
94a114b19a tools/btdecode.sh: add optional elf file parameter
Example: ./nuttx/tools/btdecode.sh aarch64-none-elf-addr2line crash.log build/nuttx
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-09-30 08:44:18 +08:00
ligd
7cf5e7cb34 ci: corrent the error judgement on mq testcase
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-29 18:18:01 +08:00
Huang Qi
6edbde25e5 nxstyle: Add NativeSymbol to white list
Add the new symbol `NativeSymbol` to the white list,
and update the comments about the symbols that are
from WAMR project.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-28 19:33:05 +08:00
liaobin1
0e8cf3837a tools/nxstyle: Add RuntimeInitArgs to the white content list
`RuntimeInitArgs` is used by WAMR, a popular WebAssembly runtime,
it used in nuttx-apps side.

Signed-off-by: liaobin1 <liaobin1@xiaomi.com>
2024-09-27 21:42:06 +08:00
YAMAMOTO Takashi
1bf778020a tools/btdecode.sh: make grep overridable
This script seems to assume GNU grep, which is not commonly
available as "grep" on some platforms.  For examples, it's
more common to have it named "ggrep" on BSD-based systems
including macOS.

Ideally, I suppose we should avoid GNU dependencies like this
in general.  But I'm not motivated enough to rewrite this script
in a portable way today.

cf. https://www.gnu.org/software/grep/manual/grep.html#grep-Programs-1
2024-09-26 23:59:50 +08:00
simbit18
2fbe02afec ci/platforms/darwin.sh: switch Wget to cURL tool
Switch wget to cURL tool for:

arm_gcc_toolchain()
arm64_gcc_toolchain()
gperf()
riscv_gcc_toolchain()
sparc_gcc_toolchain()
xtensa_esp32_gcc_toolchain()
wasi_sdk()

Used git clone --depth 1 a shallow clone with a history truncated to reduce the clone size for:

kconfig_frontends()

added ninja installation
2024-09-26 10:54:16 -03:00
simbit18
715a3d8446 ci/platforms: linux.sh ubuntu.sh switch Wget to cURL tool
Switch wget to cURL tool for:
arm_gcc_toolchain()
arm64_gcc_toolchain()
riscv_gcc_toolchain()
sparc_gcc_toolchain()
xtensa_esp32_gcc_toolchain()
xtensa_esp32s2_gcc_toolchain()
xtensa_esp32s3_gcc_toolchain()
wasi_sdk()

Used git clone --depth 1 a shallow clone with a history truncated to reduce the clone size for:
kconfig_frontends()
2024-09-26 10:53:58 -03:00
simbit18
45a8d99755 ci/platforms/msys2.sh: update esptool version and switch Wget to cURL tool
Bumps esptool from 4.7.0 to 4.8.0.

Switch wget to cURL tool
arm_gcc_toolchain()
arm64_gcc_toolchain()
riscv_gcc_toolchain()
sparc_gcc_toolchain()
xtensa_esp32_gcc_toolchain()
xtensa_esp32s2_gcc_toolchain()
xtensa_esp32s3_gcc_toolchain()

Create a shallow clone with a history truncated of
gen_romfs()
kconfig_frontends()
2024-09-25 23:52:45 +08:00
Alin Jerpelea
9fa35a774f tools/doreleasenotes
Simple tool to generate the NuttX release notes

tested on Python-3.8.9

Requirements
pip install PyGithub
pip install PyInquirer
pip install tqdm

The following arguments are required for generating a release: release_version, gh_token

Inspired by https://github.com/btashton/nxutils

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-09-25 01:38:04 +08:00
Tiago Medicci Serrano
27858f913b tools: Add generic tool to decode the backtrace dump
The script can decode the backtrace dump, considering the syntax
of the backtrace format (properly handle the dump when SMP is
enabled, for instance) based on chip name or the toolchains's
addr2line tool.
2024-09-23 20:40:58 +08:00
wangmingrong1
b5c5e4b850 gdb plugin: Encapsulate the gdb native command gcore as nxgcore
Modify elf with nxgcore and call gcore:
(gdb) nxgcore --help
usage: [-h] [-o OUTPUT] [-t OBJCOPY] [-r MEMRANGE]

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Gcore output file
  -t OBJCOPY, --objcopy OBJCOPY
                        Select the appropriate architecture for the objcopy
                        tool
  -r MEMRANGE, --memrange MEMRANGE

examples:
	(gdb) nxgcore -t arm-none-eabi-objcopy -r 0x40200000,0x48000000,0x07

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-09-20 22:07:29 +08:00
wangmingrong1
469418f3c9 mm/kasan: Kasan global support setting alignment length
1. Similar to asan, supports single byte out of bounds detection
2. Fix the script to address the issue of not supporting the big end

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-09-20 21:47:23 +08:00
wangmingrong1
0d8b6de03a mm/kasan: Map the generated shadow area to the fixed segment
Since the size of the shadow area will change during the script merging of global variables, it will lead to unpredictable number of links. After fixing, only three links are required.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-09-20 21:47:23 +08:00
wangmingrong1
5c511443fe mm/kasan: Using arrays instead of linked lists
1. Modify the Kasan global variable script to support array storage of region addresses
2. Due to the lack of formatting in the previous attempt, a formatting script was created

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-09-20 21:47:23 +08:00
simbit18
6a0c0722e2 CI: Improvement to speed up compilation and reduce download errors.
The simple improvement is designed to speed up compilation and reduce download errors on github and local.

Added a folder nxtmpdir for storing third-party packages

nuttxworkspace
|
|- nuttx
|- apps
|- nxtmpdir

tools/Unix.mk:
added export NXTMPDIR := $(WSDIR)/nxtmpdir

tools/configure.sh:
added option -S creates the nxtmpdir folder for third-party packages.

tools/Config.mk:
added macro
CLONE - Git clone repository.
CHECK_COMMITSHA - Check if the branch contains the commit SHA-1.

tools/testbuild.sh:
added option -S

For now I added in the folder this package

ESP_HAL_3RDPARTY_URL = https://github.com/espressif/esp-hal-3rdparty.git

ARCH
arch/xtensa/src/esp32/Make.defs
arch/xtensa/src/esp32s2/Make.defs
arch/xtensa/src/esp32s3/Make.defs
arch/risc-v/src/common/espressif/Make.defs
arch/risc-v/src/esp32c3-legacy/Make.defs

but you can also add other packages (maybe also of apps)
2024-09-20 11:26:01 +08:00
xuxin19
1d3dd328dd modify BUILD_LOADABLE to MODULES which backwards-compatible Kernel
maintains the same semantics as Kernel’s module build
and compatible with Kconfiglib implementation.

The problem of kconfiglib not being able to use tri-states is this:
linux is here torvalds/linux@6dd85ff
The module option is extracted from one of the triate three states into a MODULE keyword.
Kconfiglib supports the default implementation of module to be MODULE for compatibility with the linux kernel, and triate degenerates into bool two states
Refer to this code: 061e71f7d7/kconfiglib.py (L4274-L4284)

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-19 08:32:03 +08:00
wangmingrong1
30652291b5 nxstyle.c: Eliminate case issues with compiler-generated functions
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-09-19 03:15:29 +08:00
Masayuki Ishikawa
df298c186f Revert "build depend:Revert Make.dep intermediate ddc file"
This reverts commit ddc3119c4e.
2024-09-15 19:29:47 +08:00
xuxin19
ddc3119c4e build depend:Revert Make.dep intermediate ddc file
Revert "Parallelize depend file generation"
This reverts commit d5b6ec450f.

parallel depend ddc does not significantly speed up compilation,
intermediately generated .ddc files can cause problems if compilation is interrupted unexpectedly

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-15 10:01:58 +08:00
Alin Jerpelea
c9eef2d697 tools: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-09-10 23:11:11 +08:00
shizhenghui
d285e5bc31 Dockerfile: add subversion to final images
Add subversion to install list ensure linux docker
can use svn command to download source code.

Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-09-10 12:17:20 +08:00
George White
3f00c4aae0 rp2040: support pico-sdk 2.0.0
Since the introduction of the rp2350, the pico-sdk project has been
re-arranged and elf2uf2 has been merged in to a new 'picotool' binary
which is supplied and installed separately.
2024-09-08 21:43:22 +08:00
shizhenghui
af19a22b11 ci-docker: add subversion to linux dockerfile
Add subversion to install list ensure linux docker
can use svn command to download source code.

Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-09-05 21:25:46 +08:00
TAiGA
cc0d4af20a tools/mksymtab: support for structure 2024-09-05 15:54:49 +08:00
Matheus Catarino
1936e68f40 risc-v/qemu-rv: Add Build Config for leds64_zig
This PR adds a new Build Config `rv-virt:leds64_zig` that builds the Zig App `leds_zig` for QEMU RISC-V 64-bit.
ref.: https://github.com/apache/nuttx-apps/pull/2534
2024-09-05 11:28:12 +08:00
Alexander Merkle
39937c9685 tools/ci/docker/linux/Dockerfile: fix ccache when running container as user
Normally ccache places the temporary files in `~/.ccache`, when invoking the container with
  `-u <uid>:<gid>`
as e.g. Jenkins does, this might result in a invalid/unknown home folder.
Thus ccache tries to write to `/.ccache` which doesn't exist and the user doesn't have any permissions.

Explicitly set `CCACHE_DIR` to a folder with appropriate permissions.
2024-09-05 10:09:57 +08:00