From 5c1ee1f7add1a0cd41d705a36af679d6d242b15b Mon Sep 17 00:00:00 2001 From: Wietse van Buitenen Date: Sun, 31 May 2015 13:02:13 +0200 Subject: [PATCH 1/6] Use correct variable for sendNTPpacket --- libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino b/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino index a3fdaf49c3..4176c511b2 100644 --- a/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino +++ b/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino @@ -72,7 +72,7 @@ void loop() //get a random server from the pool WiFi.hostByName(ntpServerName, timeServerIP); - sendNTPpacket(timeServer); // send an NTP packet to a time server + sendNTPpacket(timeServerIP); // send an NTP packet to a time server // wait to see if a reply is available delay(1000); From d5b578b161bc7d63f6e9c1bd942b602d2dc59f87 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 1 Jun 2015 02:08:48 +0300 Subject: [PATCH 2/6] reading eboot commands via RTC, flash erase/copy --- bootloaders/eboot/Makefile | 3 +- bootloaders/eboot/eboot.c | 94 +++++++++++++++++++++++++++++- bootloaders/eboot/eboot.elf | Bin 5209 -> 11738 bytes bootloaders/eboot/eboot.h | 3 + bootloaders/eboot/eboot_command.c | 47 +++++++++++++++ bootloaders/eboot/eboot_command.h | 29 +++++++++ 6 files changed, 174 insertions(+), 2 deletions(-) create mode 100644 bootloaders/eboot/eboot_command.c create mode 100644 bootloaders/eboot/eboot_command.h diff --git a/bootloaders/eboot/Makefile b/bootloaders/eboot/Makefile index 32e325f34b..8aaac9cabb 100644 --- a/bootloaders/eboot/Makefile +++ b/bootloaders/eboot/Makefile @@ -5,6 +5,7 @@ TARGET_DIR := ./ TARGET_OBJ_FILES := \ eboot.o \ + eboot_command.o \ TARGET_OBJ_PATHS := $(addprefix $(TARGET_DIR)/,$(TARGET_OBJ_FILES)) @@ -17,7 +18,7 @@ OBJDUMP := $(XTENSA_TOOCHAIN)xtensa-lx106-elf-objdump CFLAGS += -std=gnu99 -CFLAGS += -O0 -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals +CFLAGS += -Os -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals LDFLAGS += -nostdlib -Wl,--no-check-sections -umain diff --git a/bootloaders/eboot/eboot.c b/bootloaders/eboot/eboot.c index e39375d2d2..86a27eff04 100644 --- a/bootloaders/eboot/eboot.c +++ b/bootloaders/eboot/eboot.c @@ -10,6 +10,7 @@ #include #include #include "eboot.h" +#include "eboot_command.h" extern void* flashchip; #define SWRST do { (*((volatile uint32_t*) 0x60000700)) |= 0x80000000; } while(0); @@ -71,9 +72,100 @@ int load_app_from_flash_raw(const uint32_t flash_addr) } + +int erase(const uint32_t start, const uint32_t size) +{ + if (start & (FLASH_SECTOR_SIZE - 1) != 0) { + return 1; + } + + const uint32_t sectors_per_block = FLASH_BLOCK_SIZE / FLASH_SECTOR_SIZE; + uint32_t current_sector = start / FLASH_SECTOR_SIZE; + uint32_t sector_count = (size + FLASH_SECTOR_SIZE - 1) / FLASH_SECTOR_SIZE; + const uint32_t end = current_sector + sector_count; + + for (; current_sector < end && (current_sector & (sectors_per_block-1)); + ++current_sector, --sector_count) { + if (SPIEraseSector(current_sector)) { + return 2; + } + } + + for (;current_sector + sectors_per_block <= end; + current_sector += sectors_per_block, + sector_count -= sectors_per_block) { + if (SPIEraseBlock(current_sector / sectors_per_block)) { + return 3; + } + } + + for (; current_sector < end; + ++current_sector, --sector_count) { + if (SPIEraseSector(current_sector)) { + return 4; + } + } + + return 0; +} + +int copy_raw(const uint32_t src_addr, + const uint32_t dst_addr, + const uint32_t size) +{ + // require regions to be aligned + if (src_addr & 0xfff != 0 || + dst_addr & 0xfff != 0) { + return 1; + } + + if (erase(dst_addr, size)) { + return 2; + } + + const uint32_t buffer_size = 4096; + uint8_t buffer[buffer_size]; + + const uint32_t end = src_addr + size; + uint32_t saddr = src_addr; + uint32_t daddr = dst_addr; + uint32_t left = size; + while (saddr < end) { + uint32_t will_copy = (left < buffer_size) ? left : buffer_size; + if (SPIRead(saddr, buffer, will_copy)) { + return 3; + } + if (SPIWrite(daddr, buffer, will_copy)) { + return 4; + } + saddr += will_copy; + daddr += will_copy; + left -= will_copy; + } + + return 0; +} + + + void main() { - int res = load_app_from_flash_raw(0); + int res; + struct eboot_command cmd; + + eboot_command_read(&cmd); + + if (cmd.action == ACTION_COPY_RAW) { + res = copy_raw(cmd.args[0], cmd.args[1], cmd.args[2]); + if (res == 0) { + cmd.action = ACTION_LOAD_APP; + } + } + + if (cmd.action == ACTION_LOAD_APP) { + res = load_app_from_flash_raw(0); + } + if (res) { ets_putc('\n'); ets_putc('#'); diff --git a/bootloaders/eboot/eboot.elf b/bootloaders/eboot/eboot.elf index b2381a4098690e025f33c25290a14715934882fe..b7908dfd67b803008b425ac3b0d07ce5d7dd279b 100755 GIT binary patch literal 11738 zcmb_i3v^t?d7im@ceN|69;>x%89%g=t;jak!^Q=f+E|h;V;O^uBtK|vmX)-YWTahr zcjX5aNVs4i7_i}_JmN%#Q%+9^%?Xf}a0r_bMDOl_~xH~{(olf+`Bv6yl%CWQs~PN*9&syZ;Kk1pgvWB!X?BK5fW}O zPXt7P(!Ze_OsLtG_a8<7X;Fi~U5fsByKURFe-8YGF6z8R)Qr8D9#)8>>2$hm=2fC0 zT?l@yX!t>kXb`}x11)mI4UmqUxmYwjJL{M!ioyRXJvxHA_}FW29lCqbX~Tb8#p^|{ zKI(hw?5&^el<%jH3USid)Zr=rdHQ$$1*hNl?+=RV{N>Vr+gW)wAb(E4xsMuuny#03 zpI$qs@xRkmKgcgXoo+mxUNEO>iSe=_)a<$n=);^}#T1*i8LLiiVY+`_-?WtW(d zu8_W}6;B*-iPezL^gdPXfAi4sN6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Yacln#ZcRD)X1dhwn(ti;+-9saOluLl7Zo@SfqpD=tic)H>;$X;i#U-kg zT}L37O1g5PP3f|_if@S{q(XIZSY=sM8PyBR+Bag>wsg_VqUed4MZGpCtpBO)ffgkM z*S@ux^me6Bo7?Q$9Pc48JZ$R?dd^h>boKCT+@kjlWb0+mL>E2OrDwvxZ$0*0z2jYa z3x38DJ@lUL(yKx5YpxNGjJ^uQ&ZAQsz~kfhU3x^S=w7|QplbKg1gDXV`Z~JxesTC= zyiq3|oB-)idlucriJpZX9R#!0euOMeOUnkT+*gO2Y@CIKva zcL;IzgZ$H(^2YZj=-iu~^$a5RVbA;n)>`gOkr|pl1KR8V1j#SI)0RIC+WNnA^d-Fc0l$nO#y#!)TnpuO>Z7PR}5Lh|c0-;=+apuPTn(KY{%UGjUDyt6(5N5pF{2|DM= zXOWIjdw)4Q20CHcu=h(QxhJ3PCxBEk3<+PSnj$G`g-La#UY8qESuW!VXPUayRGWrU zk?OK>o=NzYOuUQUx+#@pLtzqq+iV?6+c0I_>^!6-#rpP1x>k`*+18^FY&A(byDZI} zot-eJSlhBSNuG>26MEQJ|7#+!g&qHfUB=stK*=t*uA-rk{sTxtGVlNZ diff --git a/bootloaders/eboot/eboot.h b/bootloaders/eboot/eboot.h index b77f8f45a6..973c616a80 100644 --- a/bootloaders/eboot/eboot.h +++ b/bootloaders/eboot/eboot.h @@ -14,6 +14,9 @@ int SPIEraseSector(uint32_t sector); int SPIRead(uint32_t addr, void *dest, size_t size); int SPIWrite(uint32_t addr, void *src, size_t size); + +#define FLASH_SECTOR_SIZE 0x1000 +#define FLASH_BLOCK_SIZE 0x10000 #define APP_START_OFFSET 0x1000 typedef struct { diff --git a/bootloaders/eboot/eboot_command.c b/bootloaders/eboot/eboot_command.c new file mode 100644 index 0000000000..1e9cbed2cf --- /dev/null +++ b/bootloaders/eboot/eboot_command.c @@ -0,0 +1,47 @@ +#include "eboot_command.h" + +uint32_t crc_update(uint32_t crc, const uint8_t *data, size_t length) +{ + uint32_t i; + bool bit; + uint8_t c; + + while (length--) { + c = *data++; + for (i = 0x80; i > 0; i >>= 1) { + bit = crc & 0x80000000; + if (c & i) { + bit = !bit; + } + crc <<= 1; + if (bit) { + crc ^= 0x04c11db7; + } + } + } + return crc; +} + +uint32_t eboot_command_calculate_crc32(const struct eboot_command* cmd) +{ + return crc_update(0xffffffff, (const uint8_t*) cmd, + offsetof(struct eboot_command, crc32)); +} + +void eboot_command_read(struct eboot_command* cmd) +{ + const uint32_t dw_count = sizeof(struct eboot_command) / sizeof(uint32_t); + uint32_t* dst = (uint32_t *) cmd; + for (uint32_t i = 0; i < dw_count; ++i) { + dst[i] = RTC_MEM[i]; + } + + uint32_t crc32 = eboot_command_calculate_crc32(cmd); + if (cmd->magic & EBOOT_MAGIC_MASK != EBOOT_MAGIC || + cmd->crc32 != crc32) { + + cmd->action = ACTION_LOAD_APP; + cmd->args[0] = 0; + } +} + diff --git a/bootloaders/eboot/eboot_command.h b/bootloaders/eboot/eboot_command.h new file mode 100644 index 0000000000..aa0fc11bbd --- /dev/null +++ b/bootloaders/eboot/eboot_command.h @@ -0,0 +1,29 @@ +#ifndef EBOOT_COMMAND_H +#define EBOOT_COMMAND_H + +#include +#include +#include + +#define RTC_MEM ((volatile uint32_t*)0x60001200) + +enum action_t { + ACTION_COPY_RAW = 0x00000001, + ACTION_LOAD_APP = 0xffffffff +}; + +#define EBOOT_MAGIC 0xeb001000 +#define EBOOT_MAGIC_MASK 0xfffff000 + +struct eboot_command { + uint32_t magic; + enum action_t action; + uint32_t args[29]; + uint32_t crc32; +}; + + +void eboot_command_read(struct eboot_command* cmd); + + +#endif //EBOOT_COMMAND_H From 06fcbf075a0f10ae70032abe19bd82c9afadaf09 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 1 Jun 2015 02:09:46 +0300 Subject: [PATCH 3/6] Remove .bss from sketch size calculation --- platform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.txt b/platform.txt index f0796310b0..2695115c28 100644 --- a/platform.txt +++ b/platform.txt @@ -78,7 +78,7 @@ recipe.objcopy.hex.pattern="{runtime.tools.esptool.path}/{compiler.esptool.cmd}" ## Compute size recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" -recipe.size.regex=^(?:\.irom0\.text|\.text|\.data|\.rodata|\.bss|)\s+([0-9]+).* +recipe.size.regex=^(?:\.irom0\.text|\.text|\.data|\.rodata|)\s+([0-9]+).* recipe.size.regex.data=^(?:\.data|\.rodata|\.bss)\s+([0-9]+).* #recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).* From c66a60d972e6a5903b06958a92ab466e70d80428 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 1 Jun 2015 03:05:34 +0300 Subject: [PATCH 4/6] Fix missing slash --- cores/esp8266/core_esp8266_timer.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cores/esp8266/core_esp8266_timer.c b/cores/esp8266/core_esp8266_timer.c index 08b971c58c..819c5f9901 100644 --- a/cores/esp8266/core_esp8266_timer.c +++ b/cores/esp8266/core_esp8266_timer.c @@ -20,18 +20,11 @@ */ #include "wiring_private.h" #include "pins_arduino.h" -#ifdef __cplusplus -extern "C" { -#endif #include "c_types.h" #include "ets_sys.h" -#ifdef __cplusplus -} -#endif - -/ ------------------------------------------------------------------ - +// ------------------------------------------------------------------ - // timer 1 static volatile timercallback timer1_user_cb = NULL; From bdf24031ebf5435834ee854e04c0d8c0e2da6a8a Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 1 Jun 2015 13:33:56 +0300 Subject: [PATCH 5/6] Fix uboot startup --- bootloaders/eboot/Makefile | 2 +- bootloaders/eboot/eboot.c | 2 +- bootloaders/eboot/eboot.elf | Bin 11738 -> 9816 bytes bootloaders/eboot/eboot.ld | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bootloaders/eboot/Makefile b/bootloaders/eboot/Makefile index 8aaac9cabb..cd9e141431 100644 --- a/bootloaders/eboot/Makefile +++ b/bootloaders/eboot/Makefile @@ -18,7 +18,7 @@ OBJDUMP := $(XTENSA_TOOCHAIN)xtensa-lx106-elf-objdump CFLAGS += -std=gnu99 -CFLAGS += -Os -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals +CFLAGS += -O0 -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals LDFLAGS += -nostdlib -Wl,--no-check-sections -umain diff --git a/bootloaders/eboot/eboot.c b/bootloaders/eboot/eboot.c index 86a27eff04..b3193e299a 100644 --- a/bootloaders/eboot/eboot.c +++ b/bootloaders/eboot/eboot.c @@ -150,7 +150,7 @@ int copy_raw(const uint32_t src_addr, void main() { - int res; + int res = 9; struct eboot_command cmd; eboot_command_read(&cmd); diff --git a/bootloaders/eboot/eboot.elf b/bootloaders/eboot/eboot.elf index b7908dfd67b803008b425ac3b0d07ce5d7dd279b..0637a05253c2b3f61f91954695e5fd4b116cadc6 100755 GIT binary patch literal 9816 zcmcIqeQaCTb-(vLiXtV7kD{FTLykq!arEd!qD;Ffo!Zrx_>LrBdmuRJ8s|+1C%) zxDI^n{j9&Dfq5V6U;8%ezc9l3nUAqi;H;7D2j|$kce4IJzwMHP`PqK|rHk$xpZxe2 zJak$=9el$V(jr%Ux;A*$#ow=7WbD+S$G@|OFQp$_K;h9-w!IdWx{u6dr| z|0X0Op5W#6rl6h+^?8(F%%%5j`az{@v%}+;$hAt>D;^NPZzujEhz-HB93m0TpMH-_AzzpZ}>Cdygl$vjb7oH4F-YW(*C%zOGlA^>A}U*8=N(58nK* z%Wgbpc9$6c$m%qDttQs z@eBS-z2wtVO1%BG_?kE3tKW{Vx*16Pp<8JX{I&>3#4bruT)ecwA5Z=;W1S-5XB+=<3PVCo3l_$AW=S<>VD$df)dH zPs_#b4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_g-Y4K3w0JR)n_9o{xE_3uNW@c`z~sy{_iPw_PaoYz57*eFVJv@0!i?$2_M$N#aMo$l!;;^Z##< zs`ht)*AEDMBM^^+ufV1CKLYRc|84Nj@tp^cUm7#^1IBoMuHxr5P)dLKuL);+KGmG# z3zPpaJN~}_ul}QFx4&yb`v)fQPk`rxlY0cm^LOB#_I?ar|KLddd*JyX=e!_)7QAyj z=fU$3_)S|s1xw87?_%)I@vKx!FdL8d3HlDD&&DGKo(HpAZTmNYciMjhe61rNKVwFcuRY@dCSV?4eEt$Rdd_Qws80YPVVjqaOyaOx&^-Vt%c z Date: Mon, 1 Jun 2015 15:50:51 +0300 Subject: [PATCH 6/6] Update README.md Update travis link [ci skip] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b6c1bf224..008ddcd3e6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Arduino-compatible IDE with ESP8266 support =========================================== -![Linux build status](http://img.shields.io/travis/igrr/Arduino.svg) +[![Linux build status](http://img.shields.io/travis/igrr/Arduino.svg)](https://travis-ci.org/igrr/Arduino) [![Donate](http://img.shields.io/paypal/donate.png?color=yellow)](https://www.paypal.com/webscr?cmd=_s-xclick&hosted_button_id=4M56YCWV6PX66) This project brings support for ESP8266 chip to the Arduino environment. ESP8266WiFi library bundled with this project has the same interface as the WiFi Shield library, making it easy to re-use existing code and libraries.