[WiPy 2.0] Pycom-esp-idf example error: undifined reference to 'mp_thread_clean'

  • Hi to everyone,

    I try to execute the examples in folder pycom-esp-idf (get-started -> hello world) following this guide:

    After the command (where I do not change any options):

    make menuconfig

    try to execute:

    make all

    but I receive the following error meassage:

    fatal: No names found, cannot describe anything.
    fatal: No names found, cannot describe anything.
    LD hello-world.elf
    /home/aeromechs/pycom-esp-idf/examples/get-started/hello_world/build/freertos/libfreertos.a(tasks.o):(.literal.prvDeleteTCB+0x10): undefined reference to `mp_thread_clean'
    /home/aeromechs/pycom-esp-idf/examples/get-started/hello_world/build/freertos/libfreertos.a(tasks.o): In function `prvDeleteTCB':
    /home/aeromechs/pycom-esp-idf/components/freertos/./tasks.c:4421: undefined reference to `mp_thread_clean'
    collect2: error: ld returned 1 exit status
    /home/aeromechs/pycom-esp-idf/make/project.mk:322: set di istruzioni per l'obiettivo "/home/aeromechs/pycom-esp-idf/examples/get-started/hello_world/build/hello-world.elf" non riuscito
    make: *** [/home/aeromechs/pycom-esp-idf/examples/get-started/hello_world/build/hello-world.elf] Errore 1

    Any suggests?


  • @jmarcelino Because we want preserve the Pycom WiPy firmware ad edit it with some frozen files and custom API C (like SSL and BT that have some problems).

  • @Innocenzo @salvoaerodev
    The function is defined in pycom-micropython-sigfox/esp32/mpthreadport.c

    It's interesting it worked by just copying it over but I still don't see why you'd want to compile your C programs using pycom-esp-idf when the official ESP-IDF repo at https://github.com/espressif/esp-idf:

    Is there a reason I'm missing?

  • @salvoaerodev well done.

  • The function to add is

    /* Missing function */
    void mp_thread_clean (void *tcb) {

    in the hello_world_main.c

  • The Hello World example, included in the pycom-esp-idf misses the TCB cleanup function, just defined in FreeRTOS config file. Add it in the .c file, and recompile it. It should works in this way.

  • @Innocenzo
    Great! Well the "problem" is Pycom-esp-idf expects MicroPython to be present (the mp_ prefix you see in the error). It was forked and adapted for it.

    i can't see any other useful purpose to use it instead of the official ESP-IDF repo.

  • @jmarcelino Ok it works with the new repository!

    But there isn't a way to resolve the problem in the pycom-esp-idf repository?

    EDIT: There is a function in pycom-esp-idf/components/freertos/task.c called portCLEAN_UP_TCB( pxTCB ); that causes the problem. I've deleted it and everything works.

    I don't think that is a good solution.

  • @Innocenzo
    Sounds like you need to point IDF_PATH environment variable to the new ESP-IDF folder.

    export IDF_PATH=/path/to/your/new/esp-idf should do it

  • @jmarcelino This is a good news :D

    Anyway the error persist also using this repository.

  • @Innocenzo
    No changes required! :-) You can use the WiPy as a fully compatible ESP32 device.

  • @jmarcelino Thanks a lot.

    But if I use this repository how many changes I must do in order to use it for my Wipy?

  • @Innocenzo
    The pycom-esp-idf is a special modified version to support the MicroPython build from Pycom.

    If you want to use the C APIs use the official ESP-IDF from https://github.com/espressif/esp-idf (which is also more up to date)

Log in to reply

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.