-
Notifications
You must be signed in to change notification settings - Fork 238
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
M5Stack Core2 panics on startup #1227
Comments
Could you please remove build output and try again with a verbose build?
Then send Thank you. Are you able to build for other targets? |
I think the key thing is here: |
Here it is. I put instrumental build version (debug_instrument.output) aside just in case.
|
I've delved into the implementation of audioout.c. As the error message suggests, I checked for any remaining legacy APIs for I2S. It appears that the i2s_write_expand function does not exist in esp-idf v5, which seems to be leading to a runtime error. https://github.com/Moddable-OpenSource/moddable/blame/public/modules/pins/i2s/audioout.c#L1602 To verify this, I modified esp32/m5stack_core2/manifest.json and changed MODDEF_AUDIOOUT_I2S_BITSPERSAMPLE to 16 to bypass the use of i2s_write_expand. Doing so eliminates the relevant error, and audio playback proceeds as expected. |
It looks like the M5Stack Core2 is the only public device that uses 32-bit output. That's why the use of the deprecated In #if MODDEF_AUDIOOUT_I2S_BITSPERSAMPLE == 32
i2s_config.slot_cfg.data_bit_width = I2S_DATA_BIT_WIDTH_16BIT;
i2s_config.slot_cfg.ws_width = I2S_DATA_BIT_WIDTH_32BIT; In the same function, fold together the 16 and 32 bit cases, so both use #elif (16 == MODDEF_AUDIOOUT_I2S_BITSPERSAMPLE) || (32 == MODDEF_AUDIOOUT_I2S_BITSPERSAMPLE)
i2s_channel_write(out->tx_handle, (const char *)out->buffer, sizeof(out->buffer), &bytes_written, portMAX_DELAY);
#else
#error invalid MODDEF_AUDIOOUT_I2S_BITSPERSAMPLE
#endif It would be good to have this case working for other devices that may need it. Still, it may be just fine on M5Stack Core2 to use the 16 bit case. Thank you! |
I applied the change above and the sound is back! Thank you for your quick fix. |
Build environment: Linux(22.04)
Moddable SDK version: v4.2.0
Target device: M5Stack Core2
Description
M5Stack Core2 panics on startup.
According to the instrument log, it seems to be a kind of deprecation error for i2s driver.
Steps to Reproduce
cd $MODDABLE/examples/helloworld
mcconfig -m -i -p esp32/m5stack_core2
Other information
Full Instrumentation log
The text was updated successfully, but these errors were encountered: