M5stack programming without Arduino IDE : how ?
-
@jimit
I am running Mac OSIn my setup the M5Stack-IDF is in esp-idf.
I achieved to run esp-idf hello-world example on the M5Stack but I need to use M5 specific functions, hence the need for M5Stack.h I guess
The content of hello_world is (sorry indentation is not kept by this site FAQ engine):
build/
components/
arduino/
appveyor.yml
boards.txt
component.mk
cores/
docs/
Kconfig
libraries/
Makefile.projbuild
package/
package.json
platform.txt
programmers.txt
README.md
tools/
variants/
main
component.mk
hello_world_main.c
Makefile
README.md
sdkconfig
sdkconfig.oldI'll keep on tomorrow
-
@jrs Glad you seem to have it working.
Since yours is working, it should be safe to assume your setup is correct: with M5Stack-IDF installed in the ESP-IDF directory.
Thanks for the update....
-
The easyest way to start with ESP-IDF is by PlatformIO
That IDE include ESP-IDF, Arduino, Mbed... -
@calin Great tip re. PlatformIO - will take it for a spin...
-
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 incomponents/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 ofcomponents/M5Stack/component.mk
?Thank you for attention.
-
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
-
@wtakuo Thank you!
-
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 fromsrc
. So we don't need to add these subdirectories toCOMPONENT_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.
-
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. Somain
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.
-
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.
-
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 :)
-
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