I completed all steps with success (I took the latest SDK release, v1.2.0), but unfortunately when it comes to building one of the examples at https://github.com/esp8266/source-code-examples.git, I have many difficulties.
For example when I tried building the "blinky" example, I received the following error messages:
CC user/user_main.c
AR build/app_app.a
LD build/app.out
/opt/Espressif/ESP8266_SDK/lib/libmain.a(app_main.o): In function `user_uart_wait_tx_fifo_empty':
(.irom0.text+0x324): undefined reference to `user_rf_pre_init'
/opt/Espressif/ESP8266_SDK/lib/libmain.a(app_main.o): In function `user_uart_wait_tx_fifo_empty':
(.irom0.text+0x443): undefined reference to `user_rf_pre_init'
collect2: error: ld returned 1 exit status
Makefile:116: recipe for target 'build/app.out' failed
make: *** [build/app.out] Error 1
Could someone help me with this? I am not yet so familiar with the tools, so I don't understand what's wrong. It seems as if the tools can't find some function (user_rf_pre_init). How could that be?
UPDATE
I found a solution to overcome this problem. This was to create a dummy void user_rf_pre_init(void){} function in the user_main.c file of the examples. Then the process moved on but another difficulty occurred. Now esptool.py throws an error:
FW firmware/
esptool.py v2.0-beta1
WARNING: Unexpected ELF section header length a99c is not mod-28
Traceback (most recent call last):
File "/usr/local/bin/esptool.py", line 4, in <module>
__import__('pkg_resources').run_script('esptool==2.0b1', 'esptool.py')
File "/home/nikos/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 738, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/home/nikos/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1506, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/esptool-2.0b1-py2.7.egg/EGG-INFO/scripts/esptool.py", line 2270, in <module>
File "/usr/local/lib/python2.7/dist-packages/esptool-2.0b1-py2.7.egg/EGG-INFO/scripts/esptool.py", line 2072, in main
File "/usr/local/lib/python2.7/dist-packages/esptool-2.0b1-py2.7.egg/EGG-INFO/scripts/esptool.py", line 1689, in elf2image
File "/usr/local/lib/python2.7/dist-packages/esptool-2.0b1-py2.7.egg/EGG-INFO/scripts/esptool.py", line 1302, in __init__
File "/usr/local/lib/python2.7/dist-packages/esptool-2.0b1-py2.7.egg/EGG-INFO/scripts/esptool.py", line 1325, in _read_elf_file
File "/usr/local/lib/python2.7/dist-packages/esptool-2.0b1-py2.7.egg/EGG-INFO/scripts/esptool.py", line 1342, in _read_sections
File "/usr/local/lib/python2.7/dist-packages/esptool-2.0b1-py2.7.egg/EGG-INFO/scripts/esptool.py", line 1340, in read_section_header
struct.error: unpack_from requires a buffer of at least 24 bytes
Makefile:112: recipe for target 'firmware/0x00000.bin' failed
make: *** [firmware/0x00000.bin] Error 1
Any ideas?