From 9fe31b21623c2ebf93b291b91bcf11eb30f9bbeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Fri, 6 Jan 2023 00:08:23 +0100 Subject: [PATCH] esp32-dfu: fix esp_mac_read include with ESP-IDF v5.0, esp_read_mac used by this DFU to set the serial, is not included in esp_system.h anymore. the fix is mentioned in the hint: HINT:esp_mac.h header file is not included by esp_system.h anymore. It shall then be manually included with #include "esp_mac.h"HINT: Please check that the function name is correct. Also it is possible that you've forgot to import esp_read_mac library(s) in header file or add the necessary REQURIES component. Try to add missing libraries to your project header file or check idf_component_register(REQUIRES ...) section in your component CmakeList.txt file. For more information run 'idf.py docs -sp api-guides/build-system.html'. this fix explicitly includes esp_mac.h --- examples/device/dfu_freertos/src/usb_descriptors.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/device/dfu_freertos/src/usb_descriptors.c b/examples/device/dfu_freertos/src/usb_descriptors.c index d4ecc2840..2e98a9c15 100644 --- a/examples/device/dfu_freertos/src/usb_descriptors.c +++ b/examples/device/dfu_freertos/src/usb_descriptors.c @@ -25,6 +25,9 @@ #include "tusb.h" #include "class/dfu/dfu_device.h" +#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3) + #include "esp_mac.h" +#endif /* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug. * Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.