Arduino-FOC icon indicating copy to clipboard operation
Arduino-FOC copied to clipboard

SAMD51 compile problems on Adafruit ItsyBitsy M4

Open runger1101001 opened this issue 3 years ago • 2 comments

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 avatar Sep 19 '22 20:09 runger1101001

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 avatar Sep 19 '22 20:09 runger1101001

Fix for compile problems is committed to dev branch.

runger1101001 avatar Sep 19 '22 21:09 runger1101001