Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

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

    Scheduled Pinned Locked Moved Firmware
    wipyesp32bug
    13 Posts 3 Posters 3.5k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I Offline
      Innocenzo
      last edited by

      Hi to everyone,

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

      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?

      Thx

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jmarcelino @Innocenzo
        last edited by jmarcelino

        @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)

        I 1 Reply Last reply Reply Quote 1
        • I Offline
          Innocenzo @jmarcelino
          last edited by Innocenzo

          @jmarcelino Thanks a lot.

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

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jmarcelino @Innocenzo
            last edited by

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

            I 1 Reply Last reply Reply Quote 1
            • I Offline
              Innocenzo @jmarcelino
              last edited by

              @jmarcelino This is a good news :D

              Anyway the error persist also using this repository.

              J 1 Reply Last reply Reply Quote 0
              • J Offline
                jmarcelino @Innocenzo
                last edited by

                @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

                I 1 Reply Last reply Reply Quote 1
                • I Offline
                  Innocenzo @jmarcelino
                  last edited by Innocenzo

                  @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.

                  J 1 Reply Last reply Reply Quote 0
                  • J Offline
                    jmarcelino @Innocenzo
                    last edited by

                    @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.

                    1 Reply Last reply Reply Quote 0
                    • salvoaerodevS Offline
                      salvoaerodev
                      last edited by

                      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.

                      I 1 Reply Last reply Reply Quote 1
                      • salvoaerodevS Offline
                        salvoaerodev
                        last edited by salvoaerodev

                        The function to add is

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

                        in the hello_world_main.c

                        1 Reply Last reply Reply Quote 1
                        • I Offline
                          Innocenzo @salvoaerodev
                          last edited by

                          @salvoaerodev well done.

                          J 1 Reply Last reply Reply Quote 0
                          • J Offline
                            jmarcelino @Innocenzo
                            last edited by

                            @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:

                            • works with the Pycom boards
                            • is much more up-to-date
                            • matches the ESP-IDF documentation at http://esp-idf.readthedocs.io/en/latest/
                            • Gives you support via the official esp32.com forums

                            Is there a reason I'm missing?

                            I 1 Reply Last reply Reply Quote 1
                            • I Offline
                              Innocenzo @jmarcelino
                              last edited by Innocenzo

                              @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).

                              1 Reply Last reply Reply Quote 0

                              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                              With your input, this post could be even better 💗

                              Register Login
                              • 1 / 1
                              • First post
                                Last post

                              Pycom on Twitter

                              Pycom