SmartIotMaker commented on issue #14368:
URL: https://github.com/apache/nuttx/issues/14368#issuecomment-2421224290

   Run follow command:
   1.  `./tools/configure.sh -S -l esp32s3-devkit:mcuboot_nsh`
   2. `make menuconfig` to select Mount on bring-up" in  `"Board Selection" -> 
"Mount SPI Flash MTD on bring-up" -> "SMARTFS"` , eanble `Larg File Support` in 
`"File Systems" -> "Large File Support"`, enable `BSD licenses` in `" License 
Setup"->"Use components that have BSD licenses"`, enable "
   3. `make make bootloader ` to create  `mcuboot-esp32s3.bin` file
   4. `make -j` to create `nuttx.bin` file
   5. `esptool.py erase_flash`
   6. `make flash ESPTOOL_PORT=/dev/ttyUSB0 ESPTOOL_BINDIR=./`
   7. ` minicom -b 115200 -D /dev/ttyUSB0 -o`
   8. reset board by press reset button and then get follow log:
   
   ```
   ESP-ROM:esp32s3-20210327
   Build:Mar 27 2021
   rst:0x1 (POWERON),boot:0x2b (SPI_FAST_FLASH_BOOT)
   SPIWP:0xee
   mode:DIO, clock div:2
   load:0x3fcd35a8,len:0x1528
   load:0x403b0000,len:0x1dbc
   load:0x403ba000,len:0x2894
   entry 0x403bc844
   [esp32s3] [INF] *** Booting MCUboot build v1.10.0-131-gb206b99b ***
   [esp32s3] [INF] [boot] chip revision: v0.2
   [esp32s3] [INF] [boot.esp32s3] Boot SPI Speed : 40MHz
   [esp32s3] [INF] [boot.esp32s3] SPI Mode       : DIO
   [esp32s3] [INF] [boot.esp32s3] SPI Flash Size : 16MB
   [esp32s3] [INF] [boot] Enabling RNG early entropy source...
   [esp32s3] [INF] Primary image: magic=good, swap_type=0x1, copy_done=0x3, 
image_ok=0x1
   [esp32s3] [INF] Scratch: magic=bad, swap_type=0x0, copy_done=0x2, 
image_ok=0x3
   [esp32s3] [INF] Boot source: primary slot
   [esp32s3] [INF] Image index: 0, Swap type: none
   [esp32s3] [INF] Disabling RNG early entropy source...
   [esp32s3] [INF] br_image_off = 0x10000
   [esp32s3] [INF] ih_hdr_size = 0x20
   [esp32s3] [INF] Loading image 0 - slot 0 from flash, area id: 1
   [esp32s3] [INF] DRAM segment: start=0x15918, size=0xae0, vaddr=0x3fc8a180
   [esp32s3] [INF] IRAM segment: start=0x12e58, size=0x2ac0, vaddr=0x40374000
   [esp32s3] [INF] start=0x40374b54
   IROM segment aligned lma 0x00020000 vma 0x42010000 len 0x01be6c (114284)
   DROM segment aligned lma 0x00010000 vma 0x3c000000 len 0x002e18 (11800)
   ```
   after that, no anymore info.
   
   follow is defconfig context create by`make savedefconfig` :
   ```
   #
   # This file is autogenerated: PLEASE DO NOT EDIT IT.
   #
   # You can use "make menuconfig" to make any modifications to the installed 
.config file.
   # You can then do "make savedefconfig" to generate a new defconfig file that 
includes your
   # modifications.
   #
   # CONFIG_ARCH_LEDS is not set
   # CONFIG_NSH_ARGCAT is not set
   # CONFIG_NSH_CMDOPT_HEXDUMP is not set
   CONFIG_ALLOW_BSD_COMPONENTS=y
   CONFIG_ARCH="xtensa"
   CONFIG_ARCH_BOARD="esp32s3-devkit"
   CONFIG_ARCH_BOARD_COMMON=y
   CONFIG_ARCH_BOARD_ESP32S3_DEVKIT=y
   CONFIG_ARCH_CHIP="esp32s3"
   CONFIG_ARCH_CHIP_ESP32S3=y
   CONFIG_ARCH_CHIP_ESP32S3WROOM1N4=y
   CONFIG_ARCH_INTERRUPTSTACK=2048
   CONFIG_ARCH_STACKDUMP=y
   CONFIG_ARCH_XTENSA=y
   CONFIG_BOARDCTL_RESET=y
   CONFIG_BOARD_LOOPSPERMSEC=16717
   CONFIG_BUILTIN=y
   CONFIG_ESP32S3_APP_FORMAT_MCUBOOT=y
   CONFIG_ESP32S3_SPIFLASH=y
   CONFIG_ESP32S3_SPIFLASH_SMARTFS=y
   CONFIG_ESP32S3_UART0=y
   CONFIG_FS_PROCFS=y
   CONFIG_FS_SPIFFS=y
   CONFIG_HAVE_CXX=y
   CONFIG_HAVE_CXXINITIALIZE=y
   CONFIG_IDLETHREAD_STACKSIZE=3072
   CONFIG_INIT_ENTRYPOINT="nsh_main"
   CONFIG_INTELHEX_BINARY=y
   CONFIG_NSH_ARCHINIT=y
   CONFIG_NSH_BUILTIN_APPS=y
   CONFIG_NSH_DISABLE_LOSMART=y
   CONFIG_NSH_FILEIOSIZE=512
   CONFIG_NSH_LINELEN=64
   CONFIG_NSH_READLINE=y
   CONFIG_PREALLOC_TIMERS=4
   CONFIG_RAM_SIZE=114688
   CONFIG_RAM_START=0x20000000
   CONFIG_RR_INTERVAL=200
   CONFIG_SCHED_WAITPID=y
   CONFIG_START_DAY=6
   CONFIG_START_MONTH=12
   CONFIG_START_YEAR=2011
   CONFIG_SYSLOG_BUFFER=y
   CONFIG_SYSTEM_NSH=y
   CONFIG_UART0_SERIAL_CONSOLE=y
   ```
   
   when I trace step by step, I find cpu hang in `spi_flash_disable_cache`, 
follow is call stack:
   ```
   init_storage_partition(esp32s3_board_spiflash.c) -> 
setup_spiffs(esp32s3_board_spiflash.c) ->  nx_mount(fs_mount.c) 
->mops->bind()->spiffs_bind(spiffs_vfs.c) -> spiffs_objlu_scan(spiffs_core.c) 
-> spiffs_cache_read(spiffs_cache)
   -> spiffs_mtd_read(spiffs_mtd.c) -> MTD_READ(fs->mtd, offset, len, dest) -> 
esp32s3_read(esp32s3_spiflash_mtd.c) -> spi_flash_read(esp32s3_spiflash.c) -> 
spiflash_start(esp32s3_spiflash.c) -> spiflash_suspend_cache(esp32s3_spiflash.c)
   -> spi_flash_disable_cache(cache_hal.c)
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to