Build and deployment issues with olimex-iot-firmware-esp8266

Started by meinereiner, December 19, 2016, 10:39:26 AM

Previous topic - Next topic

meinereiner

Thanks for your help!

If you like to you can also use the docker toolchain. The behaviour was the same:
https://hub.docker.com/r/vowstar/esp8266/
Once installed docker and pulled the image in the link above you can easily compile. Just navigate in the terminal to the project location and execute the following command:


docker run --rm -ti -v `pwd`:/build vowstar/esp8266 /bin/bash -c "cd /build/; make clean && make APP=1 DEVICE=EVB_ONLY && make APP=2 DEVICE=EVB_ONLY"


This will mount your project folder (the current location) to /build, you navigate there and exevute the build. The files will be put as usual to your project folder.

You dont have to, maybe it makes only the analysation easiert.
But in my last tries I did not use docker at all, just a local installation of the toolchain where you've provided the link.

Hopefully you find something as I'm also out of ideas!

PeteW

Here is what I have tested on two different computers:

  • Ubuntu 16.04.1 LTS
  • Windows 10 with Ubuntu bash shell


###
### TOOLCHAIN INSTALL
###
cd ~
git clone --recursive https://github.com/pietrushnic/esp-open-sdk.git
cd esp-open-sdk/
make STANDALONE=n

### remove old SDK that come with toolchain
rm -rf esp_iot_sdk*
rm -rf sdk

PATH=$HOME/esp-open-sdk/xtensa-lx106-elf/bin:$PATH

###
### FIRMWARE BUILD
###
cd ~
git clone https://github.com/OLIMEX/olimex-iot-firmware-esp8266.git
cd olimex-iot-firmware-esp8266/

### Build no device binaries
make clean
make APP=1
make clean
make APP=2

### Build EVB_ONLY binaries
make clean
make APP=1 DEVICE=EVB_ONLY
make clean
make APP=2 DEVICE=EVB_ONLY

### to deploy no device binaries use
python esptool/esptool.py \
        --port /dev/ttyUSB0 \
        --baud 576000 \
        write_flash \
                0x00000  bin/boot_v1.6.bin \
                0x01000  bin/upgrade/user1.2048.new.3.bin \
                0x81000  bin/upgrade/user2.2048.new.3.bin \
                0x100000 bin/blank.bin \
                0x101000 bin/blank.bin \
                0x102000 bin/blank.bin \
                0x103000 bin/blank.bin \
                0x1FC000 bin/esp_init_data_default.bin \
                0x1FE000 bin/blank.bin \
        --flash_size 16m

### to deploy EVB_ONLY binaries use
python esptool/esptool.py \
        --port /dev/ttyUSB0 \
        --baud 576000 \
        write_flash \
                0x00000  bin/boot_v1.6.bin \
                0x01000  bin/upgrade/EVB_ONLY/user1.2048.new.3.bin \
                0x81000  bin/upgrade/EVB_ONLY/user2.2048.new.3.bin \
                0x100000 bin/blank.bin \
                0x101000 bin/blank.bin \
                0x102000 bin/blank.bin \
                0x103000 bin/blank.bin \
                0x1FC000 bin/esp_init_data_default.bin \
                0x1FE000 bin/blank.bin \
        --flash_size 16m



The result
When compare binaries from my original setup with those compiled on other machines they are all different but  are with exactly same size.

When deployed to the board all worked as expected.


meinereiner

I cannot finally confirm that it is working but why so ever this time it looks better with the build. At least the ESP is not resetting constantly!  ;D

The only difference are the following 3 lines from what I did and I thing the rm was mainly my issue:  :-X

make STANDALONE=n

### remove old SDK that come with toolchain
rm -rf esp_iot_sdk*
rm -rf sdk



But I wil give it a try and let you know again.
Thank you very much so far for your help!

But one, stupid question: Why is APP1 and APP2 compiled seperately?
Isn't there a way to compile one global image or to make at least one time a make? Sure I can create a shell script in order to do that but when I want to integrate it in an IDE for instance it is not that handy.
I understand that there are those two parts ...
Can you quickly give me some hints?!

PeteW

QuoteBut one, stupid question: Why is APP1 and APP2 compiled seperately?

There is no such thing as "stupid question".

We need two binary images user1.*.bin and user2.*.bin to be able to support Firmware Over The Air (FOTA) updates. SDK requires if user1 image is active to upload user2 image which is stored at different address. After upload is complete we mark user2 image as active and reboot the board. With this approach if connection drops during upgrade we will not end with corrupted firmware.

I do not know exactly how APP=1 and APP=2 affects SDK build process. So I prefer to play safe and compile binaries separately.

meinereiner

OK understood. Thank you for explaining!

But then it wouldn't be necessary to upload via serial connection every time user1 and user2, right?
Isnt there a way to compile one common image that can be only flashed via serial? Because when I make it without the app and get such an eagle file that I flash, I have my original behaviour back again.

Anyway: I think I can now continue. Thank you very much for your help!