- 作者:
- 分类:知识&开发->MCU SOC->ESP_WiFi
- 阅读:1286
- 点赞:0
- 版权: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-build
or
docker 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
dir
is the direction of esp8266-nonos-sdk project
when pull and run completed, the next time you want use this container bydocker start esp8266-builder
docker attach esp8266-builder
4. build project and download to board
run in container
cd /build/esp8266-nonos-sdk
make flash
build options:
make : compile project
make flash : compile and upload code to flash of board
make erase : erase all data in flash
make monitor : serial monitor tool
make clean : clean binary files
make distclean : clean binary files and folders
make help : help info
parameters:
(1) ESPPORT
Default:/dev/ttyUSB0
(2) DOWNLOADBAUD
Default:1500000
(3) COMPILE
Possible value: gcc
Default value: gcc
If set null, will use xt-xcc.
(4) BOOT
Possible value: none/old/new
none: no need boot
old: use boot_v1.1
new: use boot_v1.2+
Default value: new
(5) APP
Possible value: 0/1/2
0: original mode, generate eagle.app.v6.flash.bin and eagle.app.v6.irom0text.bin
1: generate user1
2: generate user2
Default value: 1
(6) SPI_SPEED
Possible value: 20/26.7/40/80
Default value: 40
(7) SPI_MODE
Possible value: QIO/QOUT/DIO/DOUT
Default value: DIO
(8) SPI_SIZE_MAP
Possible value: 0/2/3/4/5/6
Default value: 2
For example:
make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=DIO SPI_SIZE_MAP=2
You can also use gen_misc to make and generate specific bin you needed.
Linux: ./gen_misc.sh
Windows: gen_misc.bat
Follow the tips and steps by steps.
5. monitor serial output
use serial monitor:
- when linux ,use
minicom
orscreen
useminicom
exit minicom:sudo apt install minicom
sudo 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 example
to src
,or delete example
to make project clean~~