esplay-retro-emulation icon indicating copy to clipboard operation
esplay-retro-emulation copied to clipboard

Can you update to the latest IDF

Open FantasyGmm opened this issue 2 years ago • 43 comments

/home/gm/esplay-retro-emulation/esplay-launcher/components/acodecs/src/xmplite/loaders/xm_load.c: In function 'xm_load': /home/gm/esplay-retro-emulation/esplay-launcher/components/acodecs/src/xmplite/loaders/xm_load.c:645:38: error: 'snprintf' output truncated before the last format character [-Werror=format-truncation=] snprintf(tracker_name, 20, "%-20.20s", xfh.tracker); ^ /home/gm/esplay-retro-emulation/esplay-launcher/components/acodecs/src/xmplite/loaders/xm_load.c:645:2: note: 'snprintf' output 21 bytes into a destination of size 20 snprintf(tracker_name, 20, "%-20.20s", xfh.tracker); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors make[1]: *** [/home/gm/esp/esp-idf/make/component_wrapper.mk:298: src/xmplite/loaders/xm_load.o] Error 1 make: *** [/home/gm/esp/esp-idf/make/project.mk:649: component-acodecs-build] Error 2 make: *** Waiting for unfinished jobs.... When I manually compile esplay launcher, the above error will appear. Other things are compiled normally. I use idf4.4.1. I don't know why this error occurs I can't compile others, for example, gnuboy lacks display h. Nofrendo is missing settings h

FantasyGmm avatar Jun 08 '22 05:06 FantasyGmm

Actually i have it in my local repo, but it's very experimental, also the current code only support idf v4.2 not the latest one 4.4 because conflict of DMA between sdcard sdmmc and i2s driver

pebri86 avatar Jun 10 '22 22:06 pebri86

/home/gm/esplay-retro-emulation/esplay-launcher/components/acodecs/src/xmplite/loaders/xm_load.c: In function 'xm_load': /home/gm/esplay-retro-emulation/esplay-launcher/components/acodecs/src/xmplite/loaders/xm_load.c:645:38: error: 'snprintf' output truncated before the last format character [-Werror=format-truncation=] snprintf(tracker_name, 20, "%-20.20s", xfh.tracker); ^ /home/gm/esplay-retro-emulation/esplay-launcher/components/acodecs/src/xmplite/loaders/xm_load.c:645:2: note: 'snprintf' output 21 bytes into a destination of size 20 snprintf(tracker_name, 20, "%-20.20s", xfh.tracker); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors make[1]: *** [/home/gm/esp/esp-idf/make/component_wrapper.mk:298: src/xmplite/loaders/xm_load.o] Error 1 make: *** [/home/gm/esp/esp-idf/make/project.mk:649: component-acodecs-build] Error 2 make: *** Waiting for unfinished jobs.... When I manually compile esplay launcher, the above error will appear. Other things are compiled normally. I use idf4.4.1. I don't know why this error occurs I can't compile others, for example, gnuboy lacks display h. Nofrendo is missing settings h

to suppress warning threated error above try using flag Wno-format-truncation when compile

pebri86 avatar Jun 10 '22 22:06 pebri86

I'm trying to port it to S3. The base firmware can run, butthe simulator can't be compiled

FantasyGmm avatar Jun 13 '22 13:06 FantasyGmm

Can you create a branch to upload the code? Maybe I can make it run on S3

FantasyGmm avatar Jun 13 '22 13:06 FantasyGmm

I'm trying to port it to S3. The base firmware can run, butthe simulator can't be compiled

Can S3 run on idf 4.2? i tried idf 4.4 but it still incomplete, the source compiled successfully but i2s and sdcard in sdmmc mode can't run together

pebri86 avatar Jun 14 '22 05:06 pebri86

At present, the only release of S3 is 4.4.1, but the SDMMC of the base firmware can not be attached anyway. It has been timeout all the time. It is useless to replace the TF Card

FantasyGmm avatar Jun 14 '22 07:06 FantasyGmm

I found the reason. SDMMC forgot to be grounded. Now it is normal. I asked my friend. He said that I2S and SDIO of S3 can work together

FantasyGmm avatar Jun 14 '22 07:06 FantasyGmm

I found the reason. SDMMC forgot to be grounded. Now it is normal. I asked my friend. He said that I2S and SDIO of S3 can work together

wow glad to hear that sdmmc can work together on S3. esp32 'classic' complain about DMA conflict on idf 4.4. Maybe i can suggest you a snippet code how to suppress warning error when compile on idf 4.4

pebri86 avatar Jun 14 '22 10:06 pebri86

Thank you very much. some files is missing. I don't know where to get these files,If you have time in the near future, can you fix the this project?

FantasyGmm avatar Jun 14 '22 13:06 FantasyGmm

Excuse me, can you compile under idf4.4.1 now?

FantasyGmm avatar Jun 19 '22 08:06 FantasyGmm

Excuse me, can you compile under idf4.4.1 now?

I'm sorry, i need to setup again my environment. i just reinstall the os of my PC. i'll make a separate branch for that.##

pebri86 avatar Jun 20 '22 22:06 pebri86

Can I compile it now? Maybe you can upload a complete project (some header files are missing now), and then I'll find a way to do it myself

FantasyGmm avatar Jul 02 '22 15:07 FantasyGmm

I recently migrated the master to the new version of IDF and rewritten the build system to use cmake recommended by ESP IDF I will weld a new board to test it tomorrow https://github.com/FantasyGmm/esplay-retro-emulation

FantasyGmm avatar Aug 13 '22 11:08 FantasyGmm

Now I have three independent firmware, when I use mkfw to combine them FW firmware swipes under BL, the 0th firmware will be written normally, and the subsequent firmware will have erase error. After that, the firmware cannot be started normally after the writing is completed

FantasyGmm avatar Aug 14 '22 14:08 FantasyGmm

Now I have three independent firmware, when I use mkfw to combine them FW firmware swipes under BL, the 0th firmware will be written normally, and the subsequent firmware will have erase error. After that, the firmware cannot be started normally after the writing is completed

What the error message when writing the firmware? is it length error? Did you check the binary size? is the partition for each binary size has enough space?

pebri86 avatar Aug 14 '22 16:08 pebri86

menu_main: fileName=/sd/esplay/firmware/ESPLAY.FW
flash_firmware: HEAP=0x0081667b
Opening file /sd/esplay/firmware/ESPLAY.FW.
Header OK: ESPLAY_FIRMWARE_V00_01
FirmwareDescription=Retro-Emulation
flash_firmware: expected_checksum=0x957b4974
flash_firmware: checksum=0x957b4974
flash_firmware: FLASH_START_ADDRESS=0x00070000
Erasing ... (0)
Writing (0) - 00000000
Writing (0) - 0x001000
Writing (0) - 0x002000
Writing (0) - 0x003000
Writing (0) - 0x004000
Writing (0) - 0x005000
....
Writing (0) - 0x13b000
Writing (0) - 0x13c000
OK: [0] Length=0x13cc60
part 0:
	magic=0x50aa
	type=0x01
	subtype=0x02
	[pos.offset=0x00009000, pos.size=0x00004000]
	label='nvs             '
	flags=0000000000

part 1:
	magic=0x50aa
	type=0x01
	subtype=0000
	[pos.offset=0x0000d000, pos.size=0x00002000]
	label='otadata         '
	flags=0000000000

part 2:
	magic=0x50aa
	type=0x01
	subtype=0x01
	[pos.offset=0x0000f000, pos.size=0x00001000]
	label='phy_init        '
	flags=0000000000

part 3:
	magic=0x50aa
	type=0000
	subtype=0000
	[pos.offset=0x00010000, pos.size=0x00060000]
	label='firmware        '
	flags=0000000000

part 4:
	magic=0xebeb
	type=0xff
	subtype=0xff
	[pos.offset=0xffffffff, pos.size=0xffffffff]
	label=(label is broken,too many random char)
	flags=0x6eb2314a

flash_firmware: current flash addr 1ACC60,1A0000Erasing ... (1)
spi_flash_erase_range failed. eraseBlocks=157
Writing (1) - 00000000
Writing (1) - 0x001000
....

I used this function print_partitions(); to print the partition table after writing. Only the first firmware was successfully written to the partition. However, it is obvious that the written Part4 partition information is incorrect. I don't know why. I fork the base and the warehouse and submit the modified code. Can you check it

FantasyGmm avatar Aug 15 '22 06:08 FantasyGmm

I forgot to say that I use ESP32S3N8R8, with 8MB flash and 8MB PSRAM

FantasyGmm avatar Aug 15 '22 09:08 FantasyGmm

menu_main: fileName=/sd/esplay/firmware/ESPLAY.FW
flash_firmware: HEAP=0x0081667b
Opening file /sd/esplay/firmware/ESPLAY.FW.
Header OK: ESPLAY_FIRMWARE_V00_01
FirmwareDescription=Retro-Emulation
flash_firmware: expected_checksum=0x957b4974
flash_firmware: checksum=0x957b4974
flash_firmware: FLASH_START_ADDRESS=0x00070000
Erasing ... (0)
Writing (0) - 00000000
Writing (0) - 0x001000
Writing (0) - 0x002000
Writing (0) - 0x003000
Writing (0) - 0x004000
Writing (0) - 0x005000
....
Writing (0) - 0x13b000
Writing (0) - 0x13c000
OK: [0] Length=0x13cc60
part 0:
	magic=0x50aa
	type=0x01
	subtype=0x02
	[pos.offset=0x00009000, pos.size=0x00004000]
	label='nvs             '
	flags=0000000000

part 1:
	magic=0x50aa
	type=0x01
	subtype=0000
	[pos.offset=0x0000d000, pos.size=0x00002000]
	label='otadata         '
	flags=0000000000

part 2:
	magic=0x50aa
	type=0x01
	subtype=0x01
	[pos.offset=0x0000f000, pos.size=0x00001000]
	label='phy_init        '
	flags=0000000000

part 3:
	magic=0x50aa
	type=0000
	subtype=0000
	[pos.offset=0x00010000, pos.size=0x00060000]
	label='firmware        '
	flags=0000000000

part 4:
	magic=0xebeb
	type=0xff
	subtype=0xff
	[pos.offset=0xffffffff, pos.size=0xffffffff]
	label=(label is broken,too many random char)
	flags=0x6eb2314a

flash_firmware: current flash addr 1ACC60,1A0000Erasing ... (1)
spi_flash_erase_range failed. eraseBlocks=157
Writing (1) - 00000000
Writing (1) - 0x001000
....

I used this function print_partitions(); to print the partition table after writing. Only the first firmware was successfully written to the partition. However, it is obvious that the written Part4 partition information is incorrect. I don't know why. I fork the base and the warehouse and submit the modified code. Can you check it

print_partition after writing one part is not make sense since the partition table will be update after all the part of fw written, can you mention the size of all binary file generated after compile? it should be checked and update the mk_release.sh file if the partition reserve is not enough

pebri86 avatar Aug 15 '22 16:08 pebri86

Yes, I found this problem later. The crash occurred because IDF prevented writing to the partition table address,need to modify menuconfig and set the write protection address in spiflash. I modified the firmware size every time after compiling. The size is the same as the firmware file size, but the partition misalignment will be promoted during writing. Except for the first one, I can successfully boot the launcher firmware after writing, but I can't start the simulator, The viewing error is that the set OTA boot API returned 0x1503. It looks like the simulator firmware was written incorrectly

FantasyGmm avatar Aug 16 '22 06:08 FantasyGmm

Yes, I found this problem later. The crash occurred because IDF prevented writing to the partition table address,need to modify menuconfig and set the write protection address in spiflash. I modified the firmware size every time after compiling. The size is the same as the firmware file size, but the partition misalignment will be promoted during writing. Except for the first one, I can successfully boot the launcher firmware after writing, but I can't start the simulator, The viewing error is that the set OTA boot API returned 0x1503. It looks like the simulator firmware was written incorrectly

if you modifiy the firmware size then you must make sure the size partition is 64Kb aligned, that's why it is error partition misalignment

pebri86 avatar Aug 16 '22 10:08 pebri86

Does it have to be 64K aligned? I think the official document only needs 4K alignment

FantasyGmm avatar Aug 16 '22 12:08 FantasyGmm

esp log

write_partition_table: startTableEntry=4, startFlashAddress=0x070000
part 0:
	magic=0x50aa
	type=0x01
	subtype=0x02
	[pos.offset=0x00009000, pos.size=0x00004000]
	label='nvs             '
	flags=0000000000

part 1:
	magic=0x50aa
	type=0x01
	subtype=0000
	[pos.offset=0x0000d000, pos.size=0x00002000]
	label='otadata         '
	flags=0000000000

part 2:
	magic=0x50aa
	type=0x01
	subtype=0x01
	[pos.offset=0x0000f000, pos.size=0x00001000]
	label='phy_init        '
	flags=0000000000

part 3:
	magic=0x50aa
	type=0000
	subtype=0000
	[pos.offset=0x00010000, pos.size=0x00060000]
	label='firmware        '
	flags=0000000000

part 4:
	magic=0x50aa
	type=0000
	subtype=0x10
	[pos.offset=0x00070000, pos.size=0x00142510]
	label='esplay-launcher '
	flags=0000000000

part 5:
	magic=0x50aa
	type=0000
	subtype=0x11
	[pos.offset=0x001b3000, pos.size=0x0007ea60]
	label='esplay-gnuboy   '
	flags=0000000000

part 6:
	magic=0x50aa
	type=0000
	subtype=0x12
	[pos.offset=0x00232000, pos.size=0x0007c800]
	label='esplay-nofrendo '
	flags=0000000000

part 7:
	magic=0x50aa
	type=0000
	subtype=0x13
	[pos.offset=0x002af000, pos.size=0x0012ff50]
	label='esplay-smsplusgx'
	flags=0000000000

Booting application.
I (47350) esp_image: segment 0: paddr=00070020 vaddr=3c0a0020 size=7f10ch (520460) map
I (47400) esp_image: segment 1: paddr=000ef134 vaddr=3fc9bf50 size=00ee4h (  3812) 
I (47400) esp_image: segment 2: paddr=000f0020 vaddr=42000020 size=9eabch (649916) map
I (47480) esp_image: segment 3: paddr=0018eae4 vaddr=3fc9ce34 size=03a74h ( 14964) 
I (47480) esp_image: segment 4: paddr=00192560 vaddr=40378000 size=13f44h ( 81732) 
I (47490) esp_image: segment 5: paddr=001a64ac vaddr=50000000 size=00010h (    16) 
I (47490) esp_image: segment 6: paddr=001a64c4 vaddr=600fe000 size=00028h (    40) 
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40379a68
0x40379a68: esp_restart_noos at /Users/fantasy/esp/esp-idf-esplay/components/esp_system/port/soc/esp32s3/system_internal.c:143 (discriminator 1)

SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x1654
load:0x403c9700,len:0xbb8
load:0x403cc700,len:0x2f88
entry 0x403c9954
I (29) boot: ESP-IDF v4.4.2-dirty 2nd stage bootloader
I (29) boot: compile time 23:52:48
I (29) boot: chip revision: 0
I (31) boot.esp32s3: Boot SPI Speed : 80MHz
I (36) boot.esp32s3: SPI Mode       : DIO
I (41) boot.esp32s3: SPI Flash Size : 8MB
I (45) boot: Enabling RNG early entropy source...
I (51) boot: Partition Table:
I (54) boot: ## Label            Usage          Type ST Offset   Length
I (62) boot:  0 nvs              WiFi data        01 02 00009000 00004000
I (69) boot:  1 otadata          OTA data         01 00 0000d000 00002000
I (77) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (84) boot:  3 firmware         factory app      00 00 00010000 00060000
I (92) boot:  4 esplay-launcher  OTA app          00 10 00070000 00142510
I (99) boot:  5 esplay-gnuboy    OTA app          00 11 001b3000 0007ea60
I (107) boot:  6 esplay-nofrendo  OTA app          00 12 00232000 0007c800
I (114) boot:  7 esplay-smsplusgx OTA app          00 13 002af000 0012ff50
I (122) boot: End of partition table
I (126) esp_image: segment 0: paddr=00070020 vaddr=3c0a0020 size=7f10ch (520460) map
I (228) esp_image: segment 1: paddr=000ef134 vaddr=3fc9bf50 size=00ee4h (  3812) load
I (229) esp_image: segment 2: paddr=000f0020 vaddr=42000020 size=9eabch (649916) map
I (350) esp_image: segment 3: paddr=0018eae4 vaddr=3fc9ce34 size=03a74h ( 14964) load
I (353) esp_image: segment 4: paddr=00192560 vaddr=40378000 size=13f44h ( 81732) load
I (374) esp_image: segment 5: paddr=001a64ac vaddr=50000000 size=00010h (    16) load
I (374) esp_image: segment 6: paddr=001a64c4 vaddr=600fe000 size=00028h (    40) load
I (388) boot: Loaded app from partition at offset 0x70000
I (388) boot: Disabling RNG early entropy source...
I (403) opi psram: vendor id : 0x0d (AP)
I (403) opi psram: dev id    : 0x02 (generation 3)
I (403) opi psram: density   : 0x03 (64 Mbit)
I (406) opi psram: good-die  : 0x01 (Pass)
I (411) opi psram: Latency   : 0x01 (Fixed)
I (416) opi psram: VCC       : 0x01 (3V)
I (421) opi psram: SRF       : 0x01 (Fast Refresh)
I (426) opi psram: BurstType : 0x01 (Hybrid Wrap)
I (431) opi psram: BurstLen  : 0x01 (32 Byte)
I (437) opi psram: Readlatency  : 0x02 (10 cycles@Fixed)
I (443) opi psram: DriveStrength: 0x00 (1/1)
W (447) PSRAM: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version.
I (458) spiram: Found 64MBit SPI RAM device
I (462) spiram: SPI RAM mode: sram 80m
I (467) spiram: PSRAM initialized, cache is in normal (1-core) mode.
I (474) cpu_start: Pro cpu up.
I (478) cpu_start: Starting app cpu, entry point is 0x40379650
0x40379650: call_start_cpu0 at /Users/fantasy/esp/esp-idf-esplay/components/esp_system/port/cpu_start.c:486

I (462) cpu_start: App cpu up.
I (779) spiram: SPI SRAM memory test OK
I (787) cpu_start: Pro cpu start user code
I (788) cpu_start: cpu freq: 240000000
I (788) cpu_start: Application information:
I (790) cpu_start: Project name:     esplay-launcher
I (796) cpu_start: App version:      v2.3-esplay-micro-16-gc028eb3
I (803) cpu_start: Compile time:     Aug 16 2022 20:08:46
I (809) cpu_start: ELF file SHA256:  a0f6e57757651e0f...
I (815) cpu_start: ESP-IDF:          v4.4.2-dirty
I (820) heap_init: Initializing. RAM available for dynamic allocation:
I (827) heap_init: At 3FCA4A00 len 0003B600 (237 KiB): D/IRAM
I (834) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (841) heap_init: At 600FE028 len 00001FD8 (7 KiB): RTCRAM
I (847) spiram: Adding pool of 8192K of external SPI memory to heap allocator
I (855) spi_flash: detected chip: generic
I (859) spi_flash: flash io: qio
I (864) sleep: Configure to isolate all GPIO pins in sleep state
I (870) sleep: Enable automatic switching of GPIO sleep configuration
I (877) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (898) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
audio_init: sample_rate=44100
W (908) I2S: APLL not supported on current chip, use I2S_CLK_D2CLK as default clock source
I (918) I2S: DMA Malloc info, datalen=blocksize=2136, dma_buf_count=8
I (918) I2S: I2S0, MCLK output by GPIO0
audio_volume_set: value (20)
I (928) gpio: GPIO[40]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (938) gpio: GPIO[41]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (948) gpio: GPIO[42]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
input_gamepad_init done.
ST7789V initialization.
Enable backlight.
Backlight initialization done.
ADC: Characterized using Default Vref
I (1818) gpio: GPIO[21]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1818) gpio: GPIO[14]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1828) gpio: GPIO[17]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 

AP Disabled, enabled wifi to use File Manager
ui_file_chooser: fileCount = 2
E (6938) esp_image: Segment 0 load address 0x3c040020, doesn't match data 0x001b3020
system_application_set: esp_ota_set_boot_partition failed.

mkfw log

mkfw: ./mkfw Retro-Emulation assets/tile.raw 0 16 1271056 esplay-launcher esplay-launcher/build/esplay-launcher.bin 0 17 485984 esplay-gnuboy esplay-gnuboy/build/esplay-gnuboy.bin 0 18 509952 esplay-nofrendo esplay-nofrendo/build/esplay-nofrendo.bin 0 19 1195856 esplay-smsplusgx esplay-smsplusgx/build/esplay-smsplusgx.bin 
start mkfw
%  HEADER='ESPLAY_FIRMWARE_V00_01'
%  FirmwareDescription='Retro-Emulation'
%  tile: wrote 8256 bytes.
%  [0] type=0, subtype=16, length=1271056, label=esplay-launcher
%  part=0, length=1271056, data=esplay-launcher/build/esplay-launcher.bin
%  [1] type=0, subtype=17, length=485984, label=esplay-gnuboy
%  part=1, length=485984, data=esplay-gnuboy/build/esplay-gnuboy.bin
%  [2] type=0, subtype=18, length=509952, label=esplay-nofrendo
%  part=2, length=509952, data=esplay-nofrendo/build/esplay-nofrendo.bin
%  [3] type=0, subtype=19, length=1195856, label=esplay-smsplusgx
%  part=3, length=1195856, data=esplay-smsplusgx/build/esplay-smsplusgx.bin
%  main: checksum=0x75f3f1c6

FantasyGmm avatar Aug 16 '22 12:08 FantasyGmm

Does it have to be 64K aligned? I think the official document only needs 4K alignment

no the 4k is offset of bootloader, the app partition must be 64KB alignment cause the mmu

pebri86 avatar Aug 16 '22 19:08 pebri86

esp log

write_partition_table: startTableEntry=4, startFlashAddress=0x070000
part 0:
	magic=0x50aa
	type=0x01
	subtype=0x02
	[pos.offset=0x00009000, pos.size=0x00004000]
	label='nvs             '
	flags=0000000000

part 1:
	magic=0x50aa
	type=0x01
	subtype=0000
	[pos.offset=0x0000d000, pos.size=0x00002000]
	label='otadata         '
	flags=0000000000

part 2:
	magic=0x50aa
	type=0x01
	subtype=0x01
	[pos.offset=0x0000f000, pos.size=0x00001000]
	label='phy_init        '
	flags=0000000000

part 3:
	magic=0x50aa
	type=0000
	subtype=0000
	[pos.offset=0x00010000, pos.size=0x00060000]
	label='firmware        '
	flags=0000000000

part 4:
	magic=0x50aa
	type=0000
	subtype=0x10
	[pos.offset=0x00070000, pos.size=0x00142510]
	label='esplay-launcher '
	flags=0000000000

part 5:
	magic=0x50aa
	type=0000
	subtype=0x11
	[pos.offset=0x001b3000, pos.size=0x0007ea60]
	label='esplay-gnuboy   '
	flags=0000000000

part 6:
	magic=0x50aa
	type=0000
	subtype=0x12
	[pos.offset=0x00232000, pos.size=0x0007c800]
	label='esplay-nofrendo '
	flags=0000000000

part 7:
	magic=0x50aa
	type=0000
	subtype=0x13
	[pos.offset=0x002af000, pos.size=0x0012ff50]
	label='esplay-smsplusgx'
	flags=0000000000

Booting application.
I (47350) esp_image: segment 0: paddr=00070020 vaddr=3c0a0020 size=7f10ch (520460) map
I (47400) esp_image: segment 1: paddr=000ef134 vaddr=3fc9bf50 size=00ee4h (  3812) 
I (47400) esp_image: segment 2: paddr=000f0020 vaddr=42000020 size=9eabch (649916) map
I (47480) esp_image: segment 3: paddr=0018eae4 vaddr=3fc9ce34 size=03a74h ( 14964) 
I (47480) esp_image: segment 4: paddr=00192560 vaddr=40378000 size=13f44h ( 81732) 
I (47490) esp_image: segment 5: paddr=001a64ac vaddr=50000000 size=00010h (    16) 
I (47490) esp_image: segment 6: paddr=001a64c4 vaddr=600fe000 size=00028h (    40) 
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40379a68
0x40379a68: esp_restart_noos at /Users/fantasy/esp/esp-idf-esplay/components/esp_system/port/soc/esp32s3/system_internal.c:143 (discriminator 1)

SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x1654
load:0x403c9700,len:0xbb8
load:0x403cc700,len:0x2f88
entry 0x403c9954
I (29) boot: ESP-IDF v4.4.2-dirty 2nd stage bootloader
I (29) boot: compile time 23:52:48
I (29) boot: chip revision: 0
I (31) boot.esp32s3: Boot SPI Speed : 80MHz
I (36) boot.esp32s3: SPI Mode       : DIO
I (41) boot.esp32s3: SPI Flash Size : 8MB
I (45) boot: Enabling RNG early entropy source...
I (51) boot: Partition Table:
I (54) boot: ## Label            Usage          Type ST Offset   Length
I (62) boot:  0 nvs              WiFi data        01 02 00009000 00004000
I (69) boot:  1 otadata          OTA data         01 00 0000d000 00002000
I (77) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (84) boot:  3 firmware         factory app      00 00 00010000 00060000
I (92) boot:  4 esplay-launcher  OTA app          00 10 00070000 00142510
I (99) boot:  5 esplay-gnuboy    OTA app          00 11 001b3000 0007ea60
I (107) boot:  6 esplay-nofrendo  OTA app          00 12 00232000 0007c800
I (114) boot:  7 esplay-smsplusgx OTA app          00 13 002af000 0012ff50
I (122) boot: End of partition table
I (126) esp_image: segment 0: paddr=00070020 vaddr=3c0a0020 size=7f10ch (520460) map
I (228) esp_image: segment 1: paddr=000ef134 vaddr=3fc9bf50 size=00ee4h (  3812) load
I (229) esp_image: segment 2: paddr=000f0020 vaddr=42000020 size=9eabch (649916) map
I (350) esp_image: segment 3: paddr=0018eae4 vaddr=3fc9ce34 size=03a74h ( 14964) load
I (353) esp_image: segment 4: paddr=00192560 vaddr=40378000 size=13f44h ( 81732) load
I (374) esp_image: segment 5: paddr=001a64ac vaddr=50000000 size=00010h (    16) load
I (374) esp_image: segment 6: paddr=001a64c4 vaddr=600fe000 size=00028h (    40) load
I (388) boot: Loaded app from partition at offset 0x70000
I (388) boot: Disabling RNG early entropy source...
I (403) opi psram: vendor id : 0x0d (AP)
I (403) opi psram: dev id    : 0x02 (generation 3)
I (403) opi psram: density   : 0x03 (64 Mbit)
I (406) opi psram: good-die  : 0x01 (Pass)
I (411) opi psram: Latency   : 0x01 (Fixed)
I (416) opi psram: VCC       : 0x01 (3V)
I (421) opi psram: SRF       : 0x01 (Fast Refresh)
I (426) opi psram: BurstType : 0x01 (Hybrid Wrap)
I (431) opi psram: BurstLen  : 0x01 (32 Byte)
I (437) opi psram: Readlatency  : 0x02 (10 cycles@Fixed)
I (443) opi psram: DriveStrength: 0x00 (1/1)
W (447) PSRAM: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version.
I (458) spiram: Found 64MBit SPI RAM device
I (462) spiram: SPI RAM mode: sram 80m
I (467) spiram: PSRAM initialized, cache is in normal (1-core) mode.
I (474) cpu_start: Pro cpu up.
I (478) cpu_start: Starting app cpu, entry point is 0x40379650
0x40379650: call_start_cpu0 at /Users/fantasy/esp/esp-idf-esplay/components/esp_system/port/cpu_start.c:486

I (462) cpu_start: App cpu up.
I (779) spiram: SPI SRAM memory test OK
I (787) cpu_start: Pro cpu start user code
I (788) cpu_start: cpu freq: 240000000
I (788) cpu_start: Application information:
I (790) cpu_start: Project name:     esplay-launcher
I (796) cpu_start: App version:      v2.3-esplay-micro-16-gc028eb3
I (803) cpu_start: Compile time:     Aug 16 2022 20:08:46
I (809) cpu_start: ELF file SHA256:  a0f6e57757651e0f...
I (815) cpu_start: ESP-IDF:          v4.4.2-dirty
I (820) heap_init: Initializing. RAM available for dynamic allocation:
I (827) heap_init: At 3FCA4A00 len 0003B600 (237 KiB): D/IRAM
I (834) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (841) heap_init: At 600FE028 len 00001FD8 (7 KiB): RTCRAM
I (847) spiram: Adding pool of 8192K of external SPI memory to heap allocator
I (855) spi_flash: detected chip: generic
I (859) spi_flash: flash io: qio
I (864) sleep: Configure to isolate all GPIO pins in sleep state
I (870) sleep: Enable automatic switching of GPIO sleep configuration
I (877) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (898) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
audio_init: sample_rate=44100
W (908) I2S: APLL not supported on current chip, use I2S_CLK_D2CLK as default clock source
I (918) I2S: DMA Malloc info, datalen=blocksize=2136, dma_buf_count=8
I (918) I2S: I2S0, MCLK output by GPIO0
audio_volume_set: value (20)
I (928) gpio: GPIO[40]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (938) gpio: GPIO[41]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (948) gpio: GPIO[42]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
input_gamepad_init done.
ST7789V initialization.
Enable backlight.
Backlight initialization done.
ADC: Characterized using Default Vref
I (1818) gpio: GPIO[21]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1818) gpio: GPIO[14]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1828) gpio: GPIO[17]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 

AP Disabled, enabled wifi to use File Manager
ui_file_chooser: fileCount = 2
E (6938) esp_image: Segment 0 load address 0x3c040020, doesn't match data 0x001b3020
system_application_set: esp_ota_set_boot_partition failed.

mkfw log

mkfw: ./mkfw Retro-Emulation assets/tile.raw 0 16 1271056 esplay-launcher esplay-launcher/build/esplay-launcher.bin 0 17 485984 esplay-gnuboy esplay-gnuboy/build/esplay-gnuboy.bin 0 18 509952 esplay-nofrendo esplay-nofrendo/build/esplay-nofrendo.bin 0 19 1195856 esplay-smsplusgx esplay-smsplusgx/build/esplay-smsplusgx.bin 
start mkfw
%  HEADER='ESPLAY_FIRMWARE_V00_01'
%  FirmwareDescription='Retro-Emulation'
%  tile: wrote 8256 bytes.
%  [0] type=0, subtype=16, length=1271056, label=esplay-launcher
%  part=0, length=1271056, data=esplay-launcher/build/esplay-launcher.bin
%  [1] type=0, subtype=17, length=485984, label=esplay-gnuboy
%  part=1, length=485984, data=esplay-gnuboy/build/esplay-gnuboy.bin
%  [2] type=0, subtype=18, length=509952, label=esplay-nofrendo
%  part=2, length=509952, data=esplay-nofrendo/build/esplay-nofrendo.bin
%  [3] type=0, subtype=19, length=1195856, label=esplay-smsplusgx
%  part=3, length=1195856, data=esplay-smsplusgx/build/esplay-smsplusgx.bin
%  main: checksum=0x75f3f1c6

seems it was successfully running, but the partition size of gnuboy seems not 64KB aligned, try with value 524288

pebri86 avatar Aug 16 '22 19:08 pebri86

I think it may be that the order of esplay gnuboy and esplay nofrendo is reversed. I swapped two partitions. Gnuboy cannot display anything, but OSD menu can be displayed. However, nes simulator still crashes esplay nofrendo log

I (0) cpu_start: App cpu up.
I (633) spiram: SPI SRAM memory test OK
I (641) cpu_start: Pro cpu start user code
I (641) cpu_start: cpu freq: 240000000
I (641) cpu_start: Application information:
I (644) cpu_start: Project name:     esplay-nofrendo
I (650) cpu_start: App version:      v2.3-esplay-micro-14-g0e64cb0-d
I (657) cpu_start: Compile time:     Aug 17 2022 16:17:27
I (663) cpu_start: ELF file SHA256:  9c44a50e0b31971a...
I (669) cpu_start: ESP-IDF:          v4.4.2-dirty
I (674) heap_init: Initializing. RAM available for dynamic allocation:
I (681) heap_init: At 3FCBE490 len 00021B70 (134 KiB): D/IRAM
I (688) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (694) heap_init: At 600FE028 len 00001FD8 (7 KiB): RTCRAM
I (701) spiram: Adding pool of 8192K of external SPI memory to heap allocator
I (709) spi_flash: detected chip: generic
I (713) spi_flash: flash io: qio
I (718) sleep: Configure to isolate all GPIO pins in sleep state
I (724) sleep: Enable automatic switching of GPIO sleep configuration
I (731) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (751) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
audio_init: sample_rate=32000
W (761) I2S: APLL not supported on current chip, use I2S_CLK_D2CLK as default clock source
I (771) I2S: DMA Malloc info, datalen=blocksize=2136, dma_buf_count=8
I (771) I2S: I2S0, MCLK output by GPIO0
audio_volume_set: value (20)
A HEAP:0x822827
I (781) gpio: GPIO[40]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (791) gpio: GPIO[41]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (801) gpio: GPIO[42]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
input_gamepad_init done.
ST7789V initialization.
Enable backlight.
Backlight initialization done.
ADC: Characterized using Default Vref
app_main: Unexpected deep sleep reset
osd_getromdata: Reading from sdcard.
I (1671) gpio: GPIO[21]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1681) gpio: GPIO[14]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1691) gpio: GPIO[17]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
app_main: fileSize=49168
NoFrendo start!
audio_volume_set: value (20)
vid_init done
bmp_create: width=256, height=240, overdraw=8
Initialized. ROM@0x3f800000
rom_load: rominfo->filename='rom'
Head: 0x3f800000 (0 0 0 0)
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x40379bed  PS      : 0x00060230  A0      : 0x803852dc  A1      : 0x3fcc2500  
0x40379bed: heap_caps_free at /Users/fantasy/esp/esp-idf-esplay/components/heap/heap_caps.c:340

A2      : 0x3fcae21c  A3      : 0x3c051e1d  A4      : 0x3fcc2520  A5      : 0x3fcc2500  
A6      : 0x00000008  A7      : 0x00000008  A8      : 0x80379bed  A9      : 0x3fcc24e0  
A10     : 0x00000000  A11     : 0x3fce453c  A12     : 0x3c051e1d  A13     : 0x3fcc2520  
A14     : 0x3fcc2500  A15     : 0x00000008  SAR     : 0x00000016  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x0000001c  LBEG    : 0x400556d5  LEND    : 0x400556e5  LCOUNT  : 0xffffffff  


Backtrace:0x40379bea:0x3fcc25000x403852d9:0x3fcc2520 0x42006cae:0x3fcc2540 0x42007b6a:0x3fcc2560 0x42007dea:0x3fcc2580 0x4200745b:0x3fcc25b0 0x42016492:0x3fcc25f0 0x420073b7:0x3fcc2610 0x42006535:0x3fcc2630 0x42042874:0x3fcc2660 
0x40379bea: heap_caps_free at /Users/fantasy/esp/esp-idf-esplay/components/heap/heap_caps.c:338

0x403852d9: free at /Users/fantasy/esp/esp-idf-esplay/components/newlib/heap.c:39

0x42006cae: bmp_destroy at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/components/nofrendo/bitmap.c:115

0x42007b6a: nes_destroy at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/components/nofrendo/nes/nes.c:472

0x42007dea: nes_insertcart at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/components/nofrendo/nes/nes.c:534

0x4200745b: internal_insert at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/components/nofrendo/nofrendo.c:176
 (inlined by) main_loop at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/components/nofrendo/nofrendo.c:254

0x42016492: osd_main at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/components/nofrendo-esp32/osd.c:38

0x420073b7: nofrendo_main at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/components/nofrendo/nofrendo.c:224

0x42006535: app_main at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/main/main.c:169

0x42042874: main_task at /Users/fantasy/esp/esp-idf-esplay/components/freertos/port/port_common.c:141 (discriminator 1)
ELF file SHA256: 9c44a50e0b31971a
Rebooting...

esplay gnuboy

SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x1654
load:0x403c9700,len:0xbb8
load:0x403cc700,len:0x2f88
entry 0x403c9954
I (29) boot: ESP-IDF v4.4.2-dirty 2nd stage bootloader
I (29) boot: compile time 23:52:48
I (29) boot: chip revision: 0
I (31) boot.esp32s3: Boot SPI Speed : 80MHz
I (36) boot.esp32s3: SPI Mode       : DIO
I (41) boot.esp32s3: SPI Flash Size : 8MB
I (45) boot: Enabling RNG early entropy source...
I (51) boot: Partition Table:
I (54) boot: ## Label            Usage          Type ST Offset   Length
I (62) boot:  0 nvs              WiFi data        01 02 00009000 00004000
I (69) boot:  1 otadata          OTA data         01 00 0000d000 00002000
I (77) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (84) boot:  3 firmware         factory app      00 00 00010000 00060000
I (92) boot:  4 esplay-launcher  OTA app          00 10 00070000 00130000
I (99) boot:  5 esplay-nofrendo  OTA app          00 11 001a0000 00080000
I (107) boot:  6 esplay-gnuboy    OTA app          00 12 00220000 00070000
I (114) boot:  7 esplay-smsplusgx OTA app          00 13 00290000 00130000
I (122) boot: End of partition table
I (126) esp_image: segment 0: paddr=00220020 vaddr=3c040020 size=22078h (139384) map
I (159) esp_image: segment 1: paddr=002420a0 vaddr=3fc9f1a0 size=029fch ( 10748) load
I (162) esp_image: segment 2: paddr=00244aa4 vaddr=40378000 size=0b574h ( 46452) load
I (175) esp_image: segment 3: paddr=00250020 vaddr=42000020 size=325cch (206284) map
I (213) esp_image: segment 4: paddr=002825f4 vaddr=40383574 size=0bc2ch ( 48172) load
I (224) esp_image: segment 5: paddr=0028e228 vaddr=50000000 size=00010h (    16) load
I (224) esp_image: segment 6: paddr=0028e240 vaddr=600fe000 size=00028h (    40) load
I (238) boot: Loaded app from partition at offset 0x220000
I (238) boot: Disabling RNG early entropy source...
I (253) opi psram: vendor id : 0x0d (AP)
I (253) opi psram: dev id    : 0x02 (generation 3)
I (253) opi psram: density   : 0x03 (64 Mbit)
I (257) opi psram: good-die  : 0x01 (Pass)
I (261) opi psram: Latency   : 0x01 (Fixed)
I (266) opi psram: VCC       : 0x01 (3V)
I (271) opi psram: SRF       : 0x01 (Fast Refresh)
I (276) opi psram: BurstType : 0x01 (Hybrid Wrap)
I (282) opi psram: BurstLen  : 0x01 (32 Byte)
I (287) opi psram: Readlatency  : 0x02 (10 cycles@Fixed)
I (293) opi psram: DriveStrength: 0x00 (1/1)
W (298) PSRAM: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version.
I (308) spiram: Found 64MBit SPI RAM device
I (313) spiram: SPI RAM mode: sram 80m
I (317) spiram: PSRAM initialized, cache is in normal (1-core) mode.
I (324) cpu_start: Pro cpu up.
I (328) cpu_start: Starting app cpu, entry point is 0x403791e0
I (313) cpu_start: App cpu up.
I (629) spiram: SPI SRAM memory test OK
I (638) cpu_start: Pro cpu start user code
I (638) cpu_start: cpu freq: 240000000
I (638) cpu_start: Application information:
I (640) cpu_start: Project name:     esplay-gnuboy
I (646) cpu_start: App version:      v2.3-esplay-micro-14-g0e64cb0-d
I (653) cpu_start: Compile time:     Aug 17 2022 15:26:25
I (659) cpu_start: ELF file SHA256:  05e343745b5d0118...
I (665) cpu_start: ESP-IDF:          v4.4.2-dirty
I (670) heap_init: Initializing. RAM available for dynamic allocation:
I (678) heap_init: At 3FCB0008 len 0002FFF8 (191 KiB): D/IRAM
I (684) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (691) heap_init: At 600FE028 len 00001FD8 (7 KiB): RTCRAM
I (697) spiram: Adding pool of 8192K of external SPI memory to heap allocator
I (705) spi_flash: detected chip: generic
I (710) spi_flash: flash io: qio
I (714) sleep: Configure to isolate all GPIO pins in sleep state
I (720) sleep: Enable automatic switching of GPIO sleep configuration
I (728) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (748) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
audio_init: sample_rate=32000
W (758) I2S: APLL not supported on current chip, use I2S_CLK_D2CLK as default clock source
I (768) I2S: DMA Malloc info, datalen=blocksize=2136, dma_buf_count=8
I (768) I2S: I2S0, MCLK output by GPIO0
audio_volume_set: value (20)
ST7789V initialization.
Enable backlight.
Backlight initialization done.
audio_volume_set: value (20)
ADC: Characterized using Default Vref
I (1638) gpio: GPIO[40]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (1648) gpio: GPIO[41]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (1658) gpio: GPIO[42]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
input_gamepad_init done.
app_main: Non deep sleep startup
loader: Reading from sdcard.
I (1738) gpio: GPIO[21]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1738) gpio: GPIO[14]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1748) gpio: GPIO[17]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
Initialized. ROM@0x3f800000
loader: rom.name=''
loader: mbc.type=MBC_NONE, mbc.romsize=2 (32K), mbc.ramsize=1 (8K)
app_main: displayBuffer[0]=0x3fcbd398, [1]=0x3fcc879c
sdcard_create_savefile_path: savefile_path='/sd/esplay/data/gb/test.gb.sav'
LoadState: fopen /sd/esplay/data/gb/test.gb.sav load failed
HEAP:0x8095ab, FPS:68.144005
HEAP:0x8094cb, FPS:59.016319
HEAP:0x8094cb, FPS:58.987000
HEAP:0x8094cb, FPS:59.341526
HEAP:0x8094cb, FPS:59.998055
HEAP:0x8094cb, FPS:59.002842
HEAP:0x8094cb, FPS:58.959499
HEAP:0x8094cb, FPS:59.878738
HEAP:0x8094cb, FPS:59.014355
HEAP:0x8094cb, FPS:59.002895
HEAP:0x8094cb, FPS:59.940201
HEAP:0x8094cb, FPS:58.904919
HEAP:0x8094cb, FPS:59.015503
HEAP:0x8094cb, FPS:62.755291
HEAP:0x8094cb, FPS:61.832798
HEAP:0x8094cb, FPS:58.974964
sdcard_create_savefile_path: savefile_path='/sd/esplay/data/gb/test.gb.sav'
savesate: wrote sram addr=0x3fce23d8, size=0x1000, count=1
savesate: wrote sram addr=0x3fce33d8, size=0x1000, count=1
SaveState: savestate OK.

FantasyGmm avatar Aug 17 '22 08:08 FantasyGmm

I think it may be that the order of esplay gnuboy and esplay nofrendo is reversed. I swapped two partitions. Gnuboy cannot display anything, but OSD menu can be displayed. However, nes simulator still crashes esplay nofrendo log

I (0) cpu_start: App cpu up.
I (633) spiram: SPI SRAM memory test OK
I (641) cpu_start: Pro cpu start user code
I (641) cpu_start: cpu freq: 240000000
I (641) cpu_start: Application information:
I (644) cpu_start: Project name:     esplay-nofrendo
I (650) cpu_start: App version:      v2.3-esplay-micro-14-g0e64cb0-d
I (657) cpu_start: Compile time:     Aug 17 2022 16:17:27
I (663) cpu_start: ELF file SHA256:  9c44a50e0b31971a...
I (669) cpu_start: ESP-IDF:          v4.4.2-dirty
I (674) heap_init: Initializing. RAM available for dynamic allocation:
I (681) heap_init: At 3FCBE490 len 00021B70 (134 KiB): D/IRAM
I (688) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (694) heap_init: At 600FE028 len 00001FD8 (7 KiB): RTCRAM
I (701) spiram: Adding pool of 8192K of external SPI memory to heap allocator
I (709) spi_flash: detected chip: generic
I (713) spi_flash: flash io: qio
I (718) sleep: Configure to isolate all GPIO pins in sleep state
I (724) sleep: Enable automatic switching of GPIO sleep configuration
I (731) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (751) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
audio_init: sample_rate=32000
W (761) I2S: APLL not supported on current chip, use I2S_CLK_D2CLK as default clock source
I (771) I2S: DMA Malloc info, datalen=blocksize=2136, dma_buf_count=8
I (771) I2S: I2S0, MCLK output by GPIO0
audio_volume_set: value (20)
A HEAP:0x822827
I (781) gpio: GPIO[40]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (791) gpio: GPIO[41]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (801) gpio: GPIO[42]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
input_gamepad_init done.
ST7789V initialization.
Enable backlight.
Backlight initialization done.
ADC: Characterized using Default Vref
app_main: Unexpected deep sleep reset
osd_getromdata: Reading from sdcard.
I (1671) gpio: GPIO[21]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1681) gpio: GPIO[14]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1691) gpio: GPIO[17]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
app_main: fileSize=49168
NoFrendo start!
audio_volume_set: value (20)
vid_init done
bmp_create: width=256, height=240, overdraw=8
Initialized. ROM@0x3f800000
rom_load: rominfo->filename='rom'
Head: 0x3f800000 (0 0 0 0)
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x40379bed  PS      : 0x00060230  A0      : 0x803852dc  A1      : 0x3fcc2500  
0x40379bed: heap_caps_free at /Users/fantasy/esp/esp-idf-esplay/components/heap/heap_caps.c:340

A2      : 0x3fcae21c  A3      : 0x3c051e1d  A4      : 0x3fcc2520  A5      : 0x3fcc2500  
A6      : 0x00000008  A7      : 0x00000008  A8      : 0x80379bed  A9      : 0x3fcc24e0  
A10     : 0x00000000  A11     : 0x3fce453c  A12     : 0x3c051e1d  A13     : 0x3fcc2520  
A14     : 0x3fcc2500  A15     : 0x00000008  SAR     : 0x00000016  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x0000001c  LBEG    : 0x400556d5  LEND    : 0x400556e5  LCOUNT  : 0xffffffff  


Backtrace:0x40379bea:0x3fcc25000x403852d9:0x3fcc2520 0x42006cae:0x3fcc2540 0x42007b6a:0x3fcc2560 0x42007dea:0x3fcc2580 0x4200745b:0x3fcc25b0 0x42016492:0x3fcc25f0 0x420073b7:0x3fcc2610 0x42006535:0x3fcc2630 0x42042874:0x3fcc2660 
0x40379bea: heap_caps_free at /Users/fantasy/esp/esp-idf-esplay/components/heap/heap_caps.c:338

0x403852d9: free at /Users/fantasy/esp/esp-idf-esplay/components/newlib/heap.c:39

0x42006cae: bmp_destroy at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/components/nofrendo/bitmap.c:115

0x42007b6a: nes_destroy at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/components/nofrendo/nes/nes.c:472

0x42007dea: nes_insertcart at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/components/nofrendo/nes/nes.c:534

0x4200745b: internal_insert at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/components/nofrendo/nofrendo.c:176
 (inlined by) main_loop at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/components/nofrendo/nofrendo.c:254

0x42016492: osd_main at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/components/nofrendo-esp32/osd.c:38

0x420073b7: nofrendo_main at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/components/nofrendo/nofrendo.c:224

0x42006535: app_main at /Users/fantasy/clionProject/esplay-retro-emulation/esplay-nofrendo/main/main.c:169

0x42042874: main_task at /Users/fantasy/esp/esp-idf-esplay/components/freertos/port/port_common.c:141 (discriminator 1)
ELF file SHA256: 9c44a50e0b31971a
Rebooting...

esplay gnuboy

SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x1654
load:0x403c9700,len:0xbb8
load:0x403cc700,len:0x2f88
entry 0x403c9954
I (29) boot: ESP-IDF v4.4.2-dirty 2nd stage bootloader
I (29) boot: compile time 23:52:48
I (29) boot: chip revision: 0
I (31) boot.esp32s3: Boot SPI Speed : 80MHz
I (36) boot.esp32s3: SPI Mode       : DIO
I (41) boot.esp32s3: SPI Flash Size : 8MB
I (45) boot: Enabling RNG early entropy source...
I (51) boot: Partition Table:
I (54) boot: ## Label            Usage          Type ST Offset   Length
I (62) boot:  0 nvs              WiFi data        01 02 00009000 00004000
I (69) boot:  1 otadata          OTA data         01 00 0000d000 00002000
I (77) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (84) boot:  3 firmware         factory app      00 00 00010000 00060000
I (92) boot:  4 esplay-launcher  OTA app          00 10 00070000 00130000
I (99) boot:  5 esplay-nofrendo  OTA app          00 11 001a0000 00080000
I (107) boot:  6 esplay-gnuboy    OTA app          00 12 00220000 00070000
I (114) boot:  7 esplay-smsplusgx OTA app          00 13 00290000 00130000
I (122) boot: End of partition table
I (126) esp_image: segment 0: paddr=00220020 vaddr=3c040020 size=22078h (139384) map
I (159) esp_image: segment 1: paddr=002420a0 vaddr=3fc9f1a0 size=029fch ( 10748) load
I (162) esp_image: segment 2: paddr=00244aa4 vaddr=40378000 size=0b574h ( 46452) load
I (175) esp_image: segment 3: paddr=00250020 vaddr=42000020 size=325cch (206284) map
I (213) esp_image: segment 4: paddr=002825f4 vaddr=40383574 size=0bc2ch ( 48172) load
I (224) esp_image: segment 5: paddr=0028e228 vaddr=50000000 size=00010h (    16) load
I (224) esp_image: segment 6: paddr=0028e240 vaddr=600fe000 size=00028h (    40) load
I (238) boot: Loaded app from partition at offset 0x220000
I (238) boot: Disabling RNG early entropy source...
I (253) opi psram: vendor id : 0x0d (AP)
I (253) opi psram: dev id    : 0x02 (generation 3)
I (253) opi psram: density   : 0x03 (64 Mbit)
I (257) opi psram: good-die  : 0x01 (Pass)
I (261) opi psram: Latency   : 0x01 (Fixed)
I (266) opi psram: VCC       : 0x01 (3V)
I (271) opi psram: SRF       : 0x01 (Fast Refresh)
I (276) opi psram: BurstType : 0x01 (Hybrid Wrap)
I (282) opi psram: BurstLen  : 0x01 (32 Byte)
I (287) opi psram: Readlatency  : 0x02 (10 cycles@Fixed)
I (293) opi psram: DriveStrength: 0x00 (1/1)
W (298) PSRAM: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version.
I (308) spiram: Found 64MBit SPI RAM device
I (313) spiram: SPI RAM mode: sram 80m
I (317) spiram: PSRAM initialized, cache is in normal (1-core) mode.
I (324) cpu_start: Pro cpu up.
I (328) cpu_start: Starting app cpu, entry point is 0x403791e0
I (313) cpu_start: App cpu up.
I (629) spiram: SPI SRAM memory test OK
I (638) cpu_start: Pro cpu start user code
I (638) cpu_start: cpu freq: 240000000
I (638) cpu_start: Application information:
I (640) cpu_start: Project name:     esplay-gnuboy
I (646) cpu_start: App version:      v2.3-esplay-micro-14-g0e64cb0-d
I (653) cpu_start: Compile time:     Aug 17 2022 15:26:25
I (659) cpu_start: ELF file SHA256:  05e343745b5d0118...
I (665) cpu_start: ESP-IDF:          v4.4.2-dirty
I (670) heap_init: Initializing. RAM available for dynamic allocation:
I (678) heap_init: At 3FCB0008 len 0002FFF8 (191 KiB): D/IRAM
I (684) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (691) heap_init: At 600FE028 len 00001FD8 (7 KiB): RTCRAM
I (697) spiram: Adding pool of 8192K of external SPI memory to heap allocator
I (705) spi_flash: detected chip: generic
I (710) spi_flash: flash io: qio
I (714) sleep: Configure to isolate all GPIO pins in sleep state
I (720) sleep: Enable automatic switching of GPIO sleep configuration
I (728) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (748) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
audio_init: sample_rate=32000
W (758) I2S: APLL not supported on current chip, use I2S_CLK_D2CLK as default clock source
I (768) I2S: DMA Malloc info, datalen=blocksize=2136, dma_buf_count=8
I (768) I2S: I2S0, MCLK output by GPIO0
audio_volume_set: value (20)
ST7789V initialization.
Enable backlight.
Backlight initialization done.
audio_volume_set: value (20)
ADC: Characterized using Default Vref
I (1638) gpio: GPIO[40]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (1648) gpio: GPIO[41]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (1658) gpio: GPIO[42]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
input_gamepad_init done.
app_main: Non deep sleep startup
loader: Reading from sdcard.
I (1738) gpio: GPIO[21]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1738) gpio: GPIO[14]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1748) gpio: GPIO[17]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
Initialized. ROM@0x3f800000
loader: rom.name=''
loader: mbc.type=MBC_NONE, mbc.romsize=2 (32K), mbc.ramsize=1 (8K)
app_main: displayBuffer[0]=0x3fcbd398, [1]=0x3fcc879c
sdcard_create_savefile_path: savefile_path='/sd/esplay/data/gb/test.gb.sav'
LoadState: fopen /sd/esplay/data/gb/test.gb.sav load failed
HEAP:0x8095ab, FPS:68.144005
HEAP:0x8094cb, FPS:59.016319
HEAP:0x8094cb, FPS:58.987000
HEAP:0x8094cb, FPS:59.341526
HEAP:0x8094cb, FPS:59.998055
HEAP:0x8094cb, FPS:59.002842
HEAP:0x8094cb, FPS:58.959499
HEAP:0x8094cb, FPS:59.878738
HEAP:0x8094cb, FPS:59.014355
HEAP:0x8094cb, FPS:59.002895
HEAP:0x8094cb, FPS:59.940201
HEAP:0x8094cb, FPS:58.904919
HEAP:0x8094cb, FPS:59.015503
HEAP:0x8094cb, FPS:62.755291
HEAP:0x8094cb, FPS:61.832798
HEAP:0x8094cb, FPS:58.974964
sdcard_create_savefile_path: savefile_path='/sd/esplay/data/gb/test.gb.sav'
savesate: wrote sram addr=0x3fce23d8, size=0x1000, count=1
savesate: wrote sram addr=0x3fce33d8, size=0x1000, count=1
SaveState: savestate OK.

nofrendo crash while loading a rom, did you try another one?

pebri86 avatar Aug 17 '22 15:08 pebri86

I have two NES ROMs and one GB Rom. I tried two NES ROMs, both of which crashed, but they can be used normally on esp32. So is the GB ROM

FantasyGmm avatar Aug 18 '22 05:08 FantasyGmm

I found that the crash may be caused by the change of the ROM data address. The memory mapping addresses of esp32 and esp32s3 are different. When I change the address to 0x3d000000 or 0x3c000000, it crashes without any trace I want to ask how to set this address,Esp32s3 is a continuous block of memory, rather than two separate blocks of memory like esp32 esp32 pdf:https://www.espressif.com.cn/sites/default/files/documentation/esp32_datasheet_en.pdf esp32s3 pdf:https://www.espressif.com.cn/sites/default/files/documentation/esp32-s3_datasheet_en.pdf

SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x1654
load:0x403c9700,len:0xbb8
load:0x403cc700,len:0x2f88
entry 0x403c9954
I (29) boot: ESP-IDF v4.4.2-dirty 2nd stage bootloader
I (29) boot: compile time 17:41:42
I (29) boot: chip revision: 0
I (31) boot.esp32s3: Boot SPI Speed : 80MHz
I (36) boot.esp32s3: SPI Mode       : DIO
I (41) boot.esp32s3: SPI Flash Size : 8MB
W (45) boot.esp32s3: PRO CPU has been reset by WDT.
W (51) boot.esp32s3: APP CPU has been reset by WDT.
I (57) boot: Enabling RNG early entropy source...
I (62) boot: Partition Table:
I (66) boot: ## Label            Usage          Type ST Offset   Length
I (73) boot:  0 nvs              WiFi data        01 02 00009000 00004000
I (80) boot:  1 otadata          OTA data         01 00 0000d000 00002000
I (88) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (95) boot:  3 firmware         factory app      00 00 00010000 00060000
I (103) boot:  4 esplay-launcher  OTA app          00 10 00070000 00130000
I (110) boot:  5 esplay-nofrendo  OTA app          00 11 001a0000 00080000
I (118) boot:  6 esplay-gnuboy    OTA app          00 12 00220000 00070000
I (125) boot:  7 esplay-smsplusgx OTA app          00 13 00290000 00130000
I (133) boot: End of partition table
I (137) esp_image: segment 0: paddr=001a0020 vaddr=3c050020 size=1f034h (127028) map
I (169) esp_image: segment 1: paddr=001bf05c vaddr=3fc97100 size=00fbch (  4028) load
I (170) esp_image: segment 2: paddr=001c0020 vaddr=42000020 size=42a30h (272944) map
I (223) esp_image: segment 3: paddr=00202a58 vaddr=3fc980bc size=02358h (  9048) load
I (225) esp_image: segment 4: paddr=00204db8 vaddr=40378000 size=0f100h ( 61696) load
I (243) esp_image: segment 5: paddr=00213ec0 vaddr=50000000 size=00010h (    16) load
I (243) esp_image: segment 6: paddr=00213ed8 vaddr=600fe000 size=00028h (    40) load
I (254) boot: Loaded app from partition at offset 0x1a0000
I (255) boot: Disabling RNG early entropy source...
I (272) opi psram: vendor id : 0x0d (AP)
I (272) opi psram: dev id    : 0x02 (generation 3)
I (272) opi psram: density   : 0x03 (64 Mbit)
I (276) opi psram: good-die  : 0x01 (Pass)
I (281) opi psram: Latency   : 0x01 (Fixed)
I (285) opi psram: VCC       : 0x01 (3V)
I (290) opi psram: SRF       : 0x01 (Fast Refresh)
I (295) opi psram: BurstType : 0x01 (Hybrid Wrap)
I (301) opi psram: BurstLen  : 0x01 (32 Byte)
I (306) opi psram: Readlatency  : 0x02 (10 cycles@Fixed)
I (312) opi psram: DriveStrength: 0x00 (1/1)
W (317) PSRAM: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version.
I (328) spiram: Found 64MBit SPI RAM device
I (332) spiram: SPI RAM mode: sram 80m
I (336) spiram: PSRAM initialized, cache is in normal (1-core) mode.
I (343) cpu_start: Pro cpu up.
I (347) cpu_start: Starting app cpu, entry point is 0x403790a4
0x403790a4: call_start_cpu1 at /Users/fantasy/esp/esp-idf-esplay/components/esp_system/port/cpu_start.c:160

I (0) cpu_start: App cpu up.
I (649) spiram: SPI SRAM memory test OK
I (657) cpu_start: Pro cpu start user code
I (657) cpu_start: cpu freq: 240000000
I (657) cpu_start: Application information:
I (660) cpu_start: Project name:     esplay-nofrendo
I (665) cpu_start: App version:      v2.3-esplay-micro-14-g0e64cb0-d
I (672) cpu_start: Compile time:     Aug 17 2022 16:17:27
I (678) cpu_start: ELF file SHA256:  dcc5ff2f8dbd3b26...
I (684) cpu_start: ESP-IDF:          v4.4.2-dirty
I (690) heap_init: Initializing. RAM available for dynamic allocation:
I (697) heap_init: At 3FCBE490 len 00021B70 (134 KiB): D/IRAM
I (703) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (710) heap_init: At 600FE028 len 00001FD8 (7 KiB): RTCRAM
I (716) spiram: Adding pool of 8192K of external SPI memory to heap allocator
I (725) spi_flash: detected chip: generic
I (729) spi_flash: flash io: qio
I (733) sleep: Configure to isolate all GPIO pins in sleep state
I (740) sleep: Enable automatic switching of GPIO sleep configuration
I (747) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (767) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
audio_init: sample_rate=32000
W (777) I2S: APLL not supported on current chip, use I2S_CLK_D2CLK as default clock source
I (787) I2S: DMA Malloc info, datalen=blocksize=2136, dma_buf_count=8
I (787) I2S: I2S0, MCLK output by GPIO0
audio_volume_set: value (20)
A HEAP:0x822823
I (797) gpio: GPIO[40]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (807) gpio: GPIO[41]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
I (817) gpio: GPIO[42]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
input_gamepad_init done.
ST7789V initialization.
Enable backlight.
Backlight initialization done.
ADC: Characterized using Default Vref
app_main: Unexpected deep sleep reset
osd_getromdata: Reading from sdcard.
I (1687) gpio: GPIO[21]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1697) gpio: GPIO[14]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1707) gpio: GPIO[17]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x8 (TG1WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x42002c4b
0x42002c4b: panic_handler at /Users/fantasy/esp/esp-idf-esplay/components/esp_system/port/panic_handler.c:148 (discriminator 3)

SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x1654
load:0x403c9700,len:0xbb8
load:0x403cc700,len:0x2f88
entry 0x403c9954
I (29) boot: ESP-IDF v4.4.2-dirty 2nd stage bootloader

FantasyGmm avatar Aug 19 '22 10:08 FantasyGmm

which address did you change? mapping address for ext. psram? esp32 ext. ram at 0x3f800000 while esp32-s3 at 0x3d000000, you need to configure them at all of the emulator. follow here https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/external-ram.html

pebri86 avatar Aug 20 '22 01:08 pebri86

gnuboy loader.c

int rom_load()
{
	byte c, *data, *header;
	int rlen;

//	data = (void*)0x3f800000;//esp32
	data = (void*)0x3D000000;//esp32s3

nofrendo main.c

//static char* ROM_DATA = (char*)0x3f800000;//esp32
static char* ROM_DATA = (char*)0x3D000000;//esp32s3

I only changed the address of these two places, but neither of them can be started to enter the game, they will crash and restart and cannot enter the game

FantasyGmm avatar Aug 20 '22 04:08 FantasyGmm