sparkfun / SparkFun_IoT_Brushless_Motor_Driver

The hardware repository for an IoT motor driver development board using the ESP32
https://docs.sparkfun.com/SparkFun_IoT_Brushless_Motor_Driver/
Other
6 stars 0 forks source link

error: 'mcpwm_isr_register' was not declared in this scope #2

Closed lboue closed 7 months ago

lboue commented 9 months ago

Subject of the issue

error: 'mcpwm_isr_register' was not declared in this scope

Your workbench

Arduino IDE Version: 2.2.1

Steps to reproduce

How to reproduce this issue :

Expected behavior

It should with

Actual behavior

This error:

In file included from c:\Arduino\libraries\Simple_FOC\src\current_sense\hardware_specific\esp32\esp32_mcu.cpp:3:
c:\users\ludovic\downloads\rf433\libraries\simple_foc\src\drivers\hardware_specific\esp32\esp32_driver_mcpwm.h:11:62: note: '#pragma message: SimpleFOC: compiling for ESP32 MCPWM driver'
   11 | #pragma message("SimpleFOC: compiling for ESP32 MCPWM driver")
      |                                                              ^
c:\Arduino\libraries\Simple_FOC\src\current_sense\hardware_specific\esp32\esp32_mcu.cpp: In function 'void _driverSyncLowSide(void*, void*)':
c:\Arduino\libraries\Simple_FOC\src\current_sense\hardware_specific\esp32\esp32_mcu.cpp:119:5: error: 'mcpwm_isr_register' was not declared in this scope
  119 |     mcpwm_isr_register(mcpwm_unit, mcpwm0_isr_handler, NULL, ESP_INTR_FLAG_IRAM, NULL);  //Set ISR Handler
      |     ^~~~~~~~~~~~~~~~~~
c:\Arduino\libraries\Simple_FOC\src\current_sense\hardware_specific\esp32\esp32_mcu.cpp:121:5: error: 'mcpwm_isr_register' was not declared in this scope
  121 |     mcpwm_isr_register(mcpwm_unit, mcpwm1_isr_handler, NULL, ESP_INTR_FLAG_IRAM, NULL);  //Set ISR Handler
      |     ^~~~~~~~~~~~~~~~~~

exit status 1

Compilation error: exit status 1
UliBartels commented 7 months ago

Hey Iboue,

I recently solved the same issue on my system and I don't think this is an issue with the SimpleFOC library but rather your esp32 setup. All this assumes you're using the Arduino IDE. Take a look in your board manager and check which version of the esp32 board library you have installed. For me, it turned out I had 3.0.0.alpha. Reason for this was that in my package manager I had:

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

rather than:

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

I uninstalled esp32, switched the package link from dev branch to the actual esp32 branch and installed esp32 version 2.0.14. This fixed the issue.

lboue commented 7 months ago

Thanks @UliBartels