HomeACcessoryKid / ESP8266-HomeKit

HomeKit server Native on ESP8266_RTOS with an API approach
https://www.youtube.com/watch?v=Xnr-utWDIR8
Apache License 2.0
487 stars 74 forks source link

Hanging in boot process after installation #20

Closed tilman closed 5 years ago

tilman commented 7 years ago

I followed the Instructions in the Wiki. With the gen_misc.sh script i used the defaults and edited the files as recommended. I also tried it with flashing blank.bin and esp_init_data_default.bin: ~/Python/esptool/esptool.py --baud 230400 -p /dev/cu.SLAB_USBtoUART write_flash 0x00000 ../ESP8266_BIN/eagle.flash.bin 0x14000 ../ESP8266_BIN/eagle.irom0text.bin 0x3fe000 bin/blank.bin 0x3fc000 bin/esp_init_data_default.bin

The esp i am using is the: NodeMcu Amica V3 ESP-12E ESP12E 4MB FLASH Workstation is a MacBook

This is what i receive if i connect to my esp via uart:

$ pio device monitor --port /dev/cu.SLAB_USBtoUART --baud 74880
--- Miniterm on /dev/cu.SLAB_USBtoUART  74880,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
load 0x40100000, len 30372, room 16
tail 4
chksum 0x88
load 0x3ffe8000, len 2860, room 4
tail 8
chksum 0xe9
load 0x3ffe8b40, len 3152, room 0
tail 0
chksum 0x9a

csum 0x9a
OS SDK ver: 1.5.0-dev(488a5a6) compiled @ Feb 27 2017 11:49:07
rf_cal[0] !=0x05,is 0xFF

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 30372, room 16
tail 4
chksum 0x88
load 0x3ffe8000, len 2860, room 4
tail 8
chksum 0xe9
load 0x3ffe8b40, len 3152, room 0
tail 0
chksum 0x9a
csum 0x9a
OS SDK ver: 1.5.0-dev(488a5a6) compiled @ Feb 27 2017 11:49:07
rf_cal[0] !=0x05,is 0xFF

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)
...
...
...
keeps rebooting as long as the power is connected

Any Idea what to do?

AdySan commented 7 years ago

Those addresses look correct for a 4MB flash size. Have you tried to erase flash?

esptool.py --baud 230400 -p /dev/tty.SLAB_USBtoUART erase_flash

Also if you have another board handy, do your binaries actually work on another board?

streicherlouw commented 7 years ago

Did you ever get this to work? I have tried to recompile and reprogram probably 50 or 60 times, with all permutations of DIO, QIO, flash size, erasing first and different versions of ESPtool, but I keep having the rf_cal repeated boot problem... I have tried on both 4M (Wemos D1) and 16M (Wemos D1 pro mini) boards.

HomeACcessoryKid commented 7 years ago

You might have to flash some esp generic sectors at the end of the memory. Don't have the info at hand but it has been answered before.

BR, HacK

On 23 Jul 2017, at 08:49, streicherlouw notifications@github.com wrote:

Did you ever get this to work? I have tried to recompile and reprogram probably 50 or 60 times, with all permutations of DIO, QIO, flash size, erasing first and different versions of ESPtool, but I keep having the rf_cal repeated boot problem... I have tried on both 4M (Wemos D1) and 16M (Wemos D1 pro mini) boards.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

streicherlouw commented 7 years ago

Thank you kindly for the quick reply. My problem seems to be with the underlying ESP8266_RTOS_SDK, as I get the same error (rf_cal[0] !=0x05,is 0xFF) regardless of which ESP8266_RTOS_SDK example I try, not just with the homekit code. The ESP8266_RTOS_SDK documentation, unfortunately, seems to be out of date, as it refers to loading eagle.app.v6.flash.bin, eagle.app.v6.irom0text.bin and blank.bin, of which the first two are not generated by the library anymore (on my computer compilation yields eagle.flash.bin and eagle.irom0text.bin in stead). If you could can provide any more hints as to where I can look for solutions, it would be immensely appreciated. Even just the command line you use to program your modules would be of great help. I am currently trying the following programming command, but still without luck: esptool.py --baud 230400 -p /dev/tty.SLAB_USBtoUART write_flash 0x00000 ../../bin/eagle.flash.bin 0x20000 ../../bin/eagle.irom0text.bin 0xFC000 ../../bin/esp_init_data_default.bin 0x7E000 ../../bin/blank.bin . I use this with an eagle.app.v6.ld setting of irom0_0_seg : org = 0x40220000, len = 0x5C000.

streicherlouw commented 7 years ago

For reference, the full boot error message is as below, and I am using a Mac with the case sensitive file system and macOs Sierra.

OS SDK ver: 1.5.0-dev(1aafc07) compiled @ May 17 2017 10:13:23 rf_cal[0] !=0x05,is 0xFF

I also have this error condition when tyring simply : esptool.py --baud 230400 -p /dev/tty.SLAB_USBtoUART write_flash 0x00000 ../../bin/eagle.flash.bin 0x14000 ../../bin/eagle.irom0text.bin (and changing the ld file appropriately)

and even after erasing the module completely with esptool.py --baud 230400 -p /dev/tty.SLAB_USBtoUART erase_flash

and I have the exact same problem regardless of whether I program a generic 4M ESP12 module or a 16M Wemos D1 pro mini. I simply have no idea where to go from here, but think there is something interesting about the fact that even the stock ESP8266_RTOS_SDK example fail in the same way...

streicherlouw commented 7 years ago

All good. Thanks for the help. I got it to work by pretending I have a 512KB device:

To repeat, build with all default options:

Please follow below steps(1-5) to generate specific bin(s): STEP 1: use boot_v1.2+ by default boot mode: new STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin) enter (0/1/2, default 0): ignore boot generate bin: eagle.flash.bin+eagle.irom0text.bin STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz) enter (0/1/2/3, default 2): spi speed: 40 MHz STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT) enter (0/1/2/3, default 0): spi mode: QIO STEP 5: choose spi size and map 0= 512KB( 256KB+ 256KB) 2=1024KB( 512KB+ 512KB) 3=2048KB( 512KB+ 512KB) 4=4096KB( 512KB+ 512KB) 5=2048KB(1024KB+1024KB) 6=4096KB(1024KB+1024KB) enter (0/2/3/4/5/6, default 0): spi size: 512KB spi ota map: 256KB + 256KB

and then force ESP tool to program it as if it was a 512 KB device:

esptool.py --baud 230400 -p /dev/tty.SLAB_USBtoUART write_flash --flash_size 512KB 0x00000 ../../bin/eagle.flash.bin 0x14000 ../../bin/eagle.irom0text.bin 0x7C000 ../../bin/esp_init_data_default.bin 0x7E000 ../../bin/blank.bin

This worked on a Wemos D1 Pro mini (16M)

abhinavjha86 commented 7 years ago

this worked for me too... thanks a lot @streicherlouw