FreeRTOS / Lab-Project-FreeRTOS-POSIX

This repository contains FreeRTOS+POSIX source code, which could be consumed as a submodule.
MIT License
95 stars 60 forks source link

failed to compile with ESP-IDF #13

Closed NoeelMoeskops closed 2 years ago

NoeelMoeskops commented 3 years ago

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:

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

RichardBarry commented 3 years ago

Hi - grateful if you can post this to the support forum so we can work through the issues - then come back here if updates need to be made. Probably the "libraries" category would be most appropriate: https://forums.freertos.org/c/libraries/6

NoeelMoeskops commented 3 years ago

I posted it on the forum. We'll see how it goes.

NoeelMoeskops commented 3 years ago

@lundinc2 has made some significant progress in modifying FreeRTOS-POSIX and ESP-IDF to make it compile and run. See his changes to FreeRTOS-POSIX here and the FreeRTOS forum for more information. It is mostly backporting because ESP-IDF uses an older version of FreeRTOS that does not support atomic.h. I'm wondering if these changes could be made available upstream?

lundinc2 commented 3 years ago

Hi @NoeelMoeskops I will look into getting these changes into this repo (Or atleast changes that make it easier to port to IDF).

dan4thewin commented 2 years ago

Due to the age of this, I'll close this issue. If there's still a need, please open a new one. Thank you.