- 作者:
- 分类:知识&开发->MCU SOC->ESP_WiFi
- 阅读:3205
- 点赞:1
- 版权:CC BY-SA 4.0
- 创建:2019-10-13
- 更新:2019-10-19
搭建 8266 的 docker 编译环境
版权声明:本文为 neucrack 的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接(持续更新):https://neucrack.com/p/33
原文链接(持续更新):https://neucrack.com/p/33
Feature
- based on espressif nonos sdk v2.0
- integrate esptool and set default download baudrate as 1500000
- driver and project can be built directly at you first get this project
How To Use
1. clone esp8266-nonos-sdk(optimized) project
git clone https://github.com/Neutree/esp8266-nonos-sdk.git
2. install docker
3. create container(set up compile environment and download tool etc.)
- pull docker image:
docker pull neucrack/esp-buildordocker pull daocloud.io/neucrack/esp-build
- plug in you device(eg:node mcu)
- create a container
docker run -ti --name esp8266-builder --device /dev/ttyUSB0:/dev/ttyUSB0 -v dir:/build neucrack/esp-build /bin/bash
the
diris the direction of esp8266-nonos-sdk project
when pull and run completed, the next time you want use this container bydocker start esp8266-builderdocker attach esp8266-builder
4. build project and download to board
run in container
cd /build/esp8266-nonos-sdkmake flash
build options:
make : compile projectmake flash : compile and upload code to flash of boardmake erase : erase all data in flashmake monitor : serial monitor toolmake clean : clean binary filesmake distclean : clean binary files and foldersmake help : help infoparameters:
(1) ESPPORTDefault:/dev/ttyUSB0(2) DOWNLOADBAUDDefault:1500000(3) COMPILEPossible value: gccDefault value: gccIf set null, will use xt-xcc.(4) BOOTPossible value: none/old/newnone: no need bootold: use boot_v1.1new: use boot_v1.2+Default value: new(5) APPPossible value: 0/1/20: original mode, generate eagle.app.v6.flash.bin and eagle.app.v6.irom0text.bin1: generate user12: generate user2Default value: 1(6) SPI_SPEEDPossible value: 20/26.7/40/80Default value: 40(7) SPI_MODEPossible value: QIO/QOUT/DIO/DOUTDefault value: DIO(8) SPI_SIZE_MAPPossible value: 0/2/3/4/5/6Default value: 2For example:make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=DIO SPI_SIZE_MAP=2You can also use gen_misc to make and generate specific bin you needed.Linux: ./gen_misc.shWindows: gen_misc.batFollow the tips and steps by steps.
5. monitor serial output
use serial monitor:
- when linux ,use
minicomorscreen
useminicom
exit minicom:sudo apt install minicomsudo minicom -s (setting /deb/ttyUSB0 115200 8n1)sudo minicom -c on
ctrl+A -> X -> Enter
or usescreen
exit screen:screen /dev/ttyUSB0 115200
ctrl+A -> K -> Y - when docker,use:
(pay attenrion, RTS and DTR are locked, so push reset button will not functional, use ctrl+T->ctrl+H to see help)make monitor
- when windows,use serial monitor with GUI,such as UartAssist.exe
directories description
src source code|---driver driver source code|---include include files|---user user main
you can copy example from exampleto src,or delete example to make project clean~~
