Commit graph

60363 commits

Author SHA1 Message Date
chao an
fa44369e0f arm64/qemu/fdt: fix build break
nuttx/boards/arm64/qemu/qemu-armv8a/src/qemu_bringup.c: In function 'register_pci_host_from_fdt':
nuttx/boards/arm64/qemu/qemu-armv8a/src/qemu_bringup.c:138:15: error: too few arguments to function 'fdt_get_reg_base'
  138 |   cfg.start = fdt_get_reg_base(fdt, offset);
      |               ^~~~~~~~~~~~~~~~
In file included from nuttx/boards/arm64/qemu/qemu-armv8a/src/qemu_bringup.c:34:
nuttx/include/nuttx/fdt.h:253:11: note: declared here
  253 | uintptr_t fdt_get_reg_base(FAR const void *fdt, int offset, int index);
      |           ^~~~~~~~~~~~~~~~

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-10 15:47:05 -03:00
chao an
e50b5773de arm64/qemu/fdt: remove duplicate mmio parser code
reuse fdt_virtio_mmio_devices_register() to avoid duplicate

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-10 15:47:05 -03:00
Michal Lenc
ef469bac7f samv7: ensure the correct location of message RAM
The message RAM does not behave correctly if lower 16 bits of
buffer address overflow (upper 16 bits are set once in matrix driver
for the entire CAN driver). For example message RAM starting at
0x2040fc20 would not work for buffers that go beyond 0x20410000 and
MCAN would sent data located at 0x20400000 to the network. The same
issue would occur even if TX buffers would start directly at 0x20410000.
The upper 16 bits would still have 0x2040 value because of RX buffers
located in 0x2040ffff range.

This commit ensures the RAM is always located at the beginning of
the data section and thus the overflow mentioned above should never occur.
The alternative would be to use larger alignment, but the message RAM
can have up to 4352 words and this would cause a significant padding.

The RAM is also initialized to zero to ensure valid parity/ECC checksums.
The address issue is not described anywhere in the manual, so it is
possible this is caused by some incorrect configuration, but the context
of the registers looks valid.

This commit also fixes the compilation errors when the driver is run
without data cache.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-02-10 15:43:54 -03:00
Rodrigo Sim
2d6d52c84a Documentation: Add XIAO nRF52840 Board
Signed-off-by: Rodrigo Sim <rcsim10@gmail.com>
2025-02-10 15:42:53 -03:00
Jorge Guzman
04b7e357c0 boards/linum-stm32h753bi: optimize display timings and memory config
- Optimize FMC/SDRAM configuration for faster memory access
- Improve overall display performance for LVGL applications

These changes aim to enhance the FPS in LVGL benchmark demos.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2025-02-10 11:01:45 -03:00
hujun5
a31d983161 bluetooth: miss carrier_[on/off] in bt_netdev
fix regression from https://github.com/apache/nuttx/pull/15237

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-02-10 09:01:03 +01:00
Neo Xu
1aced99ebb board/msp3-an547: add gdbstub config
Add this config so we can test GDB stub feature easily.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2025-02-09 11:45:43 +08:00
Neo Xu
28cf56ce4f gdbstub: fix memory binary upload on latest GDB
GDB release 16.2 recently to fix the incompatibility issue with LLDB.
For us, the only change is stub must report it support feature 'binary-upload' before GDB will use this feature.
For more information, find bug report and discussion in https://sourceware.org/bugzilla/show_bug.cgi?id=32593

Use GDB 16.2, now it works with binary upload.
```
  [remote] Sending packet: $x39c,4#a7
  [remote] Received Ack
  [remote] Packet received: b\000\203
```

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2025-02-09 11:45:43 +08:00
Kyle Wilson
ac0ba3f413 Add STM32H5 architecture documentation.
Add documentation for nucleo-h563zi development board.

Removed whitespace at the end of lines.

Fixed column formatting.

Fixed Title overline too short error.

Added image to nucleo-h563zi documentation.
2025-02-09 00:01:45 +08:00
Stepan Pressl
d269c0f350 arch/arm/src/samv7/sam_tc_lowerhalf.c: do not set the CPCSTOP bit
The CPCSTOP has a negative effect on the periodic timer operation.
This causes the timer to stop when an overrun occurs.
Timer must be then restarted in the interrupt. However, as interrupts
are not infinitely fast, this prolongs the next timeout.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-02-08 10:44:28 -03:00
Eren Terzioglu
b25c4ec963 esp32[s3]: Add ES8311 support for esp32s3-lcd-ev board 2025-02-08 10:41:03 -03:00
Yanfeng Liu
ac4b5395f1 qemu/armv7-r: add poweroff
This adds poweroff function to qemu-armv7r:nsh using
semihosting based approach.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-08 19:38:56 +08:00
Yanfeng Liu
20098f3b34 arch/arm: add semihosting poweroff
This adds semihosting based poweroff to arm/common. It uses
semihosting operation SYS_EXIT (0x18) with parameter AppExit
(0x20026).

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-08 19:38:56 +08:00
Jukka Laitinen
e56eaffe76 Documentation/platforms/risc-v/mpfs/boards/icicle/index.rst: Add documentation for "hwtest" board configuration
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-02-08 19:31:13 +08:00
Jukka Laitinen
e23f2edc63 boards/risc-v/mpfs/icicle/configs/nsh/defconfig: Increase stack sizes
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-02-08 19:30:29 +08:00
Jukka Laitinen
88f12ee001 boards/risc-v/mpfs/icicle: Combine "network" and "usb" targets to "hwtest"
Reduce the amount of configurations for CI.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-02-08 19:30:29 +08:00
Kyle Wilson
7b3b24d9f6 Added missing UARTs and USARTs to STM32H56xx pinmap. Fixed UART IRQ definitions. Added missing rx and tx buffers. 2025-02-08 14:17:29 +08:00
Jukka Laitinen
ca6f5db6fc arch/risc-v/Kconfig: Select ARCH_RV_CPUID_MAP for all mpfs targets
The default mapping functions are needed for mpfs

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-02-07 23:46:40 +08:00
zouboan
6dbb2edd2c Documentation:add documentation about ethernet for Zynq MPSoC and ZCU111
This commit add documentation Description for ZYNQ-MPSOC's NET driver key
features and ethernet config of ZCU111.
2025-02-07 20:21:18 +08:00
zouboan
22f2d39e21 arch/zynq-mpsoc improve the ethernet driver
1. Changes the phyadd to 0xC to speed up the training of phyadd.
2. Set RX DMA buffer size configureable.
3. Create netnsh configs as ethernet boot from QSPI FLASH.
4. Fix some typo in #15720 which is nonsynchronous with local code.
2025-02-07 20:21:18 +08:00
chao an
9754fdf63c mps/mps3-an547: correct command line of genromfs
genromfs -a 128 -f ../romfs.img -d pic

f: -f output
a: -a alignment

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-07 17:41:04 +08:00
chao an
e06d8575c0 cmake/pic: sync pic related compiler flags from makefile
PIC(Position-Independent-Code) board could work on cmake:

cmake -B ap -DBOARD_CONFIG=mps3-an547:ap -GNinja

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-07 17:41:04 +08:00
chao an
b001b61401 rptun/ivshmem: RPTUN_IVSHMEM should depends on DEV_SIMPLE_ADDRENV
fix build break:

ld: drivers/libdrivers.a(rptun_ivshmem.c.obj): in function `rptun_ivshmem_get_resource':
nuttx/drivers/rptun/rptun_ivshmem.c:215:(.text.rptun_ivshmem_get_resource+0xfc): undefined reference to `simple_addrenv_initialize'
ld: openamp/libmetal/lib/libmetal.a(io.c.obj): in function `metal_io_phys_to_offset_':
nuttx/openamp/libmetal/lib/system/nuttx/io.c:112:(.text.metal_io_phys_to_offset_+0xc): undefined reference to `up_addrenv_pa_to_va'

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-07 17:40:38 +08:00
chao an
c3426325d8 qemu-armv7a/ivshmem: add ivshmem chapter
An example implementation for OpenAMP based on the Inter-VM share memory(ivshmem)::

rpproxy_ivshmem:  Remote slave(client) proxy process.
rpserver_ivshmem: Remote master(host) server process.

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-07 17:40:38 +08:00
chao an
8204b0028a qemu-armv7a/ivshmem: add ivshmem(Inter-VM share memory) example
rpproxy_ivshmem:  Remote slave(client) proxy process.
rpserver_ivshmem: Remote master(host) server process.

Please refer to the official Qemu ivshmem documentation for more information:

https://www.qemu.org/docs/master/system/devices/ivshmem.html

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-07 17:40:38 +08:00
Tiago Medicci Serrano
2ebdd72487 include/stdlib.h: define system()'s prototype for the flat build
The `$(APPDIR)` folder is added to the `$(KERNDEPDIRS)` when
`CONFIG_BUILD_KERNEL=y`. The `depend` phase iterates over the
`$(KERNDEPDIRS)` folders and executes the `depend` recipe of these
folders (including the apps' recipes) with the `__KERNEL__` macro
defined, which prevents `system()`'s prototype from being declared.
2025-02-07 09:03:14 +08:00
xuxingliang
c319863834 nxgdb/mm: fix regular expression to parse log
There could be only one space ahead of address.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-07 08:18:14 +08:00
xuxingliang
1577fe3160 nxgdb/mm: warning if corrupted memory node found
If the nodesize is 0, we cannot iterate to next node, siliently return None will cause memleak command to generate false positive report with no warnings.
Add log to indicate such case.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-07 08:18:14 +08:00
xuxingliang
ef52c68e06 nxgdb/mm: add prenode, nextnode property for mempool
So it looks like a memory node in heap thus we can process it in a unified way

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-07 08:18:14 +08:00
Tiago Medicci Serrano
fdc0b608b5 libc/wcsrtombs: Fix the wcsrtombs() according to the POSIX standard
According to https://pubs.opengroup.org/onlinepubs/9799919799/, the
expected behavior for the wcstombs() function is that it should
convert the wide-character codes stoping conversion either when a
character sequence exceeds the limit of n total bytes or if a null
byte is stored. In the first case, the null-terminated value should
not be appended to the dst buffer.

Currently, no null-terminator is appended to the dst buffer, even
when it's expected to be appended, generating erroneous output.
2025-02-06 10:24:55 +01:00
Michal Lenc
0ae633cc08 clock/clock_adjtime.c: fix compile errors
The missing <nuttx/spinlock.h> header caused following compile errors:

CC:  clock/clock_adjtime.c clock/clock_adjtime.c: In function 'adjtime_wdog_callback':
clock/clock_adjtime.c:67:11: error: implicit declaration of function 'spin_lock_irqsave' [-Wimplicit-function-declaration]
   67 |   flags = spin_lock_irqsave(&g_adjtime_lock);
      |           ^~~~~~~~~~~~~~~~~
clock/clock_adjtime.c:78:3: error: implicit declaration of function 'spin_unlock_irqrestore' [-Wimplicit-function-declaration]
   78 |   spin_unlock_irqrestore(&g_adjtime_lock, flags);

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-02-06 09:22:44 +08:00
xuxingliang
04bd00f80a pynuttx: optimize memory leak check by skipping previously checked pointers
Reduce leak analysis time from 12s to 7.8s, achieving a 35% performance improvement that tested on an internal project.

1. Use memoryview to avoid creating int objects, reducing overhead
2. Store checked pointers in a dictionary for efficient lookups, improving performance.
3. While dictionary operations have some cost, the overall speedup is significant.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-05 09:15:27 -03:00
xuxingliang
b90638493a pynuttx: fix memleak
Only need to check used node, excluding free nodes.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-05 09:15:27 -03:00
Neo Xu
ca92c208c1 arch/arm64: generate error if context size is not aligned to 16bytes
Make sure the registers context size is aligned to 16bytes as required by armv8-a.
This issue has been reported earlier, thus make sense to make sure it won't happen in future.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2025-02-05 19:28:03 +08:00
xuxingliang
f9d8cdcca2 nxgdb/memdump: add free command
(gdb) free
name            total      used       free       maxused    maxfree    nused      nfree
GImageCache     10485756   10411964   73792      10602184   62328      217        7
uncache         10485756   127812     10357944   270512     10350560   4          2
Umem            26879516   17458732   9420784    20957888   9260768    1211       234
(gdb)

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-04 09:32:07 -03:00
zouboan
586b9c54ac arch/arm64 Fix the SP unalignment issues
zynq-mpsoc and zcu111 borad was broken by #15437, because #15437 changes
ARM64_CONTEXT_REGS from 36 to 37, resulting in the stack no longer being
16-byte aligned which appears to violate the ARMv8-A architecture's
requirement for 16-byte stack alignment. this commit changes ARM64_CONTEXT_REGS
to 38 to fix this issues.
2025-02-04 13:18:32 +08:00
Luchian Mihai
4f6940c533 boards: add arch depends for aurix tc397 board 2025-02-04 13:17:06 +08:00
xuxingliang
8995e5a66e nxgdb/fs: simplify inode print and add more options
Use Inode.__repr__ for print and use single line for all information.
Add 'verbose' and 'nodetype' option to show more details and only print specifiy node type like PIPE.
Add / to name for pseudodir.
Catch memory error when accessing node element.

E.g.

(gdb) foreach inode --nodetype pipe
        ├── run/ 0x41a27a50 PSEUDODIR
        │   ├── bt:bluetoothCS1fd26 0x4530c510 PIPE
        │   ├── bt:bluetoothCS20 0x42daae40 PIPE
        │   ├── socketpair0x457fd2e0SC20540 0x44ea27b0 PIPE
        │   └── tmp/ 0x42dd7cf0 PSEUDODIR
        │       │   └── usock/ 0x42dd6c10 PSEUDODIR
        │       │       └── speech.usockHD 0x42dc8270 PIPE
        │       ├── central_lite.socketCS5e 0x42e1e7b0 PIPE
        │       ├── central_service_lite.socketSC86 0x432ee6d0 PIPE
        │       │   └── usock/ 0x43d6ed60 PSEUDODIR
        │       │       └── speech.usockHD 0x43da2ba0 PIPE
        │       ├── uv-feature-sockSC8d 0x43540430 PIPE
        │       ├── uv-miot-sockCS54 0x42e272e0 PIPE
        │       └── uv-miot-sockSC54 0x42e270b0 PIPE

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-03 09:21:26 +01:00
xuxingliang
dc5251f9c8 nxgdb/fs: use default args
Instead of storing it to self

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-03 09:21:26 +01:00
zouboan
d36b2f94d3 zcu111: add support for net and dp83867 phy
The PS-side Gigabit Ethernet MAC (GEM) implements a 10/100/1000 Mb/s
Ethernet interface, which connects to a TI DP83867IRPAP Ethernet
RGMII PHY before being routed to an RJ45 Ethernet connector on ZCU111
board.The RGMII Ethernet PHY is boot strapped to PHY address 5'b01100
(0x0C) and Auto Negotiation is set to Enable.This commit add Ethernet
support for ZCU111 board and TI DP83867IRPAP Ethernet RGMII PHY.
2025-02-02 14:17:45 +08:00
zouboan
934c93be93 arch/arm64/zynq-mpsoc: add support for ethernet gem
Zynq MPSOC The processing system (PS) is equipped with four gigabit
Ethernet controllers.Each  controller can be configured independently.
Each controller uses a reduced gigabit media independent interface (RGMII)
v2.0. This commit add support for ethernet of ZYNQ MPSOC.
2025-02-02 14:17:45 +08:00
Neo Xu
698b2e00e6 nxgdb: include all files to package
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2025-02-02 14:02:24 +08:00
xuxingliang
14cc23f42a nxgdb: add missing protocols definitions
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-02 14:02:24 +08:00
yinshengkai
50fb43e23b tools: rename tools/gdb/nuttxgdb to tools/pynuttx/nxgdb
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2025-02-02 14:02:24 +08:00
Tiago Medicci Serrano
08fe636001 xtensa/esp32[s2|c3|c6|h2]: fix sched_[lock|unlock] boot crash
Move the code to iram0 since sched_lock/sched_unlock is called in
the early boot phase.
2025-02-02 00:51:42 +08:00
Huang Qi
e043658d1e arch/xtensa: Add --print-memory-usage to LDFLAGS in Toolchain.defs
Summary:
- Added `--print-memory-usage` to `LDFLAGS` in `Toolchain.defs` for both `lx6` and `lx7` architectures
- This flag enables memory usage reporting during the linking phase, providing better visibility into memory allocation

Impact:
- No functional changes - the flag only adds additional debug information during the build process
- Improves debugging and optimization capabilities by providing detailed memory usage statistics
- Maintains compatibility with existing build configurations and toolchains

Testing:
Test result on esp32s3:
```
Memory region         Used Size  Region Size  %age Used
             ROM:      556116 B   16777184 B      3.31%
     iram0_0_seg:       23296 B       304 KB      7.48%
     irom0_0_seg:      621652 B   16777184 B      3.71%
     dram0_0_seg:       85780 B       288 KB     29.09%
     drom0_0_seg:      157180 B   16777184 B      0.94%
    rtc_iram_seg:           0 B       8168 B      0.00%
    rtc_data_seg:           0 B       8168 B      0.00%
rtc_reserved_seg:           0 B         24 B      0.00%
    rtc_slow_seg:           0 B         8 KB      0.00%
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-02-01 13:20:12 -03:00
xuxingliang
c1f9c730be gdb: add tool to check heap memory corruption
Only heap nodes are checked for now.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-01-31 23:29:34 +08:00
hujun5
8f9c1cbe73 xtensa/esp32s3: Fix esp32s3 sched_lock crash
move the code to iram0 since sched_lock/sched_unlock
is called in the early boot phase

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-31 23:19:59 +08:00
Xiang Xiao
dc2ae56098 arch: Remove the abuse of spinlock in smp boot
What's really need is a done signal sent from the secondary
cpu to the boot cpu, so let's simplify the logic by:
1.Change the spinlock to a bool flag
2.Set the flag to true in the secondary cpu
3.Wait the flag set in the boot cpu before continue booting

This also remove all bad usage of spinlock from the code base:
1.Lock spinlock in one thread, but unlock in a different thread
2.Lock spinlock twice in one thread, but unlock only once

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-31 23:19:44 +08:00
Luchian Mihai
4606f1f9e1 feat: drop legacy pinmap for nsh config
migrate from legacy pinmap for nucleo-f429zi board nsh config
2025-01-31 12:53:36 +08:00