Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash after I2S fix #4

Open
ahammers opened this issue Mar 6, 2024 · 0 comments
Open

Crash after I2S fix #4

ahammers opened this issue Mar 6, 2024 · 0 comments

Comments

@ahammers
Copy link

ahammers commented Mar 6, 2024

I am trying to get this project working on a LOLIN D32 with an ILI9341 display and a MAX98357A I2S DAC.

I had it working without sound for some time but since I changed the settings from direct DAC to I2S it stops working whenever I start a ROM.

in video_audio.c I disabled the build in DAC

		.mode = I2S_MODE_MASTER | I2S_MODE_TX,
//		.mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN,

an I added the pin configuration to what I am using in my other projects:

static const i2s_pin_config_t pin_config = {
	.bck_io_num = 27,
	.ws_io_num = 26,
	.data_out_num = 25,
	.data_in_num = 0 // I2S_PIN_NO_CHANGE
};	
i2s_set_pin(I2S_DEVICE_ID, &pin_config);

I don't hear any sound in the menu (don't know if this is normal) but when I start some ROM it get this messages and the system freezes (no display updates, menu button not working, ...):

rst:0x1 (POWERON_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:1
load:0x3fff0030,len:1184
load:0x40078000,len:13260
load:0x40080400,len:3028
entry 0x400805e4
Game controller initalizing
GPIO Control initated
Init SPI bus
Init SPI bus completed
Adding screen device
Adding screen completed
LCD ILI9341 initialization.
LCD initialization complete.
Start boot menu init
Reading rom list
ROM[1] icon[$] name[Super Mario Bros] file[smb.nes]
ROM[2] icon[;] name[Tetris] file[tetris.nes]
ROM[3] icon[+] name[Duck Tales] file[dtales.nes]
Found 3 ROMs
Finished boot menu init
No errors, carry on
Showing boot menu
Menu selection is /spiffs/smb.nes
NoFrendo start!
Starting main loop with file: /spiffs/smb.nes
Finished initializing sound
free heap after sound init: 234896
Game controller initalizing
GPIO Control initated
free heap after input init: 232472
video driver: Simple DirectMedia Layer at 486555958x240
vid_init done
vid_init done
PPU memory allocated and cleared
partition type = 0.
partition subtype = 17.
partition starting address = 150000.
partition size = 140000.
partition label = app1.
partition encrypted = 0.
Reading rom from /spiffs/smb.nes
Loaded/Verified 40976 ROM bytes mapped on EEPROM area
Initialized. ROM @ 0x3f410000
Head: 0x3f410000 (4e 45 53 1a)
SRAM Present
created memory mapper: None
setting up mapper 0
reset memory mapper
Timer install 60Hz
Game controller initalizing
GPIO Control initated
Init SPI bus
Init SPI bus completed
Adding screen device
Adding screen completed
LCD ILI9341 initialization.
LCD initialization complete.
Start boot menu init
Reading rom list
ROM[1] icon[$] name[Super Mario Bros] file[smb.nes]
ROM[2] icon[;] name[Tetris] file[tetris.nes]
ROM[3] icon[+] name[Duck Tales] file[dtales.nes]
Found 3 ROMs
Finished boot menu init
No errors, carry on
Showing boot menu
Menu selection is /spiffs/smb.nes
NoFrendo start!
Starting main loop with file: /spiffs/smb.nes
Finished initializing sound
free heap after sound init: 234896
Game controller initalizing
GPIO Control initated
free heap after input init: 232472
video driver: Simple DirectMedia Layer at 486555958x240
vid_init done
vid_init done
PPU memory allocated and cleared
partition type = 0.
partition subtype = 17.
partition starting address = 150000.
partition size = 140000.
partition label = app1.
partition encrypted = 0.
Reading rom from /spiffs/smb.nes
Loaded/Verified 40976 ROM bytes mapped on EEPROM area
Initialized. ROM @ 0x3f410000
Head: 0x3f410000 (4e 45 53 1a)
SRAM Present
created memory mapper: None
setting up mapper 0
reset memory mapper
Timer install 60Hz

Also I can't get the micro sd card reader to work with this project. It works in a stand alone project without changing the connections, but with nesemu it does not. But as long as I can use the SPIFFS this is no big deal for me.

Any ideas what I did wrong with the I2S configuration ?

UPDATE: I thought it's just a brownout because of the MAX98357 consuming too much power from the LOLIN D32 but even with the I2S DAC removed it hangs after "Timer install 60 Hz". But if I change i2s_set_pin(I2S_DEVICE_ID, &pin_config); back to i2s_set_pin(I2S_DEVICE_ID, NULL); it works without sound (but I can play Super Mario)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant