PocketSprite / 8bkc-gnuboy

Gnuboy port to the PocketSprite
69 stars 17 forks source link

run gnuboy error #1

Closed sunkechenjing closed 6 years ago

sunkechenjing commented 6 years ago

I had compiled and flashed gnuboy,but it always reboot.I only luanode and spi lcd(st7735r).The following is the debug information. I had't used spi flash,how to close it.Please help to analyse reason.Thanks!

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0028,len:4 load:0x3fff002c,len:6824 load:0x40078000,len:0 ho 12 tail 0 room 4 load:0x40078000,len:15704 entry 0x400793c0 I (30) boot: ESP-IDF v3.1-dev-541-g7e2028d5-dirty 2nd stage bootloader I (30) boot: compile time 22:27:42 I (32) boot: Enabling RNG early entropy source... I (37) boot: SPI Speed : 40MHz I (41) boot: SPI Mode : DIO I (45) boot: SPI Flash Size : 4MB I (49) boot: Partition Table: I (53) boot: ## Label Usage Type ST Offset Length I (60) boot: 0 appfs AppFs 43 03 00010000 00070000 I (68) boot: 1 nvs WiFi data 01 02 00080000 00010000 I (75) boot: 2 chooser factory app 00 00 00090000 00360000 I (83) boot: 3 coredump Unknown data 01 03 003f0000 00010000 I (90) boot: End of partition table I (94) boot: AppFs found I (97) appfs: Meta page 0: invalid (serial 0) I (102) appfs: Meta page 1: invalid (serial 0) I (108) appfs: No valid page found. E (112) appfs: No valid meta info found. Bailing out. E (117) boot: AppFs initialization failed I (122) boot: Disabling RNG early entropy source... I (128) boot: Loading app partition at offset 00090000 I (134) esp_image: segment 0: paddr=0x00090020 vaddr=0x3f400020 size=0x2ab6c (174956) map I (203) esp_image: segment 1: paddr=0x000bab94 vaddr=0x3ffb0000 size=0x02218 ( 8728) load I (207) esp_image: segment 2: paddr=0x000bcdb4 vaddr=0x40080000 size=0x00400 ( 1024) load I (210) esp_image: segment 3: paddr=0x000bd1bc vaddr=0x40080400 size=0x02e54 ( 11860) load I (224) esp_image: segment 4: paddr=0x000c0018 vaddr=0x400d0018 size=0x229c4 (141764) map I (277) esp_image: segment 5: paddr=0x000e29e4 vaddr=0x40083254 size=0x0dfc0 ( 57280) load I (301) esp_image: segment 6: paddr=0x000f09ac vaddr=0x400c0000 size=0x00000 ( 0) load I (311) cpu_start: Pro cpu up. I (311) cpu_start: Starting app cpu, entry point is 0x40080ef0 I (297) cpu_start: App cpu up. I (315) heap_init: Initializing. RAM available for dynamic allocation: D (322) heap_init: New heap initialised at 0x3ffae6e0 I (327) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM D (333) heap_init: New heap initialised at 0x3ffd5c10 I (338) heap_init: At 3FFD5C10 len 0000A3F0 (40 KiB): DRAM I (344) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM I (351) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM D (357) heap_init: New heap initialised at 0x40091214 I (362) heap_init: At 40091214 len 0000EDEC (59 KiB): IRAM I (368) cpu_start: Pro cpu start user code D (381) clk: RTC_SLOW_CLK calibration value: 3682035 D (166) intr_alloc: Connected src 46 to int 2 (cpu 0) D (167) intr_alloc: Connected src 57 to int 3 (cpu 0) D (167) intr_alloc: Connected src 24 to int 9 (cpu 0) I (172) cpu_start: Starting scheduler on PRO CPU. D (0) intr_alloc: Connected src 25 to int 2 (cpu 1) I (0) cpu_start: Starting scheduler on APP CPU. D (188) heap_init: New heap initialised at 0x3ffe0440 D (198) heap_init: New heap initialised at 0x3ffe4350 D (208) intr_alloc: Connected src 16 to int 12 (cpu 0) I (208) gpio: GPIO[25]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0  D (218) intr_alloc: Connected src 30 to int 13 (cpu 0) NVS inited Opening NVS storage for app MyApp Using serial port for input. Use arrow keys or JIKL for D-pad. Use A, S for A, B buttons. Use Z for start, X for select, P for power. Guru Meditation Error: Core 0 panic'ed (LoadProhibited) . Exception was unhandled. Core 0 register dump: PC : 0x400e5224 PS : 0x00060830 A0 : 0x800e5330 A1 : 0x3ffd8cc0
A2 : 0x3f403998 A3 : 0x00000000 A4 : 0x3ffd8f78 A5 : 0x00000000
A6 : 0x00000000 A7 : 0xff000000 A8 : 0x00000000 A9 : 0x00000000
A10 : 0x00000000 A11 : 0x00000000 A12 : 0x3ffd67a0 A13 : 0x00000000
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x0000001e EXCCAUSE: 0x0000001c
EXCVADDR: 0x000000f5 LBEG : 0x400012e5 LEND : 0x40001309 LCOUNT : 0x800e07ff

Backtrace: 0x400e5224:0x3ffd8cc0 0x400e532d:0x3ffd8ce0 0x400d2f7b:0x3ffd8d00 0x400d1266:0x3ffd8d40

Rebooting...

Spritetm commented 6 years ago

Yeah, sorry, the emulators don't work in 'fake' mode because the system lacks an appfs partition when compiled like this. It's a design choice because most devboards only have 4MiB, and putting the full system on there means people would run out of space pretty soon on their devboard, while the PocketSprite would have plenty of space left.

sunkechenjing commented 6 years ago

Is there a way to cut the emulator for running it?if not. Is there others program that can run on this system.Thanks!

Spritetm commented 6 years ago

Not easily, sorry. You can try running a native app like https://github.com/PocketSprite/8bkc-fluppy , however.

sunkechenjing commented 6 years ago

I have a W25Q64 64Mbit spi flash.Applying the flash,can solve the program?

Spritetm commented 6 years ago

Possibly. You'd have to replace your existing flash chipo with that one as well as craft a new partition table specific for 8MiB flash with an appfs, as well as initialize that appfs.

sunkechenjing commented 6 years ago

I had seen esp32 flash record, Records show that the download process is correct.My controller is ESP320WDQ6. Chip is ESP320WDQ6 Uploading stub... Running stub... Stub running... Configuring flash size... Auto-detected Flash size: 4MB Flash params set to 0x0220 Compressed 22624 bytes to 13348... Wrote 22624 bytes (13348 compressed) at 0x00001000 in 1.2 seconds (effective 152.2 kbit/s)... Hash of data verified.
Compressed 395728 bytes to 156059... Wrote 395728 bytes (156059 compressed) at 0x00090000 in 13.9 seconds (effective 228.0 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 117...
Wrote 3072 bytes (117 compressed) at 0x00008000 in 0.0 seconds (effective 1557.2 kbit/s)...
Hash of data verified.

Spritetm commented 6 years ago

The download process can be successful without issues, the emulator still will not work. The native PocketSprite has a file system on its flash (the AppFs), where the chooser, the apps and everthing else lives. Because the 'fake' mode is mostly meant for people who want to start developing apps without having the pocketsprite, and the devboards they use probably do not have space for the needed AppFs, support for it in 'fake' mode is taken out. Unfortunately, the GnuBoy and SMSPlus emulators need AppFs to work, so they will not work in 'fake' mode.

As I said before, the way to make this work is to modify the partition table used for the 'fake' target to include an AppFs partition like the real PocketSprite partition table has, plus add the needed functionality into the HAL code.

In other words: without heavily modifying the 'fake' PocketSprite code, the emulators will not work. As I have no intention to add the code to make them work, I'm closing this issue. If you are able to get it to work in such a way that still allow people to develop large games with this, feel free to send in a pull request.