ESP32 compilation errors with 2.0.1 update (FYI)

Hi all,

Just wanna report a thing I noticed while I was switching from arduino to esp32.

A lot of the examples would not compile and comes up with errors. After reading through the forum, I decided to try rolling back the ESP32 board version by expessif systems from 2.0.1 to 2.0.0.

I can now compile both my codes and examples with the slightly older 2.0.0 instead. I believe something changed, although I’m not sure what it is…

if you are curious, the error message when compile with the current 2.0.1 is as follows,




C:\Users\z_jia\Dropbox\Projects\001_Dexterity\angle_control_test\angle_control_test.ino: In function 'void setup()':
C:\Users\z_jia\Dropbox\Projects\001_Dexterity\angle_control_test\angle_control_test.ino:220:44: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   command.add('T', doTarget, "target angle");
                                            ^
In file included from C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\current_sense\hardware_specific\esp32_adc_driver.cpp:9:
C:\Users\z_jia\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.1/tools/sdk/esp32/include/esp_hw_support/include/esp_intr.h:8:2: warning: #warning esp_intr.h is deprecated, please include esp_intr_alloc.h instead [-Wcpp]
 #warning esp_intr.h is deprecated, please include esp_intr_alloc.h instead
  ^~~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\current_sense\hardware_specific\esp32_mcu.cpp: In function 'void _driverSyncLowSide()':
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\current_sense\hardware_specific\esp32_mcu.cpp:83:79: warning: 'esp_err_t mcpwm_isr_register(mcpwm_unit_t, void (*)(void*), void*, int, intr_handle_data_t**)' is deprecated: interrupt events are handled by driver, please use callback [-Wdeprecated-declarations]
   mcpwm_isr_register(MCPWM_UNIT_0, isr_handler, NULL, ESP_INTR_FLAG_IRAM, NULL);  //Set ISR Handler
                                                                               ^
In file included from C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\current_sense\hardware_specific\esp32_mcu.cpp:6:
C:\Users\z_jia\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.1/tools/sdk/esp32/include/driver/include/driver/mcpwm.h:926:11: note: declared here
 esp_err_t mcpwm_isr_register(mcpwm_unit_t mcpwm_num, void (*fn)(void *), void *arg, int intr_alloc_flags,
           ^~~~~~~~~~~~~~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\current_sense\hardware_specific\esp32_mcu.cpp:83:79: warning: 'esp_err_t mcpwm_isr_register(mcpwm_unit_t, void (*)(void*), void*, int, intr_handle_data_t**)' is deprecated: interrupt events are handled by driver, please use callback [-Wdeprecated-declarations]
   mcpwm_isr_register(MCPWM_UNIT_0, isr_handler, NULL, ESP_INTR_FLAG_IRAM, NULL);  //Set ISR Handler
                                                                               ^
In file included from C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\current_sense\hardware_specific\esp32_mcu.cpp:6:
C:\Users\z_jia\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.1/tools/sdk/esp32/include/driver/include/driver/mcpwm.h:926:11: note: declared here
 esp_err_t mcpwm_isr_register(mcpwm_unit_t mcpwm_num, void (*fn)(void *), void *arg, int intr_alloc_flags,
           ^~~~~~~~~~~~~~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp: In function 'void _configureTimerFrequency(long int, mcpwm_dev_t*, mcpwm_unit_t, float)':
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:127:22: error: 'volatile union mcpwm_clk_cfg_reg_t' has no member named 'prescale'
   mcpwm_num->clk_cfg.prescale = 0;
                      ^~~~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:143:23: error: 'volatile struct mcpwm_timer_regs_t' has no member named 'period'
   mcpwm_num->timer[0].period.prescale = prescaler;
                       ^~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:144:23: error: 'volatile struct mcpwm_timer_regs_t' has no member named 'period'
   mcpwm_num->timer[1].period.prescale = prescaler;
                       ^~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:145:23: error: 'volatile struct mcpwm_timer_regs_t' has no member named 'period'
   mcpwm_num->timer[2].period.prescale = prescaler;
                       ^~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:148:23: error: 'volatile struct mcpwm_timer_regs_t' has no member named 'period'
   mcpwm_num->timer[0].period.period = resolution_corrected;
                       ^~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:149:23: error: 'volatile struct mcpwm_timer_regs_t' has no member named 'period'
   mcpwm_num->timer[1].period.period = resolution_corrected;
                       ^~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:150:23: error: 'volatile struct mcpwm_timer_regs_t' has no member named 'period'
   mcpwm_num->timer[2].period.period = resolution_corrected;
                       ^~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:152:23: error: 'volatile struct mcpwm_timer_regs_t' has no member named 'period'
   mcpwm_num->timer[0].period.upmethod = 0;
                       ^~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:153:23: error: 'volatile struct mcpwm_timer_regs_t' has no member named 'period'
   mcpwm_num->timer[1].period.upmethod = 0;
                       ^~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:154:23: error: 'volatile struct mcpwm_timer_regs_t' has no member named 'period'
   mcpwm_num->timer[2].period.upmethod = 0;
                       ^~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:165:73: warning: 'esp_err_t mcpwm_sync_enable(mcpwm_unit_t, mcpwm_timer_t, mcpwm_sync_signal_t, uint32_t)' is deprecated: please use mcpwm_sync_configure() instead [-Wdeprecated-declarations]
   mcpwm_sync_enable(mcpwm_unit, MCPWM_TIMER_0, (mcpwm_sync_signal_t)1, 0);
                                                                         ^
In file included from C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:5:
C:\Users\z_jia\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.1/tools/sdk/esp32/include/driver/include/driver/mcpwm.h:838:11: note: declared here
 esp_err_t mcpwm_sync_enable(mcpwm_unit_t mcpwm_num, mcpwm_timer_t timer_num, mcpwm_sync_signal_t sync_sig,
           ^~~~~~~~~~~~~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:165:73: warning: 'esp_err_t mcpwm_sync_enable(mcpwm_unit_t, mcpwm_timer_t, mcpwm_sync_signal_t, uint32_t)' is deprecated: please use mcpwm_sync_configure() instead [-Wdeprecated-declarations]
   mcpwm_sync_enable(mcpwm_unit, MCPWM_TIMER_0, (mcpwm_sync_signal_t)1, 0);
                                                                         ^
In file included from C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:5:
C:\Users\z_jia\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.1/tools/sdk/esp32/include/driver/include/driver/mcpwm.h:838:11: note: declared here
 esp_err_t mcpwm_sync_enable(mcpwm_unit_t mcpwm_num, mcpwm_timer_t timer_num, mcpwm_sync_signal_t sync_sig,
           ^~~~~~~~~~~~~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:166:73: warning: 'esp_err_t mcpwm_sync_enable(mcpwm_unit_t, mcpwm_timer_t, mcpwm_sync_signal_t, uint32_t)' is deprecated: please use mcpwm_sync_configure() instead [-Wdeprecated-declarations]
   mcpwm_sync_enable(mcpwm_unit, MCPWM_TIMER_1, (mcpwm_sync_signal_t)1, 0);
                                                                         ^
In file included from C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:5:
C:\Users\z_jia\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.1/tools/sdk/esp32/include/driver/include/driver/mcpwm.h:838:11: note: declared here
 esp_err_t mcpwm_sync_enable(mcpwm_unit_t mcpwm_num, mcpwm_timer_t timer_num, mcpwm_sync_signal_t sync_sig,
           ^~~~~~~~~~~~~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:166:73: warning: 'esp_err_t mcpwm_sync_enable(mcpwm_unit_t, mcpwm_timer_t, mcpwm_sync_signal_t, uint32_t)' is deprecated: please use mcpwm_sync_configure() instead [-Wdeprecated-declarations]
   mcpwm_sync_enable(mcpwm_unit, MCPWM_TIMER_1, (mcpwm_sync_signal_t)1, 0);
                                                                         ^
In file included from C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:5:
C:\Users\z_jia\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.1/tools/sdk/esp32/include/driver/include/driver/mcpwm.h:838:11: note: declared here
 esp_err_t mcpwm_sync_enable(mcpwm_unit_t mcpwm_num, mcpwm_timer_t timer_num, mcpwm_sync_signal_t sync_sig,
           ^~~~~~~~~~~~~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:167:73: warning: 'esp_err_t mcpwm_sync_enable(mcpwm_unit_t, mcpwm_timer_t, mcpwm_sync_signal_t, uint32_t)' is deprecated: please use mcpwm_sync_configure() instead [-Wdeprecated-declarations]
   mcpwm_sync_enable(mcpwm_unit, MCPWM_TIMER_2, (mcpwm_sync_signal_t)1, 0);
                                                                         ^
In file included from C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:5:
C:\Users\z_jia\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.1/tools/sdk/esp32/include/driver/include/driver/mcpwm.h:838:11: note: declared here
 esp_err_t mcpwm_sync_enable(mcpwm_unit_t mcpwm_num, mcpwm_timer_t timer_num, mcpwm_sync_signal_t sync_sig,
           ^~~~~~~~~~~~~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:167:73: warning: 'esp_err_t mcpwm_sync_enable(mcpwm_unit_t, mcpwm_timer_t, mcpwm_sync_signal_t, uint32_t)' is deprecated: please use mcpwm_sync_configure() instead [-Wdeprecated-declarations]
   mcpwm_sync_enable(mcpwm_unit, MCPWM_TIMER_2, (mcpwm_sync_signal_t)1, 0);
                                                                         ^
In file included from C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:5:
C:\Users\z_jia\Documents\ArduinoData\packages\esp32\hardware\esp32\2.0.1/tools/sdk/esp32/include/driver/include/driver/mcpwm.h:838:11: note: declared here
 esp_err_t mcpwm_sync_enable(mcpwm_unit_t mcpwm_num, mcpwm_timer_t timer_num, mcpwm_sync_signal_t sync_sig,
           ^~~~~~~~~~~~~~~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:169:23: error: 'volatile struct mcpwm_timer_regs_t' has no member named 'sync'
   mcpwm_num->timer[0].sync.out_sel = 1;
                       ^~~~
C:\Users\z_jia\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\esp32_mcu.cpp:171:23: error: 'volatile struct mcpwm_timer_regs_t' has no member named 'sync'
   mcpwm_num->timer[0].sync.out_sel = 0;
                       ^~~~
exit status 1
Error compiling for board NodeMCU-32S.

1 Like

Hey @Neuro,

I did not know about this, thanks.
Unfortunately the changes in the API do happen and we will adapt our code as soon as we can. :smiley:

For now we suggest using the version 2.0.0

I made an issue to track this: ESP32 compilation errors with 2.0.1 version of Espressif Arduino board support · Issue #140 · simplefoc/Arduino-FOC · GitHub