Skip to content

Conversation

@linguini1
Copy link
Contributor

@linguini1 linguini1 commented Oct 26, 2025

Summary

This initial implementation sets up support for the EMMC interfaces on the BCM2711. Only EMMC2 is tested since it is the interface of interest (connects to uSD card). MMCSD communication is functional and the boot partition of the SD card can be mounted and interacted with. Stress testing fails, insertion/removal events only work right after boot.

Closes #16948.
Closes #16949.

NOTE: Card insertion/removal events may not be possible with this implementation. I have followed the SD host controller simplified specification section 3.1 (SD card detection), but I have not gotten any results. I am leaving it alone for now.

NOTE: This is a draft PR for initial review. I still have some changes to make to stabilize this feature. I can't seem to get card insertion/removal interrupts to fire, although I see that they exist in the RPi Linux code and other projects. I've configured them the same way as other interrupts but no luck beyond initial boot.

Does anyone know how to support 8-bit transfer? The controller is capable of that, but the widebus functionality of the NuttX upper-half driver only seems to allow 1b or 4b modes.

Impact

Users can now interact with the micro-SD card through NuttX! Right now they are able to mount the boot partition, however I will also add support for mounting two separate partitions on the micro SD card so that a disk filesystem exists.

Testing

Tested using all the code included in this PR:

  • Initialize SDIO lower-half properly
  • Bind SDIO lower-half to MMCSD driver, verify that /dev/mmcsd0 is mounted and that logs from the driver indicate correct operation
  • Mount /dev/mmcsd0 to NuttX at /sd and verify that I can see all of the files in the card with ls
  • Verify that I can cat a file in the SD card
  • Verify that I can echo to a file on the SD card to create a new one

Successful mount

[    1.538000] fat_mount: FAT32:
[    1.541000] fat_mount:       HW  sector size:     512
[    1.546000] fat_mount:           sectors:         62521344
[    1.551000] fat_mount:       FAT reserved:        32
[    1.555000] fat_mount:           sectors:         62519296
[    1.561000] fat_mount:           start sector:    2080
[    1.565000] fat_mount:           root sector:     2
[    1.570000] fat_mount:           root entries:    0
[    1.575000] fat_mount:           data sector:     32608
[    1.580000] fat_mount:           FSINFO sector:   2049
[    1.584000] fat_mount:           Num FATs:        2
[    1.589000] fat_mount:           FAT sectors:     15264
[    1.594000] fat_mount:           sectors/cluster: 32
[    1.598000] fat_mount:           max clusters:    1952773
[    1.604000] fat_mount:       FSI free count       1952130
[    1.609000] fat_mount:           next free        1417

NuttShell (NSH) NuttX-12.11.0
nsh> ls 
/:
 dev/
 proc/
 sd/
nsh> ls /dev
/dev:
 console
 mmcsd0
 null
 zero

Listing the SD card boot partition:

/sd:
 bcm2711-rpi-4-b.dtb
 config.txt
 fixup4cd.dat
 fixup4.dat
 fixup4db.dat
 fixup4x.dat
 nuttx.bin
 start4cd.elf
 start4db.elf
 start4.elf
 start4x.elf
 overlays/
 test.txt
nsh> 

Using cat to see file contents of test.txt:

nsh> cat /sd/test.txt
This is a test! 

Using echo to append to test.txt:

nsh> echo "Another test!" >> /sd/test.txt
nsh> cat /sd/test.txt
This is a test!
Another test!
nsh> 

The sdstress test passes, so long as I configure it with the byte parameter as 1023 or less. The moment I make it 1024 bytes or larger, I get a lot of errors. I would imagine that this is something to do with the block gaps/the maximum supported transfer size being 1KB.

1023 byte stress test output:

nsh> sdstress -b 1023
Start stress test with 64 files, 1023 bytes and 32 iterations.
iteration 0 took 2607.000 ms: OK
iteration 1 took 1830.000 ms: OK
iteration 2 took 1566.000 ms: OK
iteration 3 took 3877.000 ms: OK
iteration 4 took 1608.000 ms: OK
iteration 5 took 1675.000 ms: OK
iteration 6 took 1605.000 ms: OK
iteration 7 took 1604.000 ms: OK
iteration 8 took 1602.000 ms: OK
iteration 9 took 1594.000 ms: OK
iteration 10 took 1704.000 ms: OK
iteration 11 took 1710.000 ms: OK
iteration 12 took 1664.000 ms: OK
iteration 13 took 1634.000 ms: OK
iteration 14 took 1650.000 ms: OK
iteration 15 took 1735.000 ms: OK
iteration 16 took 1658.000 ms: OK
iteration 17 took 1741.000 ms: OK
iteration 18 took 1661.000 ms: OK
iteration 19 took 1771.000 ms: OK
iteration 20 took 1690.000 ms: OK
iteration 21 took 1671.000 ms: OK
iteration 22 took 3241.000 ms: OK
iteration 23 took 2973.000 ms: OK
iteration 24 took 1914.000 ms: OK
iteration 25 took 2064.000 ms: OK
iteration 26 took 2490.000 ms: OK
iteration 27 took 1617.000 ms: OK
iteration 28 took 1616.000 ms: OK
iteration 29 took 1701.000 ms: OK
iteration 30 took 1633.000 ms: OK
iteration 31 took 1625.000 ms: OK
Test OK: Average time: 1897.844 ms
nsh> 

Output of stress test when above 1023 bytes:

nsh> sdstress -b 1024
Start stress test with 64 files, 1024 bytes and 32 iterations.
[  396.530000] mmcsd_readmultiple: ERROR: Card not ready: -110
[  396.534000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
read /sd/stress/[  396.593000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
tmp000 failed, r[  396.652000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
et: -1, errno 11[  396.711000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
0 -> Unknown err[  396.770000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
or 110
iteratio[  396.829000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
n 0 took 1067.00[  396.888000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
0 ms: FAIL
Test[  396.947000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
 FAIL: Average t[  397.006000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
ime: 33.344 ms
[  397.065000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
nsh> [  397.124000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  397.183000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  397.242000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  397.301000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  397.360000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  397.419000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  397.478000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  397.537000] mmcsd_writesingle: ERROR: Card not ready: -110
[  397.537000] file_put: ERROR: fs putfilep file_close() failed: -110

After this, it hangs. Following a reboot, here are the contents of the created stress/ directory:

nsh> ls -l /sd/stress
/sd/stress:
 -rw-rw-rw-           0 tmp000
nsh> 

For whatever reason, very strange behaviour occurs when using a 64GB Sandisk card. Sometimes there is a data CRC failure after boot and the FAT filesystem never mounts, even when re-attempted, due to this error. Other times, the FAT filesystem mounts but attempting to create a file on the card causes sendcmd to be called with CMD13 repeatedly until the watchdog times out. I cannot figure out why this is happening for only the 64GB card.

@github-actions github-actions bot added Arch: arm64 Issues related to ARM64 (64-bit) architecture Board: arm64 Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. labels Oct 26, 2025
Copy link
Contributor

@acassis acassis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @linguini1 ! Kudos!!!

Copy link
Contributor

@acassis acassis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the Documentation/ to include this new feature. Also include board profile "sd" example explaining how to use

@linguini1
Copy link
Contributor Author

Please update the Documentation/ to include this new feature. Also include board profile "sd" example explaining how to use

That's my intention, there is an SD config currently. I just want to try and get stress testing passed before I write the docs.

@cederom
Copy link
Contributor

cederom commented Oct 27, 2025

Great work @linguini1 :-) Would that solution work also on rPI-Zero-2W? I have only this board to test :-P

I found some info here: https://groups.google.com/g/bcm2835/c/vrpnf1Py-Mg

BCM2835
Raspberry Pi 1 Models A, A+, B, B+, the Raspberry Pi Zero, the Raspberry Pi Zero W

BCM2836
The underlying architecture in BCM2836 is identical to BCM2835. The only significant difference is the removal of the ARM1176JZF-S processor and replacement with a quad-core Cortex-A7 cluster.

BCM2837
Raspberry Pi 3 Model B, later models of the Raspberry Pi 2 Model B, and the Raspberry Pi Compute Module 3. The underlying architecture of the BCM2837 is identical to the BCM2836. The only significant difference is the replacement of the ARMv7 quad core cluster with a quad-core ARM Cortex A53 (ARMv8) cluster.

BCM2711
Raspberry Pi 4 Model B, the Raspberry Pi 400, and the Raspberry Pi Compute Module 4. BCM2711 is a considerable upgrade on that used by the SoCs in earlier Raspberry Pi models. It continues the quad-core CPU design of the BCM2837, but uses the more powerful ARM A72 core. It has a greatly improved GPU feature set with much faster input/output, due to the incorporation of a PCIe link that connects the USB 2 and USB 3 ports, and a natively attached Ethernet controller. It is also capable of addressing more memory than the SoCs used before.

RP3A0
The Raspberry Pi RP3A0 is our first System-in-Package (SiP) consisting of a Broadcom BCM2710A1 — which is the silicon die packaged inside the Broadcom BCM2837 chip which is used on the Raspberry Pi 3 — along with 512MB of DRAM.

It is used by the Raspberry Pi Zero 2 W.

Please refer to the following BCM2836 document for details on the ARM peripherals specification, which also applies to the BCM2837 and RP3A0.

I can either try to just run the firmware from rPI-4B on rPI-Zero-2W or buy 4B are there any specific hardware version / model / release to consider @linguini1 ? :-)

@linguini1
Copy link
Contributor Author

Great work @linguini1 :-) Would that solution work also on rPI-Zero-2W? I have only this board to test :-P

Unfortunately I don't think so, I believe your board has a different SoC. I think I might be on my own to troubleshoot this unless anyone can spot something wrong with the implementation!

@cederom
Copy link
Contributor

cederom commented Oct 27, 2025

Okay I have ordered rPI 4B 8GB and 5 8GB to have testing boards.. but right now working on priority stuff so will test in a free moment next week+ :-)

@linguini1 linguini1 force-pushed the pi4b-sdmmc branch 3 times, most recently from 5d1e7b4 to 121b5aa Compare October 27, 2025 22:40
@linguini1 linguini1 marked this pull request as ready for review October 27, 2025 23:08
@github-actions github-actions bot added the Area: Documentation Improvements or additions to documentation label Oct 27, 2025
@linguini1 linguini1 force-pushed the pi4b-sdmmc branch 2 times, most recently from ad99c9e to ff5b93d Compare October 27, 2025 23:13
@linguini1 linguini1 requested a review from acassis October 27, 2025 23:27
acassis
acassis previously approved these changes Oct 28, 2025
Copy link
Contributor

@acassis acassis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving since it works for some SDCards, but maybe you should include "depends on EXPERIMENT" to BCM2711_EMMC. This way users will reduce the expectations on this driver.

@linguini1
Copy link
Contributor Author

linguini1 commented Oct 28, 2025

I'm approving since it works for some SDCards, but maybe you should include "depends on EXPERIMENT" to BCM2711_EMMC. This way users will reduce the expectations on this driver.

Good idea! I always forget about this Kconfig option, I just marked as experimental (with lots of warnings) in the documentation. I will do that!

Hopefully having the experimental feature which works at about 80% will leave room for other contributors to figure out the remaining issues/stabilize over time.

This initial implementation sets up support for the EMMC interfaces on
the BCM2711. Only EMMC2 is tested since it is the interface of interest
(connects to uSD card). MMCSD communication is functional and the boot
partition of the SD card can be mounted and interacted with.
Insertion/removal interrupts do not fire after initial boot, and
sdstress fails with any byte size larger than 1023. 32GB card works
perfectly, while 64GB card exhibits strange behaviour when interacting
with VFAT filesystem.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
The documentation is now updated to reflect the new EMMC support. I have
also improved the format to match the standard board documentation
template, and included better support descriptions for features that
have varying levels of implementation.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
@cederom
Copy link
Contributor

cederom commented Oct 28, 2025

I dont have the board yet.. just wondering if there are two SD card slots? If the OS/RTOS boots from SD then this will allow accessing files from the same card? I have somewhere small eMMC board with 16GB (or 32GB) NAND for VisionFive2 SBC but not sure if there is a slot here for that and if that fits the connector on rPI 4B? :-P

@linguini1
Copy link
Contributor Author

I dont have the board yet.. just wondering if there are two SD card slots? If the OS/RTOS boots from SD then this will allow accessing files from the same card? I have somewhere small eMMC board with 16GB (or 32GB) NAND for VisionFive2 SBC but not sure if there is a slot here for that and if that fits the connector on rPI 4B? :-P

There is only one microSD slot, which this patch aims to support. That is the same SD that the system boots from, so this patch allows users to access the boot partition after boot (totally fine to read/write). I plan to add support for two partitions later for users who don't want to mess around on the same partition as the boot files.

To my knowledge, the EMMC1 interface connects to the SDIO controllable WiFi chip. There is also a third SDHCI interface which I haven't supported yet that allows another external SD card, I believe connected through the GPIO pins.

Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @linguini1 amazing work, great description, documentation, and testing!! :-)

I have ordered the boards and will be able to test next week with rPI 4B 8GB and SanDisk HighEndurance 64GB and Patriot EP 64GB cards but you have my go already :-)

@linguini1
Copy link
Contributor Author

Thank you @linguini1 amazing work, great description, documentation, and testing!! :-)

Thank you!

I have ordered the boards and will be able to test next week with rPI 4B 8GB and SanDisk HighEndurance 64GB and Patriot EP 64GB cards but you have my go already :-)

I look forward to it! If you encounter any issues in your testing please open bug issues (I will do the same for my 64GB card after this is merged so I don't forget about it). Those issues still need more triaging, unfortunately school is getting busy again so I'll have to tackle them slowly and one-by-one. More people triaging is very helpful and appreciated!

@acassis acassis merged commit 11e81d1 into apache:master Oct 28, 2025
14 checks passed
@cederom
Copy link
Contributor

cederom commented Nov 4, 2025

Okay I have the rPI 4B 8GB and a moment to test :-) I also got rPI 5 8GB just in case :-P

  1. uSD Patriot 64GB EP A1 XC V30 U3:
- Boot from EL2
- Boot from EL1
- Boot to C runtime for OS Initialize
[    0.002000] bcm2711_mbox_sendreq: Unknown response code: 00000000
[    0.215000] bcm2711_waitresponse: Got error: -110
[    0.219000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00008101 failed: -110
[    0.227000] bcm2711_recvshort: Error: -110

NuttShell (NSH) NuttX-10.4.0
nsh> uname -a
NuttX 10.4.0 89e841fed4 Nov  4 2025 01:33:33 arm64 raspberrypi-4b
nsh> ?
help usage:  help [-v] [<cmd>]

    .           cp          expr        mkdir       rm          uname
    [           cmp         false       mkfatfs     rmdir       umount
    ?           dirname     fdinfo      mkrd        set         unset
    alias       df          free        mount       sleep       uptime
    unalias     dmesg       help        mv          source      usleep
    basename    echo        hexdump     pidof       test        watch
    break       env         kill        printf      time        xd
    cat         exec        pkill       ps          true        wait
    cd          exit        ls          pwd         truncate

Builtin Apps:
    dd          getprime    nsh         ostest      sdstress    sh

nsh> free
      total       used       free    maxused    maxfree  nused  nfree name
18446744073637310464      2279218446744073637287672      2346418446744073637287672     28      1 Umem

nsh> ls /sd
/sd:
 nuttx/
 bcm2711-rpi-4-b.dtb
 config.txt
 fixup4.dat
 stress/
 raspbian/
 fixup4cd.dat
 fixup4db.dat
 fixup4x.dat
 start4.elf
 start4cd.elf
 start4db.elf
 start4x.elf
 nuttx.bin
 test.txt

nsh> rm /sd/test.txt
nsh> cat /sd/test.txt
nsh: cat: open failed: 2
nsh> echo "NUTTX ON RPI4B SD TEST WITH PATRIOT 64GB" >> /sd/test.txt
nsh> cat /sd/test.txt
NUTTX ON RPI4B SD TEST WITH PATRIOT 64GB


nsh> rm -rf /sd/stress <--- WITH THIS EXISTING SDSTRESS WONT START/FINISH (TODO: FIX).
nsh> sdstress -d 1023
Stress test on a mount point
sdstress: [-r] [-b] [-f]
  -r   Number of runs (1-10000), default 32
  -b   Number of bytes (1-10000), default 4096
  -f   Number of files (1-999), default 64
nsh> sdstress -b 1023
Start stress test with 64 files, 1023 bytes and 32 iterations.
iteration 0 took 958.000 ms: OK
iteration 1 took 955.000 ms: OK
iteration 2 took 953.000 ms: OK
iteration 3 took 957.000 ms: OK
iteration 4 took 948.000 ms: OK
iteration 5 took 972.000 ms: OK
iteration 6 took 963.000 ms: OK
iteration 7 took 960.000 ms: OK
iteration 8 took 944.000 ms: OK
iteration 9 took 945.000 ms: OK
iteration 10 took 943.000 ms: OK
iteration 11 took 942.000 ms: OK
iteration 12 took 947.000 ms: OK
iteration 13 took 964.000 ms: OK
iteration 14 took 962.000 ms: OK
iteration 15 took 965.000 ms: OK
iteration 16 took 952.000 ms: OK
iteration 17 took 931.000 ms: OK
iteration 18 took 941.000 ms: OK
iteration 19 took 934.000 ms: OK
iteration 20 took 954.000 ms: OK
iteration 21 took 945.000 ms: OK
iteration 22 took 965.000 ms: OK
iteration 23 took 952.000 ms: OK
iteration 24 took 941.000 ms: OK
iteration 25 took 926.000 ms: OK
iteration 26 took 948.000 ms: OK
iteration 27 took 939.000 ms: OK
iteration 28 took 963.000 ms: OK
iteration 29 took 961.000 ms: OK
iteration 30 took 956.000 ms: OK
iteration 31 took 950.000 ms: OK
Test OK: Average time: 951.125 ms

nsh> sdstress -b 1024
Start stress test with 64 files, 1024 bytes and 32 iterations.
[  212.190000] mmcsd_readmultiple: ERROR: Card not ready: -110
[  212.194000] bcm2711_waitresponse: Timed out polling response.
[  212.194000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
read /sd/stress/[  212.259000] bcm2711_waitresponse: Timed out polling response.
[  212.259000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
tmp000 failed, r[  212.324000] bcm2711_waitresponse: Timed out polling response.
[  212.324000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
et: -1, errno 11[  212.389000] bcm2711_waitresponse: Timed out polling response.
[  212.389000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
0 -> Unknown err[  212.454000] bcm2711_waitresponse: Timed out polling response.
[  212.454000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
or 110
iteratio[  212.519000] bcm2711_waitresponse: Timed out polling response.
[  212.519000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
n 0 took 1017.00[  212.584000] bcm2711_waitresponse: Timed out polling response.
[  212.584000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
0 ms: FAIL
Test[  212.649000] bcm2711_waitresponse: Timed out polling response.
[  212.649000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
 FAIL: Average t[  212.714000] bcm2711_waitresponse: Timed out polling response.
[  212.714000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
ime: 31.781 ms
[  212.779000] bcm2711_waitresponse: Timed out polling response.
[  212.779000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
nsh> [  212.844000] bcm2711_waitresponse: Timed out polling response.
[  212.844000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  212.909000] bcm2711_waitresponse: Timed out polling response.
[  212.909000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  212.974000] bcm2711_waitresponse: Timed out polling response.
[  212.974000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  213.039000] bcm2711_waitresponse: Timed out polling response.
[  213.039000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  213.104000] bcm2711_waitresponse: Timed out polling response.
[  213.104000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  213.169000] bcm2711_waitresponse: Timed out polling response.
[  213.169000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  213.234000] mmcsd_writesingle: ERROR: Card not ready: -110
[  213.234000] file_put: ERROR: fs putfilep file_close() failed: -110

nsh> sdstress -b 1023
Start stress test with 64 files, 1023 bytes and 32 iterations.
[  223.528000] mmcsd_writesingle: ERROR: Card not ready: -110
mkdir /sd/stress failed, ret: -1, errno: 110 -> Unknown error 110
iteration 0 took 1004.000 ms: FAIL
Test FAIL: Average time: 31.375 ms
nsh>
nsh> rm -rf /sd/stress
[  233.774000] mmcsd_writesingle: ERROR: Card not ready: -110
nsh: rm: unlink failed: 110
nsh> ls /sd
/sd:
[  242.645000] mmcsd_writesingle: ERROR: Card not ready: -110

>>> SD CARD IS UNRESPONSIVE <<<

>>> HARD RESET <<<

- Ready to Boot Primary CPU
- Boot from EL2
- Boot from EL1
- Boot to C runtime for OS Initialize
[    0.002000] bcm2711_mbox_sendreq: Unknown response code: 00000000
[    0.215000] bcm2711_waitresponse: Got error: -110
[    0.219000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00008101 failed: -110
[    0.227000] bcm2711_recvshort: Error: -110

NuttShell (NSH) NuttX-10.4.0
nsh> ls /sd
/sd:
 nuttx/
 bcm2711-rpi-4-b.dtb
 config.txt
 fixup4.dat
 stress/
 raspbian/
 fixup4cd.dat
 fixup4db.dat
 fixup4x.dat
 start4.elf
 start4cd.elf
 start4db.elf
 start4x.elf
 nuttx.bin
 test.txt
nsh> cat /sd/test.txt
NUTTX ON RPI4B SD TEST WITH PATRIOT 64GB <--- FILE PERSISTED :-)


nsh> sdstress -b 1023
Start stress test with 64 files, 1023 bytes and 32 iterations.
mkdir /sd/stress failed, ret: -1, errno: 17 -> Unknown error 17
iteration 0 took 2.000 ms: FAIL
Test FAIL: Average time: 0.062 ms

nsh> rm -rf /sd/stress <--- /SD/STRESS BLOCKS SDSTRESS.

nsh> sdstress -b 1023 -r 1
Start stress test with 64 files, 1023 bytes and 1 iterations.
iteration 0 took 917.000 ms: OK
Test OK: Average time: 917.000 ms
  1. uSD SanDisk Endurance 64GB V30 U3:
- Ready to Boot Primary CPU
- Boot from EL2
- Boot from EL1
- Boot to C runtime for OS Initialize
[    0.002000] bcm2711_mbox_sendreq: Unknown response code: 00000000
[    0.215000] bcm2711_waitresponse: Got error: -110
[    0.219000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00008101 failed: -110
[    0.227000] bcm2711_recvshort: Error: -110

NuttShell (NSH) NuttX-10.4.0
nsh> uname -a
NuttX 10.4.0 89e841fed4 Nov  4 2025 01:30:07 arm64 raspberrypi-4b
nsh> ?
help usage:  help [-v] [<cmd>]

    .           cp          expr        mkdir       rm          uname
    [           cmp         false       mkfatfs     rmdir       umount
    ?           dirname     fdinfo      mkrd        set         unset
    alias       df          free        mount       sleep       uptime
    unalias     dmesg       help        mv          source      usleep
    basename    echo        hexdump     pidof       test        watch
    break       env         kill        printf      time        xd
    cat         exec        pkill       ps          true        wait
    cd          exit        ls          pwd         truncate

Builtin Apps:
    dd          getprime    nsh         ostest      sdstress    sh

nsh> free
      total       used       free    maxused    maxfree  nused  nfree name
18446744073637310464      2279218446744073637287672      2346418446744073637287672     28      1 Umem
nsh>
nsh> ls /sd
/sd:
 bcm2711-rpi-4-b.dtb
 config.txt
 fixup4.dat
 fixup4cd.dat
 fixup4db.dat
 fixup4x.dat
 nuttx.bin
 start4.elf
 start4cd.elf
 start4db.elf
 start4x.elf

nsh> cat /sd/test.txt
nsh: cat: open failed: 2
nsh> echo "NUTTX ON RPI4B SD TEST WITH SANDISK ENDURANCE 64GB" >> /sd/test.txt
nsh> cat /sd/test.txt
NUTTX ON RPI4B SD TEST WITH SANDISK ENDURANCE 64GB

nsh> sdstress -b 1023
Start stress test with 64 files, 1023 bytes and 32 iterations.
iteration 0 took 1118.000 ms: OK
iteration 1 took 1108.000 ms: OK
iteration 2 took 1112.000 ms: OK
iteration 3 took 1097.000 ms: OK
iteration 4 took 1090.000 ms: OK
iteration 5 took 1088.000 ms: OK
iteration 6 took 1087.000 ms: OK
iteration 7 took 1103.000 ms: OK
iteration 8 took 1089.000 ms: OK
iteration 9 took 1093.000 ms: OK
iteration 10 took 1084.000 ms: OK
iteration 11 took 1074.000 ms: OK
iteration 12 took 1062.000 ms: OK
iteration 13 took 1053.000 ms: OK
iteration 14 took 1058.000 ms: OK
iteration 15 took 1077.000 ms: OK
iteration 16 took 1078.000 ms: OK
iteration 17 took 1089.000 ms: OK
iteration 18 took 1090.000 ms: OK
iteration 19 took 1089.000 ms: OK
iteration 20 took 1090.000 ms: OK
iteration 21 took 1089.000 ms: OK
iteration 22 took 1104.000 ms: OK
iteration 23 took 1079.000 ms: OK
iteration 24 took 1087.000 ms: OK
iteration 25 took 1089.000 ms: OK
iteration 26 took 1075.000 ms: OK
iteration 27 took 1070.000 ms: OK
iteration 28 took 1051.000 ms: OK
iteration 29 took 1058.000 ms: OK
iteration 30 took 1076.000 ms: OK
iteration 31 took 1055.000 ms: OK
Test OK: Average time: 1083.188 ms

nsh> sdstress -b 1023 -r 1
Start stress test with 64 files, 1023 bytes and 1 iterations.
iteration 0 took 1081.000 ms: OK
Test OK: Average time: 1081.000 ms

nsh> sdstress -b 1024
Start stress test with 64 files, 1024 bytes and 32 iterations.
[  115.619000] mmcsd_readmultiple: ERROR: Card not ready: -110
[  115.623000] bcm2711_waitresponse: Timed out polling response.
[  115.623000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
read /sd/stress/[  115.688000] bcm2711_waitresponse: Timed out polling response.
[  115.688000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
tmp000 failed, r[  115.753000] bcm2711_waitresponse: Timed out polling response.
[  115.753000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
et: -1, errno 11[  115.818000] bcm2711_waitresponse: Timed out polling response.
[  115.818000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
0 -> Unknown err[  115.883000] bcm2711_waitresponse: Timed out polling response.
[  115.883000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
or 110
iteratio[  115.948000] bcm2711_waitresponse: Timed out polling response.
[  115.948000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
n 0 took 1078.00[  116.013000] bcm2711_waitresponse: Timed out polling response.
[  116.013000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
0 ms: FAIL
Test[  116.078000] bcm2711_waitresponse: Timed out polling response.
[  116.078000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
 FAIL: Average t[  116.143000] bcm2711_waitresponse: Timed out polling response.
[  116.143000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
ime: 33.688 ms
[  116.208000] bcm2711_waitresponse: Timed out polling response.
[  116.208000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
nsh> [  116.273000] bcm2711_waitresponse: Timed out polling response.
[  116.273000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  116.338000] bcm2711_waitresponse: Timed out polling response.
[  116.338000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  116.403000] bcm2711_waitresponse: Timed out polling response.
[  116.403000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  116.468000] bcm2711_waitresponse: Timed out polling response.
[  116.468000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  116.533000] bcm2711_waitresponse: Timed out polling response.
[  116.533000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  116.598000] bcm2711_waitresponse: Timed out polling response.
[  116.598000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[  116.663000] mmcsd_writesingle: ERROR: Card not ready: -110
[  116.663000] file_put: ERROR: fs putfilep file_close() failed: -110

nsh> ls /sd
/sd:
[  121.664000] mmcsd_writesingle: ERROR: Card not ready: -110

>>> SDCARD UNRESPONSIVE <<<

>>> HARD RESET <<<

- Ready to Boot Primary CPU
- Boot from EL2
- Boot from EL1
- Boot to C runtime for OS Initialize
[    0.002000] bcm2711_mbox_sendreq: Unknown response code: 00000000
[    0.215000] bcm2711_waitresponse: Got error: -110
[    0.219000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00008101 failed: -110
[    0.227000] bcm2711_recvshort: Error: -110

NuttShell (NSH) NuttX-10.4.0
nsh> cat /sd/test.txt
NUTTX ON RPI4B SD TEST WITH SANDISK ENDURANCE 64GB <--- FILE PRESERVED.

nsh> ls /sd
/sd:
 bcm2711-rpi-4-b.dtb
 config.txt
 fixup4.dat
 fixup4cd.dat
 fixup4db.dat
 fixup4x.dat
 nuttx.bin
 start4.elf
 start4cd.elf
 start4db.elf
 start4x.elf
 test.txt
 stress/

nsh> rm -rf /sd/stress <--- EXISTING /SD/STRESS BLOCKS SDSTRESS, REMOVE.

nsh> sdstress -b 1023 -r 5
Start stress test with 64 files, 1023 bytes and 5 iterations.
iteration 0 took 1052.000 ms: OK
iteration 1 took 1051.000 ms: OK
iteration 2 took 1050.000 ms: OK
iteration 3 took 1049.000 ms: OK
iteration 4 took 1049.000 ms: OK
Test OK: Average time: 1050.200 ms

nsh> sdstress -b 1024
Start stress test with 64 files, 1024 bytes and 32 iterations.
[   42.358000] mmcsd_readmultiple: ERROR: Card not ready: -110
[   42.362000] bcm2711_waitresponse: Timed out polling response.
[   42.362000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
read /sd/stress/[   42.427000] bcm2711_waitresponse: Timed out polling response.
[   42.427000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
tmp000 failed, r[   42.492000] bcm2711_waitresponse: Timed out polling response.
[   42.492000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
et: -1, errno 11[   42.557000] bcm2711_waitresponse: Timed out polling response.
[   42.557000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
0 -> Unknown err[   42.622000] bcm2711_waitresponse: Timed out polling response.
[   42.622000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
or 110
iteratio[   42.687000] bcm2711_waitresponse: Timed out polling response.
[   42.687000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
n 0 took 1076.00[   42.752000] bcm2711_waitresponse: Timed out polling response.
[   42.752000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
0 ms: FAIL
Test[   42.817000] bcm2711_waitresponse: Timed out polling response.
[   42.817000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
 FAIL: Average t[   42.882000] bcm2711_waitresponse: Timed out polling response.
[   42.882000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
ime: 33.625 ms
[   42.947000] bcm2711_waitresponse: Timed out polling response.
[   42.947000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
nsh> [   43.012000] bcm2711_waitresponse: Timed out polling response.
[   43.012000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[   43.077000] bcm2711_waitresponse: Timed out polling response.
[   43.077000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[   43.142000] bcm2711_waitresponse: Timed out polling response.
[   43.142000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[   43.207000] bcm2711_waitresponse: Timed out polling response.
[   43.207000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[   43.272000] bcm2711_waitresponse: Timed out polling response.
[   43.272000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[   43.337000] bcm2711_waitresponse: Timed out polling response.
[   43.337000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 0000004d failed: -110
[   43.402000] mmcsd_writesingle: ERROR: Card not ready: -110
[   43.402000] file_put: ERROR: fs putfilep file_close() failed: -110

nsh> ls /sd
/sd:
[   47.662000] mmcsd_writesingle: ERROR: Card not ready: -110
  1. uSD SanDisk 2GB:
- Boot from EL2
- Boot from EL1
- Boot to C runtime for OS Initialize
[    0.002000] bcm2711_mbox_sendreq: Unknown response code: 00000000
[    0.215000] bcm2711_waitresponse: Got error: -110
[    0.219000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00008101 failed: -110
[    0.227000] bcm2711_recvshort: Error: -110

NuttShell (NSH) NuttX-10.4.0
nsh> uname -a
NuttX 10.4.0 89e841fed4 Nov  4 2025 01:33:33 arm64 raspberrypi-4b
nsh> ?
help usage:  help [-v] [<cmd>]

    .           cp          expr        mkdir       rm          uname
    [           cmp         false       mkfatfs     rmdir       umount
    ?           dirname     fdinfo      mkrd        set         unset
    alias       df          free        mount       sleep       uptime
    unalias     dmesg       help        mv          source      usleep
    basename    echo        hexdump     pidof       test        watch
    break       env         kill        printf      time        xd
    cat         exec        pkill       ps          true        wait
    cd          exit        ls          pwd         truncate

Builtin Apps:
    dd          getprime    nsh         ostest      sdstress    sh
nsh> cat /sd/test.txt
Another test!
BLAH
nsh> echo "NUTTX TEST ON RPI4B AND SANDISK 2GB CARD" >> /sd/test.txt
nsh> cat /sd/test.txt
Another test!
BLAH
NUTTX TEST ON RPI4B AND SANDISK 2GB CARD
nsh> sdstress
Start stress test with 64 files, 4096 bytes and 32 iterations.
[   44.802000] bcm2711_eventtimeout: Watchdog timeout on slot 2
[   44.802000] mmcsd_eventwait: ERROR: Awakened with 08
[   44.812000] mmcsd_readmultiple: ERROR: CMD18 transfer failed: -110
[   44.818000] bcm2711_waitresponse: Timed out polling response.
[   44.818000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00001458 failed: -110
[   44.881000] mmcsd_eventwait: ERROR: Awakened with 1c
[   44.881000] mmcsd_writesingle: ERROR: CMD24 transfer failed: -110
[   44.881000] file_put: ERROR: fs putfilep file_close() failed: -110
read /sd/stress/tmp000 failed, ret: -1, errno 110 -> Unknown error 110
iteration 0 took 947.000 ms: FAIL
Test FAIL: Average time: 29.594 ms
nsh> sdstress
[   49.608000] bcm2711_waitresponse: Got error: -110
[   49.612000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00001458 failed: -110
[   49.620000] bcm2711_recvshortcrc: Error: -110
[   49.624000] mmcsd_writesingle: ERROR: mmcsd_recv_r1 for CMD24 failed: -110
Start stress test with 64 files, 4096 bytes and 32 iterations.
mkdir /sd/stress failed, ret: -1, errno: 110 -> Unknown error 110
iteration 0 took 23.000 ms: FAIL
Test FAIL: Average time: 0.719 ms
nsh> sdstress -b 1023
Start stress test with 64 files, 1023 bytes and 32 iterations.

>>> HANGS HERE <<<

>>> HARD RESET <<<

- Ready to Boot Primary CPU
- Boot from EL2
- Boot from EL1
- Boot to C runtime for OS Initialize
[    0.002000] bcm2711_mbox_sendreq: Unknown response code: 00000000
[    0.215000] bcm2711_waitresponse: Got error: -110
[    0.219000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00008101 failed: -110
[    0.227000] bcm2711_recvshort: Error: -110

NuttShell (NSH) NuttX-10.4.0
nsh> cat /sd/test.txt
Another test!
BLAH
NUTTX TEST ON RPI4B AND SANDISK 2GB CARD
nsh> sdstress -b 1023
Start stress test with 64 files, 1023 bytes and 32 iterations.
mkdir /sd/stress failed, ret: -1, errno: 17 -> Unknown error 17
iteration 0 took 1.000 ms: FAIL
Test FAIL: Average time: 0.031 ms
nsh> ls /sd
/sd:
 bcm2711-rpi-4-b.dtb
 config.txt
 fixup4.dat
 fixup4cd.dat
 fixup4db.dat
 fixup4x.dat
 nuttx.bin
 start4.elf
 start4cd.elf
 start4db.elf
 start4x.elf
 test.txt
 stress/
nsh> rm -rf /sd/stress

>>> EXISTING /SD/STRESS BLOCKS TESTING NEEDS TO BE REMOVED <<<

nsh> sdstress -b 1023
Start stress test with 64 files, 1023 bytes and 32 iterations.
iteration 0 took 2865.000 ms: OK
iteration 1 took 2582.000 ms: OK
iteration 2 took 3023.000 ms: OK
iteration 3 took 3005.000 ms: OK
iteration 4 took 2913.000 ms: OK
iteration 5 took 3043.000 ms: OK
iteration 6 took 2636.000 ms: OK
iteration 7 took 2648.000 ms: OK
iteration 8 took 2654.000 ms: OK
iteration 9 took 2973.000 ms: OK
iteration 10 took 2820.000 ms: OK
iteration 11 took 3048.000 ms: OK
iteration 12 took 2702.000 ms: OK
iteration 13 took 2994.000 ms: OK
iteration 14 took 2660.000 ms: OK
iteration 15 took 3031.000 ms: OK
iteration 16 took 2825.000 ms: OK
iteration 17 took 3037.000 ms: OK
iteration 18 took 2693.000 ms: OK
iteration 19 took 3036.000 ms: OK
iteration 20 took 2682.000 ms: OK
iteration 21 took 3047.000 ms: OK
iteration 22 took 2375.000 ms: OK
iteration 23 took 2668.000 ms: OK
iteration 24 took 2654.000 ms: OK
iteration 25 took 3009.000 ms: OK
iteration 26 took 2629.000 ms: OK
iteration 27 took 3081.000 ms: OK
iteration 28 took 2586.000 ms: OK
iteration 29 took 3015.000 ms: OK
iteration 30 took 2606.000 ms: OK
iteration 31 took 3167.000 ms: OK
Test OK: Average time: 2834.594 ms

nsh> free
      total       used       free    maxused    maxfree  nused  nfree name
18446744073637310464      2279218446744073637287672      3478418446744073637287672     28      1 Umem
nsh> free -h
nsh: free: too many arguments

>>> WE NEED TO ADD FREE -H FLAG SO ITS READABLE IN MB/GB <<<

nsh> sdstress --help
Stress test on a mount point
sdstress: [-r] [-b] [-f]
  -r   Number of runs (1-10000), default 32
  -b   Number of bytes (1-10000), default 4096
  -f   Number of files (1-999), default 64

nsh> sdstress -r 1 -b 1023
Start stress test with 64 files, 1023 bytes and 1 iterations.
iteration 0 took 2575.000 ms: OK
Test OK: Average time: 2575.000 ms

nsh> sdstress -r 1 -b 1024
Start stress test with 64 files, 1024 bytes and 1 iterations.
[  204.940000] bcm2711_eventtimeout: Watchdog timeout on slot 2
[  204.940000] mmcsd_eventwait: ERROR: Awakened with 08
[  204.950000] mmcsd_readmultiple: ERROR: CMD18 transfer failed: -110
[  204.956000] bcm2711_waitresponse: Timed out polling response.
[  204.956000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00001458 failed: -110
[  205.019000] mmcsd_eventwait: ERROR: Awakened with 1c
[  205.019000] mmcsd_writesingle: ERROR: CMD24 transfer failed: -110
[  205.019000] file_put: ERROR: fs putfilep file_close() failed: -110
read /sd/stress/tmp000 failed, ret: -1, errno 110 -> Unknown error 110
iteration 0 took 385.000 ms: FAIL
Test FAIL: Average time: 385.000 ms

nsh> sdstress -r 1 -b 1024
Start st[  207.418000] bcm2711_waitresponse: Got error: -110
[  207.423000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00001458 failed: -110
[  207.431000] bcm2711_recvshortcrc: Error: -110
[  207.436000] mmcsd_writesingle: ERROR: mmcsd_recv_r1 for CMD24 failed: -110
ress test with 64 files, 1024 bytes and 1 iterations.
mkdir /sd/stress failed, ret: -1, errno: 110 -> Unknown error 110
iteration 0 took 25.000 ms: FAIL
Test FAIL: Average time: 25.000 ms

nsh> sdstress -r 1 -b 1023
Start stress test with 64 files, 1023 bytes and 1 iterations.

>>> HANGS HERE BECAUSE /SD/STRESS EXISTS <<<
  1. uSD NONAME 2GB:
- Boot from EL2
- Boot from EL1
- Boot to C runtime for OS Initialize
[    0.002000] bcm2711_mbox_sendreq: Unknown response code: 00000000
[    0.215000] bcm2711_waitresponse: Got error: -110
[    0.219000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00008101 failed: -110
[    0.227000] bcm2711_recvshort: Error: -110

NuttShell (NSH) NuttX-10.4.0
nsh> uname -a
NuttX 10.4.0 89e841fed4 Nov  4 2025 01:33:33 arm64 raspberrypi-4b
nsh> free
      total       used       free    maxused    maxfree  nused  nfree name
18446744073637310464      2279218446744073637287672      2346418446744073637287672     28      1 Umem

nsh> ls /sd
/sd:
 bcm2711-rpi-4-b.dtb
 config.txt
 fixup4.dat
 fixup4cd.dat
 fixup4db.dat
 fixup4x.dat
 nuttx.bin
 start4.elf
 start4cd.elf
 start4db.elf
 start4x.elf
 test.txt

nsh> cat /sd/test.txt
Another test!
BLAH
nsh> echo "NUTTX ON RPI4B SD TEST WITH NONAME 2GB" >> /sd/test.txt
nsh> cat /sd/test.txt
Another test!
BLAH
NUTTX ON RPI4B SD TEST WITH NONAME 2GB

nsh> sdstress -b 1023
Start stress test with 64 files, 1023 bytes and 32 iterations.
iteration 0 took 3478.000 ms: OK
iteration 1 took 3811.000 ms: OK
iteration 2 took 4493.000 ms: OK
iteration 3 took 5218.000 ms: OK
iteration 4 took 4479.000 ms: OK
iteration 5 took 4489.000 ms: OK
iteration 6 took 4638.000 ms: OK
iteration 7 took 4480.000 ms: OK
iteration 8 took 4503.000 ms: OK
iteration 9 took 4502.000 ms: OK
iteration 10 took 4538.000 ms: OK
iteration 11 took 4577.000 ms: OK
iteration 12 took 4561.000 ms: OK
iteration 13 took 4587.000 ms: OK
iteration 14 took 4596.000 ms: OK
iteration 15 took 4569.000 ms: OK
iteration 16 took 5414.000 ms: OK
iteration 17 took 5333.000 ms: OK
iteration 18 took 5278.000 ms: OK
iteration 19 took 5259.000 ms: OK
iteration 20 took 5316.000 ms: OK
iteration 21 took 5285.000 ms: OK
iteration 22 took 5279.000 ms: OK
iteration 23 took 5481.000 ms: OK
iteration 24 took 6064.000 ms: OK
iteration 25 took 5353.000 ms: OK
iteration 26 took 5324.000 ms: OK
iteration 27 took 5306.000 ms: OK
iteration 28 took 5360.000 ms: OK
iteration 29 took 5493.000 ms: OK
iteration 30 took 5335.000 ms: OK
iteration 31 took 5368.000 ms: OK
Test OK: Average time: 4930.219 ms

nsh> sdstress -b 1023 -r 1
Start stress test with 64 files, 1023 bytes and 1 iterations.
iteration 0 took 5386.000 ms: OK
Test OK: Average time: 5386.000 ms

nsh> sdstress -b 1024 -r 1
Start stress test with 64 files, 1024 bytes and 1 iterations.
[  412.117000] bcm2711_eventtimeout: Watchdog timeout on slot 2
[  412.117000] mmcsd_eventwait: ERROR: Awakened with 08
[  412.127000] mmcsd_readmultiple: ERROR: CMD18 transfer failed: -110
[  412.133000] bcm2711_waitresponse: Timed out polling response.
[  412.133000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00001458 failed: -110
[  412.196000] mmcsd_eventwait: ERROR: Awakened with 1c
[  412.196000] mmcsd_writesingle: ERROR: CMD24 transfer failed: -110
[  412.196000] file_put: ERROR: fs putfilep file_close() failed: -110
read /sd/stress/tmp000 failed, ret: -1, errno 110 -> Unknown error 110
iteration 0 took 450.000 ms: FAIL
Test FAIL: Average time: 450.000 ms

>>> RESET <<<

- Ready to Boot Primary CPU
- Boot from EL2
- Boot from EL1
- Boot to C runtime for OS Initialize
[    0.002000] bcm2711_mbox_sendreq: Unknown response code: 00000000
[    0.215000] bcm2711_waitresponse: Got error: -110
[    0.219000] mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00008101 failed: -110
[    0.227000] bcm2711_recvshort: Error: -110

NuttShell (NSH) NuttX-10.4.0
nsh> cat /sd/test.txt
Another test!
BLAH
NUTTX ON RPI4B SD TEST WITH NONAME 2GB

@linguini1
Copy link
Contributor Author

Thank you for testing @cederom ! It looks like things are working well with a variety of different cards as long as the operations are 1023 bytes or less. I think this is a limitation of the write FIFO in the controller, as the write-ready interrupts don't seem to be behaving as I expected they would. I will spend some time later to try to fix this transfer size issue but I haven't had any luck so far. It might be a while.

@cederom
Copy link
Contributor

cederom commented Nov 4, 2025

Thank You for porting NuttX to rPI 4B @linguini1 this is hard and amazing work kudos!! :-)

I have now setup and I know how to use it let me know when you need more testing :-)

During this tests I found some related improvements:

@linguini1
Copy link
Contributor Author

Thank You for porting NuttX to rPI 4B @linguini1 this is hard and amazing work kudos!! :-)

I have now setup and I know how to use it let me know when you need more testing :-)

During this tests I found some related improvements:

I really appreciate your time testing! Great finds as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm64 Issues related to ARM64 (64-bit) architecture Area: Documentation Improvements or additions to documentation Board: arm64 Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] RPi 4B mount boot partition of SD card [FEATURE] RPi 4B SD card support

4 participants