diff --git a/arch/xtensa/src/esp32s2/esp32s2_tim.c b/arch/xtensa/src/esp32s2/esp32s2_tim.c index 19c219b9ba..1f1be2d0ef 100644 --- a/arch/xtensa/src/esp32s2/esp32s2_tim.c +++ b/arch/xtensa/src/esp32s2/esp32s2_tim.c @@ -39,6 +39,9 @@ #include "hardware/esp32s2_systimer.h" #include "hardware/esp32s2_tim.h" +#include "soc/periph_defs.h" +#include "esp_private/periph_ctrl.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -1254,6 +1257,15 @@ struct esp32s2_tim_dev_s *esp32s2_tim_init(int timer) #endif } + if (tim->gid == GROUP0) + { + periph_module_enable(PERIPH_TIMG0_MODULE); + } + else + { + periph_module_enable(PERIPH_TIMG1_MODULE); + } + /* Verify if it is in use */ if (tim->inuse == false) diff --git a/arch/xtensa/src/esp32s2/esp32s2_wdt.c b/arch/xtensa/src/esp32s2/esp32s2_wdt.c index 449f512b48..7420a762c4 100644 --- a/arch/xtensa/src/esp32s2/esp32s2_wdt.c +++ b/arch/xtensa/src/esp32s2/esp32s2_wdt.c @@ -38,6 +38,9 @@ #include "hardware/esp32s2_rtccntl.h" #include "hardware/esp32s2_tim.h" +#include "soc/periph_defs.h" +#include "esp_private/periph_ctrl.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -1042,6 +1045,7 @@ struct esp32s2_wdt_dev_s *esp32s2_wdt_init(enum esp32s2_wdt_inst_e wdt_id) } else { + periph_module_enable(PERIPH_TIMG1_MODULE); wdt->inuse = true; }