espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.25k stars 7.19k forks source link

ESP-IDF HID Examples osal_freertos.h cant include "FreeRTOS.h" (IDFGH-11225) #12391

Closed OrhanYigitDurmaz closed 10 months ago

OrhanYigitDurmaz commented 10 months ago

Answers checklist.

General issue report

The HID Example for esp32s3 has the TinyUSB for it, but the bare one, not the Espressif's port. So I added it by simply adding espressif/tinyusb: "^0.15.0~3" to the idf_component.yml . This fixed the compiling problem and the #include "tinyusb.h" error. But now tinyusb.h has a include error on it. So i go to tinyusb.h, and i see cant include tusb because its dependency FreeRTOS.h is not found. I go more, and find that its in the osal_freertos.h file it cant include four files:

#include TU_INCLUDE_PATH(CFG_TUSB_OS_INC_PATH,FreeRTOS.h)
#include TU_INCLUDE_PATH(CFG_TUSB_OS_INC_PATH,semphr.h)
#include TU_INCLUDE_PATH(CFG_TUSB_OS_INC_PATH,queue.h)
#include TU_INCLUDE_PATH(CFG_TUSB_OS_INC_PATH,task.h)

it only says: "cannot open source file" and i fix it only adding the freertos folder on front of it like this:

#include TU_INCLUDE_PATH(CFG_TUSB_OS_INC_PATH,freertos/FreeRTOS.h)
#include TU_INCLUDE_PATH(CFG_TUSB_OS_INC_PATH,freertos/semphr.h)
#include TU_INCLUDE_PATH(CFG_TUSB_OS_INC_PATH,freertos/queue.h)
#include TU_INCLUDE_PATH(CFG_TUSB_OS_INC_PATH,freertos/task.h)

so a pull request to add these lines to the osal_freertos.h file and the tinyusb dependency to the idf_component.yml are needed.

OrhanYigitDurmaz commented 10 months ago

Using powershell with VSCode IDE and ESP-IDF v5.1.1

also cant find CFG_TUSB_OS_INC_PATH with control key and left click on IDE

adding "freertos/" to the task.h makes it to cant find the "pdMS_TO_TICKS" function in "projdefs.h"

image

tore-espressif commented 10 months ago

Hi @OrhanYigitDurmaz The tusb_hid example is pulling esp_tinyusb from ESP registry (this dependency is defined in main/idf_component.yml). It contains the 'bare' TinyUSB + some configuration specific to ESP chips. The build works OK for me, without any changes.

Could you please share your output of your build command? and content of dependencies.lock file, that should be created in root of the examples after successful build? Thanks

OrhanYigitDurmaz commented 10 months ago

Hi @OrhanYigitDurmaz The tusb_hid example is pulling esp_tinyusb from ESP registry (this dependency is defined in main/idf_component.yml). It contains the 'bare' TinyUSB + some configuration specific to ESP chips. The build works OK for me, without any changes.

Could you please share your output of your build command? and content of dependencies.lock file, that should be created in root of the examples after successful build? Thanks

Sorry for the inconvenience, without the changes the build also works ok for me. The IntelliSense thinks it doesnt exist.

tore-espressif commented 10 months ago

So can we close this issue?

OrhanYigitDurmaz commented 10 months ago

So can we close this issue?

Yes, thanks