Commit graph

4541 commits

Author SHA1 Message Date
YAMAMOTO Takashi
14edf1385c sim: Fix build errors on macOS
macOS 15.2
x86-64
Xcode 16.1
```
ld: warning: disabling chained fixups because of unaligned pointers
ld: illegal text-relocation in '_main'+0x1F (/Users/yamamoto/git/nuttx/nuttx/arc
h/sim/src/nuttx.rel) to '_g_argc'
```
2024-12-17 18:15:00 +08:00
YAMAMOTO Takashi
0028f0cae9 enable CONFIG_PIPES where CONFIG_LIBUV is enabled
after running the following script, reverted a few
unrelated modifications manually.
```
git grep -l CONFIG_LIBUV|grep defconfig|while read FILE;do
DIR=$(dirname $FILE)
./tools/configure.sh -E $DIR
kconfig-tweak -e CONFIG_PIPES
kconfig-tweak -d CONFIG_HOST_MACOS
make savedefconfig
cp defconfig $FILE
done
```

cf. https://github.com/apache/nuttx/issues/14773
2024-12-17 18:13:48 +08:00
zhangyuan29
8eb8472eed arm/lpc17xx: disable mqueue sysv
mqueue sysv not used, remove to reduce sram usage

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-17 15:40:48 +08:00
Alin Jerpelea
62306849ca boards/arm/s32k1xx: 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-12-17 08:37:13 +08:00
Tiago Medicci Serrano
0da4e44e48 rv-virt/citest: Increase init task stack size to 3072
After https://github.com/apache/nuttx/pull/15075, the size of the
stack size has decreased 8 bytes and the init stack size for the
rv-virt:citest defconfig was near its full capacity, which lead to
crashing the `ps` command. The init stack size for this defconfig
was increased from 2048 to 3072 to avoid stack overflow.
2024-12-13 18:19:54 +08:00
chao an
5abcc49789 mps2-an500/knsh: disable SPINLOCK to avoid build break
workaround for remove libc depends from kernel api

build break on phase 2 userspace link:

| arm-none-eabi-ld -o nuttx_user.elf --undefined=nsh_main --entry=nsh_main -T /nuttx/boards/arm/mps/mps2-an500/scripts/memory.ld \
| -T /nuttx/boards/arm/mps/mps2-an500/scripts/user-space.ld -L/nuttx/staging/ -L/nuttx/staging/ -L/nuttx/staging/ -L/nuttx/staging/ \
| -L/nuttx/staging/ -L/nuttx/staging/ mps_userspace.o --start-group -lproxies -lc -lmm -larch -lxx -lapps --end-group \
| "prebuilts/linux/gcc/arm/bin/../lib/gcc/arm-none-eabi/13.3.1/thumb/v7e-m+fp/hard/libgcc.a"
|
| arm-none-eabi-ld: /nuttx/staging//libc.a(lib_pathbuffer.o): in function `spin_unlock_wo_note':
| /nuttx/include/nuttx/spinlock.h:380:(.text.lib_get_pathbuffer+0x298): undefined reference to `g_irq_spin_count'
| arm-none-eabi-ld: /nuttx/include/nuttx/spinlock.h:380:(.text.lib_get_pathbuffer+0x29c): undefined reference to `g_irq_spin'
| arm-none-eabi-ld: /nuttx/staging//libc.a(lib_pathbuffer.o): in function `lib_put_pathbuffer':
| /nuttx/libs/libc/misc/lib_pathbuffer.c:147:(.text.lib_put_pathbuffer+0x210): undefined reference to `g_irq_spin_count'
| arm-none-eabi-ld: /nuttx/libs/libc/misc/lib_pathbuffer.c:147:(.text.lib_put_pathbuffer+0x214): undefined reference to `g_irq_spin'
| make[1]: *** [Makefile:61: nuttx_user.elf] Error 1
| make[1]: Leaving directory '/nuttx/boards/arm/mps/mps2-an500/kernel'
| make: *** [tools/Unix.mk:540: nuttx] Error 2

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-12 22:00:45 +08:00
simbit18
6b7722cfb4 build(CMAKE): fix pac sim elf ONLY in Linux platform
avoid SIM compilation post build issues on other platforms

same fix for build with make
https://github.com/apache/nuttx/pull/14800
2024-12-10 21:57:55 +08:00
simbit18
eec97064d7 fix nxstyle
Removed extra spaces from .h and .c files
2024-12-10 21:57:22 +08:00
hujun5
16b63ed837 armv7/8m: fix regresion from https://github.com/apache/nuttx/pull/14881
reason:
svc call may trigger hardfault

Background
    The origin of this issue is our desire to eliminate the function of storing
"regs" in g_current_regs and instead utilize (*running_task)->xcp.regs for storage.
The benefits of this approach include faster storage speed and
avoiding multiple accesses to g_current_regs during context switching,
thus ensuring that whether returning from an interrupt or an exception,
we consistently use this_task()->xcp.regs

Issue Encountered
    However, when storing registers, we must ensure that (running_task)->xcp.regs is invalid
so that it can be safely overwritten.
According to the existing logic, the only scenario where (running_task)->xcp.regs
is valid is during restore_context. We must accurately identify this scenario.
Initially, we used the condition (running_task)==NULL for this purpose, but we deemed
this approach unsatisfactory as it did not align well with the actual logic.
(running_task) should not be NULL. Consequently, we adopted other arch-specific methods for judgment,
but due to special logic in some arch, the judgment was not accurate, leading to this issue.

Solution:
    For armv6-m, we haven't found a more suitable solution, so we are sticking with (*running_task)==NULL.
    For armv7-m/armv8-m, by removing support for primask, we can achieve accurate judgment.

    PRIMASK is a design in armv6-m, that's why arm introduce BASEPRI from armv7-m.
It's wrong to provide this option for armv7-m/armv8-m arch.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-09 21:20:06 +08:00
wangjianyu3
0481533833 boards: Update configs about system/usbmsc
The Kconfig of system/usbmsc has updated to support setting paths that bind to LUN at runtime.
More details: https://github.com/apache/nuttx-apps/pull/2876

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-06 13:38:23 +08:00
Andreea Luca
e6a01a0167 Integrated feedback
Integrated feedback: refreshed mqttc defconfig file.
2024-12-06 10:59:17 +08:00
Andreea Luca
666d55a8f4 Add configs for esp-sparrow-kit
Add configs for esp-sparrow-kit, to ease enabling wifi
and mqttc applications
2024-12-06 10:59:17 +08:00
Xiang Xiao
60fb917eda Remove FAR from 32/64bit arch
since these arch doesn't distinguish between near and far pointers

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-12-05 22:55:39 +08:00
wangmingrong1
e2729f58d4 arm64/qemu: Enable lto compilation by default
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-05 20:36:37 +08:00
wangmingrong1
79758c5150 arm64/lto: Fix link error after opening lto
CPP:  /mnt/vela/github/NX/nuttx/boards/arm64/qemu/qemu-armv8a/scripts/dramboot.ld-> /mnt/vela/github/NX/nutLD: nuttx
Please update the link script, section ['.kasan.global'] cannot be found
`.eh_frame' referenced in section `.text.frame_dummy' of /mnt/vela/github/Toolchains/arm64-gcc-13/bin/../lib/gcc/aarch64-none-elf/13.2.1/crtbegin.o: defined in discarded section `.eh_frame' of /mnt/vela/github/Toolchains/arm64-gcc-13/bin/../lib/gcc/aarch64-none-elf/13.2.1/crtbegin.o
`.eh_frame' referenced in section `.text.frame_dummy' of /mnt/vela/github/Toolchains/arm64-gcc-13/bin/../lib/gcc/aarch64-none-elf/13.2.1/crtbegin.o: defined in discarded section `.eh_frame' of /mnt/vela/github/Toolchains/arm64-gcc-13/bin/../lib/gcc/aarch64-none-elf/13.2.1/crtbegin.o
Memory region         Used Size  Region Size  %age Used

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-05 13:23:59 +08:00
wangmingrong1
95ed02ec22 arm64/qemu: Add 9pfs configuration
Convenient for qemu debugging and adding ci check
We can learn to use the following command to mount 9pfs on qemu64:

qemu-system-aarch64 -cpu max -nographic \
        -machine virt,virtualization=on,gic-version=3,mte=on \
        -fsdev local,security_model=none,id=fsdev0,path=/xxxx -device virtio-9p-device,id=fs0,fsdev=fsdev0,mount_tag=host \
        -chardev stdio,id=con,mux=on, -serial chardev:con \
        -mon chardev=con,mode=readline  -kernel ./nuttx/nutt

mkdir mnt
mount -t v9fs -o trans=virtio,tag=host mnt

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-03 18:19:09 +08:00
wangmingrong1
77d993623c boards/mte: Dependencies changed, so need to delete it now
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-03 15:45:53 +08:00
stbenn
9b52710691 board/nucleo-h563zi: Add HSE option
Add an option to use HSE on the Nucleo-H563ZI with board modification. This is enabled through board Kconfig.
It supplies the same PLL output frequencies using the HSE instead of HSI, for significantly more precise clocks.
2024-12-03 09:39:13 +08:00
wangmingrong1
360c053eca arm64/qemu: Add arm64 mte defconfig support
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-02 11:04:11 -03:00
wangmingrong1
208f31c27f boards/qemu64: Due to dependency changes, the test program of kasantest is deleted.
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-02 19:49:22 +08:00
chao an
9127d8f59b sim/tflm: enable tflm hello world
tflm hello world is a basic test program to verify whether the tflm function works properly
refrash defconfig and enable tflm hello world:

Test on sim/tflm

$ cmake -B build -DBOARD_CONFIG=sim/tflm -GNinja
$ cmake --build build
$ ./build/nuttx

NuttShell (NSH) NuttX-10.4.0
nsh> tflm_hello
0 (id=0): size=16, offset=0, first_used=0 last_used=1
1 (id=1): size=64, offset=64, first_used=1 last_used=2
2 (id=2): size=64, offset=0, first_used=2 last_used=3
3 (id=3): size=16, offset=64, first_used=3 last_used=3
 0: 0000000000...................................................................... (1k)
 1: 0000000000..............................1111111111111111111111111111111111111111 (1k)
 2: 22222222222222222222222222222222222222221111111111111111111111111111111111111111 (1k)
 3: 22222222222222222222222222222222222222223333333333.............................. (1k)

"Unique Tag","Total ticks across all events with that tag."
FULLY_CONNECTED, 0
"total number of ticks", 0

[RecordingMicroAllocator] Arena allocation total 2344 bytes
[RecordingMicroAllocator] Arena allocation head 128 bytes
[RecordingMicroAllocator] Arena allocation tail 2216 bytes
[RecordingMicroAllocator] 'TfLiteEvalTensor data' used 240 bytes with alignment overhead (requested 240 bytes for 10 allocations)
[RecordingMicroAllocator] 'Persistent TfLiteTensor data' used 128 bytes with alignment overhead (requested 128 bytes for 2 tensors)
[RecordingMicroAllocator] 'Persistent buffer data' used 1152 bytes with alignment overhead (requested 1100 bytes for 7 allocations)
[RecordingMicroAllocator] 'NodeAndRegistration struct' used 192 bytes with alignment overhead (requested 192 bytes for 3 NodeAndRegistration structs)
0 (id=0): size=16, offset=0, first_used=0 last_used=1
1 (id=1): size=64, offset=64, first_used=1 last_used=2
2 (id=2): size=64, offset=0, first_used=2 last_used=3
3 (id=3): size=16, offset=64, first_used=3 last_used=3
 0: 0000000000...................................................................... (1k)
 1: 0000000000..............................1111111111111111111111111111111111111111 (1k)
 2: 22222222222222222222222222222222222222221111111111111111111111111111111111111111 (1k)
 3: 22222222222222222222222222222222222222223333333333.............................. (1k)
0 (id=0): size=16, offset=16, first_used=0 last_used=1
1 (id=1): size=16, offset=0, first_used=1 last_used=2
2 (id=2): size=16, offset=16, first_used=2 last_used=3
3 (id=3): size=16, offset=0, first_used=3 last_used=3
 0: ................0000000000000000................................................ (1k)
 1: 11111111111111110000000000000000................................................ (1k)
 2: 11111111111111112222222222222222................................................ (1k)
 3: 33333333333333332222222222222222................................................ (1k)
~~~ALL TESTS PASSED~~~

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-02 15:27:47 +08:00
wangjianyu3
f446fd5451 esp32s3-devkit/usbmsc: Add bind for MTD
And fix error: Unsupported sector size 256.

Test

  # Build & Flash
  ./tools/configure.sh -l esp32s3-devkit:usbmsc
  make flash ESPTOOL_PORT=/dev/ttyACMx

  # Runtime (Device)
  nsh> mkrd -m 10 -s 512 640
  nsh> ls -l /dev/esp32s3flash
   frw-rw-rw-     1048576 /dev/esp32s3flash
  nsh> msconn
  mcsonn_main: Creating block drivers
  mcsonn_main: Configuring with NLUNS=2
  mcsonn_main: handle=0x3fcdecc8
  mcsonn_main: Bind LUN=0 to /dev/ram10
  mcsonn_main: Bind LUN=1 to /dev/esp32s3flash
  mcsonn_main: Connected

Log (Host)

  [1478371.410664] usb 1-5: new full-speed USB device number 22 using xhci_hcd
  [1478371.539471] usb 1-5: New USB device found, idVendor=584e, idProduct=5342, bcdDevice= 3.99
  [1478371.539475] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  [1478371.539476] usb 1-5: Product: Mass Storage
  [1478371.539477] usb 1-5: Manufacturer: NuttX
  [1478371.539478] usb 1-5: SerialNumber: 0101
  [1478371.542497] usb-storage 1-5:1.0: USB Mass Storage device detected
  [1478371.542851] scsi host5: usb-storage 1-5:1.0
  [1478372.582401] scsi 5:0:0:0: Direct-Access     NuttX    Mass Storage     0101 PQ: 0 ANSI: 2
  [1478372.582785] scsi 5:0:0:1: Direct-Access     NuttX    Mass Storage     0101 PQ: 0 ANSI: 2
  [1478372.582990] sd 5:0:0:0: Attached scsi generic sg3 type 0
  [1478372.583167] sd 5:0:0:1: Attached scsi generic sg4 type 0
  [1478372.584150] sd 5:0:0:0: [sdd] 640 512-byte logical blocks: (328 kB/320 KiB)
  [1478372.801405] sd 5:0:0:0: [sdd] Write Protect is off
  [1478372.801410] sd 5:0:0:0: [sdd] Mode Sense: 0f 00 00 00
  [1478373.021406] sd 5:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
  [1478373.023228] sd 5:0:0:1: [sde] 2048 512-byte logical blocks: (1.05 MB/1.00 MiB)
  [1478373.241405] sd 5:0:0:1: [sde] Write Protect is off
  [1478373.241410] sd 5:0:0:1: [sde] Mode Sense: 0f 00 00 00
  [1478373.461442] sd 5:0:0:1: [sde] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
  [1478374.353460]  sde: sde1
  [1478374.353725] sd 5:0:0:1: [sde] Attached SCSI disk
  [1478374.363233] sd 5:0:0:0: [sdd] Attached SCSI disk
  [1478375.442736] FAT-fs (sde1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-02 13:41:26 +08:00
buxiasen
7a4fac0df6 coredump: add BOARD_CRASHDUMP_CUSTOM support
For only board specific crashdump and no syslog/blk/mtd coredump

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-30 03:08:35 +08:00
buxiasen
ddf428d66c coredump: support mtdoutstream
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-30 03:08:35 +08:00
buxiasen
88aaba29ba coredump: update coredump method to choice, default NONE
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-30 03:08:35 +08:00
chao an
2961ecab9f sim/tflm: add tflite-micro demo into ci build
$ cmake -B build -DBOARD_CONFIG=sim/tflm -GNinja
$ cmake --build build
$ ./build/nuttx

NuttShell (NSH) NuttX-10.4.0
nsh> tflm -h

Utility to use tflite micro on nuttx.
[ -C       ] Compile tflite model into c++ codes.
[ -E       ] Do once evaluation (for profiling).
[ -i <str> ] Readable model file path.
[ -o <str> ] Writable c++ file path.
[ -p <str> ] Prefix of compiled code.
[ -a <int> ] Arena size (mempool).
[ -h       ] Print this message.

nsh> tflm -E -i /data/MobileNet-v3-Small.tflite -o /data/MbileNet-v3-Small.out
0 (id=0): size=602112, offset=0, first_used=0 last_used=1
1 (id=1): size=602112, offset=602112, first_used=1 last_used=2
2 (id=2): size=602112, offset=0, first_used=2 last_used=3
3 (id=3): size=607504, offset=802816, first_used=3 last_used=4
...
* (id=114): size=4096, offset=0, first_used=114 last_used=115
* (id=115): size=4000, offset=4096, first_used=115 last_used=115
 0: 00000000000000000000000000...................................................... (588k)
 1: 0000000000000000000000000011111111111111111111111111............................ (1176k)
 2: 2222222222222222222222222211111111111111111111111111............................ (1176k)
 3: 22222222222222222222222222........333333333333333333333333333................... (1182k)
...
"Event","Tag","Ticks"
0,SUB,0
1,MUL,0
2,PAD,0
3,CONV_2D,1
4,HARD_SWISH,0
5,PAD,0
...
110,MEAN,0
111,FULLY_CONNECTED,0
112,FULLY_CONNECTED,0
113,MUL,0
114,FULLY_CONNECTED,0
"Unique Tag","Total ticks across all events with that tag."
SUB, 0
MUL, 0
PAD, 0
CONV_2D, 3
...
"total number of ticks", 3
nxai done!

Signed-off-by: chao an <anchao@lixiang.com>
2024-11-29 18:34:10 +08:00
chao an
fcd8236e24 sim/nsh: enable SIM_HOSTFS by default
hostfs will allow developers to access the current execution directory.

nsh> ls
/:
 bin/
 data/
 dev/
 etc/
 proc/
 tmp/
nsh> cd /data
nsh> ls
/data:
 README.md
 fs/
 pass1/
 cmake/
 arch/

Signed-off-by: chao an <anchao@lixiang.com>
2024-11-29 10:15:25 +01:00
simbit18
9c9b945876 fix nxstyle
Removed extra spaces from .h and .c files
2024-11-28 20:40:13 +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
wangmingrong1
4daafd0781 Fix path error
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-28 15:04:59 +08: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
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
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
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
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
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
wangjianyu3
5fabe091f3 boards/xtensa/esp32s3: Treat return value that greater than zero as succ
board_spiflash_init() => init_storage_partition() => parse_mtd_partition()
`parse_mtd_partition()` may return value that greater than zero when succ

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-26 16:33:26 +08:00
wangjianyu3
22e8e65789 boards/esp32s3: Add depends ESP32-S3-WROOM-1-N8R8 for ESP32S3_DEVKIT
Env

  esp32s3-devkit:usbnsh

Problem

  The `CONFIG_ARCH_BOARD_ESP32S3_DEVKIT` will be disabled if `CONFIG_ARCH_CHIP_ESP32S3WROOM1N8R8` selected

    $ diff defconfig boards/xtensa/esp32s3/esp32s3-devkit/configs/usbnsh/defconfig
    7a8
    > # CONFIG_ARCH_LEDS is not set
    10a12
    > CONFIG_ARCH_BOARD="esp32s3-devkit"
    12,15c14
    < CONFIG_ARCH_BOARD_CUSTOM=y
    < CONFIG_ARCH_BOARD_CUSTOM_DIR=""
    < CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
    < CONFIG_ARCH_BOARD_CUSTOM_NAME=""
    ---
    > CONFIG_ARCH_BOARD_ESP32S3_DEVKIT=y
    18c17
    < CONFIG_ARCH_CHIP_ESP32S3WROOM1N8R8=y
    ---
    > CONFIG_ARCH_CHIP_ESP32S3WROOM1N4=y

  And command make fails

    No directory at /workspace/nuttx//src
    make[1]: *** [tools/Unix.mk:320: arch/xtensa/src/board/board] Error 1
    make: *** [tools/Unix.mk:700: menuconfig] Error 2

With this patch

  $ diff defconfig boards/xtensa/esp32s3/esp32s3-devkit/configs/usbnsh/defconfig
  17c17
  < CONFIG_ARCH_CHIP_ESP32S3WROOM1N8R8=y
  ---
  > CONFIG_ARCH_CHIP_ESP32S3WROOM1N4=y

Link: https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-devkitc-1/user_guide.html

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-26 14:06:31 +08:00
wangmingrong1
d2dc2c796d Path Error
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-26 13:50:53 +08:00
cuiziwei
8e58245524 sim: Fix sim m32 start up crash issue.
After compilation, when starting nsh, the following crash occurs.
==2500151==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.
==2500151==ASan shadow was supposed to be located in the [0x1ffff000-0x3fffffff] range.
==2500151==Process memory map follows:
0x30000000-0x33dd4000 /nuttx/nuttx

To avoid overlaps, change the starting address of the text segment.

Using Ttext-segment=0x30000000 causes a crash when starting the 32-bit SIM.
Using -Ttext-segment=0x50000000 causes a crash when starting the 64-bit SIM.
Setting -Ttext-segment=0x40000000 resolves all issues perfectly.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-11-23 01:47:34 +08:00
wangjianyu3
ccefe43149 esp32s3-devkit/adb: Enable ROMFS/etc for ADB auto start
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-22 13:28:44 -03:00
wangjianyu3
9e08bb2d25 esp32s3-devkit: Add initialize scripts for ROMFS/etc
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-22 13:28:44 -03:00
wangjianyu3
385de9d850 esp32s3-devkit/adb: Reusing configuration of usb_device
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-22 13:28:44 -03:00
wangjianyu3
9a63f9a881 esp32s3-devkit/adb: Initializing configuration for ADB
Build & Flash

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

Runtime

  $ adb -s 1234 shell
  nsh> uname -a
  NuttX 0.0.0  Nov 22 2024 11:41:43 xtensa esp32s3-devkit

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-22 13:28:44 -03:00
yinshengkai
0194c2f88a gcov: update gcov compilation parameters
profile-generate is used to generate compilation feedback optimization data, not just code coverage data

It will rely on the toolchain library:
nuttx/libs/libc/misc/lib_utsname.c:94:(.text.uname+0x2c): undefined reference to `__gcov_indirect_call_profiler_v4'
arm-none-eabi-ld: nuttx/libs/libc/misc/lib_utsname.c:113:(.text.uname+0x178): undefined reference to `__gcov_indirect_call'
arm-none-eabi-ld: nuttx/libs/libc/misc/lib_utsname.c:113:(.text.uname+0x188): undefined reference to `__gcov_time_profiler_counter'
arm-none-eabi-ld: nuttx/staging/libc.a(lib_utsname.o):(.data..LPBX0+0x30): undefined reference to `__gcov_merge_time_profile'

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
wangjianyu3
27f278af90 lm3s6965-ek/qemu: Using default max command line length
The large max command line length may cause stack overflow.

Test
  ./tools/configure.sh lm3s6965-ek:qemu-flat
  make -j16
  qemu-system-arm -semihosting \
  		-M lm3s6965evb \
  		-device loader,file=nuttx.bin,addr=0x00000000 \
  		-netdev user,id=user0 \
  		-serial mon:stdio -nographic

Link: https://github.com/apache/nuttx-apps/pull/2850
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-21 14:08:17 -03:00