Robo's esp'ecial ESP8266 fork

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
mianos
Posts: 84
Joined: Sat Aug 22, 2015 6:42 am

Re: Robo's esp'ecial ESP8266 fork

Post by mianos » Tue Feb 09, 2016 3:04 am

jgriessen wrote: main.c:40:28: fatal error: user_interface.h: No such file or directory
#include "user_interface.h"
[/code]

Ideas what went wrong?
That header in esp-open-sdk/sdk/include so it's possible you have not got the SDK installed properly?
I use Paul's repo https://github.com/pfalcon/esp-open-sdk.git and set:
export PATH=/home/rfo/wa/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
I don't do a thing.

You might wish to check out the master micropython and try that first. The makefile is pretty much unchanged.

As far as merging with master, no. Now I have run out of memory and I don't want to write the python code in C, I am going to look at the pre compiled code system. I have plenty of ram once the code is compiled.
I am also going to take it easy for a bit because the kickstarter is going to have many things I have and I think I'll wait to see what stuff is already in the core and what I want to merge from my own project (ie. my own C DHT drivers etc).

User avatar
jgriessen
Posts: 191
Joined: Mon Sep 29, 2014 4:20 pm
Contact:

Re: Robo's esp'ecial ESP8266 fork

Post by jgriessen » Tue Feb 09, 2016 4:53 am

That hint got me to change the makefile and put my directories in it.
Then I got no missing include, but this error now:

Code: Select all

xtensa-lx106-elf-gcc -I../lib/netutils -I. -I.. -I../stmhal -I../lib/mp-readline -I../lib/netutils -I../lib/timeutils -Ibuild -I/opt/esp-open-sdk/sdk/include -Idevices -Wall -Wpointer-arith -Werror -ansi -std=gnu99 -nostdlib -DUART_OS=1 -fsingle-precision-constant -Wdouble-promotion -D__ets__ -DICACHE_FLASH -fno-inline-functions -Wl,-EL -mlongcalls -mtext-section-literals  -Os -DNDEBUG  -fdata-sections -ffunction-sections -c -MD -o build/uart.o uart.c
In file included from /opt/esp-open-sdk/sdk/include/ets_sys.h:12:0,
                 from uart.c:12:
uart.c: In function 'uart_config':
/opt/esp-open-sdk/sdk/include/eagle_soc.h:249:38: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
                                      &  (~(PERIPHS_IO_MUX_FUNC<<PERIPHS_IO_MUX_FUNC_S))  \
                                      ^
John Griessen blog.kitmatic.com

User avatar
jgriessen
Posts: 191
Joined: Mon Sep 29, 2014 4:20 pm
Contact:

Re: Robo's esp'ecial ESP8266 fork

Post by jgriessen » Tue Feb 09, 2016 5:10 am

Are these flags right?

Code: Select all

CFLAGS = $(INC) -Wall -Wpointer-arith -Werror -ansi -std=gnu99 -nostdlib -DUART_OS=$(UART_OS) \
	$(CFLAGS_XTENSA) $(COPT) $(CFLAGS_EXTRA)
John Griessen blog.kitmatic.com

User avatar
jgriessen
Posts: 191
Joined: Mon Sep 29, 2014 4:20 pm
Contact:

Re: Robo's esp'ecial ESP8266 fork

Post by jgriessen » Tue Feb 09, 2016 9:55 am

I think the Makefile line
ESP_DRIVER_LIB = /opt/esp-open-sdk/sdk/examples/driver_lib
doesn't have the missing
./esp_iot_sdk_v1.5.0/include/user_interface.h
when the compile stops, errors out.

Is this how it should be:
ESP_DRIVER_LIB = /opt/esp-open-sdk/esp_iot_sdk_v1.5.0
and adding:
INC += -I$(ESP_DRIVER_LIB)/include
?
Meanwhile, trying that theory out...

Code: Select all

In file included from /opt/esp-open-sdk/esp_iot_sdk_v1.5.0/include/ets_sys.h:12:0,
                 from uart.c:12:
uart.c: In function 'uart_config':
/opt/esp-open-sdk/esp_iot_sdk_v1.5.0/include/eagle_soc.h:249:38: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
Does a flag need changing to ignore warnings?
John Griessen blog.kitmatic.com

mianos
Posts: 84
Joined: Sat Aug 22, 2015 6:42 am

Re: Robo's esp'ecial ESP8266 fork

Post by mianos » Tue Feb 09, 2016 9:59 am

All I do is git clone Paul's sdk. Checkout the subprojects as instructed and 'make' (takes a while on my Linux box).
Then I clone micropython, cd micropython/esp8266
export PATH=/home/rfo/wa/esp-open-sdk/xtensa-lx106-elf/bin:$PATH

and type
make
I just did it then.

User avatar
jgriessen
Posts: 191
Joined: Mon Sep 29, 2014 4:20 pm
Contact:

Re: Robo's esp'ecial ESP8266 fork

Post by jgriessen » Tue Feb 09, 2016 10:25 am

Next I tried adding -Wno-error to the CFLAGS list so the warning about
/opt/esp-open-sdk/esp_iot_sdk_v1.5.0/include/eagle_soc.h is skipped:

Code: Select all

xtensa-lx106-elf-ld: cannot find -lmain
xtensa-lx106-elf-ld: cannot find -ljson
xtensa-lx106-elf-ld: cannot find -llwip
xtensa-lx106-elf-ld: cannot find -lpp
xtensa-lx106-elf-ld: cannot find -lnet80211
xtensa-lx106-elf-ld: cannot find -lwpa
xtensa-lx106-elf-ld: cannot find -lphy
xtensa-lx106-elf-ld: cannot find -lnet80211
xtensa-lx106-elf-ld: cannot find -lcrypto
xtensa-lx106-elf-ld: cannot find -lsmartconfig
Makefile:154: recipe for target 'build/firmware.elf' failed
And those missing files are in the esp_iot_sdk_v1.5.0 part of the esp-open-sdk directories.

So, I changed/added a definition ESP_IOT_SDK:

stopped using ESP_DRIVER_LIB anywhere,
added:

Code: Select all

ESP_IOT_SDK = /opt/esp-open-sdk/esp_iot_sdk_v1.5.0
INC += -I$(ESP_IOT_SDK)/include
LIBS = -L$(ESP_IOT_SDK)/lib -lmain -ljson -llwip -lpp -lnet80211 -lwpa -lphy -lnet80211 -lcrypto -lsmartconfig
Now it compiles:

Code: Select all

Create build/firmware-combined.bin
esptool.py elf2image build/firmware.elf
python makeimg.py build/firmware.elf-0x00000.bin build/firmware.elf-0x10000.bin build/firmware-combined.bin
('flash    ', 54912)
('padding  ', 10624)
('irom0text', 334048)
('total    ', 399584)
Will skipping those warnings make my little node.it board go up in flames? Find out after I get more sleep ;)
John Griessen blog.kitmatic.com

User avatar
jgriessen
Posts: 191
Joined: Mon Sep 29, 2014 4:20 pm
Contact:

Re: Robo's esp'ecial ESP8266 fork

Post by jgriessen » Tue Feb 09, 2016 11:11 pm

I've loaded the latest ESP8266 fork onto my board, then connect with miniterm.py. control E does not cause paste mode. Is that a missing feature? I suppose there is no documentation of the ESP8266 fork so I need to start reading the source, right?

Hints of what is like micropython on a pyboard, and example code that runs on esp8266 would be much appreciated.
John
John Griessen blog.kitmatic.com

User avatar
jgriessen
Posts: 191
Joined: Mon Sep 29, 2014 4:20 pm
Contact:

Re: Robo's esp'ecial ESP8266 fork

Post by jgriessen » Tue Feb 09, 2016 11:54 pm

I tried changing some LEDs and found that GPIO1 can't be set as output. The REPL dies if you try,
and the LED doesn't respond either.

Code: Select all

>>> import pyb
>>> pin = pyb.Pin(0, pyb.Pin.OUT_PP)
>>> pin.value(1) 
>>> pin.value(0)
>>> pin = pyb.Pin(5, pyb.Pin.OUT_PP)
>>> pin.value(0)
>>> pin.value(1)
>>> pin.value(0)
>>> pin = pyb.Pin(1, pyb.Pin.OUT_PP)
It's stuck at this point until a <ctl>-C

Is the REPL incomplete on the ESP fork?
John Griessen blog.kitmatic.com

zaforic
Posts: 1
Joined: Wed Nov 08, 2017 9:50 pm

Re: Robo's esp'ecial ESP8266 fork

Post by zaforic » Wed Nov 08, 2017 9:52 pm

Do you have any plans of merging in the latest 1.9 version of micropython? I am looking for the smartconfig changes in particular.

Post Reply