因micropython官方固件對(duì)esp32支持還不完善远寸,但是國(guó)外廠商有基于micropython對(duì)esp32針對(duì)性的支持(代碼優(yōu)先自家板子后續(xù)再提交到micropython官方合并)旗国,且python語(yǔ)法有所升級(jí)。所以手頭上有esp32板子且想體驗(yàn)較為完善的micropython可以編譯pycom的固件燒錄到自己的板子上备蚓。
系統(tǒng)環(huán)境:
ubuntu-16.04.2-desktop-amd64
假設(shè)你工作目錄為:/home/esp/esp/pycom/build
安裝依賴:
sudo apt update
sudo apt upgrade
sudo apt-get install git wget make libncurses-dev flex bison gperf python python-serial curl
一, 安裝PYCOM-IDF
1. cd /home/esp/esp/pycom/build
2. git clone --recursive https://github.com/pycom/pycom-esp-idf.git
3. cd pycom-esp-idf
4. git submodule update --init
5. export IDF_PATH=/home/esp/esp/pycom/build/pycom-esp-idf
二,安裝pycom-micropython-sigfox
1. cd /home/esp/esp/pycom/build
2. git clone --recursive https://github.com/pycom/pycom-micropython-sigfox.git
3. git submodule update --init
三贬循, 安裝XTENSA
1. cd /home/esp/esp/pycom/build
2. curl -O https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-61-gab8375a-5.2.0.tar.gz
3. tar -xzf xtensa-esp32-elf-linux64-1.22.0-61-gab8375a-5.2.0.tar.gz
4. export PATH=$PATH:/home/esp/esp/pycom/build/xtensa-esp32-elf/bin
四,構(gòu)建app & bootloader
1. cd /home/esp/esp/pycom/build/pycom-micropython-sigfox
2. make -C mpy-cross
3. cd esp32
4. make BOARD=WIPY -j4 TARGET=boot
5. make BOARD=WIPY -j4 TARGET=app
備注:
如果你的板子不是pycom出品桃序,請(qǐng)修改pycom-micropython-sigfox/esp32/boards/wipy/pins.csv文件中的引腳定義再編譯即可杖虾。
pycom-micropython-sigfox/esp32/boards/wipy/目錄下有固件燒錄配置以及其他板子配置文件定義,請(qǐng)自行查看按需修改媒熊。
參考鏈接:
https://github.com/pacmac/micropython-share
http://esp-idf.readthedocs.io/en/latest/get-started/linux-setup.html