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

    M5stack programming without Arduino IDE : how ?

    FAQS
    9
    23
    108.6k
    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.
    • C
      Calin
      last edited by

      The easyest way to start with ESP-IDF is by PlatformIO
      That IDE include ESP-IDF, Arduino, Mbed...

      JJJ 1 Reply Last reply Reply Quote 2
      • JJJ
        JJ @Calin
        last edited by JJ

        @calin Great tip re. PlatformIO - will take it for a spin...

        1 Reply Last reply Reply Quote 0
        • wtakuoW
          wtakuo
          last edited by wtakuo

          Hello.
          I started to use M5Stack a month ago. I tried several simple projects using Arduino IDE. Before moving to ESP-IDF based development, I tried a trivial (hello world) project to test my settings.

          Unfortunately, current https://github.com/m5stack/M5Stack-IDF looks outdated and incomplete. So I use https://github.com/m5stack/M5Stack as an IDF component as well as https://github.com/espressif/arduino-esp32 .

          The project directory looks like the following.

          Makefile
          sdkconfig
          components/
              arduino/            (recursive clone of https://github.com/espressif/arduino-esp32, idf-update branch)
              M5Stack/            (clone of https://github.com/m5stack/M5Stack)
                  component.mk    (should be modified. See below)
                  ...
          main/
              component.mk
              main.cpp            (copy of components/M5Stack/examples/Basics/Hello/Hello.ino)
          

          The only tweak I did is the addition of src/utlitity to the end of these path variables in components/M5Stack/component.mk.

          COMPONENT_SRCDIRS := . src src/utility
          COMPONENT_ADD_INCLUDEDIRS := . src src/utility
          

          Without this modification, make cannot correctly find the source codes and headers under src/utility.

          The above setup looks OK and works for other projects.
          My questions are:
          * Is this a correct setup for ESP-IDF projects? (Is there any better one?)
          * Is there any way to avoid the modification of components/M5Stack/component.mk?

          Thank you for attention.

          1 Reply Last reply Reply Quote 1
          • wtakuoW
            wtakuo
            last edited by

            My forked and updated version (implementing the setup in my previous post) of M5Stack-IDF template project is available: https://github.com/wtakuo/M5Stack-IDF

            dasloloD wtakuoW 2 Replies Last reply Reply Quote 1
            • dasloloD
              daslolo @wtakuo
              last edited by

              @wtakuo Thank you!

              1 Reply Last reply Reply Quote 0
              • wtakuoW
                wtakuo @wtakuo
                last edited by wtakuo

                I fixed my patch in https://github.com/wtakuo/M5Stack-IDF.

                The path variables in component.mk should look like the following.

                COMPONENT_SRCDIRS := src src/utility src/Fonts
                COMPONENT_ADD_INCLUDEDIRS := src
                

                As shown in the above code, I added src/Fonts to COMPONENT_SRCDIRS and removed unnecessary "." (current directory) from both paths. Header files in the subdirectories are specified using relative paths from src. So we don't need to add these subdirectories to COMPONENT_ADD_INCLUDEDIRS.

                Anyway, I sent pull request regarding this fix. If my PR is accepted, the patch file in https://github.com/wtakuo/M5Stack-IDF will be unnecessary.

                wtakuoW 1 Reply Last reply Reply Quote 0
                • wtakuoW
                  wtakuo @wtakuo
                  last edited by wtakuo

                  Now my PR has just been incorporated into the latest commit of M5Stack. So I removed patch.txt.

                  In addition, to tidy up the repository of my fixed M5Stack-IDF, I moved my modifications to components_patch branch. So main branch no longer contains the fix now. If you'd like to try my fixed version of M5Stack-IDF, please do like the following commands.

                  git clone --recursive -b components_patch https://github.com/wtakuo/M5Stack-IDF.git
                  

                  Sorry for inconvenience due to the changes.

                  JJJ 1 Reply Last reply Reply Quote 0
                  • JJJ
                    JJ @wtakuo
                    last edited by

                    @wtakuo

                    Hi wtakuo,

                    thanks for your work on this…. Nice that M5Stack included your work.

                    Your efforts inspired me to give installation another crack – this time using Linux instead of Windows. MUCH better so far.

                    Just have to determine which serial port is in use… got a long list rather than a defined port when following the ESP-IDF setup guide that outlined how to distinguish the serial port in use. Will follow it up laterz.

                    1 Reply Last reply Reply Quote 0
                    • H
                      hetlelid
                      last edited by hetlelid

                      For reference:

                      Arduino submodule failed. I downloaded the latest, like this (and working):

                      rm -r components/arduino/
                      git clone https://github.com/espressif/arduino-esp32.git components/arduino-esp32
                      cd components/arduino-esp32 && git submodule update --init --recursive && cd ../..

                      Nice if this could be fixed in the code, wtakuo :)

                      1 Reply Last reply Reply Quote 0
                      • m5-docsM
                        m5-docs
                        last edited by

                        Here is the article about programming with Arduino IDE
                        For Windows:
                        https://m5stack.readthedocs.io/en/latest/get-started/m5stack_core_get_started_Arduino_Windows.html
                        For MacOS:
                        https://m5stack.readthedocs.io/en/latest/get-started/m5stack_core_get_started_Arduino_MacOS.html

                        M5Stack documentation URL

                        https://docs.m5stack.com

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