These are chat archives for esp8266/Arduino

5th
Apr 2016
Dmitry Kireev
@kireevco
Apr 05 2016 00:21
I need someone to test gcc 5.3 built toolchain https://bintray.com/kireevco/generic/xtensa-lx106-elf/5.3.0/view
Ivan Grokhotkov
@igrr
Apr 05 2016 00:34
@kireevco i tried OS X version, and got a bunch of errors which look like this:
Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: /Users/igrokhotkov/projects/esp8266/arduino.cc/master/build/macosx/work/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/tools/sdk/lib/libpp.a(pm_for_bcn_only_mode.o): compiled for a little endian system and target is big endian
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: failed to merge target specific data of file /Users/igrokhotkov/projects/esp8266/arduino.cc/master/build/macosx/work/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/tools/sdk/lib/libpp.a(pm_for_bcn_only_mode.o)
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: /Users/igrokhotkov/projects/esp8266/arduino.cc/master/build/macosx/work/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/tools/sdk/lib/libpp.a(pp.o): compiled for a little endian system and target is big endian
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: failed to merge target specific data of file /Users/igrokhotkov/projects/esp8266/arduino.cc/master/build/macosx/work/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/tools/sdk/lib/libpp.a(pp.o)
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: /Users/igrokhotkov/projects/esp8266/arduino.cc/master/build/macosx/work/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/tools/sdk/lib/libpp.a(rate_control.o): compiled for a little endian system and target is big endian
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: failed to merge target specific data of file /Users/igrokhotkov/projects/esp8266/arduino.cc/master/build/macosx/work/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/tools/sdk/lib/libpp.a(rate_control.o)
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: /Users/igrokhotkov/projects/esp8266/arduino.cc/master/build/macosx/work/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/tools/sdk/lib/libpp.a(trc.o): compiled for a little endian system and target is big endian
and target is big endian looks strange — our lx106 is little-endian
Dmitry Kireev
@kireevco
Apr 05 2016 00:35
@igrr hmmm... I've seen this before...
ok, thanks
Dmitry Kireev
@kireevco
Apr 05 2016 00:54
@igrr how do you test? I will make changes, build and test it
Dmitry Kireev
@kireevco
Apr 05 2016 00:59
(and did you notice how small is the toolchain? :))
refresh the page if ssl fails
tzapu
@tzapu
Apr 05 2016 08:04
guys, are you powering led s (smd) directly on the esp’s 3.3v or through a resistor?
Me No Dev
@me-no-dev
Apr 05 2016 08:29
220/330/1K resistor
depending on the led's forward voltage and current requirements
need to take into account what the ESP can source/drain as well
tzapu
@tzapu
Apr 05 2016 08:33
thanks @me-no-dev
Me No Dev
@me-no-dev
Apr 05 2016 08:37
:) you're welcome @tzapu
sticilface
@sticilface
Apr 05 2016 09:42
@igrr thanks for the snappy fix. that works a treat.
Ivan Grokhotkov
@igrr
Apr 05 2016 10:14
@sticilface cool, i haven't tested yet if i broke something on the SSL side. will likely test today and merge.
Ivan Grokhotkov
@igrr
Apr 05 2016 10:26
@kireevco I have tried the new link but i'm seeing the same issue.
i test by replacing the toolchain folder in the Arduino IDE installation with the contents from your archive, and building an empty sketch
but i can get the same result from the command line:
./xtensa-lx106-elf-gcc ~/e/esp_iot_sdk_v1.5.2/lib/libmain.a -o /tmp/libmain.a -nostdlib -u call_user_start
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(vector.o): compiled for a little endian system and target is big endian
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: failed to merge target specific data of file /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(vector.o)
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(app_main.o): compiled for a little endian system and target is big endian
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: failed to merge target specific data of file /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(app_main.o)
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(ets_timer.o): compiled for a little endian system and target is big endian
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: failed to merge target specific data of file /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(ets_timer.o)
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(mem_manager.o): compiled for a little endian system and target is big endian
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: failed to merge target specific data of file /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(mem_manager.o)
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(spi_flash.o): compiled for a little endian system and target is big endian
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: failed to merge target specific data of file /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(spi_flash.o)
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(user_interface.o): compiled for a little endian system and target is big endian
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: failed to merge target specific data of file /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(user_interface.o)
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(eagle_lib.o): compiled for a little endian system and target is big endian
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: failed to merge target specific data of file /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(eagle_lib.o)
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: /Users/igrokhotkov/e/esp_iot_sdk_v1.5.2/lib/libmain.a(eagle_lwip_if.o): compiled for a little endian system and target is big endian
/Users/igrokhotkov/projects/esp8266/xtensa-lx106-elf-5.3/bin/../lib/gcc/xtensa-lx106-elf/5.3.0/../../../../xtensa-lx106-elf/bin/ld: failed to merge target specific data of f
~/e/esp_iot_sdk_v1.5.2 is the IOT SDK 1.5.2, as the name implies...
Lars Englund
@larsenglund
Apr 05 2016 10:42
Hmm, I have a strange power problem, I'm deep sleeping my esp and was seeing 0.1mA when in deep sleep but now it's suddenly jumped to 2.4mA when deep sleeping o_O
haven't changed the hardware and the software is quite minimal..
The harware is just a bare esp12f with 3x10k pull resistors
void blinkLed() {
  digitalWrite(2, LOW);   // Turn the LED on (Note that LOW is the voltage level
  delay(500);                      // Wait for a second
  digitalWrite(2, HIGH);  // Turn the LED off by making the voltage HIGH
  delay(500);                      // Wait for two seconds (to demonstrate the active low LED)
}

void setup() {
  Serial.begin(DEBUG_BAUDRATE);
  Serial.println("setup()");

  WiFi.disconnect(); 
  WiFi.mode(WIFI_OFF);
  WiFi.forceSleepBegin();
  delay(1);

  pinMode(2, OUTPUT);     // Initialize the LED_BUILTIN pin as an output

  blinkLed();
}

void loop() {
  Serial.println("delay");
  delay(4000);

  Serial.println("sleep 1");
  Serial.flush();

  blinkLed();blinkLed();
  ESP.deepSleep(5*1000*1000, WAKE_RF_DISABLED);//WAKE_RF_DEFAULT);//, WAKE_RF_DISABLED);
}
And here I was being unhappy with the 0.1mA I was seeing (due to the pullups i suppose?)
But 2.4mA is just too much!
Lars Englund
@larsenglund
Apr 05 2016 10:47
Any thoughts on what I might have fubared?
Lars Englund
@larsenglund
Apr 05 2016 10:59
Actually, on more careful inspection my esp only has a 10k pullup on ch_pd and a 10k pulldown on gpio2... I thought pullup on gpio0 and pulldown on gpio15 was required..
(the board I'm using is the top board of a Witty from which I desoldered the ams1117 regulator, LDR and RGB LED)
Dmitry Kireev
@kireevco
Apr 05 2016 15:01
@igrr alright thanks. Crap.
Dmitry Kireev
@kireevco
Apr 05 2016 16:23
@igrr this is very strange. on my machine it works fine, I can link against libmain.a... Are you sure environment is not passing something strange?
Keith Andrew Hill
@vic10us
Apr 05 2016 16:26
How are callbacks done for MQTT? In nodemcu this seems to be a lot easier.
seems like timers in general are much more difficult in C than in NodeMCU too...
(lua)
andig
@andig
Apr 05 2016 16:29
@igrr is it possible to enable the lwip debug output with the gcc-compiled version? The bug above has been fixed by @me-no-dev and stability has greatly improved but we're still seeing crashes that seem to happen after the _error callback has finished.
Dmitry Kireev
@kireevco
Apr 05 2016 16:29
ah.got it, now wrong
@igrr ok,so... try it this way: get https://bintray.com/artifact/download/kireevco/generic/esp-alt-sdk-v1.5.0.262-macos-x86_64.zip and run ./xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc esp_iot_sdk_v1.5.0/lib/libmain.a -o /tmp/libmain.a -nostdlib -u call_user_start (relative path to the library)
or just try to use relative path to ~/e/esp_iot_sdk_v1.5.2/lib/libmain.a
Dmitry Kireev
@kireevco
Apr 05 2016 16:53
@igrr Nevermind... Somerhing is wrong.
Ivan Grokhotkov
@igrr
Apr 05 2016 17:23
@kireevco relative path doesn't seem to make a difference
(getting the same error)
Dmitry Kireev
@kireevco
Apr 05 2016 17:23
yeah.. I'm looking into binutils... looks like LD thing