MultiGeiger icon indicating copy to clipboard operation
MultiGeiger copied to clipboard

Software Error: Board not supported / multiple definition of `hal_init'

Open norbi919 opened this issue 2 years ago • 7 comments

Hallo,

bekomme beim Kompilieren erst eine Warnung:

hal.cpp: C:\Users\Norbert\Documents\Arduino\libraries\arduino-lmic-master\src\hal\getpinmap_thisboard.cpp: In function 'const Arduino_LMIC::HalPinmap_t* Arduino_LMIC::GetPinmap_ThisBoard()': C:\Users\Norbert\Documents\Arduino\libraries\arduino-lmic-master\src\hal\getpinmap_thisboard.cpp:71:72: note: #pragma message: Board not supported -- use an explicit pinmap #pragma message("Board not supported -- use an explicit pinmap")

später dann ein Exit:

kurz vorm Ende des Compilevorgangs: c:/users/norbert/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Norbert\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.3-RC1/tools/sdk/esp32/lib\libpp.a(hal_mac.o): in function hal_init': (.text.hal_init+0xb4): multiple definition of hal_init'; C:\Users\Norbert\AppData\Local\Temp\arduino_build_964013\libraries\arduino-lmic-master\hal\objs.a(hal.cpp.o):C:\Users\Norbert\Documents\Arduino\libraries\arduino-lmic-master\src\hal/hal.cpp:416: first defined here collect2.exe: error: ld returned 1 exit status

Kompiliere mit der Arduinoapp und den aktuellsten Libraries. Die MCCI LoRaWAN library and die ESP32 base libraries haben da irgendwie ein Problem.

Gibt es evtl. Libversionen die entsprechend zusammen passen?

Grüße, Norbert.

norbi919 avatar Jul 04 '22 07:07 norbi919

Das liegt wohl an der neuesten Espressif32-Arduino-Anpassung. Es gibt zwei Workarounds:

  • entweder auf eine ältere Version der ESP32-Libraries zurückgehen (bei Platformio z.b. in platformio.ini einfügen: platform = [email protected]
  • oder aber den LMIC Library Ordner in das lib/ Verzeichnis des Projektes kopieren und da dann hal_init() überall, wo es vorkommt (ist nur 2x), umbenennen. Ist nicht elegant, aber geht erst mal.

rexfue avatar Jul 07 '22 13:07 rexfue

1 Jahr später... - ist das Problem immer noch nicht richtig gelöst?

ThomasWaldmann avatar Oct 15 '23 19:10 ThomasWaldmann

It IS solved, use

build_flags = -D CFG_eu868=1 -D CFG_sx1276_radio=1 -D ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS=1 -D hal_init=LMICHAL_init <---------------------

in platform.ini.

On 15. Oct 2023, at 21:45, TW @.***> wrote:

1 Jahr später... - ist das Problem immer noch nicht richtig gelöst?

— Reply to this email directly, view it on GitHub https://github.com/ecocurious2/MultiGeiger/issues/461#issuecomment-1763486755, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFSNFB6LJUSGJAF3DDVVNTTX7Q4O3AVCNFSM52SIKCJ2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZWGM2DQNRXGU2Q. You are receiving this because you commented.

rexfue avatar Oct 16 '23 05:10 rexfue

I have that (have copied git-committed platformio-example.ini to local platformio.ini), but as I use the arduino IDE, I guess that is not used?

ThomasWaldmann avatar Oct 16 '23 10:10 ThomasWaldmann

You are right. If you find, how to set precompiler flags in Arduino IDE, then you can try it

On 16. Oct 2023, at 12:22, TW @.***> wrote:

I have that (have copied git-committed platformio-example.ini to local platformio.ini), but as I use the arduino IDE, I guess that is not used?

— Reply to this email directly, view it on GitHub https://github.com/ecocurious2/MultiGeiger/issues/461#issuecomment-1764167960, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFSNFB6J3TMWGYJX4RR5RV3X7UDGZAVCNFSM52SIKCJ2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZWGQYTMNZZGYYA. You are receiving this because you commented.

rexfue avatar Oct 16 '23 10:10 rexfue

Didn't find a way yet. There is no GUI dialogue.

Also tried this script to invoke arduino ide, but the compilation still does not work:

export CFLAGS="-DCFG_eu868=1 -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS=1 -Dhal_init=LMICHAL_init"

/Applications/Arduino\ IDE.app/Contents/MacOS/Arduino\ IDE

ThomasWaldmann avatar Oct 16 '23 12:10 ThomasWaldmann

Hmmm, ich verwende auf dem MAC Visual Studio Code und Platformio für alle ESP32 Anwendungen

On 16. Oct 2023, at 14:05, TW @.***> wrote:

Didn't find a way yet. There is no GUI dialogue.

Also tried this script to invoke arduino ide, but the compilation still does not work:

export CFLAGS="-DCFG_eu868=1 -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS=1 -Dhal_init=LMICHAL_init"

/Applications/Arduino\ IDE.app/Contents/MacOS/Arduino\ IDE — Reply to this email directly, view it on GitHub https://github.com/ecocurious2/MultiGeiger/issues/461#issuecomment-1764330571, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFSNFB627IKCAM3WQRJBJTTX7UPH7AVCNFSM52SIKCJ2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZWGQZTGMBVG4YQ. You are receiving this because you commented.

rexfue avatar Oct 16 '23 15:10 rexfue