New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api services remote_transmitter compile error esp32c3 #2 #3564
Comments
Similar issue but I got a bit more in the log
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
bug still present |
I confirm this is still an issue with ESP32C3, in this case using Arduino idf (haven't tried with esp-idf).
It only happens when enabling services:, removing that part allows to compile correctly. |
@agners Please help us out, this issue is related to what you saw here esphome/esphome#2035 (comment). The linker gets confused by the different types and gives an error when enabling api user services. The error goes away by changing int32_t to long (esphome/esphome@dev...CarlosGS:esphome:patch-48), but the API stops working. In general, I don't understand this part well enough to make a proper PR. Maybe it is possible to re-define the int32_t earlier, or maybe it is something else. Hoping you can have a go at it. Thanks! :) |
Can't you just define it using
Honestly, I am also not sure as to why RISC-V defines uint32_t differently. |
Hm, that would essentially revert my change 🤔 Yeah, not sure 😰 |
Thanks! No worries, I was just hoping it'd be something more evident 😄 Another issue caused by this: #3970 For the api services, I've tried just swapping all Thanks for having a look. Can't do much more at the moment either, but it's good to keep an eye on that annoying change. |
Well, I guess it is a good thing in the end, as it matches now and it seems to be what upstream GCC is doing. But yeah, the change is annoying at first 😅
I mean it didn't compile before, so "stops working" sounds weird to me? |
Good point! Well the linker error mentioned in this thread only appears when adding I meant when changing |
here's my fix:
file at .esphome/build/fingerprint/fix.h
I got the idea from seams esp-idf assumes int is int long for RISC-V/esp32-3c. Maybe PlatformIO can use this fix too. I try to make a pr when I figure out how to make this automatic. |
`
thank you very much for this hotfix, got my stuff working now, after several headaches ;) @esp Core developers: Is there any chance you can "really fix" this datatype interpretation issue? |
I can also confirm the hotfix works |
Here's the updated patch, after the .esphome build folder was moved in esphome/esphome#5374
esphome:
name: theName
platformio_options:
board_build.extra_flags:
- "-include \"src/fix.h\""
includes:
- fix.h This way the fix.h file is automatically copied into the src/ folder within the platformio build directory. |
Thank you! This worked for me as well with a ESP-C3-Zero board. |
Not sure when or how, but this seems to be already fixed 🎉 |
The problem
Getting undefined reference when using lambda
Seems that stale bot is closing a lot of issues in this repo that should not be closed - I've come across this a lot in this repo., this time, came here from google, with same problem.
original issue: #3201
one thing i'm noticing is that i use esp32-c3 too, in this case, with esp-idf however.
Which version of ESPHome has the issue?
ESPHome version 2022.8.3 compiled on Sep 7 2022, 22:10:13
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
2022.8.7
What platform are you using?
ESP-IDF
Board
ESP-C3-12F custom hardware
Component causing the issue
api service lambda
Example YAML snippet
Anything in the logs that might be useful for us?
INFO Reading configuration /config/esphome/espinfra1.yaml... INFO Generating C++ source... INFO Compiling app... Processing espinfra1 (board: esp32-c3-devkitm-1; framework: espidf; platform: platformio/espressif32 @ 3.5.0) -------------------------------------------------------------------------------- HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash - framework-espidf @ 3.40302.0 (4.3.2) - tool-cmake @ 3.16.4 - tool-ninja @ 1.7.1 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch2 - toolchain-xtensa-esp32s2 @ 8.4.0+2021r2-patch2 Reading CMake configuration... LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf No dependencies Compiling /data/espinfra1/.pioenvs/espinfra1/src/main.o Linking /data/espinfra1/.pioenvs/espinfra1/firmware.elf /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/espinfra1/.pioenvs/espinfra1/src/main.o: in function `esphome::api::ListEntitiesServicesArgument::ListEntitiesServicesArgument()': /config/esphome/.esphome/build/espinfra1/src/esphome/components/api/api_pb2.h:786: undefined reference to `esphome::api::enums::ServiceArgType esphome::api::to_service_arg_type<std::vector<long, std::allocator<long> > >()' collect2: error: ld returned 1 exit status *** [/data/espinfra1/.pioenvs/espinfra1/firmware.elf] Error 1 ========================= [FAILED] Took 21.36 seconds =========================
The text was updated successfully, but these errors were encountered: