Core 2 and COMMU



  • Hello,

    I recently purchased an M5Stack Core 2.
    I want to use it with the Arduino IDE in its latest version (Windows 10) .

    I try to run example touch.ino while choosing board "M5Stack-Core-Esp32" or "M5Stack-Core2".

    if I add the COMMU extension (I need the CAN Bus) I get the following error message regardless of the card:

    Configuring flash size ...
    Warning: Could not auto-detect Flash size (FlashID = 0x0, SizeID = 0x0), defaulting to 4MB
    Compressed 8192 bytes to 47 ...
    Writing at 0x0000e000 ... (100%)
    Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 21845.2 kbit / s) ...

    A fatal error occurred: Timed out waiting for packet header

    No solution found on internet.

    Thanks for your help.

    Didier


  • Global Moderator

    Hello, could you try to change the USB cable to different one and try to write the program again?



  • @zontex Hello,

    I try with the USB cable delivered with Core 2 or one of mine, nothing change.
    Didier


  • Global Moderator

    @benjo51 Could you please try to use M5Burner to burn the UIFlow firmware and see if you get the same error?



  • @zontex Without COMMU of course no error but with COMMU I have this one

    Start Burn

    --chip esp32 --port COM3 --baud 921600 --before default_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x1000 D:\F - Locoduino\M5Stack\M5Burner\packages\fw\core\UIFlow_Core2-v1.7.0-core2.bin

    esptool.py v2.5.0
    Serial port COM3
    Connecting...
    .

    Chip is ESP32D0WDQ6 (revision 1)
    Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse
    MAC: 84:cc:a8:60:ed:ac
    Uploading stub...
    Running stub...
    Stub running...
    Changing baud rate to 921600
    Changed.
    Configuring flash size...
    Warning: Could not auto-detect Flash size (FlashID=0xffffff, SizeID=0xff), defaulting to 4MB

    A fatal error occurred: File D:\F - Locoduino\M5Stack\M5Burner\packages\fw\core\UIFlow_Core2-v1.7.0-core2.bin (length 8376320) at offset 4096 will not fit in 4194304 bytes of flash. Use --flash-size argument, or change flashing address.

    Burn Failed



  • Hello @Benjo51

    just to be clear. You are able to flash your M5Core2 as long as the COMMU module is not connected (stacked) to it, correct?

    It looks like when the COMMU module is connected (stacked) it blocks / uses the default UART pins which then prevent the download.

    Have you verified the COMMU jumpers J6, J7, J9 and J10 are set correctly to use UART2? (The default UART is required for the firmware download.)

    Please note that compared to M5Stack (Gray, Fire, etc.) in M5Core2 UART2 pins have changed from GPIO16/GPIO17 to GPIO13/GPIO14 so you might need to adapt your code accordingly.

    Thanks
    Felix



  • Hello @felmue

    @felmue said in Core 2 and COMMU:

    just to be clear. You are able to flash your M5Core2 as long as the COMMU module is not connected (stacked) to it, correct?

    Yes that's right.

    About COMMU jumpers it's not very easy to find information about it. Not easy also to find them on the board whithout a good magnifying glass. I found a picture on the net more easy to read.
    And when I bought the COMMU, I didn't think I had to understand the schematic. I thought it was more plug & play as the presentation suggests.
    Anyway thank you very much for your help. I will persevere.
    Didier



  • Hello @Benjo51

    from my experience in general M5Stack devices and modules are simply stackable without any issues but over time some GPIOs needed to be rearranged in later products to accommodate for newer functions etc. which can cause issues like you most likely are encountering right now.

    Most modules have been created for M5Stack devices (Gray, Fire etc.) and while they still can be used with the newer M5Core2 device some of them might require some modifications (hardware or software).

    I agree, it can be a bit frustrating at times but on the bright side you will probably learn some new skills, like reading and understanding schematics.

    I am positive you'll figure it out.

    Cheers
    Felix



  • @felmue said in Core 2 and COMMU:

    I agree, it can be a bit frustrating at times but on the bright side you will probably learn some new skills, like reading and understanding schematics.
    I am positive you'll figure it out.

    Of course, I have been playing with Arduino and ESP8266 / 32 for 3 years and several years ago with the PIC16 ... and all my pleasure is to learn and to discover.
    I have already read many schematics and created myself some PCBs for my project.
    Thank you Felix