Skip to content

Instantly share code, notes, and snippets.

@Naohiro2g
Last active December 26, 2019 15:48
Show Gist options
  • Save Naohiro2g/c385e77a327a2b79261e39798322a3a7 to your computer and use it in GitHub Desktop.
Save Naohiro2g/c385e77a327a2b79261e39798322a3a7 to your computer and use it in GitHub Desktop.
MacでESP32のLチカ(ESP-IDF版)2019-02-20 ref: https://qiita.com/naohiro2g/items/79c99eac5254be1d051d
sudo easy_install pip
sudo pip install pyserial
mkdir -p ~/esp
cd ~/esp
curl -O https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz
tar -xzf xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz
export PATH=$HOME/esp/xtensa-esp32-elf/bin:$PATH
export IDF_PATH=~/esp/esp-idf
cd ~/esp
git clone --recursive https://github.com/espressif/esp-idf.git
python -m pip install --user -r $IDF_PATH/requirements.txt
cd ~/esp
git clone https://github.com/espressif/esp-idf-template.git myapp
cd ~/esp/myapp
make flash
ls /dev/cu.*
server:myapp tsuji$ make flash
Flashing binaries to serial port /dev/cu.SLAB_USBtoUART (app at offset 0x10000)...
esptool.py v2.0-beta1
Connecting......
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Attaching SPI flash...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x022f
Compressed 9504 bytes to 5656...
Wrote 9504 bytes (5656 compressed) at 0x00001000 in 0.1 seconds (effective 887.3 kbit/s)...
Hash of data verified.
Compressed 488048 bytes to 247504...
Wrote 488048 bytes (247504 compressed) at 0x00010000 in 5.1 seconds (effective 758.3 kbit/s)...
Hash of data verified.
server:myapp tsuji$ make flash
CC main.o
AR libmain.a
LD app-template.elf
esptool.py v2.0-beta1
Flashing binaries to serial port /dev/cu.SLAB_USBtoUART (app at offset 0x10000)...
esptool.py v2.0-beta1
Connecting...........................................
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
make: *** [flash] Error 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment