May be I'm overlooking something very simple, but I can't figure it out.
Want to use a library (DShotRMT.h by DrGlaucous) to implement a DShot protocol on my Arduino ESP32 using the newer RMT backend infrastructure introduced with espidf 5.0.0.
To enable this for the Arduino env, DrGlaucous made an additional library (ESP-RMT-NEO) since Arduino still uses the 4.x version of espidf.
However, I can't get it to work. This is the error message after compiling this piece of code.
#include <DShotRMT.h>
const byte p_FL = 7; //
DShotRMT motorFL(p_FL, RMT_CHANNEL_0);
void setup() {
motorFL.begin(DSHOT300);
}
void loop() {
motorFL.send_dshot_value(48);
}
Can't find driver/rmt_rx.h: No such file or directory
Installed both libs using Sketch->Include library->Add .ZIP library.... all good
Libs are in the right place (arduino->libraries->DShot-rmt and rmtNEO), 'src' directory is in the right place, 'driver' subdirectory is in the right place.
libraries/
└── DShot-rmt/
└── dev, examples, etc
└── src/
└── DShotRMT.cpp
└── DShotRMT.h
└── rmtNEO/
└── .json, .properties, readme, etc
└── src/
└── clk_tree_defs.h
└── driver/
└── rmt_rx.h
└── <other .h files>
And still no success.
What am I doing wrong here?
docdoc
June 19, 2025, 9:21am
2
Idk if this is exactly your case, but read this thread, they seem to have solved the issue:
opened 02:08PM - 03 Dec 24 UTC
closed 02:03AM - 05 Dec 24 UTC
Status: Done
Resolution: Done
### Answers checklist.
- [x] I have read the documentation [ESP-IDF Programming… Guide](https://docs.espressif.com/projects/esp-idf/en/latest/) and the issue is not addressed there.
- [X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- [X] I have searched the issue tracker for a similar issue and not found a similar issue.
### IDF version.
v5.2.2
### Operating System used.
Windows
### How did you build your project?
Command line with CMake
### If you are using Windows, please specify command line type.
PowerShell
### What is the expected behavior?
The cmake can find head file `"driver/rmt_tx.h"`, then make my project successfully.
### What is the actual behavior?
The cmake can't find head file `"driver/rmt_tx.h"`, and throwing an error:
```
In file included from I:/Projects/esp32-s3zhukongyaokongche/fasheduan/main/drivers/ws2812.c:1:
I:/Projects/esp32-s3zhukongyaokongche/fasheduan/main/drivers/ws2812.h:7:10: fatal error: driver/rmt_tx.h: No such file or directory
7 | #include "driver/rmt_tx.h"
| ^~~~~~~~~~~~~~~~~
```
but in the same project on esp32, cmake can find this head file.
### Steps to reproduce.
1. I copy the `drivers/ws2812.c` from other project(esp32), and copy to this project(esp32s3)
2. change CMakeLists.txt to:
```
idf_component_register(SRCS "main.c" "drivers/ws2812.c"
INCLUDE_DIRS "."
#REQUIRES
PRIV_REQUIRES nvs_flash esp_wifi)
```
3. then click:

4. throw this error.
### Build or installation Logs.
```plain
[0/1] Re-running CMake...-- ccache will be used for faster recompilation
-- git rev-parse returned 'fatal: not a git repository (or any of the parent directories): .git'
-- Could not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32s3
-- Project sdkconfig file I:/Projects/esp32-s3zhukongyaokongche/fasheduan/sdkconfig
-- Compiler supported targets: xtensa-esp-elf
-- App "fasheduan" version: 1
-- Adding linker script I:/Projects/esp32-s3zhukongyaokongche/fasheduan/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script I:/Projects/esp32-s3zhukongyaokongche/fasheduan/build/esp-idf/esp_system/ld/sections.ld.in
-- Adding linker script I:/ESP-IDF/v5.2.2/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.ld
-- Adding linker script I:/ESP-IDF/v5.2.2/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.api.ld
-- Adding linker script I:/ESP-IDF/v5.2.2/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.libgcc.ld
-- Adding linker script I:/ESP-IDF/v5.2.2/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.newlib.ld
-- Adding linker script I:/ESP-IDF/v5.2.2/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.version.ld
-- Adding linker script I:/ESP-IDF/v5.2.2/esp-idf/components/soc/esp32s3/ld/esp32s3.peripherals.ld
-- Components: app_trace app_update bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp_adc esp_app_format esp_bootloader_format esp_coex esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_wifi espcoredump esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json log lwip main mbedtls mqtt newlib nvs_flash nvs_sec_provider openthread partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport touch_element ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: I:/ESP-IDF/v5.2.2/esp-idf/components/app_trace I:/ESP-IDF/v5.2.2/esp-idf/components/app_update I:/ESP-IDF/v5.2.2/esp-idf/components/bootloader I:/ESP-IDF/v5.2.2/esp-idf/components/bootloader_support I:/ESP-IDF/v5.2.2/esp-idf/components/bt I:/ESP-IDF/v5.2.2/esp-idf/components/cmock I:/ESP-IDF/v5.2.2/esp-idf/components/console I:/ESP-IDF/v5.2.2/esp-idf/components/cxx I:/ESP-IDF/v5.2.2/esp-idf/components/driver I:/ESP-IDF/v5.2.2/esp-idf/components/efuse I:/ESP-IDF/v5.2.2/esp-idf/components/esp-tls I:/ESP-IDF/v5.2.2/esp-idf/components/esp_adc I:/ESP-IDF/v5.2.2/esp-idf/components/esp_app_format I:/ESP-IDF/v5.2.2/esp-idf/components/esp_bootloader_format I:/ESP-IDF/v5.2.2/esp-idf/components/esp_coex I:/ESP-IDF/v5.2.2/esp-idf/components/esp_common I:/ESP-IDF/v5.2.2/esp-idf/components/esp_eth I:/ESP-IDF/v5.2.2/esp-idf/components/esp_event I:/ESP-IDF/v5.2.2/esp-idf/components/esp_gdbstub I:/ESP-IDF/v5.2.2/esp-idf/components/esp_hid I:/ESP-IDF/v5.2.2/esp-idf/components/esp_http_client I:/ESP-IDF/v5.2.2/esp-idf/components/esp_http_server I:/ESP-IDF/v5.2.2/esp-idf/components/esp_https_ota I:/ESP-IDF/v5.2.2/esp-idf/components/esp_https_server I:/ESP-IDF/v5.2.2/esp-idf/components/esp_hw_support I:/ESP-IDF/v5.2.2/esp-idf/components/esp_lcd I:/ESP-IDF/v5.2.2/esp-idf/components/esp_local_ctrl
I:/ESP-IDF/v5.2.2/esp-idf/components/esp_mm I:/ESP-IDF/v5.2.2/esp-idf/components/esp_netif I:/ESP-IDF/v5.2.2/esp-idf/components/esp_netif_stack I:/ESP-IDF/v5.2.2/esp-idf/components/esp_partition I:/ESP-IDF/v5.2.2/esp-idf/components/esp_phy I:/ESP-IDF/v5.2.2/esp-idf/components/esp_pm I:/ESP-IDF/v5.2.2/esp-idf/components/esp_psram I:/ESP-IDF/v5.2.2/esp-idf/components/esp_ringbuf I:/ESP-IDF/v5.2.2/esp-idf/components/esp_rom I:/ESP-IDF/v5.2.2/esp-idf/components/esp_system I:/ESP-IDF/v5.2.2/esp-idf/components/esp_timer I:/ESP-IDF/v5.2.2/esp-idf/components/esp_wifi I:/ESP-IDF/v5.2.2/esp-idf/components/espcoredump I:/ESP-IDF/v5.2.2/esp-idf/components/esptool_py I:/ESP-IDF/v5.2.2/esp-idf/components/fatfs I:/ESP-IDF/v5.2.2/esp-idf/components/freertos
I:/ESP-IDF/v5.2.2/esp-idf/components/hal I:/ESP-IDF/v5.2.2/esp-idf/components/heap I:/ESP-IDF/v5.2.2/esp-idf/components/http_parser I:/ESP-IDF/v5.2.2/esp-idf/components/idf_test I:/ESP-IDF/v5.2.2/esp-idf/components/ieee802154 I:/ESP-IDF/v5.2.2/esp-idf/components/json I:/ESP-IDF/v5.2.2/esp-idf/components/log I:/ESP-IDF/v5.2.2/esp-idf/components/lwip I:/Projects/esp32-s3zhukongyaokongche/fasheduan/main I:/ESP-IDF/v5.2.2/esp-idf/components/mbedtls I:/ESP-IDF/v5.2.2/esp-idf/components/mqtt I:/ESP-IDF/v5.2.2/esp-idf/components/newlib I:/ESP-IDF/v5.2.2/esp-idf/components/nvs_flash I:/ESP-IDF/v5.2.2/esp-idf/components/nvs_sec_provider I:/ESP-IDF/v5.2.2/esp-idf/components/openthread I:/ESP-IDF/v5.2.2/esp-idf/components/partition_table I:/ESP-IDF/v5.2.2/esp-idf/components/perfmon I:/ESP-IDF/v5.2.2/esp-idf/components/protobuf-c I:/ESP-IDF/v5.2.2/esp-idf/components/protocomm I:/ESP-IDF/v5.2.2/esp-idf/components/pthread I:/ESP-IDF/v5.2.2/esp-idf/components/sdmmc I:/ESP-IDF/v5.2.2/esp-idf/components/soc I:/ESP-IDF/v5.2.2/esp-idf/components/spi_flash I:/ESP-IDF/v5.2.2/esp-idf/components/spiffs I:/ESP-IDF/v5.2.2/esp-idf/components/tcp_transport I:/ESP-IDF/v5.2.2/esp-idf/components/touch_element I:/ESP-IDF/v5.2.2/esp-idf/components/ulp I:/ESP-IDF/v5.2.2/esp-idf/components/unity I:/ESP-IDF/v5.2.2/esp-idf/components/usb I:/ESP-IDF/v5.2.2/esp-idf/components/vfs I:/ESP-IDF/v5.2.2/esp-idf/components/wear_levelling I:/ESP-IDF/v5.2.2/esp-idf/components/wifi_provisioning I:/ESP-IDF/v5.2.2/esp-idf/components/wpa_supplicant I:/ESP-IDF/v5.2.2/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: I:/Projects/esp32-s3zhukongyaokongche/fasheduan/build
[1/9] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/drivers/ws2812.c.obj
FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/drivers/ws2812.c.obj
ccache I:\ESP-IDF\.espressif\tools\xtensa-esp-elf\esp-13.2.0_20230928\xtensa-esp-elf\bin\xtensa-esp32s3-elf-gcc.exe -DESP_PLATFORM -DIDF_VER=\"v5.2.2-1-gbdcfabac2d-dirty\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -II:/Projects/esp32-s3zhukongyaokongche/fasheduan/build/config -II:/Projects/esp32-s3zhukongyaokongche/fasheduan/main -II:/ESP-IDF/v5.2.2/esp-idf/components/newlib/platform_include -II:/ESP-IDF/v5.2.2/esp-idf/components/freertos/config/include -II:/ESP-IDF/v5.2.2/esp-idf/components/freertos/config/include/freertos -II:/ESP-IDF/v5.2.2/esp-idf/components/freertos/config/xtensa/include -II:/ESP-IDF/v5.2.2/esp-idf/components/freertos/FreeRTOS-Kernel/include -II:/ESP-IDF/v5.2.2/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -II:/ESP-IDF/v5.2.2/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos -II:/ESP-IDF/v5.2.2/esp-idf/components/freertos/esp_additions/include -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_hw_support/include -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_hw_support/include/soc -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_hw_support/include/soc/esp32s3 -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_hw_support/port/esp32s3/. -II:/ESP-IDF/v5.2.2/esp-idf/components/heap/include -II:/ESP-IDF/v5.2.2/esp-idf/components/log/include -II:/ESP-IDF/v5.2.2/esp-idf/components/soc/include -II:/ESP-IDF/v5.2.2/esp-idf/components/soc/esp32s3 -II:/ESP-IDF/v5.2.2/esp-idf/components/soc/esp32s3/include -II:/ESP-IDF/v5.2.2/esp-idf/components/hal/platform_port/include -II:/ESP-IDF/v5.2.2/esp-idf/components/hal/esp32s3/include -II:/ESP-IDF/v5.2.2/esp-idf/components/hal/include -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_rom/include -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_rom/include/esp32s3 -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_rom/esp32s3 -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_common/include -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_system/include
-II:/ESP-IDF/v5.2.2/esp-idf/components/esp_system/port/soc -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_system/port/include/private -II:/ESP-IDF/v5.2.2/esp-idf/components/xtensa/esp32s3/include -II:/ESP-IDF/v5.2.2/esp-idf/components/xtensa/include -II:/ESP-IDF/v5.2.2/esp-idf/components/xtensa/deprecated_include -II:/ESP-IDF/v5.2.2/esp-idf/components/lwip/include -II:/ESP-IDF/v5.2.2/esp-idf/components/lwip/include/apps -II:/ESP-IDF/v5.2.2/esp-idf/components/lwip/include/apps/sntp -II:/ESP-IDF/v5.2.2/esp-idf/components/lwip/lwip/src/include -II:/ESP-IDF/v5.2.2/esp-idf/components/lwip/port/include -II:/ESP-IDF/v5.2.2/esp-idf/components/lwip/port/freertos/include -II:/ESP-IDF/v5.2.2/esp-idf/components/lwip/port/esp32xx/include -II:/ESP-IDF/v5.2.2/esp-idf/components/lwip/port/esp32xx/include/arch -II:/ESP-IDF/v5.2.2/esp-idf/components/lwip/port/esp32xx/include/sys -II:/ESP-IDF/v5.2.2/esp-idf/components/nvs_flash/include -II:/ESP-IDF/v5.2.2/esp-idf/components/spi_flash/include -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_partition/include -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_wifi/include -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_wifi/wifi_apps/include -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_event/include -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_phy/include -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_phy/esp32s3/include -II:/ESP-IDF/v5.2.2/esp-idf/components/esp_netif/include -mlongcalls -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -O2 -fmacro-prefix-map=I:/Projects/esp32-s3zhukongyaokongche/fasheduan=. -fmacro-prefix-map=I:/ESP-IDF/v5.2.2/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -std=gnu17 -Wno-old-style-declaration -MD -MT esp-idf/main/CMakeFiles/__idf_main.dir/drivers/ws2812.c.obj -MF esp-idf\main\CMakeFiles\__idf_main.dir\drivers\ws2812.c.obj.d -o esp-idf/main/CMakeFiles/__idf_main.dir/drivers/ws2812.c.obj -c I:/Projects/esp32-s3zhukongyaokongche/fasheduan/main/drivers/ws2812.c
In file included from I:/Projects/esp32-s3zhukongyaokongche/fasheduan/main/drivers/ws2812.c:1:
I:/Projects/esp32-s3zhukongyaokongche/fasheduan/main/drivers/ws2812.h:7:10: fatal error: driver/rmt_tx.h: No such file or directory
7 | #include "driver/rmt_tx.h"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
[2/9] Performing build step for 'bootloader'
[1/1] cmd.exe /C "cd /D I:\Projects\esp32-s3zhukongyaokongche\fasheduan\build\bootloader\esp-idf\esptool_py && I:\ESP-IDF\.espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe I:/ESP-IDF/v5.2.2/esp-idf/components/partition_table/check_sizes.py --offset 0x9000 bootloader 0x0 I:/Projects/esp32-s3zhukongyaokongche/fasheduan/build/bootloader/bootloader.bin"
Bootloader binary size 0x5d00 bytes. 0x3300 bytes (35%) free.
ninja: build stopped: subcommand failed.
```
### More Information.
But the other lib on esp32s3 can find header file, such as:
```c
// Standard
#include <stdio.h>
#include <string.h>
// esp
#include "esp_task_wdt.h"
#include "esp_log.h"
// RGB light
//#include "drivers/ws2812.h"
// FreeRTOS
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
// NVS
#include "nvs.h"
#include "nvs_flash.h"
// WiFi
#include "esp_wifi.h"
#include "esp_mac.h"
```
Thanks for your reply. However, I can not find a file called "CMakeLists.txt " in any of the used libraries.
docdoc
June 19, 2025, 2:28pm
4
Still not knowing the specific libray, It looks like as "driver" directory isn't part of the DShot-rmt library structure, so obviously the path "driver/rmt_rx.h" fails.
I don't know if it's kinda problem of both libraries and/or the way they've been installed, but even the enclosed example has the same #include of your sketch and it should work (not in your environment).
Anyway, I see the "DShotRMT.h" file includes those paths:
#include <driver/gpio.h>
#include <driver/rmt_tx.h>
#include <driver/rmt_rx.h>
#include <driver/rmt_types.h>
They seem to be part of that other "rmtNEO" library, so perhaps something went wrong with the installation or configuration, I don't know.
I think you should first double check the libraries you installed (are there others to do the same? Or newer versions? Do they need to be installed separately or using a specific procedure?). Then, if everything fails, contact the library author.
I think @docdoc is onto something.
When you compile a sketch, Arduino IDE searches for the library that provides each of the header files specified in the #include
directives of your sketch program's code (both the code in the sketch itself, and in the libraries used by the sketch). It then adds the paths of the discovered libraries to the compiler's "search path" . However, this "library discovery" system only searches the root of the library source folders , so it won't discover libraries for which the #include
directive specifies a header file in a subfolder of the library.
So the way to fix this problem is to cause Arduino IDE to discover the "rmtNEO " library that provides the driver/rmt_rx.h
header file, making sure the discovery occurs prior to reaching the #include
directive for the header file in the subfolder of the library. You can do that by adding an #include
directive for a header file from the source root folder of the library above the #include
directive for DShotRMT.h
(which transitively provides the #include
directive for driver/rmt_rx.h
).
So add the following code to the top of your sketch:
#include <clk_tree_defs.h>
Then compile the sketch again. When I did that, I found that the "driver/rmt_rx.h: No such file or directory
" error no longer occurred. I did encounter an new error:
C:\Users\per\Documents\Arduino\sketch_jun7a\sketch_jun7a.ino:5:24: error: 'RMT_CHANNEL_0' was not declared in this scope
DShotRMT motorFL(p_FL, RMT_CHANNEL_0);
^~~~~~~~~~~~~
Using library rmtNEO at version 0.0.3 in folder: C:\Users\per\Documents\Arduino\libraries\rmtNEO
Using library DShot-rmt at version 4.3.0 in folder: C:\Users\per\Documents\Arduino\libraries\DShot-rmt
but at least it gets you past the library discovery problem.
Thanks very much for your help. Works!!
And yes, time to deal with the next hurdles
You are welcome. I'm glad if I was able to be of assistance.
Regards, Per