I’m newbies with ESP8266-01, but I’ve a lot experience in C++ and ASM then I’m really understood what the “makefile” do for you. But before ask you question, let me resume the situation.
SETUP
Plug on a breadboard with a simple MAX233 on a standard DB9 Com1. I used BS170 Transistor to shift level on both port (RX/TX).
OS and program
- Microsoft Windows 10 x64
Cygwin x86
Xtensa 1.0.6 build 161014 (I have also build 141114)
Python 2.7 (I think we can go without)
NodeMCU ESP-FLASHER (better look)
Espressif SDK 1.50 last build
The resume
Of course everything begin with NodeMCU and ESPlorer, it’s the fastest way to get result, but I’d like LUA script and we can make lighter with specific firmware. After I decide to compile with SDK 1.5 by Espressif, of course lack of experience I face the wall.
The first result I get is when I’ve try Blink tutorial (http://www.instructables.com/id/Blink-for-ESP8266-native-like-arduino-using-Window/?ALLSTEPS) by jbeemster (ADD crypto to LIBS inside MAKEFILE to be Compatible 1.5). After an analyst of the Makefile, I’ve understand the method.
GCC every .C file inside asked module (driver, user)
AR every .O file inside asked module into App.a file
LD the App.a file into TARGET.out
Esptool TARGET.out into TARGET.eagle.flash.bin
Esptool TARGET.out into TARGET.eagle.irom0text.bin
I think that Esptool can be replaced by OBJ-Dump and OBJ-Copy but I’m not sure. My batch file included in my package can replace makefile and if we skip (or convert) Esptool it’s can be also used without CYGWIN and PHYTON. Inside the package (http://www.mediafire.com/download/hemz9bc1898ybgt/ESPBuilder.rar) you can also see a ESP-ENV, it’s a simple batch file who start Command prompt with proper path (That’s solution offer to not increase your path constantly)
Code: Select all
@echo off
if /i "%1" equ "/S" goto Start
cmd /k %~dp0%~nx0 /S
goto :EOF
:Start
set Prompt=[$P]$_¯
cd /d %~dp0%
set path=%~dp0bin;%~dp0CygWinLite\bin;%~dp0xtensa106\bin;%~dp0Python27;%~dp0Python27\Scripts;%path%
set COMPILE=gcc
Now I can go inside my blink projects folder and do some command like
- Make
Make clean
Build (the non-Cygwin solution)
Ok, Now for the final. I move AT example content inside app folder. That’s mean that I’ve App/user instead App/at/User. I go inside my root SDK and l have try some command. But before, note that I’ve the same result inside Cygwin shell that Native Windows CMD.
The first MAKE try have the same result that my Own Build batch, because it’s compile into the eagle version.
Build.bat
make COMPILE=gcc BOOT=none APP=0 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=0
#error "upgrade is not supported when eagle.flash.bin+eagle.irom0text.bin!!!"
Let’s give another mode
make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=0
make[1]: Entering directory '/cygdrive/e/ESPBuilder/Sdk/app'
make[2]: Entering directory '/cygdrive/e/ESPBuilder/Sdk/app/user'
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLA
SH -DAT_UPGRADE_SUPPORT -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle user_main.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -DICACHE_FLA
SH -DAT_UPGRADE_SUPPORT -I include -I ./ -I ../../include/ets -I ../include -I ../../include -I ../../include/eagle at_upgrade.c
.output/eagle/debug/obj/at_upgrade.d:1: *** multiple target patterns. Stop.
make[2]: Leaving directory '/cygdrive/e/ESPBuilder/Sdk/app/user'
../Makefile:307: recipe for target '.subdirs' failed
make[1]: *** [.subdirs] Error 2
make[1]: Leaving directory '/cygdrive/e/ESPBuilder/Sdk/app'
Makefile:307: recipe for target '.subdirs' failed
make: *** [.subdirs] Error 2
Now I give up!
