Closed cvanelteren closed 3 years ago
Hi @cvanelteren, thanks for reporting this. I only have a feather with an ATmega32u4 to play around with, so I haven't tested esp32 yet. But if you could give me your platformio.ini file, I could try to reproduce the build issue that you're seeing.
Also, thanks for mentioning the panicoverride. I also had to add it, but forgot to mention it in the Readme.
No worries! The config is attached.
I was messing around with more modern cpp, I have both test with and without setting them. Both give the same error. I read somewhere that nim uses 64 bit by default. The error message seems to relate to some disagreement on types, not sure if that is related or a cause.
I hardcoded the cpu type to avr
in nim-platformio. When I change avr
to esp
then compilation works with the platformio config that you provided.
Now I just need to figure out a way to make this configurable...
Thanks for your help @cvanelteren. Your PRs in nim-platformio
have fixed the issue.
Hi,
Thanks for this project! Nim seems to be very interesting for micro-controller applications. I am trying to get the tutorial running, but I am running in to issues getting it up and running on an esp32 (perhaps not supported). Perhaps you could point me in the right direction in fixing them, any help is greatly appreciated. Best wishes, C
output
``` *** [.pio/build/ttgo-lora32-v2/src/nimcache/stdlib_system.nim.cpp.o] Error 1 In file included from src/nimcache/@mmain.nim.cpp:4:0: .pio/libdeps/ttgo-lora32-v2/nimbase/nimbase.h:493:131: error: size of array 'Nim_and_C_compiler_disagree_on_target_architecture' is negative typedef int Nim_and_C_compiler_disagree_on_target_architecture[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1]; ^ .pio/libdeps/ttgo-lora32-v2/FastLED/src/platforms/esp/32/clockless_rmt_esp32.cpp: In static member function 'static void ESP32RMTController::interruptHandler(void*)': .pio/libdeps/ttgo-lora32-v2/FastLED/src/platforms/esp/32/clockless_rmt_esp32.cpp:318:10: warning: unused variable 'stuff_to_do' [-Wunused-variable] bool stuff_to_do = false; ^ src/nimcache/@mmain.nim.cpp:21:53: error: conflicting declaration of 'void setup()' with 'C' linkage extern "C" N_LIB_PRIVATE N_NIMCALL(void, setup)(void); ^ In file included from src/nimcache/@mmain.nim.cpp:5:0: /home/casper/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:118:6: note: previous declaration with 'C++' linkage void setup(void); ^ src/nimcache/@mmain.nim.cpp:23:52: error: conflicting declaration of 'void loop()' with 'C' linkage extern "C" N_LIB_PRIVATE N_NIMCALL(void, loop)(void); ^ In file included from src/nimcache/@mmain.nim.cpp:5:0: /home/casper/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:119:6: note: previous declaration with 'C++' linkage void loop(void) ```main.nim
``` import pkg/nim-arduino/arduino #import arduino setup: pinMode(LED_BUILTIN, OUTPUT) loop: digitalWrite(LED_BUILTIN, HIGH) delay(1000) digitalWrite(LED_BUILTIN, LOW) delay(1000) ```edit: I also had to add panic override as such
since it was complaining that this file didn't exist