simplefoc / Arduino-FOC

Arduino FOC for BLDC and Stepper motors - Arduino Based Field Oriented Control Algorithm Library
https://docs.simplefoc.com
MIT License
2.1k stars 537 forks source link

SAMD51 compile problems on Adafruit ItsyBitsy M4 #217

Closed runger1101001 closed 2 years ago

runger1101001 commented 2 years ago

Arduino IDE Adafruit ItsyBitsy M4 Load SimpleFOC example full_control_serial Click Verify Get loads of errors like this… C:\Users\Richard\Documents\Arduino\libraries\Simple_FOC\src\drivers\hardware_specific\samd51_mcu.cpp:32:17: error: ‘TC4_CH1’ was not declared in this scope; did you mean ‘TC3_CH1’? 32 | { PORTB, 9, TC4_CH1, 1, NOT_ON_TIMER, 0, NOT_ON_TIMER, 0}, | ^~~ | TC3_CH1 Does anyone know a fix? It seems like the hardware definitions for this board are wrong?

From: https://community.simplefoc.com/t/compiling-simplefoc-for-samd51-problem/2439

runger1101001 commented 2 years ago

Ok, quick check reveals that the SAMD51G19A has fewer timer/counters than the other SAMD51s... so its board files are missing the defines for the higher number counters.

Will solve it by defining them as NOT_ON_TIMER if not already defined

runger1101001 commented 2 years ago

Fix for compile problems is committed to dev branch.