Skip to content

failed to compile with ESP-IDF #13

@NoeelMoeskops

Description

@NoeelMoeskops

Hi,

I'm having some trouble getting this to work with an ESP32 (w/ ESP-IDF 4.1). There seems to be all kinds of missing headers and deprecated function calls. After modifying the source code I got some part to compile, but now I'm stuck on a number of problems, and I'm not sure if I'm doing something wrong.
Like:

  • implicit declaration of function xSemaphoreCreateCountingStatic
  • error: 'errno' undeclared (could be easily fixed with #include "errno.h")
  • #include "Atomic.h" not found
  • #include "FreeRTOS.h" instead of #include "freertos/FreeRTOS.h"
  • taskENTER_CRITICAL(); missing mux argument.
  • int sched_get_priority_max( int policy ); not implemented by ESP-IDF while shed.h is disabled in FreeRTOS_POSIX_portable.h
  • Pthread types header from FreeRTOS_POSIX is read instead of ESP-IDF while the FreeRTOS-POSIX pthread header is disabled in FreeRTOS_POSIX_portable.h causing failed to find declarations.
  • There are some more, but I can't remember them right now.

I might have done something horribly wrong and that it is all my fault, but the issues just seem to keep piling up and I thought you guys might have a better idea what is going on. My CMakeLists.txt looks like this:

idf_component_register(
        SRCS
        "FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_pthread.c"
        "FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_semaphore.c"
        "FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_clock.c"
        "FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_timer.c"
        "FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_utils.c"
        "FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_mqueue.c"
        "FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_pthread_barrier.c"
        "FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_sched.c"
        "FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_unistd.c"
        "FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_pthread_mutex.c"
        "FreeRTOS-Plus-POSIX/source/FreeRTOS_POSIX_pthread_cond.c"

        INCLUDE_DIRS
        "include/FreeRTOS_POSIX"

        PRIV_INCLUDE_DIRS
        "FreeRTOS-Plus-POSIX/include"
        "FreeRTOS-Plus-POSIX/include/portable"
        "FreeRTOS-Plus-POSIX/include/portable/espressif/esp32_devkitc_esp_wrover_kit"
        "include"
        "include/private"
        "/home/noeel/esp/esp-idf-v4.1/components/freertos/include/freertos"

        PRIV_REQUIRES pthread newlib
)

unmodified source code build log looks like this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions