Commit graph

57764 commits

Author SHA1 Message Date
Xiang Xiao
556a81d8e4 Revert "Use small lock to protect usbdev and endpoint in arch mips"
This reverts commit ac2b495945.
2025-02-13 14:15:43 +08:00
Xiang Xiao
a488b22b22 Revert "Use small lock to protect usbdev and endpoint in arch renesas."
This reverts commit e211904640.
2025-02-13 14:15:43 +08:00
Xiang Xiao
2301fd5d25 Revert "Use small lock to protect usbdev and endpoint in arch ARM."
This reverts commit e177ff9c0c.
2025-02-13 14:15:43 +08:00
Xiang Xiao
6d2f81f490 Revert " Use small lock to protect timer related resources in arch ARM."
This reverts commit 5f77da4c51.
2025-02-13 14:15:43 +08:00
Xiang Xiao
52d0b4ccf4 Revert "Use small lock to protect resources related to cpufifo."
This reverts commit 8b5ea40a2b.
2025-02-13 14:15:43 +08:00
Xiang Xiao
191e3ba1f7 Revert "Use small lock to protect resources related to timers in arch risc-v, xtensa and tricore."
This reverts commit ecaddbb0aa.
2025-02-13 14:15:43 +08:00
Xiang Xiao
9e687ca896 Revert "Use small lock to protect resources related to irq in arch avr, hc, mips and or1k."
This reverts commit bed3bd0852.
2025-02-13 14:15:43 +08:00
Xiang Xiao
96093574fc Revert "Use small lock to protect resources related to lpi2c."
This reverts commit 0b542ff824.
2025-02-13 14:15:43 +08:00
Xiang Xiao
f9076d53c4 Revert "Use small lock to protect resources related to irq in arch risc-V and xtensa."
This reverts commit 099801630d.
2025-02-13 14:15:43 +08:00
Xiang Xiao
0021e7731a Revert "Because sched_lock is now called in spin_lock_irqsave, there is no need to call it explicitly."
This reverts commit b0af946b7a.
2025-02-13 14:15:43 +08:00
Xiang Xiao
18156742f1 Revert "Use small lock to protect resources related to i2c master and slave."
This reverts commit 2c4fe28d4e.
2025-02-13 14:15:43 +08:00
Xiang Xiao
61620affe6 Revert "Use small lock to protect resources related to i2c."
This reverts commit 919ed2e3d4.
2025-02-13 14:15:43 +08:00
Xiang Xiao
43a47f49dc Revert "Use small lock to protect resources related to irq in arch ARM."
This reverts commit c754019f5a.
2025-02-13 14:15:43 +08:00
Xiang Xiao
2f7120e4bc Revert "Fix compile error."
This reverts commit 60df0cd6da.
2025-02-13 14:15:43 +08:00
Xiang Xiao
83c2bcb33a Revert "Use small lock to protect resources related to ethernet."
This reverts commit 60125038fc.
2025-02-13 14:15:43 +08:00
Xiang Xiao
259f25b2ce Revert "Fix wrong variable name. lock -> eth_lock"
This reverts commit c8f8a61f89.
2025-02-13 14:15:43 +08:00
Xiang Xiao
45422e2ad9 Revert "No need to call sched_lock explicitly after call spin_lock_irqsave, since it will be called in func spin_lock_irqsave."
This reverts commit 8f3a2a6f76.
2025-02-13 14:15:43 +08:00
Michal Lenc
99c7b64072 mtd/w25q: ensure the correct behavior if erase sector fails
Function w25qxxxjv_erase wasn't correctly handling an error in
w25qxxxjv_erase_sector call and was returning success even on failure.
Moreover this change does not immediately return EBUSY but waits for
the previous operation to finish. If the timeout is significant (more
than erase time of the entire flash), then it returns EBUSY.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-02-13 10:02:06 +08:00
cuiziwei
b57f3bb840 Fix macOS build error.
1. fix https://github.com/apache/nuttx/issues/14774.
Change the defconfig of libcxxtest and select libcxxabi by default to
fix sim:libcxxtest build in macOS CI can't find cxxabi.h.

2. fix https://github.com/apache/nuttx/issues/15491.
libcxxabi cannot be used with uclibc, so when compiling macos sim, libcxxabi cannot be selected by default in Kconfig.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2025-02-12 15:24:02 -03:00
Huang Qi
df65980273 docs: enhance Rust guide with CPU optimization instructions
Summary:
- Added a section to the Rust guide that explains how to use the `RUSTFLAGS` environment variable to specify the target CPU for optimization.
- Provides examples and instructions for setting `RUSTFLAGS` for different CPU models, such as Cortex-M33 and Cortex-M55, to generate performance-optimized code.

Impact:
- Enhances the developer's ability to produce more efficient Rust applications on NuttX by leveraging CPU-specific optimizations.
- No runtime or functional changes; only documentation improvements to guide users in optimizing their build configurations for specific hardware.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-02-12 15:23:28 -03:00
Huang Qi
081588c1c5 docs: update rust guide to include X86 and X86_64 support
Summary:
- Updated the Rust guide documentation to include X86 and X86_64 platforms in the supported platforms list.
- Ensured that the guide provides accurate and up-to-date information for developers using these new platforms.

Impact:
- Expands the platform support section of the Rust guide, making it more inclusive and useful for a wider range of developers.
- No functional changes to the code itself; this update only affects the documentation.
- Enhances the usability of the guide by providing necessary setup and configuration details for the X86 and X86_64 architectures.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-02-12 15:23:28 -03:00
Jacob Dahl
3dcedd507b h7: eth: add checks for PHYID in stm32_phyinit
Fixes bug where stm32_phyinit will succeed even when no PHY is connected. This is because there is no check that a PHY is actually communicating and returning data.

Update include/nuttx/net/mii.h

Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com>
2025-02-12 15:00:19 -03:00
chao an
e5388558a6 qemu/ivshmem: switch proxy/server roles
In this PR we switch proxy/server roles to set proxy as remoteproc master,
This will help us communicate with the linux kernel without making any changes
in the rpproxy_ivshmem configuration.

Build NuttX RTOS:
$ cmake -B proxy -DBOARD_CONFIG=qemu-armv8a:rpproxy_ivshmem -GNinja
$ cmake --build proxy
$ qemu-system-aarch64 -cpu cortex-a53 -nographic -machine virt,virtualization=on,gic-version=3 -kernel proxy/nuttx \
  -device ivshmem-plain,id=shmem0,memdev=shmmem-shmem0,addr=0xb \
  -object memory-backend-file,id=shmmem-shmem0,mem-path=/dev/shm/ivshmem0,size=4194304,share=yes

Bringup Linux Kernel:
$ qemu-system-aarch64 -M virt -cpu cortex-a57 -smp 1 -m 4G -kernel linux/arch/arm64/boot/Image -initrd busybox-1.35.0/initramfs.cpio.gz \
  -nographic -append "init=/init console=ttyAMA0" \
  -device ivshmem-plain,id=shmem0,memdev=shmmem-shmem0,addr=0xb -object \
  memory-backend-file,id=shmmem-shmem0,mem-path=/dev/shm/ivshmem0,size=4194304,share=yes

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd070]
[    0.000000] Linux version 6.14.0-rc1-00035-g998ca87a4914 (archer@archer) (aarch64-linux-gnu-gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #7 SMP PREEMPT Tue Feb 11 12:19:40 CST 2025
[    0.000000] KASLR enabled
[    0.000000] random: crng init done
[    0.000000] Machine model: linux,dummy-virt
...
[    1.001209] remoteproc remoteproc0: ivshmem_rproc is available
[    1.001548] remoteproc remoteproc0: attaching to ivshmem_rproc
[    1.001721] ivshmem_rproc 0000:00:0b.0: dma declare pa=0x80000000d0 dma=0xd0 size=65536
[    1.002164] ivshmem_rproc 0000:00:0b.0: mem entry pa=0x80000100d0 dma=0x100d0, size=4128560
[    1.003605] ivshmem_rproc 0000:00:0b.0: attach entry
[    1.005573] virtio_rpmsg_bus virtio1: rpmsg host is online
[    1.005741] rproc-virtio rproc-virtio.1.auto: registered virtio1 (type 7)
[    1.005873] remoteproc remoteproc0: remote processor ivshmem_rproc is now attached
[    1.012959] virtio_rpmsg_bus virtio1: creating channel rpmsg-syslog addr 0x400
[    1.014240] virtio_rpmsg_bus virtio1: creating channel rpmsg-sensor addr 0x401
[    1.014454] virtio_rpmsg_bus virtio1: creating channel rpmsg-ping addr 0x402
[    1.014644] rpmsg_ping virtio1.rpmsg-ping.-1.1026: rpmsg_ping_probe

below is rpmsg-syslog from NuttX kernel
...
[    1.116680] [    0.000000] [ 0] [  INFO] [proxy] pci_register_rptun_ivshmem_driver: Register ivshmem driver, id=0, cpuname=server, master=0
[    1.116867] [    0.025900] [ 3] [  INFO] [proxy] pci_scan_bus: pci_scan_bus for bus 0
[    1.116987] [    0.026900] [ 3] [  INFO] [proxy] pci_scan_bus: class = 00000600, hdr_type = 00000000
[    1.117121] [    0.027100] [ 3] [  INFO] [proxy] pci_scan_bus: 00:00 [1b36:0008]
[    1.117232] [    0.027500] [ 3] [  INFO] [proxy] pci_setup_device: pbar0 set bad mask
[    1.117349] [    0.027700] [ 3] [  INFO] [proxy] pci_setup_device: pbar1 set bad mask
[    1.117460] [    0.027900] [ 3] [  INFO] [proxy] pci_setup_device: pbar2 set bad mask
[    1.117573] [    0.028100] [ 3] [  INFO] [proxy] pci_setup_device: pbar3 set bad mask
[    1.117692] [    0.028200] [ 3] [  INFO] [proxy] pci_setup_device: pbar4 set bad mask

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-12 15:41:37 +01:00
Matteo Golin
729f8a75f7 drivers/sensors: Added uORB driver for LSM6DSO32 IMU.
Adds support for the LSM6DSO32 IMU by STM using the uORB framework. This
only contains limited support for the I2C interface, interrupt and
polling driven measurement and standard modes of operation (high
performance ODRs). Features like interrupts besides DRDY, filtering,
gesture recognition and acting as a bus master are not implemented.
2025-02-12 10:44:15 -03:00
Ville Juven
597b3e6ca7 mpfs_i2c: Increase TTOA margin to 1ms
Due to interrupt latencies the i2c transfer done interrupt can get
deferred by a few hunder microseconds. This makes the i2c transfer timeout
way too early, even though the i2c IP block is already done.

Fix this by adding a significant amount of margin (1ms) to the timeout
value.
2025-02-12 10:37:03 -03:00
Ville Juven
255d8c57c0 mpfs_i2c: Clean up the logic in i2c_transfer
This removes several error conditions that can be present after a failed
i2c transaction. The most important of them is the priv->sem_isr semaphore
which can be signaled due to a race condition.

This also ensures the i2c device itself is in idle state before futzing
around with it.

Also, add a comment about the SI-flag in the I2C CTRL register; it has
a hidden dual meaning. Not only does it clear a pending interrupt, it
also moves the I2C IP state machine forward. This requires extra logic
in the driver to cope.
2025-02-12 10:37:03 -03:00
zhaohaiyang1
e657b35720 nuttx/can: Modify poll logic to bind can_reader_s and pollfd.
For clearing some variables corresponding with the pollfds of the felip in can_close API, we modify poll logic by binding can_reader_s and pollfd.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2025-02-12 10:28:21 -03:00
Laczen JMS
31270a8479 net: fix ipv6_input for 6lowpan
6lowpan response for tcp and icmp was mssing because of wrong evaluation
of `dev->d_lltype`.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-02-12 10:19:50 -03:00
Ramin Seyed-Moussavi
381d3fe64f arch/arm/max326xx: add max32690 icc updates
Add updates for MAX32690 Instruction Cache Controller to enhance device support in NuttX architecture.
2025-02-11 12:27:10 -03:00
Ramin Seyed-Moussavi
e99c516a91 arch/arm/max326xx: add max32690 memorymappings
Adds memory mappings for the MAX32690 to extend support for this device in the NuttX architecture.
2025-02-11 12:27:10 -03:00
Ramin Seyed-Moussavi
a691ed84d2 arch/arm/max326xx: add max32690 global control bit definitions
Adds definitions for the global control bits of the MAX32690 to improve support for this device in the NuttX architecture.
2025-02-11 12:27:10 -03:00
Ramin Seyed-Moussavi
a4cfd5f9da arch/arm/max326xx: add max32690 irq and peripheral clock definitions
Add IRQ and peripheral definitions for MAX32690 to enhance device support in NuttX architecture.
2025-02-11 12:27:10 -03:00
Yanfeng Liu
225197b779 littlefs/cmake: fix build issue
This fixes issue on Ubuntu 22.04 with cmake v3.22.1:

```
/usr/bin/arm-none-eabi-gcc -D-DLFS_ASSERT=DEBUGASSERT -D-DLFS_CONFIG=/home/yf/Projects/Nuttx/nuttx/fs/littlefs/lfs_vfs.h -D-DLFS_DEBUG=finfo -D-DLFS_ERROR=ferr -D-DLFS_TRACE=finfo -D-DLFS_WARN=fwarn -DLFS_ATTR_MAX=1022 -DLFS_FILE_MAX=2147483647 -DLFS_NAME_MAX=32 -D__KERNEL__ -D__NuttX__
```

It happeed when building `qemu-armv7a:rpproxy_ivshmem`.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-11 23:22:07 +08:00
Yanfeng Liu
35e5612bce arch/armv7-r: select ARM_THUMB
This selects ARM_THUMB for ARMV7R per ARM document:
https://developer.arm.com/documentation/dui0471

Thanks to hujun260 for spotting this, now ostest works.

Why it helps is still to be clarified, the `arm_signal_handler.S`
might require this THUMB option.

To keep ARM_THUMB as option, this only selects it for
PROTECTED as per anchao's suggestion.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-11 19:37:14 +08:00
Yanfeng Liu
ab877b5c93 arm/qemu-armv7r: add heap alloc
This adds up_allocate_heap() support for PROTECTED mode so that
kernel and user heap sizes match memory.ld linker script.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-11 19:37:14 +08:00
Yanfeng Liu
79c2f4f394 arch/armv7-r: fix SYS_task_start
This fixes task start syscall in PROTECTED mode, following that
of armv7-m so that hello and getprime programs can run smoothly.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-11 19:37:14 +08:00
Yanfeng Liu
b7fc3aa034 arch/qemu: cortex-r5 PROTECTED support
This adds MPU and userspace handling in QEMU chips so that to
boot PROTECTED target qemu-armv7r:pnsh.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-11 19:37:14 +08:00
Yanfeng Liu
1cecf6791d arch/armv7-r: add undefined mpu_region_s
This copies struct mpu_region_s from armv7-m to fix PROTECTED mode
build error: `invalid use of undefined type 'struct mpu_region_s'`

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-11 19:37:14 +08:00
Yanfeng Liu
f1957845b9 arch/armv7-r: fix undefined ARCH_DATA_RESERVE
This fixes undefined 'ARCH_DATA_RESERVE' in arm_syscall.c:382 so
that to build qemu-armv7r:pnsh. Per nuttx/addrenv.h, that macro
is defined for BUILD_KERNEL, we need use BUILD_PROTECTED now.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-11 19:37:14 +08:00
Yanfeng Liu
b1bd1b292e arch/armv7-r: fix irq.h for PROTECTED mode
This fixes below issues when building for PROTECTED mode:
- `common/arm_fork.c:223 'struct xcpt_syscall_s' has no member 'cpsr'`
- `armv7-r/arm_syscall.c:454 'xcptcontext' has no member 'sigreturn'`

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-02-11 19:37:14 +08:00
dongjiuzhu1
34bde7b80a qemu/armv7a: register cfi flash
search the device tree and register cfi flash

test flowchart:
mount -t littlefs -o autoformat /dev/cfi-flash1 /data
fstest -m /data

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-02-11 17:23:44 +08:00
dongjiuzhu1
ef24233501 qemu/armv7-a: adjust flash size to free area to register cfi flash
122M->48M, free second cfi flash as filesystem

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-02-11 17:23:44 +08:00
zhengyu9
2c4285d9ac mtd/mtd_cfi: cfi flash bind to mtd interface
Bind cfi flash driver with the existing mtd interface

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-02-11 17:23:44 +08:00
zhengyu9
ac019bbfa2 drivers/mtd: cfi-flash driver
Realization of cfi-flash driver.
Add the interfaces of intel and amd command sets.

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-02-11 17:23:44 +08:00
Rodrigo Sim
405287081d boards/arm Add support to Seeed Xiao nRF52840 Board
Signed-off-by: Rodrigo Sim <rcsim10@gmail.com>
2025-02-10 17:08:37 -03:00
simbit18
71a221708c [Kconfig] Fix Kconfig style
drivers\sensors\Kconfig

Remove spaces from Kconfig files
Add TABs
2025-02-10 17:08:16 -03:00
Laczen JMS
6b5fccb32c esp32: add espnow documentation and defconfig.
Added documentation for espnow and a default defconfig to illustrate
the use of espnow for udp communication.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-02-10 16:15:25 -03:00
Laczen JMS
eba0362bde esp32: Add support for espnow based pktradio
Espnow is a connectionless WiFi communication protocol that can be used
to exchange information between esp nodes.

A espnow pktradio driver is proposed that allows building a 6lowpan
network of nodes.

The driver has been evaluated using udpclient & server running on
different devices.

Solves #15347

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-02-10 16:15:25 -03:00
chao an
69b0cefe80 arm64/qemu-armv8a/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-10 15:47:05 -03:00
chao an
7e96b0d934 drivers/devicetree: fix typo FDT_PCI_PREFTCH -> FDT_PCI_PREFETCH
should be FDT_PCI_PREFETCH

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-10 15:47:05 -03:00