🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Building Core2 FactoryDemo in PlatformIO

    Core2 for AWS
    9
    12
    23.9k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • greenleafG
      greenleaf
      last edited by

      If anyone else is trying to do this you'll need to fix your partition table to take advantage of the larger memory. The steps how to do this are:

      1. Go to PIO Home in Visual Studio Code
      2. Click on +New Project
      3. Name it m5core2 or similar. Choose M5Stack Core ESP32 for the board.
      4. Leave Framework set to Arduino.
      5. Open your platformio.ini file and replace the text with this:
      [env:m5stack-core-esp32]
      platform = espressif32
      board = m5stack-core-esp32
      framework = arduino
      ; [[[for macos]]]
      ;upload_port = /dev/cu.SLAB_USBtoUART
      ; [[[fix PSRAM size and you won't need have this file]]]
      board_build.partitions = default_16MB.csv
      build_flags =
          -DBOARD_HAS_PSRAM
          -mfix-esp32-psram-cache-issue
      
      1. Copy the 16MB partition table file into your src directory. You can download this file here:

      https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/default_16MB.csv

      1. In the 'lib' directory you will need three libraries.
        FastLED - https://github.com/FastLED/FastLED
        M5Core2 - https://github.com/m5stack/M5Core2
        ArduinoECCX08 - This one is in a zip file in the M5Core2 library repo:
        https://github.com/m5stack/M5Core2/blob/master/examples/core2_for_aws/ArduinoECCX08.zip

      Your lib directory should look like this when you're done:
      0_1609802773703_40f76186-abcc-4a68-916a-468a37b4451a-image.png

      1. Now copy everything from the example FactoryTest directory in the M5Core2 library into your src folder. The directory files can be viewed here:

      https://github.com/m5stack/M5Core2/tree/master/examples/core2_for_aws/FactoryTest

      1. Rename FactoryTest.ino to main.cpp

      2. Edit main.cpp and comment out these two lines with //. These tests will fail if you don't have an SDCard or something plugged into the IO port.

      0_1609802944350_e768774e-f0f1-419b-a751-2b40e2db3122-image.png

      1. Connect your M5Core2 and build/upload. You can do CTRL-Shift-P to find the Platformio:Upload option.

      2. Play with the cool factory demo!

      0_1609803302370_m5.jpg

      Thanks to jokercatz for the tip on fixing the platform:
      http://jokercatz.blogspot.com/2020/11/m5stack-core2-build-from-platformio.html

      1 Reply Last reply Reply Quote 4
      • ZontexZ
        Zontex
        last edited by

        Great post! thank you for sharing your with us your knowledge, will be pretty useful for many users over here.

        1 Reply Last reply Reply Quote 1
        • M
          masterPen6
          last edited by

          Could i build and upload every example ( in my case the Core2 AWS ) with platform IO or i need to use idf.py from ESP-IDF ?
          When i use platform IO i already have the ESP-IDF install i suppose.

          In all cases i need it to edit the configuration with the command "idf.py menuconfig" (right?), example in this step https://edukit.workshop.aws/en/blinky-hello-world/connecting-to-aws.html#configuring-the-esp32-firmware

          1 Reply Last reply Reply Quote 0
          • R
            rashedtalukder
            last edited by

            There are modifications that need to be done to use all the examples with PlatformIO. Currently we are requiring the use of ESP-IDF v4.2 and at the moment PlatformIO only supports 4.1. You could modify the projects and they should work:

            • Rename the "main" directory to "src"
            • Possibly update cmakelists.txt files (depends on example)

            Head of the AWS IoT EduKit program and AWS employee. Not an M5Stack employee.

            1 Reply Last reply Reply Quote 0
            • S
              smuasini
              last edited by

              Hi @greenleaf Are you using the M5GO Battery Bottom2? Tried following your step-by-step and it is just stuck at AT608A Check failed.

              Mine is core2 without the battery bottom.

              Thanks,
              smua

              1 Reply Last reply Reply Quote 0
              • R
                rashedtalukder
                last edited by

                This is specifically for the Core2 for AWS IoT EduKit hardware. The regular Core2 and/or the standard M5Go bottom will not work with this firmware.

                Head of the AWS IoT EduKit program and AWS employee. Not an M5Stack employee.

                jimwsmithJ 1 Reply Last reply Reply Quote 0
                • D
                  DannyG86
                  last edited by

                  @greenleaf said in Building Core2 FactoryDemo in PlatformIO:

                  http://jokercatz.blogspot.com/2020/11/m5stack-core2-build-from-platformio.html

                  Thanks for the guidance.
                  How could this be adjusted for the M5AtomLite, M5Stack Basic and M5Paper ?

                  1 Reply Last reply Reply Quote 1
                  • jimwsmithJ
                    jimwsmith @rashedtalukder
                    last edited by

                    @rashedtalukder Actually if you comment out the code checking for AT608A chip it works on plain Core 2

                    1 Reply Last reply Reply Quote 0
                    • jimwsmithJ
                      jimwsmith
                      last edited by

                      I found the actual Factory Test code for the Core 2 as this example is for the AWS Core 2
                      https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Core/M5Core2/Arduino

                      1 Reply Last reply Reply Quote 0
                      • R
                        rashedtalukder
                        last edited by

                        There are pin differences for some of the features, but yes you can disable the atecc608 part of the code.

                        Head of the AWS IoT EduKit program and AWS employee. Not an M5Stack employee.

                        1 Reply Last reply Reply Quote 0
                        • Q
                          quincy
                          last edited by

                          Thanks, I needed this so much!

                          1 Reply Last reply Reply Quote 0
                          • F
                            fundix
                            last edited by

                            bool Device = 1; // Please select your device
                            // Core2 = 1,Core2_AWS = 0;

                            I Chaged from 0 to 1

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post