esp-open-sdk icon indicating copy to clipboard operation
esp-open-sdk copied to clipboard

Blinky example don't start on esp12f

Open de1m opened this issue 7 years ago • 46 comments

Hi, I've installed the esp-open-sdk on my linux. The previously version that I've used was the SDK V1.5 and with this version working my esp12 without any problem. Now for a new project I've installed the V2.0.0_16_08_10 and compiled for a test the same blinky example (this has worked on sdk 1.5). But now my esp12 don't working(after compiling and flash). For my test I've used the Makefile from blinky example test.

de1m@comp0 /opt/esp-open-sdk/examples/blinky $ esptool.py -p /dev/ttyUSB0 write_flash --flash_mode dio 0 blinky-0x00000.bin 0x40000 blinky-0x10000.bin
esptool.py v1.2
Connecting...
Auto-detected Flash size: 32m
Running Cesanta flasher stub...
Flash params set to 0x0240
Writing 36864 @ 0x0... 36864 (100 %)
Wrote 36864 bytes at 0x0 in 3.3 seconds (90.6 kbit/s)...
Writing 196608 @ 0x40000... 196608 (100 %)
Wrote 196608 bytes at 0x40000 in 17.3 seconds (90.9 kbit/s)...
Leaving...

de1m avatar Jul 07 '17 19:07 de1m

Similar problem on ESP8266 (Wemos D1 mini Pro). It worked couple days back, now the built-in LED just blinks rapidly after flashing. No errors, compiles and flashes but doesn't work. Not sure how to proceed.

ghost avatar Jul 10 '17 12:07 ghost

There's some working examples available in esp-open-rtos, it worked for me.

ghost avatar Jul 13 '17 10:07 ghost

Everything known to work. 1) Check your hardware. 2) Check https://www.chiark.greenend.org.uk/~sgtatham/bugs.html

pfalcon avatar Jul 13 '17 10:07 pfalcon

I think hardware is okay, yesterday I've installed Arduino for ESP and it's have working without any problem. Also my last installation with sdk 1.5.4 has working.

So it's not a hardware error. Wich info do you need?

de1m avatar Jul 13 '17 11:07 de1m

I am also switching from arduino to esp-open-sdk and back, and experienced similar behaviours. The solution that worked for me is to completely blank the flash using the different available versions of esptool (there are two in esp-open-sdk, and another one in arduino).

d-a-v avatar Jul 13 '17 11:07 d-a-v

I've installed yesterday my new pc and also a fresh esp-open-sdk and esptool from python pip (version 2.1). I've erased flash with old version (from esp-open-sdk v1.2) and with the new version of esptool 2.1, then I've flash the blinky example first with esptool 1.2 then with 2.1. Also I've used manuall the old address of memory (0x0000 and 0x4000) but always the same behaviours

esptool.py -p /dev/ttyUSB0 write_flash --flash_mode dio 0 blinky-0x00000.bin 0x40000 blinky-0x10000.bin
esptool.py -p /dev/ttyUSB0 write_flash --flash_mode dio 0 blinky-0x00000.bin 0x10000 blinky-0x10000.bin

I've no idee more, what can I do. I think I do a downgrade down to sdk 1.5.4

de1m avatar Jul 13 '17 11:07 de1m

At one point I made a blank file (dd if=/dev/zero) and flashed it, then it worked after a regular flash (all esptool "blank" options were not working). I was indeed suspecting an hardware fault before that. You could try that, and trying back the 1.5.4 sdk too if it fails.

d-a-v avatar Jul 13 '17 11:07 d-a-v

okay, thank you for info. I try this today evening

de1m avatar Jul 13 '17 11:07 de1m

It's not working. So my steps

  1. Create a dummy file with dd
  2. flash this file on esp12f (esptool 1.2)
  3. flash blinky example
de1m@comp0 /opt/esp-open-sdk-a/examples/blinky $ make flash
esptool.py write_flash 0 blinky-0x00000.bin 0x10000 blinky-0x10000.bin
esptool.py v1.2
Connecting...
Auto-detected Flash size: 32m
Running Cesanta flasher stub...
Flash params set to 0x0040
Writing 36864 @ 0x0... 36864 (100 %)
Wrote 36864 bytes at 0x0 in 3.3 seconds (90.7 kbit/s)...
Writing 196608 @ 0x10000... 196608 (100 %)
Wrote 196608 bytes at 0x10000 in 17.3 seconds (90.9 kbit/s)...
Leaving...

now the chip blink with a very high frequency (it's not a correct frequency 500ms)

de1m avatar Jul 13 '17 17:07 de1m

have you tried going back to arduino environment with this chip ? there's this arduino sketch https://github.com/kentaylor/EraseEsp8266Flash to try before trying esp-open-sdk/blinky again.

d-a-v avatar Jul 15 '17 21:07 d-a-v

yesterday I' received a new dev board modul (http://www.ebay.de/itm/NodeMCU-ESP8266-ESP-12E-V1-0-Wifi-CP2102-IoT-Lua-267-/172778652438?hash=item283a690316) I've make steps like above 1.Create a dummy file with dd 2.flash this file on esp12f (esptool 1.2) 3. flash blinky example ...but the save behaviour (the chip blink with a very high frequency (it's not a correct frequency 500ms))

After this steps test with arduino and rtos version -> working

de1m avatar Jul 16 '17 14:07 de1m

Sorry I still have little experience with esp-open-sdk. I observe the same behaviour with micropython when trying lwIP-v2 and I'm still looking for time to sort this out. I'll try simple/blinky tests too when I have time. The trick above worked once. Given that arduino sketches are working, try with the erase sketch before flashing the blinky example. Have you tried all the "erase" options from all available esptool versions ?

d-a-v avatar Jul 16 '17 19:07 d-a-v

I also experience this problem. I have ESP12 module. Hardware is OK, blink example from esp-open-rtos is working (with the same sdk), but blink example from SDK result in rapidly flashing LED

tarakanov avatar Jul 18 '17 08:07 tarakanov

@tarakanov which os do you use?? Windows? Linux?

de1m avatar Jul 18 '17 14:07 de1m

I have exactly the same problem, I use the blinky firmware available here

The basic blinky example works WELL with an ESP-12E but NOT with an ESP-12F

In ordrer to install all of esp-open-rtos toolchain and and blinky code example I've approximatively followed this protocol here at https://www.penninkhof.com/2015/03/esp8266-open-sdk/#comment-698
When flashing with esptool.py it works very well with an ESP-12E but not with the same board and an ESP-12F instead.

Additionnal infos: I've the same problem by using it trough eclipse.

I confirm, I have exactly the same problem with two other of my firmwares and one of them is running with esp-open-rtos. But the esp-open-rtos uses esp-open-sdk as seen here: https://github.com/SuperHouse/esp-open-rtos So it really seems that the problem come from the esp-open-sdk !

(I used both of Ubuntu and Debian, it didn't change anything) This is a critical issue !

Navis-Raven avatar Jul 18 '17 17:07 Navis-Raven

I think the ESP-12F after flashing, does not wakes up from the boot mode since instead of having 3.3V on the GPIO 0 pin, this pin outputs an alternative signal (with an offset) which may be the quartz signal (I think that te ESP-12 outputs the quartz signal on GPIO 0 when on boot mode). Please confirm this info.

I've observed this triangular/alternative signal with an oscilloscope, on two ESP-12F but not on the ESP-12E I observed it only while in boot mode (ie. while flashing) or shortly at the beginning after a reset.

Navis-Raven avatar Jul 18 '17 17:07 Navis-Raven

"I also experience this problem. I have ESP12 module. Hardware is OK, blink example from esp-open-rtos is working (with the same sdk), but blink example from SDK result in rapidly flashing LED" @tarakanov

The problem is that the blinky example does not start at all, if you have seen the blinking correctly, and you certify that the firmware works but at high speed so it is just a problem of frequency and you've solved the problem.

So, you should use an UART to be sure that your firmware is running, and it is not just a crystal noise oscillating like the one one GPIO 0.

Navis-Raven avatar Jul 18 '17 17:07 Navis-Raven

After verification @tarakanov there is no signal on the led in my case, please verify that you have an ESP-12F and not an ESP-12E or other. It seems that our issues are not really the same even, in other words it seems that the cause of both issues are not the same

Navis-Raven avatar Jul 18 '17 18:07 Navis-Raven

I confirm, I have exactly the same problem with two other of my firmwares and one of them is running with esp-open-rtos.

NB: esp-open-rtos uses libraries from esp-open-sdk

Navis-Raven avatar Jul 18 '17 18:07 Navis-Raven

@Navis-Raven - maybe you should check to see that you are set up on the correct GPIO for your model? Maybe you have already confirmed that...

@tarakanov - I had the same problem as you it seems (rapidly blinking LED). I found a post here that helped: https://blog.vinczejanos.info/2016/11/14/unbrick-esp8266-blinking-blue-led/

Essentially, I ended up flashing some of the binary blobs from esp-open-sdk to my ESP using esptool.py. First though (as the post suggests), I found out what model SPI flash I had by issuing esptool.py --port /dev/ttyUSB0 flash_id and used the suggested file here https://code.coreboot.org/svn/flashrom/trunk/flashchips.h to figure out what my flash chip size was. I used the table in the post in order to determine what addresses I should flash the blobs to since I found my flash size to be 4MB.

I could not find the master_device_key.bin file, so I only did the following (please remember to check the table for the appropriate addresses for your model flash memory):

  1. cd esp-open-sdk/ESP8266_NONOS_SDK_V2.0.0_16_08_10/bin
  2. esptool.py write_flash 0x3FC000 esp_init_data_default.bin
  3. esptool.py write_flash 0x3FE000 blank.bin
  4. cd at_sdio/noboot
  5. esptool.py write_flash 0x00000 eagle.flash.bin
  6. esptool.py write_flash 0x40000 eagle.irom0text.bin

I then went back and ran make flash for the blinky example and that worked for me finally. Does someone know which of those flashes was necessary for things to start working? Maybe everything was?

bamartin125 avatar Jul 19 '17 04:07 bamartin125

@bamartin125 - I think it's this one

esptool.py write_flash 0x3FC000 esp_init_data_default.bin

I've been following this thread, with the vague recollection of a new blob added in SDK 2.x that needed to be flashed before things built with SDK 2.x would run. It's been quite a while since I've looked at this stuff, so I couldn't remember the details. This has jogged my memory, esp_init_data_default.bin was the one added in SDK 2.x.

jeremyd2019 avatar Jul 19 '17 05:07 jeremyd2019

@tarakanov @jeremyd2019 So in facts our issues are quite different. But if your led blinks, it might signify that your programm is running, if it is the case it is really not the same issue : please verify with an UART and printf("hello_world\n"); If your programm displays hello_world in your Putty terminal (or equivalent) so your Blinky programm is running. So in this case the issue is not the one in the titile "Blinky example don't start on esp12f". If not already tryied, try to modify the blinky programm in order to decrease the frequency of led blinking (equivalent to increase the temporisation between each blinks)

If you're sure that your programm does not run, please verify the signal on the GPIO 0, and the one on the ESP's LED and describe it.

We have to be sure that we are talking about the same problems. Because it seems that there is many issues in one here.

Navis-Raven avatar Jul 19 '17 13:07 Navis-Raven

@EVERYBODY:
We have to be sure that we are talking about the same bug:

  1. Please verify the version of the ESP-12 you use, and be sure that this is the ESP12-F (as said in the topic title) and not the ESP-12E.
  2. Verify that your blinky programm does not start, (try to send a hello world message in the UART, see the message above)
  3. Check the signal at GPIO 0 with an oscilloscope, and describe it.
  4. Check your SDK version.
  5. Does your same Blinky programm with the same PC configuration (compilation flashing toolchain etc...) works on an ESP-12E.
  6. Which OS do you use ? It is a very important step to investigate this bug.

Navis-Raven avatar Jul 19 '17 14:07 Navis-Raven

If @tarakanov and @jeremyd2019 have only a problem of frequency with their ESP-12F (if it is an F and not an E), we can apporach more a solution.

Navis-Raven avatar Jul 19 '17 14:07 Navis-Raven

For me,

  1. I use the ESP-12F
  2. The blinky program doesn't start at all. No hello world is printed into the putty console.
  3. The voltage GPIO 0 pin is a triangular/alternative signal (with an offset) instead of a 3.3V
  4. I use the latest SDK version.
  5. The same basic and standard blinky programm works on ESP-12E, and not on the ESP-12F.
  6. I've tried on Ubuntu and Debian

Navis-Raven avatar Jul 19 '17 15:07 Navis-Raven

@de1m Your new component (link below) is not an ESP-12F but an ESP-12E. "NodeMCU ESP8266 ESP-12E V1.0 Wifi CP2102 IoT Lua 267"

http://www.ebay.de/itm/NodeMCU-ESP8266-ESP-12E-V1-0-Wifi-CP2102-IoT-Lua-267-/172778652438?hash=item283a690316

The problem is that the ESP-12E is working with the basic blinky programm but not with the ESP-12F. The same issue I have. (NB: the frequency problems can be easily solved by a temporisation or decreasing frequency of blinking if necessary)

Can you describe the steps you've done to create a dummy file and flashing it please ?

Navis-Raven avatar Jul 19 '17 15:07 Navis-Raven

@Navis-Raven yes I can,

  1. Create a file in Linux with "dd" - d if=/dev/zero of=blank.bin bs=4096K count=1
  2. Write this file to esp - esptool --port=/dev/ttyUSB0 write_flash 0 blank.bin

I've changed the timer settings in blinky example, but frequency is the same

  // setup timer (500ms, repeating)
  os_timer_setfn(&some_timer, (os_timer_func_t *)some_timerfunc, NULL);
  os_timer_arm(&some_timer, 1100, 1);

de1m avatar Jul 19 '17 16:07 de1m

Please careful about this issue https://github.com/pfalcon/esp-open-sdk/issues/226, the Blinky makefile is obsolete and not up to date !

///UPDATE This has been fixed

Navis-Raven avatar Jul 20 '17 14:07 Navis-Raven

I have some news. After many trials I found something, I've seen that doing this on an ESP-12E esptool.py --port=/dev/ttyUSB0 write_flash 0x00000 blank.bin has the same results as flashing the ESP-12F with the basic blinky programm or any other programm.

So I've suspected that it was a flash problem, I've tried many flash modes, and this is what I found:

The ESP-12F I have, in the countrary of the ESP-12E model I have must be programmed in "dout" mode. But I really don't now why. This is the command line I did: esptool.py -p /dev/ttyUSB0 write_flash --flash_mode dout 0 blinky-0x00000.bin 0x10000 blinky-0x10000.bin

This are the results, I have three different hardwares (HW1, HW2, HW3) with ESP-12E and ESP-12F:

HW1+ESP-12E : Working with high speed blinking HW1+ESP-12F : Working normally (blinks every 500ms) HW2+ESP-12E : Working with high speed blinking HW3+ESP-12F : Working with high speed blinking

We can conclude at least that we are NOT facing the same issue as the beginning. These are two different issues.

The most weird thing is that after making only one "--flash_mode dout" on HW2+ESP12F, the next times I did not event had to add this flash mode dout option to succeed into flashing, however it was necessary on the HW3+ESP-12F. Very weird !

Navis-Raven avatar Jul 20 '17 18:07 Navis-Raven

It seems that the high speed blinking problem is a high speed rebooting problem.

@tarakanov @de1m you have to do an UART with a putty console then you will observe it.

Navis-Raven avatar Jul 20 '17 18:07 Navis-Raven