Page 1 of 3

MicroPython Compilation Error

Posted: Sat Mar 12, 2016 2:13 pm
by Scorpi0
Hi,

when I compile MicroPython on OS X (using virtual box, vagrant, git) I get this error :

Code: Select all

Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
CC ets_alt_task.c
In file included from ets_alt_task.c:5:0:
/home/vagrant/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/esp_sdk_ver.h:1:1: error: expected identifier or '(' before '-' token
 -e #undef ESP_SDK_VERSION
 ^
/home/vagrant/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/esp_sdk_ver.h:1:4: error: stray '#' in program
 -e #undef ESP_SDK_VERSION
    ^
make: *** [build/ets_alt_task.o] Error 1
vagrant@vagrant-ubuntu-trusty-64:~/micropython/esp8266$ 
Can someone help me?
Thanks.

Re: MicroPython Compilation Error

Posted: Sat Mar 12, 2016 3:25 pm
by Turbinenreiter
gcc version?

Re: MicroPython Compilation Error

Posted: Sat Mar 12, 2016 3:31 pm
by Scorpi0
gcc version is 4.8.4

Re: MicroPython Compilation Error

Posted: Sat Mar 12, 2016 5:24 pm
by mad474
Scorpi0 wrote:Can someone help me?
There were recent changes in the toolchain. Please rebuild and keep an eye on that.

Dirty solution: Edit ~/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/esp_sdk_ver.h

Code: Select all

- -e #undef ESP_SDK_VERSION
+ #undef ESP_SDK_VERSION

Re: MicroPython Compilation Error

Posted: Sat Mar 12, 2016 5:58 pm
by Scorpi0
how do you change it using the terminal?

Re: MicroPython Compilation Error

Posted: Sat Mar 12, 2016 10:37 pm
by mad474
Sorry if I wasn't clear. You used esp-open-sdk to build the toolchain, didn't you? So best thing you can do is to rebuild the toolchain according to https://github.com/pfalcon/esp-open-sdk#pulling-updates. Compiling MicroPython should work after that.

The dirty (and therefore not recommended) solution is to edit the above mentioned file in above mentioned manner on your host by using a file editor of your choice (and then (try to) compile MicroPython).

Re: MicroPython Compilation Error

Posted: Sun Mar 13, 2016 3:41 am
by slzatz
Same problem on Ubuntu 15.10 and everything is current. Making that change in ~/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/esp_sdk_ver.h did allow it to compile although when I flashed the esp8266 i get to the REPL and it freezes with the following -- not sure if it's related to changing esp_sdk_ver.h or completely unrelated:

Code: Select all

lbl▒▒l▒could not find module 'boot'

>>>
MicroPython v1.6-214-ge5c39a3 on 2016-03-12; ESP module with ESP8266
Type "help()" for more information.
>>> #4 ets_task(40100470, 2, 3fff8a04, 16)
task prio out of range: 2
task prio out of range: 2

Re: MicroPython Compilation Error

Posted: Sun Mar 13, 2016 3:46 am
by slzatz
A little more info -- now getting the below. Understanding that it is very early in the release of the firmware, if it's better just to sit tight and wait a bit, happy to do that. Posting if it is useful to anyone.

Code: Select all

lbl▒▒l▒could not find module 'boot'

>>>
MicroPython v1.6-214-ge5c39a3 on 2016-03-12; ESP module with ESP8266
Type "help()" for more information.
>>> #4 ets_task(40100470, 2, 3fff8a04, 16)
task prio out of range: 2
ets_post: task 32 queue full

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 30348, room 16
tail 12
chksum 0xfd
ho 0 tail 12 room 4
load 0x3ffe8000, len 924, room 12
tail 0
chksum 0x7e
load 0x3ffe83a0, len 26196, room 8
tail 12
chksum 0xe8
csum 0xe8
l▒▒|▒▒rrnb▒▒l
▒
▒b▒l

Re: MicroPython Compilation Error

Posted: Sun Mar 13, 2016 8:58 am
by mad474
slzatz wrote: very early in the release of the firmware
Off-topic: I wouldn't expect the present MicroPython/ESP8266 Github publications to be functioning software releases. The developers are doing their work "in public" (due to achieved KS stretch goal). What has been "released" is functioning ALPHA stage firmware as an isolated application with PoC character which certain KS backers have received by mail.

On-topic: I can confirm that the latest GitHub commit for MicroPython/ESP8266 leads to the aforementioned suboptimal result ;) Alas, we might have to wait a week for any substantial changes because of No. 5 in https://www.kickstarter.com/projects/21 ... ts/1508562 (I wish the guys a nice holiday!).

Re: MicroPython Compilation Error

Posted: Sun Mar 13, 2016 3:33 pm
by slzatz
As per #1895, Stefan Wendler's solution worked for me:

in "esp8266/esp_mphal.h" change:

#define UART_TASK_ID 0

to

#define UART_TASK_ID 1