Commit graph

57534 commits

Author SHA1 Message Date
chenrun1
99a1f0dc65 inet_sockif:support multiple iov recv
Summary:
  Implement multiple iovlen recvmsg in inet_sockif, only TCP mode
  support at current.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-20 17:12:14 +08:00
Zhe Weng
87a7714103 net: Split msg_iovlen check in recvmsg into each protocol
To prepare for supporting multiple iov in each protocol.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-01-20 17:12:14 +08:00
chenrun1
4d17c353dd v9fs:socket driver
Summary:
  1.Add new api for socket parsing header - v9fs_parse_size
  2.Add socket driver for 9pfs

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-20 17:12:14 +08:00
wangzhi16
5f77da4c51 Use small lock to protect timer related resources in arch ARM.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-20 17:02:30 +08:00
chao an
e1285d73fa Documentation: Replace NSH_LINELEN with LINE_MAX
forget in:
commit 38a0049f56
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Sun Jan 19 11:59:01 2025 +0800

    Documentation: Replace NSH_LINELEN with LINE_MAX

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-20 16:44:55 +08:00
wangzhi16
e177ff9c0c Use small lock to protect usbdev and endpoint in arch ARM.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-20 11:47:19 +08:00
Jorge Guzman
4857ea211f stm32h7/linum-stm32h753bi: add touch screen support
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2025-01-20 09:20:51 +08:00
wanggang26
1fd21bbd69 coredump: fix crash dump failed when items of pr_regs not equal with regs_num
elf_emit_tcb_note: nitems(status.pr_regs) is 18, g_tcbinfo.regs_num is 17, then g_tcbinfo.reg_off.p[17] has been out of bounds

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2025-01-19 19:43:53 +08:00
Xiang Xiao
38a0049f56 Documentation: Replace NSH_LINELEN with LINE_MAX
forget in:
commit 71a37b4f2d
Author: chao an <anchao.archer@bytedance.com>
Date:   Wed Jan 15 09:56:44 2025 +0800

    Documentation: clean up of CONFIG_NSH_LINELEN define

    Signed-off-by: chao an <anchao.archer@bytedance.com>

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-19 18:38:46 +08:00
hujun5
3193457dd0 sched/timer: remove critical section in setitimer
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-19 17:08:32 +08:00
hujun5
fcfc300f7a group: use tg_mutex to replace tg_joinlock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-19 17:08:32 +08:00
hujun5
544da3c64c sched/timer: remove critical section in timer_deleteall
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-19 17:08:32 +08:00
hujun5
7c9c9422d0 fix compile error
common/espressif/esp_pcnt.c: In function 'esp_pcnt_isr_default':
common/espressif/esp_pcnt.c:396:41: warning: passing argument 1 of 'spin_lock_irqsave' makes pointer from integer without a cast [-Wint-conversion]
  396 |           flags = spin_lock_irqsave(unit->lock);
      |                                     ~~~~^~~~~~
      |                                         |
      |                                         spinlock_t {aka unsigned char}
In file included from common/espressif/esp_pcnt.c:44:
/home/hujun5/下载/vela_sim/nuttx/include/nuttx/spinlock.h:507:55: note: expected 'volatile spinlock_t *' {aka 'volatile unsigned char *'} but argument is of type 'spinlock_t' {aka 'unsigned char'}
  507 | irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
      |                                  ~~~~~~~~~~~~~~~~~~~~~^~~~

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-19 17:04:36 +08:00
Ian Douglas Scott
c937899997 rp2040: Set BOARD_XOSC_STARTUPDELAY for Adafruit, Seeed XIAO
This matches how `PICO_XOSC_STARTUP_DELAY_MULTIPLIER` is set in
pico-sdk.

This should fix issues on startup for some units of these boards. It
seems not all are affected. See
https://github.com/raspberrypi/pico-sdk/pull/457 and the issue linked
there for more information.

Signed-off-by: Ian Douglas Scott <ian@iandouglasscott.com>
2025-01-18 21:05:07 +08:00
Ian Douglas Scott
806c063223 arm/rp2040,rp2350: Allow configuring XOSC startup delay
This follows the formula in the "Startup Delay" section of the
datasheets, where `BOARD_XOSC_STARTUPDELAY` is the time in milliseconds,
which is then multiplied by the clock fequency in kHz, divided by 256
cycles, and rounded up.

This differs from `pico-sdk`, which just multiplied the value of the
expression it previously used by a `PICO_XOSC_STARTUP_DELAY_MULTIPLIER`.
This seems less correct, though it should be essentially the same except
rounding. (`BOARD_XOSC_STARTUPDELAY_MULTIPLIER` also wouldn't fit nicely
the way the `#define`s are aligned.)

This sets `BOARD_XOSC_STARTUPDELAY` to `1` for all boards, so this will
produce the same output and not change behavior.

Signed-off-by: Ian Douglas Scott <ian@iandouglasscott.com>
2025-01-18 21:05:07 +08:00
Ian Douglas Scott
4401036406 arm/rp2040,rp2350: Use BOARD_XOSC_FREQ for calculating startup delay
Previously this used a hard-coded value of 12 MHz, but this presumably
should use `BOARD_XOSC_FREQ`. Similarly to how it is done in pico-sdk.

It looks like all boards are currently defined to use 12 MHz XOSC
clocks, so this won't change behavior with any of them.

Signed-off-by: Ian Douglas Scott <ian@iandouglasscott.com>
2025-01-18 21:05:07 +08:00
chao an
9f5a45340f cmake: Use EXTRAFLAGS to define customized compilation options
align them with the usage habits of makefile

cmake:

cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja -DEXTRAFLAGS="-DCONFIG_AAA=1 -DCONFIG_BBB=1 -Werror"

makefile:

make -j12 EXTRAFLAGS="-DCONFIG_AAA=1 -DCONFIG_BBB=1 -Werror"

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-18 14:12:49 +08:00
Ville Juven
4c2be5bb7f mpfs_opensbi_setup: Provide hartid and next_addr as parameters
No reason to keep asking for these over and over. Also fix bumping
the CPU booted counter when SBI is enabled.

Must also read g_hart_use_sbi before bumping the CPU booted counter.
2025-01-18 10:11:32 +08:00
chao an
36b2b90bc0 cmake/mkconfig: add support of set custom command options to config.h
add support of set custom command options to config.h
Use the -D parameter to pass the config to header file.
NOTE which must begin with the CONFIG_ prefix.
eg:
  cmake -DCONFIG_AAA=1 -DCONFIG_BBB=1 -B build -DBOARD_CONFIG=sim/nsh -GNinja

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-17 22:00:07 -03:00
Yanfeng Liu
e0ed715076 boards/arm: add qemu-armv7r board
This adds support for qemu-armv7r board with flat mode sample
config for using with QEMU emulated Cortex-R5 processor.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-17 17:50:33 -03:00
Yanfeng Liu
55e1e11f1e arm/chip/qemu: add chip QEMU_CORTEXR5
This adds support for QEMU Cortex-R5 virtual processor on existing QEMU
Cortex-A7 code base with profile support in `armv7-r/` and `armv7-a/`.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-17 17:50:33 -03:00
Yanfeng Liu
3f85df583c arch/armv7-r: revise headers to support QEMU armv7-r
This revise armv7-r/ header files needed to support QEMU cortex-r5
virtual process for armv7-r family.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-17 17:50:33 -03:00
chao an
2779989add sched/wqueue: some minor improve to reduce sched_lock range
Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-17 23:33:23 +08:00
simbit18
1bfd1d7303 [CI] testbuild.sh: Msys2 fix toolchain change
In the Msys2 (Windows) environment, this search filter is not sufficient.

$ grep _TOOLCHAIN_ .config | grep -v CONFIG_ARCH_TOOLCHAIN_* | grep =y
CONFIG_TOOLCHAIN_WINDOWS=y
CONFIG_ARM_TOOLCHAIN_GNU_EABI=y

It is necessary to add
$ grep _TOOLCHAIN_ .config |  grep -v CONFIG_TOOLCHAIN_WINDOWS | grep -v CONFIG_ARCH_TOOLCHAIN_* | grep =y
CONFIG_ARM_TOOLCHAIN_GNU_EABI=y
2025-01-17 23:25:46 +08:00
Yanfeng Liu
1b369544ca modlib/gnu-elf.ld.in: fix regression with armv7a
As armv7-a addrenv layout is not in line with other archs, we need
align it with others by defining ARCH_DATA_RESERVE_SIZE as same as
MM_PGSIZE for now to keep gnu-elf.ld.in unified.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-17 23:16:26 +08:00
raiden00pl
d4a0abec82 sched/mqueue/CMakeLists.txt: fix compilation for CONFIG_DISABLE_MQUEUE_SYSV=n
fix compilation for CONFIG_DISABLE_MQUEUE_SYSV=n in cmake
2025-01-17 23:14:39 +08:00
Yanfeng Liu
1bfff5a38d arch/armv7-r: fix gic.h build error
This fixes compilation error:

```
/tmp/nuttx/arch/arm/src/armv7-r/gic.h:699:17: error:
'GIC_ICDSGIR_NSATT_GRP1' undeclared; did you mean 'GIC_ICDSGIR_NSATT'?
```

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-17 19:01:22 +08:00
hujun5
b8660fc39c sim: fix regression from https://github.com/apache/nuttx/pull/14623
reason:
work_timer_expiry may be called in thread context

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-17 18:59:29 +08:00
Yanfeng Liu
8f435a2941 arch/Kconfig: allow FLASH config for non-MMU chips
This allows using FLASH_START and FLASH_SIZE config for chips with
no MMU.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-17 16:38:17 +08:00
liuhongchao
1e2c002a10 nuttx: add open and close callback functions for the mouse.
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2025-01-17 09:19:18 +08:00
liuhongchao
6bfec7e822 nuttx: Open mouse/touch/keyboard options can be configured
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2025-01-17 09:19:18 +08:00
liuhongchao
41688a8f13 nuttx: Support for rpmsgdev custom ioctl
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2025-01-17 09:19:18 +08:00
liuhongchao
6dbd355c1f nuttx: Support for the mouse ioctl interface
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2025-01-17 09:19:18 +08:00
Matteo Golin
c15b900a88 sensors/sht4x: Converted SHT4X driver to UORB framework. 2025-01-17 09:08:21 +08:00
Tim Hardisty
acd7e44cad Add GD55 QSPI NOR Flash support 2025-01-17 09:07:22 +08:00
Matteo Golin
5de7e240af sensors/msxxxx-crc4: Modify CRC calculation so that it passes with MS5611. 2025-01-17 09:05:54 +08:00
chao an
67582acc14 sched/wqueue: fix potential deadlock
sched_unlock() should called after spin_unlock

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-17 09:05:37 +08:00
chao an
8877366c0e sched/wdog: remove wd_cancel_irq() implement
we do not need this implement after change the lock from csec to spin_lock

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-17 09:05:11 +08:00
Huang Qi
bac2df6bc8 risc-v: replace fence.i with __ISB for instruction sync
Summary:
- Replace direct use of `fence.i` instruction with `__ISB()` macro for instruction synchronization
- This change improves portability while maintaining the same functionality

Impact:
- No functional changes - both `fence.i` and `__ISB()` ensure instruction
synchronization on RISC-V
- Makes the code more maintainable by using the architecture abstraction
layer

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-17 09:04:45 +08:00
Huang Qi
56415a0275 libc/gnssutils: remove C99 standard flag from Make.defs
Summary:
- Removed explicit -std=c99 flag from Make.defs
- The project-wide C standard is already set at a higher level
- Keeps build configuration consistent across the codebase

Impact:
- No functional changes to the code
- Maintains consistency with project-wide C standard settings

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-17 09:03:18 +08:00
wangjianyu3
7cf82fe422 libs/lib_tempbuffer: set errno when fails
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-17 08:16:14 +08:00
stbenn
b561b4459b Add uid file needed for ethernet
copied over files, not modified properly yet

Squashing lots of define errors to get ethernet.c working

quick path rename

Fix STM32_EMAC_BASE (and ICACHE/DCACHE Bases). Enable ETH, ETHTX, and ETHRX with CONFIG_STM32H5_ETHMAC (like H7 does).

Fixed stm32_get_uniqueid

Previously, an exception occurred as a result of calling this function. The problem turned out to be this line: uniqueid[i] = *((uint8_t *)(STM32_SYSMEM_UID) + i);. Dereferencing a 32-bit register as a 8-bit register seemed to be causing this issue. I think this function is better anyway, fewer register accesses and loop iterations.

Turn on SBS peripheral when using Ethernet

The SBS peripheral is required to be turned on because the ETH_SEL_PHY bits need to be set. Without turning this on, RMII mode is not possible. MII may not work either.

Style Updates
2025-01-16 18:48:57 -03:00
chenrun1
118f827103 sim_hostfs:add host_errno_convert API for convert result
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-15 23:33:53 +08:00
Filipe Cavalcanti
027a57071a boards/xtensa: disable DEV_CONSOLE on usbnsh defconfig 2025-01-15 23:33:10 +08:00
chenrun1
0c97296f39 syslog_intbuffer:fix build warning
CC:  mqueue/msgsnd.c syslog/syslog_intbuffer.c: In function 'syslog_flush_internal':
syslog/syslog_intbuffer.c:99:14: warning: unused variable 'flags' [-Wunused-variable]
   99 |   irqstate_t flags;
      |              ^~~~~

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-15 23:30:00 +08:00
chenrun1
3b6f463ce2 syslog_inbuffer:Fixed the lock reentry issue in single core + spinlock scenario
Summary:
  When spinlock.h is enabled in a single-core scenario, spinlock reentry and exceptions may occur when spin_lock_irqsave_wo_note is used in syslog_add_intbuffer

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-15 23:30:00 +08:00
Yanfeng Liu
ad7198069d arm/qemu: select PSCI at processor level
This moves ARM_HAVE_PSCI selection to virtual processor level as
armv7-r chips like Cortex-R5 doesn't have it.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-15 12:23:09 -03:00
chao an
dedb57cb2d libc/unistd: move NAME_MAX/LINE_MAX/PATH_MAX define to unistd
These options are unistd-specific and should not be filesystem dependent,
and also not suitable for define in the sched directory.

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-15 23:17:51 +08:00
chao an
71a37b4f2d Documentation: clean up of CONFIG_NSH_LINELEN define
Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-15 23:17:51 +08:00
Pavel Pisa
46c3f354b3 drivers/can: ctucanfd the first round of fixes - mainly for char dev
Corrected CAN FD messages sending in character driver mode.
Assign CAN FD format flag in reception of CAN FD messages.
Corrected some defines mismatches.

The code has been tested in QEMU

qemu-system-x86_64 -m 2G -enable-kvm -smp 1 \
  -cpu host,+pcid,+x2apic,+tsc-deadline,+xsave,+rdrand \
  -kernel nuttx/nuttx \
  -nographic -serial mon:stdio \
  -object can-bus,id=canbus0-bus \
  -object can-host-socketcan,if=can0,canbus=canbus0-bus,id=canbus0-socketcan \
  -device ctucan_pci,canbus0=canbus0-bus,canbus1=canbus0-bus

The overall state of this third party CTU CAN FD driver in NuttX
is far from ideal. It would worth to consult and follow more
closely our Linux kernel driver and even better RTEMS CAN/CAN FD
stack design

  https://canbus.pages.fel.cvut.cz/#cancan-fd-subsystem-and-drivers-for-rtems

Signed-off-by: Pavel Pisa <pisa@fel.cvut.cz>
2025-01-15 13:47:04 +01:00