Skip to content
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

atomic patch not working for esp32 #251

Open
ernie-thi opened this issue Aug 24, 2024 · 13 comments
Open

atomic patch not working for esp32 #251

ernie-thi opened this issue Aug 24, 2024 · 13 comments

Comments

@ernie-thi
Copy link

ernie-thi commented Aug 24, 2024

  • Hardware description: esp32
  • RTOS: FreeRTOS
  • Installation type: espidf, component
  • Version or commit hash: humble

Steps to reproduce the issue

Clone this repo in components folder, then as always:

idf.py set-target esp32
idf.py build 

Actual behavior

build fails:

/home/raphael/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/newlib/libnewlib.a(stdatomic.c.obj): in function `__atomic_exchange_8':
/home/raphael/esp/v5.3/esp-idf/components/newlib/stdatomic.c:77: multiple definition of `__atomic_exchange_8'; /home/raphael/idf_components/micro_ros_espidf_component/libmicroros.a(librcutils-atomic_64bits.c.obj):atomic_64bits.c:(.text.__atomic_exchange_8+0x0): first defined here
/home/raphael/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/newlib/libnewlib.a(stdatomic.c.obj): in function `__atomic_fetch_add_8':
/home/raphael/esp/v5.3/esp-idf/components/newlib/stdatomic.c:77: multiple definition of `__atomic_fetch_add_8'; /home/raphael/idf_components/micro_ros_espidf_component/libmicroros.a(librcutils-atomic_64bits.c.obj):atomic_64bits.c:(.text.__atomic_fetch_add_8+0x0): first defined here
/home/raphael/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/newlib/libnewlib.a(stdatomic.c.obj): in function `__atomic_load_8':
/home/raphael/esp/v5.3/esp-idf/components/newlib/stdatomic.c:77: multiple definition of `__atomic_load_8'; /home/raphael/idf_components/micro_ros_espidf_component/libmicroros.a(librcutils-atomic_64bits.c.obj):atomic_64bits.c:(.text.__atomic_load_8+0x0): first defined here
/home/raphael/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/newlib/libnewlib.a(stdatomic.c.obj): in function `__atomic_store_8':
/home/raphael/esp/v5.3/esp-idf/components/newlib/stdatomic.c:77: multiple definition of `__atomic_store_8'; /home/raphael/idf_components/micro_ros_espidf_component/libmicroros.a(librcutils-atomic_64bits.c.obj):atomic_64bits.c:(.text.__atomic_store_8+0x0): first defined here
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the

Additional information

By modifying the file libmicroros.mk i was able to make it work:
in line 110 i added esp32 as target too. So the full line looks like this then:
ifeq ($(IDF_TARGET),$(filter $(IDF_TARGET), esp32 esp32s2 esp32c3))
However, i`m not experienced enough to know whether this has any side effects and is a valid change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@ernie-thi and others