I was started experimenting on ESP8266 that was bought from AI-Thinker, and the wiki is here, ESP8266 and another for NodeMCU.
I have already familiar with Lua firmware, so flashed Lua node firmware and able to success with that, but I face memory issue with the Lua firmware. Then I have thought to use programming in C instead of Lua. My development environment is Ubuntu 14.0. The steps I have followed from here: https://github.com/SuperHouse/esp-open-rtos.
I was successful to build the firmware with gen_misc.sh
in examples/project_template
folder with generating below mentioned bin's with default build options :
eagle.flash.bin
eagle.irom0text.bin
then flashed with esptool.py
, using the command below:
./esptool.py write_flash 0x00000 ESPWorkspace/esp-open-sdk/ESP8266_RTOS_SDK/esp8266_bin/eagle.flash.bin 0x20000 ESPWorkspace/esp-open-sdk/ESP8266_RTOS_SDK/esp8266_bin/eagle.irom0text.bin
And the output after flashing from the board is:
Fatal exception (28): epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00007ff0, depc=0x00000000
It was just printing on to the screen repeatedly, I used minicom on Ubuntu with /dev/ttyUSB0
with 115200 baud rate for connecting the device used USB cable. and the strange part is after the power off/on cycle, I get junk data on minicom.
Some article on the net directed with debug with eagle.dump
file and eagle.s
. I have not resolved the issue with that either.
Can anyone direct me, to solve the issue?
I found the way to flash esp-8266 with esp-free-rtos, if someone benefited from my answer I'm glad. I was using NodeMcu WiFi Development Board - ESP8266(ESP-12E). The issue I faced related to fatal exception(28) due to the related memory location not available(may not be, I am just beginner here).
I mistook two separate projects are same, but are identically different as ESP8266_RTOS_SDK and esp-open-rtos.
So after some search I chose to continue with esp-open-rtos, then the error appeared, it was related to flash size, from here: https://nodemcu.readthedocs.io/en/master/en/flash/ I got the answer .
In esp-open-rtos root folder edited the parameter file changed as to FLASH_SIZE ?= 8 , FLASH_MODE ?= dout even i increased the baud rate to ESPBAUD ?= 1500000 .
I flashed with the firmware and got my C program into esp8266 .
Below I have listed a step by step guide to flash your C program into esp8266. My dev system is Ubuntu 14.04 LTS.
Make sure all Requirements and Dependencies available with your dev system mentioned in their GitHub page.
$ git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
$ make STANDALONE=n
Set the export path:
$ export PATH=/path_to_Workspace/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
$ git clone --recursive https://github.com/Superhouse/esp-open-rtos.git
$ cd esp-open-rtos
$ make flash -j4 -C examples/http_get ESPPORT=/dev/ttyUSB0
@Glorfindel has the correct answer but just to clarify.
Determine the flash size of your board:
from https://stackoverflow.com/questions/39631011/how-to-determine-flash-size-of-nodemcu
- install esptool.py
- run
esptool.py -p <serial-port> flash_id
(gives you a hex manufacturer & chip ID)- look up the chip in https://code.coreboot.org/p/flashrom/source/tree/HEAD/trunk/flashchips.h
(I had a HiLetGo nodemcu - 32Mb)
Edit the file: esp-open-rtos/parameters.mk
FLASH_SIZE ?= <N>
(where N is the megabits of your flash)FLASH_MODE ?= dio
(note I also found reference to dio here: https://groups.google.com/forum/#!topic/esp-open-rtos/-MNCe1NyVKA)
Those two changes fixed the problem for me.
User contributions licensed under CC BY-SA 3.0