cederom opened a new issue, #18873:
URL: https://github.com/apache/nuttx/issues/18873

   ### Description
   
   Hello world :-)
   
   I just got ESP32-P4-Nano board from WaveShare. Nano board [1] seems to be 
schematic compatible with ESP32-P4-Function-EV-Board [2], so for start I tried 
to build and run existing Function board firmware. Nano uses GPIO 37,38 TX,RX 
pins over CH343 chip to USB-C.
   
   I noticed that build is a bit picky about the compiler. I am using 
`CROSSDEV` parameter to make to select build toolchain.
   * builds fine even with old espressif's idf tools riscv32-esp-elf-gcc 
version 8.4.0.
   * builds fine with xpack-riscv-none-elf-gcc-14.2.0-3-linux-x64 as 
recommended in the docs [3].
   * It does not build with system riscv64-none-elf-gcc 11.3.0 (throws `error: 
unknown type name '_LOCK_T'` errors).
   
   Tried `gmake flash` with esptool version:
   1. 4.10.0:
   
   ```
   (..)
   LD: nuttx
   Memory region         Used Size  Region Size  %age Used
      tcm_idram_seg:          68 B         8 KB      0.83%
           irom_seg:      139304 B        64 MB      0.21%
           sram_seg:       35804 B     847808 B      4.22%
           drom_seg:      240948 B        64 MB      0.36%
   rev3_mspi_workaround_seg:           0 B          0 B
         lp_ram_seg:         104 B      32744 B      0.32%
    lp_reserved_seg:           0 B         24 B      0.00%
     extern_ram_seg:           0 B        64 MB      0.00%
   CP: nuttx.hex
   MKIMAGE: NuttX binary
   esptool.py -c esp32p4 elf2image --ram-only-header -fs 4MB -fm dio -ff "80m" 
-o nuttx.bin nuttx
   esptool.py v4.10.0
   Creating esp32p4 image...
   Image has only RAM segments visible. ROM segments are hidden and SHA256 
digest is not appended.
   Merged 2 ELF sections
   Successfully created esp32p4 image.
   Generated: nuttx.bin
   esptool.py -c esp32p4 -p /dev/cuaU0 -b 115200  write_flash -fs 4MB -fm dio 
-ff "80m" 0x2000 nuttx.bin
   esptool.py v4.10.0
   Serial port /dev/cuaU0
   Connecting....
   Chip is ESP32-P4 (revision v1.3)
   Features: High-Performance MCU
   Crystal is 40MHz
   MAC: XXX
   Uploading stub...
   Running stub...
   Stub running...
   Configuring flash size...
   Flash will be erased from 0x00002000 to 0x00042fff...
   Compressed 262184 bytes to 124339...
   Wrote 262184 bytes (124339 compressed) at 0x00002000 in 11.0 seconds 
(effective 190.5 kbit/s)...
   Hash of data verified.
   
   Leaving...
   Hard resetting via RTS pin...
   ```
   
   3. 5.2.0:
   
   ```
   LD: nuttx
   Memory region         Used Size  Region Size  %age Used
      tcm_idram_seg:          68 B         8 KB      0.83%
           irom_seg:      139028 B        64 MB      0.21%
           sram_seg:       35804 B     847808 B      4.22%
           drom_seg:      241008 B        64 MB      0.36%
   rev3_mspi_workaround_seg:          0 GB         0 GB
         lp_ram_seg:         104 B      32744 B      0.32%
    lp_reserved_seg:          0 GB         24 B      0.00%
     extern_ram_seg:          0 GB        64 MB      0.00%
   CP: nuttx.hex
   MKIMAGE: NuttX binary
   esptool.py -c esp32p4 elf2image --ram-only-header -fs 4MB -fm dio -ff "80m" 
-o nuttx.bin nuttx
   Warning: DEPRECATED: 'esptool.py' is deprecated. Please use 'esptool' 
instead. The '.py' suffix will be removed in a future major release.
   esptool v5.2.0
   Creating ESP32-P4 image...
   Image has only RAM segments visible. ROM segments are hidden and SHA256 
digest is not appended.
   Merged 2 ELF sections.
   Successfully created ESP32-P4 image.
   Generated: nuttx.bin
   esptool.py -c esp32p4 -p /dev/cuaU0 -b 115200  write_flash -fs 4MB -fm dio 
-ff "80m" 0x2000 nuttx.bin
   Warning: DEPRECATED: 'esptool.py' is deprecated. Please use 'esptool' 
instead. The '.py' suffix will be removed in a future major release.
   Warning: Deprecated: Command 'write_flash' is deprecated. Use 'write-flash' 
instead.
   esptool v5.2.0
   Connected to ESP32-P4 on /dev/cuaU0:
   Chip type:          ESP32-P4 (revision v1.3)
   Features:           Dual Core + LP Core, 400MHz
   Crystal frequency:  40MHz
   MAC:                XXX
   
   Stub flasher running.
   
   Configuring flash size...
   Flash will be erased from 0x00002000 to 0x00041fff...
   Wrote 261908 bytes (123944 compressed) at 0x00002000 in 11.0 seconds (189.7 
kbit/s).
   Hash of data verified.
   
   Hard resetting via RTS pin...
   ```
   
   And then I have boot loop like this no matter what compiler and esptool is 
used:
   
   ```
   rst:0x7 (HP_SYS_HP_WDT_RESET),boot:0x30f (SPI_FAST_FLASH_BOOT)
   SPI mode:DIO, clock div:1
   load:0x30100000,len:0x44
   load:0x4ff20000,len:0x56e4
   load:0x4ff25700,len:0x11c4
   SHA-256 comparison failed:
   Calculated: c97aaddceb7e952201e6cf5c679d5526b2182f495c70158eacd2a4bc87f6a99b
   Expected: 00000000f0760000000000000000000000000000000000000000000000000000
   Attempting to boot anyway...
   entry 0x4ff25364
   ESP-ROM:esp32p4-eco2-20240710
   Build:Jul 10 2024
   rst:0x7 (HP_SYS_HP_WDT_RESET),boot:0x30f (SPI_FAST_FLASH_BOOT)
   SPI mode:DIO, clock div:1
   load:0x30100000,len:0x44
   load:0x4ff20000,len:0x56e4
   load:0x4ff25700,len:0x11c4
   SHA-256 comparison failed:
   Calculated: c97aaddceb7e952201e6cf5c679d5526b2182f495c70158eacd2a4bc87f6a99b
   Expected: 00000000f0760000000000000000000000000000000000000000000000000000
   Attempting to boot anyway...
   entry 0x4ff25364
   ```
   
   What do I miss? Any hints welcome :-)
   Tomek
   
   [1] https://www.waveshare.com/wiki/ESP32-P4-Nano-StartPage#Resources
   [2] 
https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32p4/esp32-p4-function-ev-board/user_guide.html
   [3] https://nuttx.apache.org/docs/latest/platforms/risc-v/esp32p4/index.html
   
   ### Verification
   
   - [x] I have verified before submitting the report.


-- 
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