moononournation / arduino-nofrendo

Clone from source http://www.baisoku.org/nofrendo-2.0pre1.zip
Other
81 stars 37 forks source link

M5Stack Core Esp32 - Doesn't work #6

Closed Dario-Ciceri closed 4 months ago

Dario-Ciceri commented 1 year ago

As described, M5Stack Core Esp32 with Esp32 Core v2.0.4 doesn't work. It keeps resetting!!!

ASSERT: line 266 of D:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\memguard.c, malloc: out of memory at line 86 of D:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\bitmap.c. block size: 61440

memory leak - 9 unfreed blocks

addr: 0x3FFB9094, size: 256, line 26 of D:\Users\cicer\Documents\Arduino\M5STACK-nofrendo\sound.c addr: 0x3FFB432C, size: 808, line 522 of D:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\nes\nes.c addr: 0x3FFB46A4, size: 92, line 539 of D:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\nes\nes.c addr: 0x3FFB4750, size: 2048, line 546 of D:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\nes\nes.c addr: 0x3FFB4FA0, size: 296, line 990 of D:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\sndhrdw\nes_apu.c addr: 0x3FFD1B6C, size: 7584, line 127 of D:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\nes\nes_ppu.c addr: 0x3FFB5118, size: 1068, line 426 of D:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\nes\nes_rom.c addr: 0x3FFD395C, size: 8192, line 131 of D:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\nes\nes_rom.c addr: 0x3FFB5594, size: 8, line 241 of D:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\nes\nes_mmc.c abort() was called at PC 0x4012d786 on core 1

ELF file SHA256: 0000000000000000

Backtrace: 0x40087f64:0x3ffb1b90 0x400881e1:0x3ffb1bb0 0x4012d786:0x3ffb1bd0 0x4010523f:0x3ffb1bf0 0x400d8623:0x3ffb1c10 0x400d8797:0x3ffb1c30 0x400d72b4:0x3ffb1d70 0x400d8eb2:0x3ffb1d90 0x400d8b73:0x3ffb1db0 0x400d100a:0x3ffb1de0 0x400d8ab1:0x3ffb1e00 0x400d1382:0x3ffb1e20 0x400ebdf6:0x3ffb1fb0 0x40089232:0x3ffb1fd0

Rebooting...

moononournation commented 1 year ago

At the time I am writing this, the Arduino-esp32 still at version 1.0.x. Please try the older Arduino-esp32 v1.0.6 in Arduino IDE working first.

Dario-Ciceri commented 1 year ago

At the time I am writing this, the Arduino-esp32 still at version 1.0.x. Please try the older Arduino-esp32 v1.0.6 in Arduino IDE working first.

Nothing it doesn't work, btw I had to rename the display initializer in Arduino_ILI9342 gfx = new Arduino_ILI9342(bus, 33 / RST /, 2 / rotation */); because you updated the gfx library but not the NES code

Dario-Ciceri commented 11 months ago

Hi, back again on this issue and I found the error code addr: 0x3FFE8C34, size: 61440, line 86 of C:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\bitmap.c -- block corrupt which is: addr = NOFRENDO_MALLOC(((pitch * height) + 3) & 0xFFFFFFF8); /* add max 32-bit aligned adjustment */

moononournation commented 11 months ago

that means cabnot allocat memory, you should use PSRAM

Dario-Ciceri commented 11 months ago

that means cabnot allocat memory, you should use PSRAM

On arduino IDE I can't find psram enable for M5stack, also I tried with esp-idf but there's no cmakelist

moononournation commented 11 months ago

or try another smaller ROM

Dario-Ciceri commented 11 months ago

or try another smaller ROM

What if I use SD card?

moononournation commented 11 months ago

I mean smaller game, the game ROM need load into RAM before start.

Dario-Ciceri commented 11 months ago

I mean smaller game, the game ROM need load into RAM before start.

Yes this is fine, I tried without a game ROM and it gives the same problem, I think it's not a game ROM problem

Dario-Ciceri commented 11 months ago

What is it trying to load after showing nofrendo logo? I still get addr: 0x3FFE8C34, size: 61440, line 86 of C:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\bitmap.c -- block corrupt

This is what I found:

GUI: / not found, will use default ROM _my_malloc: 0 at C:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\nes\nes_rom.c:131 _my_malloc: 16384 at C:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\intro.c:4451 _my_malloc: 8192 at C:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\intro.c:4471 GUI: ROM loaded: Nofrendo intro [0] 16k/8k V _my_malloc: 8 at C:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\nes\nes_mmc.c:241 created memory mapper: None setting up mapper 0 reset memory mapper GUI: NES powered on _my_malloc: 61440 at C:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\bitmap.c:86 _my_malloc: 980 at C:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\bitmap.c:48 Timer install, configTICK_RATE_HZ=1000, freq=60 addr: 0x3FFE8C34, size: 61440, line 86 of C:\Users\cicer\Documents\Arduino\libraries\arduino-nofrendo-master\src\bitmap.c -- block corrupt

Dario-Ciceri commented 11 months ago

I tried loading tetris.nes, it detects it but after nofrendo intro I get: GUI: /fstetris.nes not found, will use default ROM and block corruption

moononournation commented 11 months ago

seems file path missing a '/' in the middle.

Dario-Ciceri commented 11 months ago

seems file path missing a '/' in the middle.

So what should I change?

I'll try #define FSROOT "/fs/" instead of #define FSROOT "/fs"

Dario-Ciceri commented 11 months ago

nothing seems to work, I can't find where's the path it's trying use

and3rson commented 5 months ago

seems file path missing a '/' in the middle.

I had the same issue, had to add "/" in main.cpp:

                    sprintf(fullFilename, "%s/%s", FSROOT, filename);