Commit graph

57021 commits

Author SHA1 Message Date
simbit18
9c9b945876 fix nxstyle
Removed extra spaces from .h and .c files
2024-11-28 20:40:13 +08:00
yangao1
968bb179fe nuttxgdb/rpmsg.py:dump rpmsg_service message
(gdb)rpmsg_service
g_rpmsg_cb:
rpmsg_cb_s at        ns_match                                 ns_bind
-------------        --------                                 -------
0xf4e00ac0           0x44708225 <rpmsg_rtc_server_ns_match>   0x4470874c <rpmsg_rtc_server_ns_bind>
0xf4e27b20           0x440c8fd6 <syslog_rpmsg_ns_match>       0x440c966a <syslog_rpmsg_ns_bind>
0xf4e27af0           0x0                                      0x0
g_rpmsg:
Endpoint at          Name                 local Addr   dest Addr    cb                                       ns_bound_cb                              ns_unbind_cb
-----------          ----                 ----------   ---------    --                                       -----------                              ------------
0xf2302ac0           NS                   53           53           0x44699520 <rpmsg_virtio_ns_callback>    0x0                                      0x0
0xf3c0f920           rpmsg-ttysensor      1025         1028         0x44704457 <uart_rpmsg_ept_cb>           0x0                                      0x0
0xf301d058           rpmsg-sensor         1026         1029         0x440c1680 <sensor_rpmsg_ept_cb>         0x440c1871 <sensor_rpmsg_device_ns_bound> 0x44693a18 <rpmsg_destroy_ept>
0xf2302a6c           rpmsg-ping           1027         1036         0x440a10d2 <rpmsg_ping_ept_cb>           0x0                                      0x0

List update: rpmsg dump contains none initialized list, need to take care of it in
NxList.

Signed-off-by: yangao1 <yangao1@xiaomi.com>
2024-11-28 20:40:04 +08:00
wangmingrong1
07493f1c8e gcov: Add gcov gcc implementation and toolchain to ci compilation
When running qemu/nsh_smp or sim/nsh configuration, run gcov -d /tmp/xxx
to save all gcov generated data and export them to the host. Use
./tools/gcov.sh to parse and generate reports. For details, see:
Documentation/applications/system/gcov/index.rst

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-28 19:35:34 +08:00
YAMAMOTO Takashi
388ab6c2db esp32s3: don't clear pending interrupts on eg. up_putc
Fixes https://github.com/apache/nuttx/issues/14872
2024-11-28 19:00:21 +08:00
hujun5
0bba53ce12 remove redundant scheduling records
reason:
Since the scheduling records have already been moved to the interrupt exit in this submission,
we need to delete the original records' locations.
This commit fixes the regression from https://github.com/apache/nuttx/pull/13651

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-28 18:56:13 +08:00
guoshichao
a2fcd9862c nuttx/arch: remove the custom board check in up_testset implementation
the up_testset implementation is common code, should not add custom
board check

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-11-28 15:06:57 +08:00
wangmingrong1
4daafd0781 Fix path error
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-28 15:04:59 +08:00
Jouni Ukkonen
6b38b83331 arch/arm64/imx9: Clear DMA channel interrupts on init
Avoid spurious interrupts on reboot

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-28 15:02:15 +08:00
Jouni Ukkonen
1d23baaa63 arch/arm64/imx9/imx9_flexspi: Replace memcpy by while loop
libc memcpy cannot access fspi memory space correctly
remove unnecessary debugassert and cache operations

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-28 15:00:33 +08:00
simbit18
0476895c0d fix nxstyle
Remove TABs
2024-11-28 09:14:49 +08:00
Ville Juven
51171d66f2 riscv/riscv_ipi.h: Do not write to CSR_MIP.MSIP as it is read-only
From the RISV-V Privileged Spec v1.10 (3.1.14 MIP/MIE):

Only the bits corresponding to lower-privilege software interrupts
(USIP, SSIP), timer interrupts (UTIP, STIP), and external interrupts
(UEIP, SEIP) in mip are writable through this CSR address; the
remaining bits are read-only.

Thus, it is futile to write to the M-mode status bit via the CSR, only
access via RISCV_IPI is valid.
2024-11-28 09:14:07 +08:00
p-szafonimateusz
eca40ff053 arch/x86_64/intel64: re-enable interrupts before syscall handle
arch/x86_64/intel64: re-enable interrupts before syscall handle
2024-11-27 13:32:23 -03:00
p-szafonimateusz
908ac756ea arch/x86_64/intel64: remove unnecessary nested syscalls logic
remove unnecessary nested syscalls logic, it's already handled different way
2024-11-27 13:32:23 -03:00
p-szafonimateusz
c02dba9a0d Documentation: add x86_64 kernel build configs
Documentation: add x86_64 kernel build configs
2024-11-27 13:32:23 -03:00
p-szafonimateusz
e7d6f2c044 arch/x86_64/intel64_irq.c: remove some magic numbers
arch/x86_64/intel64_irq.c: remove some magic numbers

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
p-szafonimateusz
fc965b856b boards/qemu-intel64: add kernel build (ROMFS) configurations
knsh_romfs - for QEMU and legacy serial port
knsh_romfs_pci - for bare-metal Intel hardware and PCI serial port

Steps to build kernel image with user-space apps in romfs:

$ ./tools/configure.sh qemu-intel64/knsh_romfs
$ make -j
$ make export -j
$ pushd ../apps
$ ./tools/mkimport.sh -z -x ../nuttx/nuttx-export-*.tar.gz
$ make import -j
$ ./tools/mkromfsimg.sh
$ mv boot_romfsimg.h ../nuttx/arch/x86_64/src/board/romfs_boot.c
$ popd
$ make -j

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
p-szafonimateusz
e95ea6fbc4 arch/x86_64: handle TLB shootdown
arch/x86_64: handle TLB shootdown

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
p-szafonimateusz
ce22c28e88 arch/x86_64: add kernel stack support
arch/x86_64: add kernel stack support

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
p-szafonimateusz
712e8d9cc7 arch/x86_64: add kernel build support
arch/x86_64: add kernel build support

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
p-szafonimateusz
8702fbef8d arch/x86_64/include/intel64/arch.h: align definitions
arch/x86_64/include/intel64/arch.h: align definitions

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
p-szafonimateusz
d51ceccd7b arch/x86_64: add syscalls support
arch/x86_64: add syscalls support

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
p-szafonimateusz
7f4279b8af arch/x86_64/: fix broken set_cr3()
arch/x86_64/: fix broken set_cr3()

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
wangjianyu3
289f43f0ad Documentation/esp32s3-devkit: Add doc for esp32s3-devkit/USBMSC
More details

  https://nuttx.apache.org/docs/latest/applications/system/usbmsc/index.html
  https://github.com/apache/nuttx/pull/14966

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-27 13:30:44 -03:00
wangjianyu3
1cfaff011e esp32s3-devkit/usbmsc: Initializing configuration for USBMSC
USBMSC - USB Mass Storage Class

Build

  $ ./tools/configure.sh -l esp32s3-devkit:usbmsc
  $ make flash ESPTOOL_PORT=/dev/ttyACMx

Runtime

  # Device
  nsh> mkrd -m 10 -s 512 640
  nsh> msconn

  # Host
  $ sudo mkfs.ext4 /dev/sdx
  $ sudo mount /dev/sdx ./mnt/

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-27 13:30:44 -03:00
wangjianyu3
ffa2209b4a boards/xtensa/esp32s3: Add USB MSC support for esp32s3
Test

  # Device:/dev/ram10 <----> Host:/dev/sde

  # Device (NuttX)
    nsh> mkrd -m 10 -s 512 640
    nsh> msconn
    nsh> ls -l /dev/ram10
     brw-rw-rw-      327680 /dev/ram10

  # Host (e.g /dev/sde)
    $ sudo mkfs.ext4 /dev/sdx
    $ sudo mount /dev/sdx /workspace/mnt

  #   Part of `df -h`
    /dev/sdx        292K   24K  248K   9% /workspace/mnt

  #   dmesg (/dev/sdd, /dev/sde)
    [1116587.199896] usb 1-10: new full-speed USB device number 122 using xhci_hcd
    [1116587.369226] usb 1-10: New USB device found, idVendor=584e, idProduct=5342, bcdDevice= 3.99
    [1116587.369231] usb 1-10: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [1116587.369232] usb 1-10: Product: Mass Storage
    [1116587.369233] usb 1-10: Manufacturer: NuttX
    [1116587.369234] usb 1-10: SerialNumber: 0101
    [1116587.385275] usb-storage 1-10:1.0: USB Mass Storage device detected
    [1116587.385526] scsi host5: usb-storage 1-10:1.0
    [1116588.423335] scsi 5:0:0:0: Direct-Access     NuttX    Mass Storage     0101 PQ: 0 ANSI: 2
    [1116588.423746] scsi 5:0:0:1: Direct-Access     NuttX    Mass Storage     0101 PQ: 0 ANSI: 2
    [1116588.424001] sd 5:0:0:0: Attached scsi generic sg3 type 0
    [1116588.424181] sd 5:0:0:1: Attached scsi generic sg4 type 0
    [1116588.424305] sd 5:0:0:0: [sdd] Unsupported sector size 256.
    [1116588.425336] sd 5:0:0:1: [sde] 640 512-byte logical blocks: (328 kB/320 KiB)
    [1116588.638620] sd 5:0:0:1: [sde] Write Protect is off
    [1116588.638624] sd 5:0:0:1: [sde] Mode Sense: 0f 00 00 00
    [1116588.858793] sd 5:0:0:0: [sdd] 0 512-byte logical blocks: (0 B/0 B)
    [1116588.858797] sd 5:0:0:0: [sdd] 256-byte physical blocks
    [1116589.078698] sd 5:0:0:0: [sdd] Write Protect is off
    [1116589.078702] sd 5:0:0:0: [sdd] Mode Sense: 0f 00 00 00
    [1116589.298629] sd 5:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    [1116589.298903] sd 5:0:0:0: [sdd] Attached SCSI disk
    [1116589.518626] sd 5:0:0:1: [sde] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    [1116589.972872] sd 5:0:0:1: [sde] Attached SCSI disk
    [1116644.299819] EXT4-fs (sde): mounted filesystem d4e18b90-b0c3-4a0f-8969-2493a41c5e02 r/w without journal. Quota mode: none.

Copy from boards/arm/rp2040/common/src/rp2040_usbmsc.c

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-27 13:30:44 -03:00
Jinliang Li
37a0445ddb armv8-r/gicv3: support fiq
1. support fiq decoding and dispatch
2. replace CONFIG_ARMV8R_DECODEFIQ with CONFIG_ARCH_HIPRI_INTERRUPT

Signed-off-by: Jinliang Li <lijinliang1@lixiang.com>
2024-11-27 14:28:27 +08:00
p-szafonimateusz
825ba8ed7b arch/x86_64/intel64: fix revoke_low_memory
fix revoke_low_memory, problem found by Xiangzhen Ouyang.

g_pt_low mapping is removed during revoke_low_memory so we can't access this memory area with 1:1 mapping.
This logic has been broken for a long time, but for some reason it worked without any crash at boot.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 03:28:37 +08:00
p-szafonimateusz
894b0f956b arch/x86_64/intel64: up_disable_irq should work from any CPU
simplify interrupt logic and allow any CPU
to disable interrupt, not only CPU that enabled it.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 03:03:05 +08:00
hujun5
ef313755e7 sched: replace up_cpu_index with this_cpu
Make this_cpu is arch independent and up_cpu_index do that.
In AMP mode, up_cpu_index() may return the index of the physical core.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-27 03:00:32 +08:00
YAMAMOTO Takashi
925573da2a esp32s3-devkit/toywasm: use littlefs 2.9.3
I chose this config because I have a hardware and I occasionally
use littlefs on its flash.
2024-11-27 02:56:52 +08:00
YAMAMOTO Takashi
6ebfe8c51f linum-stm32h753bi/littlefs: use littlefs 2.9.3
I chose this config just because it seems to support cmake-based build.
2024-11-27 02:56:52 +08:00
YAMAMOTO Takashi
610c72ccd0 fs/littlefs: add LFS_MULTIVERSION support 2024-11-27 02:56:52 +08:00
YAMAMOTO Takashi
abd769dcb0 fs/littlefs: disable -Wshadow and explain why 2024-11-27 02:56:52 +08:00
YAMAMOTO Takashi
f7e2e23f12 fs/littlefs: stop applying local patches for unknown versions of littlefs
Because they are not expected to apply cleanly.
In that case, disable all features which require the local patches.

Note: lfs_util.patch is actually necessary regardless of
the littlefs version. It should be ok to drop it for the simplest
flat memory model configurations with a single heap though. I plan
to fix it once littlefs 2.9.4 is released.

Tested with esp32s3-devkitc:toywasm + CONFIG_FS_LITTLEFS_VERSION="v2.9.3".
2024-11-27 02:56:52 +08:00
YAMAMOTO Takashi
0157118ead fs/littlefs: don't use lfs_getsetattr.patch unless FS_LITTLEFS_ATTR_UPDATE 2024-11-27 02:56:52 +08:00
zhanghongyu
ba419cc894 drivers/net/{e1000|igc}: limit no packet is transmit after carrier off
if the drvier tx queue is full up during the network cable unplugging,
there will be no txdone interrupt after inserting the network cable,
transmit cannot be recovered.

Modified to no longer fill the driver with packet when link down.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-11-27 02:46:04 +08:00
p-szafonimateusz
0932fccfb2 drivers/net/{e1000|igc}: reset TX ring when disconnected
drivers/net/{e1000|igc}: reset TX ring when disconnected

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 02:46:04 +08:00
p-szafonimateusz
ada47439bd drivers/net/{e1000|igc}: fix link status crash
netdev_lower_carrier_xxx API can't be used in interrupt context

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 02:46:04 +08:00
p-szafonimateusz
5e48f2a3d8 drivers/net/igc: make Interrupt Throttle configurable
make Interrupt Throttle configurable for igc

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 02:46:04 +08:00
p-szafonimateusz
bf4eadf735 drivers/net/{e1000|igc}: configure RX/TX descriptors from Kconfig
configure E1000/IGC RX/TX descriptors from Kconfig

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 02:46:04 +08:00
wangjianyu3
3d5cf53624 Documentation/esp32s3-devkit: Add doc for esp32s3-devkit/TXTABLE
More details

  https://github.com/apache/nuttx/pull/9936
  https://nuttx.apache.org/docs/latest/components/filesystem/partition.html#text-based-partition-table

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-27 02:45:44 +08:00
wangjianyu3
c2228c39ac esp32s3-devkit/txtable: Initializing configuration for TXTABLE
USB ADB is enabled - Based on esp32s3-devkit/adb

Build

  ./tools/configure.sh -l esp32s3-devkit:txtable
  make -j16
  make flash ESPTOOL_PORT=/dev/ttyACMx

Test

  $ adb -s 1234 shell
  nsh> cat /etc/txtable.txt
  TXTABLE0
  data 0x100000 0
  nsh> ls -l /dev/data
   frw-rw-rw-     1044480 /dev/data
  nsh>

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-27 02:45:44 +08:00
wangjianyu3
57595a7937 boards/xtensa/esp32s3: Add TXTABLE support for esp32s3
TXTABLE - Text based Partition Table

  https://github.com/apache/nuttx/pull/9936
  https://nuttx.apache.org/docs/latest/components/filesystem/partition.html#text-based-partition-table

Configuration

  + CONFIG_TXTABLE_PARTITION=y

The backup text partition table

  + CONFIG_TXTABLE_DEFAULT_PARTITION=1

  nsh> cat /etc/txtable.txt
  TXTABLE0
  data 0x100000 0

Update txtable at runtime

  dd if=/dev/zero of=/dev/txtable
  cat /etc/txtable.txt > /dev/txtable

Runtime - Partition devices "data" and "txtable" were registered

  # /dev/data    - The partition descirbed by txtable
  # /dev/txtable - Mapping to the last eraseblock of MTD

  nsh> ls -l /dev/
  /dev:
   dr--r--r--           0 adb0/
   crw-rw-rw-           0 console
   frw-rw-rw-     1044480 data
   frw-rw-rw-     1048576 esp32s3flash
   c-w--w--w-           0 log
   crw-rw-rw-           0 null
   crw-rw-rw-           0 ptmx
   dr--r--r--           0 pts/
   brw-rw-rw-        1024 ram0
   crw-rw-rw-           0 ttyS0
   frw-rw-rw-        4096 txtable
   crw-rw-rw-           0 zero

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-27 02:45:44 +08:00
simbit18
430c2ecf46 arch/risc-v/src/cmake/Toolchain.cmake: Msys2 Cmake fixed nuttx/config.h: No such file or directory
fixed
/qemu-rv/qemu_rv_head.S:25:10: fatal error: nuttx/config.h: No such file or directory
   25 | #include <nuttx/config.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

added

# override the responsible file flag

if(CMAKE_GENERATOR MATCHES "Ninja")
  set(CMAKE_C_RESPONSE_FILE_FLAG "$DEFINES $INCLUDES $FLAGS @")
  set(CMAKE_CXX_RESPONSE_FILE_FLAG "$DEFINES $INCLUDES $FLAGS @")
  set(CMAKE_ASM_RESPONSE_FILE_FLAG "$DEFINES $INCLUDES $FLAGS @")
endif()
2024-11-27 02:35:48 +08:00
Xiang Xiao
573115734d Revert "drivers/pipes: return after short write if buffer is full"
This reverts commit d0680fd1bc.
2024-11-26 11:08:02 -03:00
hujun5
610efc8f1a arm: remove up_set_current_regs/up_current_regs
reason:
up_set_current_regs initially had two functions:

1: To mark the entry into an interrupt state.
2: To record the context before an interrupt/exception. If we switch to
   a new task, we need to store the upcoming context regs by calling up_set_current_regs(regs).

Currently, we record the context in other ways, so the second function is obsolete.
Therefore, we need to rename up_set_current_regs to better reflect its actual meaning,
which is solely to mark an interrupt.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-26 20:04:54 +08:00
wangmingrong1
cdbf5c6ebe Fix compilation errors
CC:  gcov.c gcov.c: In function 'gcov_stdout_dump':
gcov.c:146:50: error: passing argument 3 of '__gcov_info_to_gcda' from incompatible pointer type [-Werror=incompatible-pointer-types]
  146 |       __gcov_info_to_gcda(info, stdout_filename, stdout_dump, NULL, &arg);
      |                                                  ^~~~~~~~~~~
      |                                                  |
      |                                                  void (*)(const void *, size_t,  void *) {aka void (*)(const void *, long unsigned int,  void *)}
In file included from gcov.c:25:
/mnt/vela/github/NX/nuttx/include/gcov.h:139:44: note: expected 'void (*)(const void *, unsigned int,  void *)' but argument is of type 'void (*)(const void *, size_t,  void *)' {aka 'void (*)(const void *, long unsigned int,  void *)'}
  139 |                                 FAR void (*dump)(FAR const void *,
      |                                     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
  140 |                                                  unsigned int, FAR void *),
      |                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~

libgcc/gcov.c: In function 'gcov_process_path.constprop':
libgcc/gcov.c:235:29: error: 'filename' may be used uninitialized [-Werror=maybe-uninitialized]
  235 |       tokens[token_count++] = filename;
      |       ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
libgcc/gcov.c:189:13: note: 'filename' was declared here
  189 |   FAR char *filename;

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-26 19:25:24 +08:00
wangjianyu3
d83ab55e00 fs/partition/txtable: Fix panic when no txtable was found in last eraseblock
Panic occured if no txtable was found in last eraseblock of MTD device and `CONFIG_TXTABLE_DEFAULT_PARTITION` was disabled

Backtrace

  sched_dumpstack
  /workspace/nuttx/libs/libc/sched/sched_dumpstack.c:71
  dump_assert_info
  /workspace/nuttx/sched/misc/assert.c:718
  xtensa_user_panic
  /workspace/nuttx/arch/xtensa/src/common/xtensa_assert.c:188 (discriminator 1)
  xtensa_user
  ??:?
  _xtensa_user_handler
  /workspace/nuttx/arch/xtensa/src/common/xtensa_user_handler.S:194
  ??
  ??:0
  parse_txtable_partition
  /workspace/nuttx/fs/partition/fs_txtable.c:136
  parse_partition
  /workspace/nuttx/fs/partition/fs_partition.c:165
  parse_mtd_partition
  /workspace/nuttx/fs/partition/fs_partition.c:291

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-26 18:23:06 +08:00
chao an
401e8eb062 sched/lockcount: replace all lockcount check to nxsched_islocked_tcb()
replace all lockcount check to nxsched_islocked_tcb()

Signed-off-by: chao an <anchao@lixiang.com>
2024-11-26 16:35:20 +08:00
chao an
4dda9800b4 espressif/mcpwm: fix compile error
continue work of PR #14938

Signed-off-by: chao an <anchao@lixiang.com>
2024-11-26 16:34:19 +08:00