tmedicci opened a new pull request, #3033:
URL: https://github.com/apache/nuttx-apps/pull/3033

   ## Summary
   
   * testing/fs/mtd_test: Add MTD test to evaluate transfer rates
   
   This test allows measuring write and read operations on an MTD flash device, 
evaluating its transfer rates.
   
   ## Impact
   
   Impact on user: YES, by providing a testing application for MTD devices 
(without any kind of buffering or file system).
   
   Impact on build: NO.
   
   Impact on hardware: NO.
   
   Impact on documentation: NO.
   
   Impact on security: NO.
   
   Impact on compatibility: NO.
   
   ## Testing
   
   To test it, create an MTD partition and register it as a block driver. Using 
`esp32s3-devkit:spiflash` defconfig, let's try it:
   
   ### Building
   
   First of all, apply the following patch (which will be submitted to the 
`nuttx` repository):
   
   ```
   diff --git a/boards/xtensa/esp32s3/common/src/esp32s3_board_spiflash.c 
b/boards/xtensa/esp32s3/common/src/esp32s3_board_spiflash.c
   index 7d0ceecc6d..37c15357c2 100644
   --- a/boards/xtensa/esp32s3/common/src/esp32s3_board_spiflash.c
   +++ b/boards/xtensa/esp32s3/common/src/esp32s3_board_spiflash.c
   @@ -333,6 +333,14 @@ static int init_storage_partition(void)
          return ret;
        }
    
   +  ret = ftl_initialize(0, mtd);
   +  if (ret < 0)
   +    {
   +      syslog(LOG_ERR, "ERROR: Failed to initialize the FTL layer: %d\n",
   +              ret);
   +      return ret;
   +    }
   +
    #ifdef CONFIG_MTD_PARTITION
      ret = parse_mtd_partition(mtd, NULL, NULL);
      if (ret < 0)
   ```
   
   After applying it, build the defconfig with the following additional configs:
   ```
   make -j distclean && ./tools/configure.sh esp32s3-devkit:spiflash && 
kconfig-tweak -d ESP32S3_SPIFLASH_SMARTFS && kconfig-tweak --set-val 
ESP32S3_SPIFLASH_MTD_BLKSIZE 4096 && kconfig-tweak -e TESTING_MTD_TRANSFER_RATE 
&&  make olddefconfig && make flash ESPTOOL_PORT=/dev/ttyUSB0 -s -j$(nproc) && 
minicom -D /dev/ttyUSB0
   ```
   
   ### Running
   
   Run the MTD test application:
   
   ```
   nsh> mtd_test /dev/mtdblock0
   ```
   
   ### Results
   
   ```
   nsh> mtd_test /dev/mtdblock0
   FLASH Test on device with:
      Sector size:        4096
      Sector count:        256
      Erase block:        4096
      Total size:      1048576
   
   Starting write operation...
   
   Write operation completed in 4.29 seconds
   Total bytes written: 1048576
   Transfer rate [write]: 238.69 KiB/s
   
   Starting read operation...
   
   Read operation completed in 0.43 seconds
   Total bytes read: 1048576
   Transfer rate [read]: 2381.40 KiB/s
   
   Data verification successful: read data matches written data
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to