#!/bin/bash :< MUST set SDK_PATH & BIN_PATH firstly!!! example: export SDK_PATH=~/esp_iot_sdk_freertos export BIN_PATH=~/esp8266_bin ! home_path=${PWD%iot*} export SDK_PATH=${home_path} export BIN_PATH=${home_path}"bin" echo "gen_misc.sh version 20150911" echo "" if [ $SDK_PATH ]; then echo "SDK_PATH:" echo "$SDK_PATH" echo "" else echo "ERROR: Please export SDK_PATH in gen_misc.sh firstly, exit!!!" exit fi if [ $BIN_PATH ]; then echo "BIN_PATH:" echo "$BIN_PATH" echo "" else echo "ERROR: Please export BIN_PATH in gen_misc.sh firstly, exit!!!" exit fi echo "Please check SDK_PATH & BIN_PATH, enter (Y/y) to continue:" read input if [[ $input != Y ]] && [[ $input != y ]]; then exit fi echo "" echo "Please follow below steps(1-5) to generate specific bin(s):" echo "STEP 1: use boot_v1.2+ by default" boot=new echo "boot mode: $boot" echo "" echo "STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)" echo "enter (0/1/2, default 0):" read input ...... echo "STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz)" echo "enter (0/1/2/3, default 2):" read input ...... echo "STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)" echo "enter (0/1/2/3, default 0):" read input if [ -z "$input" ]; then spi_mode=QIO elif [ $input == 1 ]; then spi_mode=QOUT elif [ $input == 2 ]; then spi_mode=DIO elif [ $input == 3 ]; then spi_mode=DOUT else spi_mode=QIO fi echo "spi mode: $spi_mode" echo "" echo "STEP 5: choose spi size and map" echo " 0= 512KB( 256KB+ 256KB)" echo " 2=1024KB( 512KB+ 512KB)" echo " 3=2048KB( 512KB+ 512KB)" echo " 4=4096KB( 512KB+ 512KB)" echo " 5=2048KB(1024KB+1024KB)" echo " 6=4096KB(1024KB+1024KB)" echo "enter (0/2/3/4/5/6, default 0):" read input ...... make clean make BOOT=$boot APP=$app SPI_SPEED=$spi_speed SPI_MODE=$spi_mode SPI_SIZE_MAP=$spi_size_map |