Skip to content

esp32:esp32:esp32 linking fails #1264

@FStefanni

Description

@FStefanni

Bug Report

Current behavior

Hi,

the following sketck, which is the standard blink example slightly modified, fails to link.

#define LED_BUILTIN 11
// the setup function runs once when you press reset or power the board
void setup() {
  Serial.begin(115200);
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  String s = "Hohoho";
  Serial.println(s);
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

These are the results:

  • Compiling for ESP32 Dev board via Arduino IDE: success
  • Compiling for ESP32 Dev board via arduino-cli (arduino-cli compile -v --fqbn esp32:esp32:esp32 Blink.ino): linking fails
  • Compiling for ESP32 WROVER via arduino-cli, (arduino-cli compile -v --fqbn esp32:esp32:esp32wrover Blink.ino): success

So it seems only the esp32:esp32:esp32 board fails with arduino-cli (but it is fine if compiling via IDE).

The output of the linking is something like this:

/home/kappa/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/lib/libesp32.a(cpu_start.o):(.literal.main_task+0x14): undefined reference to `app_main'
/home/kappa/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/lib/libesp32.a(cpu_start.o): In function `main_task':
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/cpu_start.c:545: undefined reference to `app_main'
/tmp/arduino-sketch-48A3503F6DEB4CDDCA880B60FB16D10F/sketch/Blink.ino.cpp.o:(.literal.startup._GLOBAL__sub_I__Z5setupv+0x4): undefined reference to `IPAddress::IPAddress(unsigned char, unsigned char, unsigned char, unsigned char)'
/tmp/arduino-sketch-48A3503F6DEB4CDDCA880B60FB16D10F/sketch/Blink.ino.cpp.o: In function `_GLOBAL__sub_I__Z5setupv':
/home/kappa/.arduino15/packages/esp32/hardware/esp32/1.0.6/cores/esp32/IPAddress.h:94: undefined reference to `IPAddress::IPAddress(unsigned char, unsigned char, unsigned char, unsigned char)'
collect2: error: ld returned 1 exit status

Expected behavior

It should link successfully :)

Environment

  • CLI version (output of arduino-cli version): arduino-cli alpha Version: 0.18.0 Commit: 46c2316 Date: 2021-03-31T09:42:54Z
  • OS and platform: the same results happen on both Linux (Ubuntu 20.04) and Windows 10.

Additional context

I am hot sure if this is a issue of arduino-cli or the ESP32 package, but since it works fine with the IDE, I suppose it is a CLI bug.

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions