Thanks to the CMake plugin, this also integrates nicely with Visual Studio Code (you'll have to select the xtensa-esp32-elf-gcc
when opening the folder in VSCode, but first be sure to clone recursivly and install the Espressif ESP32 Compiler Toolchain!).
https://docs.m5stack.com/#/en/core/m5stickc
# Recursive clone is important!
git clone --recursive <this.repository>
cd <this.repository.folder>
# Install ESP-IDF Python dependencies
/usr/bin/python -m pip install --user -r esp-idf/requirements.txt
Like described in chapter Step 1. Set up the Toolchain: https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html#step-1-set-up-the-toolchain
NOTE: You'll only need Step 1. Ignore the following steps of the Espressif guide!
mkdir build; cd build;
cmake .. -G Ninja
From within the build
directory, execute
ninja menuconfig
# M5StickC does't accept esptool.py's default 460800 bps
ESPBAUD=1500000 ninja flash
The repository is organized using git submodule
:
cd components
# add new component with a specific branch to track:
git submodule add --branch <another.repository.branch.to.track> <another.repository>
cd ..
# eventually you'll have to initialize and update subsequent submodules
git submodule update --recursive --checkout --force --init components/<another.repository>
# if the new submodule also contains submodules:
git config -f .gitmodules submodule.components/<another.repository>.fetchRecurseSubmodules true
# better not track changes in the new submodule, if it doesn't belong to you:
git config -f .gitmodules submodule.components/<another.repository>.ignore untracked
# checkout specific tag or commit:
cd components/<another.repository>
git checkout <another.repositories.tag_or_commit> # ignore the 'detached HEAD' warning!
cd ../..
git add components/<another.repository>
# commit new component
git commit -m "add new component <another.repository>@<another.repositories.tag_or_commit>"
First the update:
git submodule update --remote --recursive --force components/<another.repository>
Second test your build! Then commit your changes.
git submodule deinit -f components/<another.repository>
git rm -rf components/<another.repository>
git commit -m "Removed component <another.repository>"
rm -rf .git/modules/component/<another.repository>
# optional: set new branch to track
git config -f .gitmodules submodule.esp-idf.branch <new.Version.branch>
# update esp-idf main repo
git submodule update --remote --force esp-idf
# checkout submodules for the branch HEAD of esp-idf
cd esp-idf; git submodule update --checkout --force --recursive; cd ..
# update python dependencies
/usr/bin/python -m pip install --user -r esp-idf/requirements.txt --force
Again, double check compilation, then commit.