Looking for Factory Test Source code for Core2



  • I spoke too soon.
    The microphone doesn't work (at least the Sound FFT display does not indicate any sounds being picked up.)

    The compile gave the following warning:
    C:\Users\jld\Documents\Arduino\Core2_Factory_test\Core2_Factory_test.ino:292:33: warning: 'I2S_COMM_FORMAT_I2S' is deprecated [-Wdeprecated-declarations]
    .communication_format = I2S_COMM_FORMAT_I2S,
    ^~~~~~~~~~~~~~~~~~~
    In file included from C:\Users\jld\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1/tools/sdk/esp32/include/driver/include/driver/i2s.h:16,
    from C:\Users\jld\Documents\Arduino\Core2_Factory_test\Core2_Factory_test.ino:2:
    C:\Users\jld\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1/tools/sdk/esp32/include/hal/include/hal/i2s_types.h:95:5: note: declared here
    I2S_COMM_FORMAT_I2S attribute((deprecated)) = 0x01, /
    !< I2S communication format I2S, correspond to I2S_COMM_FORMAT_STAND_I2S
    /
    ^~~~~~~~~~~~~~~~~~~
    ***
    Any thoughts?



  • Hello @jdonth

    my best guess would be that the code has not yet been adapted to Arduino framework 2.0.1.

    Thanks
    Felix



  • @felmue
    Thanks for the assist. Any idea what version of the framework does work? That will save me itterating backwards through the install list looking for the "winner".
    Thanks,
    Joe



  • Hello @jdonth

    probably the last of the 1.0.x versions.

    Thanks
    Felix



  • @felmue
    No joy. I installed and tried the following versions:
    1.0.6
    1.6.0
    1.6.13
    1.8.0
    1.8.18
    Some of the earlier versions would not let me add external boards (M5Stack) but the later versions that did, still gave me the i2s error (which may or not be related to the no microphone).
    Thank you for your effort.
    Joe



  • Hello @jdonth

    what I meant by Arduino framework version 1.0.6 is the arduino-esp32 framework version 1.0.6 (instead of 2.0.1) and not the Arduino IDE. Sorry if I wasn't clear.

    BTW: when I run the app compiled with 2.0.1 I see this error in the log:

    E (2888) I2S: i2s_check_set_mclk(253): ESP32 only support to set GPIO0/GPIO1/GPIO3 as mclk signal, error GPIO number:6
    E (2895) I2S: i2s_set_pin(314): mclk config failed
    

    I was able to fix this error by adding this line in function InitI2SSpakerOrMic():

    tx_pin_config.mck_io_num = GPIO_NUM_0;
    

    Thanks
    Felix



  • @felmue
    I'm lost and am sorry to take up so much your time.

    I tried your fix to InitI2SSpakerOrMic and it threw so many errors I knew I lost.

    How do I tell the IDE to load the 1.0.6 framework?

    Here is the compile log. If you can see what might be wrong?
    (I edited the ...Writing lines before the 100%)

    Thanks,
    Joe

    C:\Users\jld\Documents\Arduino\Core2_Factory_test\Core2_Factory_test.ino: In function 'bool InitI2SSpakerOrMic(int)':
    C:\Users\jld\Documents\Arduino\Core2_Factory_test\Core2_Factory_test.ino:291:33: warning: 'I2S_COMM_FORMAT_I2S' is deprecated [-Wdeprecated-declarations]
    .communication_format = I2S_COMM_FORMAT_I2S,
    ^~~~~~~~~~~~~~~~~~~
    In file included from C:\Users\jld\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1/tools/sdk/esp32/include/driver/include/driver/i2s.h:16,
    from C:\Users\jld\Documents\Arduino\Core2_Factory_test\Core2_Factory_test.ino:2:
    C:\Users\jld\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1/tools/sdk/esp32/include/hal/include/hal/i2s_types.h:95:5: note: declared here
    I2S_COMM_FORMAT_I2S attribute((deprecated)) = 0x01, /!< I2S communication format I2S, correspond to I2S_COMM_FORMAT_STAND_I2S/
    ^~~~~~~~~~~~~~~~~~~
    Sketch uses 1360101 bytes (20%) of program storage space. Maximum is 6553600 bytes.
    Global variables use 49368 bytes (1%) of dynamic memory, leaving 4472616 bytes for local variables. Maximum is 4521984 bytes.
    esptool.py v3.1
    Serial port COM3
    Connecting....
    Chip is ESP32-D0WDQ6-V3 (revision 3)
    Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
    Crystal is 40MHz
    MAC: 08:3a:f2:43:6f:48
    Uploading stub...
    Running stub...
    Stub running...
    Changing baud rate to 921600
    Changed.
    Configuring flash size...
    Flash will be erased from 0x0000e000 to 0x0000ffff...
    Flash will be erased from 0x00001000 to 0x00005fff...
    Flash will be erased from 0x00010000 to 0x0015dfff...
    Flash will be erased from 0x00008000 to 0x00008fff...
    Compressed 8192 bytes to 47...
    Writing at 0x0000e000... (100 %)
    Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 558.9 kbit/s)...
    Hash of data verified.
    Flash params set to 0x024f
    Compressed 17248 bytes to 11870...
    Writing at 0x00001000... (100 %)
    Wrote 17248 bytes (11870 compressed) at 0x00001000 in 0.4 seconds (effective 325.1 kbit/s)...
    Hash of data verified.
    Compressed 1365872 bytes to 811527...
    ...(edited)
    Writing at 0x0015a60e... (100 %)
    Wrote 1365872 bytes (811527 compressed) at 0x00010000 in 10.9 seconds (effective 998.9 kbit/s)...
    Hash of data verified.
    Compressed 3072 bytes to 129...
    Writing at 0x00008000... (100 %)
    Wrote 3072 bytes (129 compressed) at 0x00008000 in 0.1 seconds (effective 424.7 kbit/s)...
    Hash of data verified.

    Leaving...
    Hard resetting via RTS pin...



  • @felmue
    I just tried the Speak project and it will not "speak" the Dongdong code.
    Perhaps knowing that both the microphone AND speaker do not work might point to where the problem is???
    Thanks,
    Joe



  • Hello @jdonth

    No worries. I am sorry it still doesn't work for you.

    How do I tell the IDE to load the 1.0.6 framework?

    That I don't know. I am not an Arduino IDE user. I suggest you ask this question in an Arduino forum.

    I do get those warnings in the compile log as well, they are not (yet) critical. Depricated only means that in the future this part of the code will be removed / modified and them most likely lead to an error / non working code. I guess if you'd like to get rid of these warnings you could replace I2S_COMM_FORMAT_I2S with I2S_COMM_FORMAT_STAND_I2S.

    Do you have the run log? Maybe there is a clue in there.

    Thanks
    Felix



  • Hello,

    Just to be sure this is not a problem with your unit, I would suggest you download the EasyLoader tool you can find the link on this page: https://docs.m5stack.com/en/core/core2

    This tool allows you burning your Core2 with the stock demo program so that you can test it without having to compile it.

    Should be a good start



  • @erich
    Thank you for your suggestion. I downloaded and ran the EasyLoader code and my unit runs the Core2_Test with the proper microphone (per the FFT bar graph).

    Compiling the code at https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Core/M5Core2/Arduino/Core2_Factory_Test

    When I run the Core2_Factory_Test I get no microphone indication (and the speaker is silent during the scrolling test phase).

    I am assuming I have some misconfiguration in my Ardunio IDE but I don't know where. The following is the compiler messages from when I compile the test program (sorry for the size, I don't know what I can safely edit, except for [many] repeated warning:excess elements in array initializer):

    C:\Users\jld\Documents\Arduino\Core2_Factory_test\SettingAppImage.c:3169:56: warning: excess elements in array initializer
    C:\Users\jld\Documents\Arduino\Core2_Factory_test\Core2_Factory_test.ino: In function 'bool InitI2SSpakerOrMic(int)':
    C:\Users\jld\Documents\Arduino\Core2_Factory_test\Core2_Factory_test.ino:291:33: warning: 'I2S_COMM_FORMAT_I2S' is deprecated [-Wdeprecated-declarations]
    .communication_format = I2S_COMM_FORMAT_I2S,
    ^~~~~~~~~~~~~~~~~~~
    In file included from C:\Users\jld\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1/tools/sdk/esp32/include/driver/include/driver/i2s.h:16,
    from C:\Users\jld\Documents\Arduino\Core2_Factory_test\Core2_Factory_test.ino:2:
    C:\Users\jld\AppData\Local\Arduino15\packages\m5stack\hardware\esp32\2.0.1/tools/sdk/esp32/include/hal/include/hal/i2s_types.h:95:5: note: declared here
    I2S_COMM_FORMAT_I2S attribute((deprecated)) = 0x01, /
    !< I2S communication format I2S, correspond to I2S_COMM_FORMAT_STAND_I2S*/
    ^~~~~~~~~~~~~~~~~~~
    Sketch uses 1360173 bytes (20%) of program storage space. Maximum is 6553600 bytes.
    Global variables use 49368 bytes (1%) of dynamic memory, leaving 4472616 bytes for local variables. Maximum is 4521984 bytes.*



  • Hello everyone, I have several M5Stack Core2s and since the last update of the M5Stack boards in Arduino it stopped working for me.
    I don't know where to go and the error I get is:

    C: \ Users \ Vicente \ AppData \ Local \ Temp \ arduino_modified_sketch_551346 \ speak.ino: In function 'bool InitI2SSpeakOrMic (int)':
    C: \ Users \ Vicente \ AppData \ Local \ Temp \ arduino_modified_sketch_551346 \ speak.ino: 38: 33: warning: 'I2S_COMM_FORMAT_I2S' is deprecated [-Wdeprecated-declarations]
    .communication_format = I2S_COMM_FORMAT_I2S, // Set the format of the communication.设置 通讯 格式
    ^ ~~~~~~~~~~~~~~~~~~
    In file included from C: \ Users \ Vicente \ AppData \ Local \ Arduino15 \ packages \ m5stack \ hardware \ esp32 \ 2.0.1 / tools / sdk / esp32 / include / driver / include / driver / i2s.h: 16,
    from C: \ Users \ Vicente \ AppData \ Local \ Temp \ arduino_modified_sketch_551346 \ speak.ino: 14:
    C: \ Users \ Vicente \ AppData \ Local \ Arduino15 \ packages \ m5stack \ hardware \ esp32 \ 2.0.1 / tools / sdk / esp32 / include / hal / include / hal / i2s_types.h: 95: 5: note: declared here
    I2S_COMM_FORMAT_I2S __attribute __ ((deprecated)) = 0x01, / *! <I2S communication format I2S, correspond to I2S_COMM_FORMAT_STAND_I2S * /
    ^ ~~~~~~~~~~~~~~~~~~



  • The precompiled binary factory test if found in the M5Burner firmware download program.



  • @felmue

    @felmue said in Looking for Factory Test Source code for Core2:

    Hello @jdonth

    what I meant by Arduino framework version 1.0.6 is the arduino-esp32 framework version 1.0.6 (instead of 2.0.1) and not the Arduino IDE. Sorry if I wasn't clear.

    BTW: when I run the app compiled with 2.0.1 I see this error in the log:

    E (2888) I2S: i2s_check_set_mclk(253): ESP32 only support to set GPIO0/GPIO1/GPIO3 as mclk signal, error GPIO number:6
    E (2895) I2S: i2s_set_pin(314): mclk config failed
    

    I was able to fix this error by adding this line in function InitI2SSpakerOrMic():

    tx_pin_config.mck_io_num = GPIO_NUM_0;
    

    Thanks
    Felix

    Thank you Felix! I'm glad I found your solution for this error. It finally works. I'm using version 2.0.2. I can now run the EchoSTT on my Core2.

    @jdonth I'm not sure if you fixed your error. I have the same deprecated error. But it still can get compiled. My suggestion is to update the M5Stack libraries. This is what I did.



  • Hello, I'm getting a similar error, trying to use the arduino samples for the M5 echo. Please let me know how I could resolve this. Thanks!
    Documents/M5-ProductExampleCodes-master/Core/Atom/AtomEcho/Arduino/EchoSTT/EchoSTT.ino: In function 'bool InitI2SSpeakOrMic(int)':/Documents/M5-ProductExampleCodes-master/Core/Atom/AtomEcho/Arduino/EchoSTT/EchoSTT.ino:39:33: warning: 'I2S_COMM_FORMAT_I2S' is deprecated [-Wdeprecated-declarations]
    .communication_format = I2S_COMM_FORMAT_I2S,
    ^~~~~~~~~~~~~~~~~~~
    In file included from/Library/Arduino15/packages/esp32/hardware/esp32/2.0.9/tools/sdk/esp32/include/driver/include/driver/i2s.h:16,
    from //Documents/M5-ProductExampleCodes-master/Core/Atom/AtomEcho/Arduino/EchoSTT/EchoSTT.ino:12:
    //Library/Arduino15/packages/esp32/hardware/esp32/2.0.9/tools/sdk/esp32/include/hal/include/hal/i2s_types.h:87:5: note: declared here
    I2S_COMM_FORMAT_I2S attribute((deprecated)) = 0x01, /!< I2S communication format I2S, correspond to I2S_COMM_FORMAT_STAND_I2S/
    ^~~~~~~~~~~~~~~~~~~
    In file included from //Documents/Arduino/libraries/FastLED/src/FastLED.h:75,
    from //Documents/Arduino/libraries/M5Atom/src/utility/LED_DisPlay.h:4,
    from //Documents/Arduino/libraries/M5Atom/src/utility/LED_DisPlay.cpp:1:
    //Documents/Arduino/libraries/FastLED/src/fastspi.h:157:23: note: #pragma message: No hardware SPI pins defined. All SPI access will default to bitbanged output

    pragma message "No hardware SPI pins defined. All SPI access will default to bitbanged output"

                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

    //Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /private/var/folders/0t/yz2z12qx3c921x7fdqmtll4r0000gn/T/arduino/sketches/9E06B621E90448B5520779C00ED5183B/EchoSTT.ino.elf section .dram0.bss' will not fit in regiondram0_0_seg'
    //Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: DRAM segment data does not fit.
    //Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: DRAM segment data does not fit.
    //Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: region `dram0_0_seg' overflowed by 5056 bytes
    collect2: error: ld returned 1 exit status

    exit status 1

    Compilation error: exit status 1