Problems compiling example code

I am running the Arduino IDE 2.1.1, using an Arduino Nano 33 BLE, with a Sparkfun TMC6300 brushless motor controller, with a SparkFun ROB-20441 motor and using (eventually) an MT6701 as a magnetic encoder.

I used the IDE Library Manager to get the Simple FOC 2.3.0 library.

When I open any example code in the IDE, and try to compile without any changes, I get compiler errors.

Can anyone give me any ideas on if this combination of hardware should work, and what might be going on? My gut is saying that the Arduino Nano 33 BLE is not supported, but per the docs, I thought it is.

Thanks,
Chuck

The compiler errors that I get are specifically:

/Users/…/Arduino/libraries/Simple_FOC/src/communication/StepDirListener.cpp: In member function ‘void StepDirListener::enableInterrupt(void ()())':
/Users/…/Arduino/libraries/Simple_FOC/src/communication/StepDirListener.cpp:16:67: error: no matching function for call to 'attachInterrupt(int&, void (
&)(), int&)’
attachInterrupt(digitalPinToInterrupt(pin_step), doA, polarity);
^
In file included from /Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/variants/ARDUINO_NANO33BLE/pinmode_arduino.h:23:0,
from /Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/cores/arduino/Arduino.h:26,
from /Users/…/Arduino/libraries/Simple_FOC/src/communication/StepDirListener.h:4,
from /Users/…/Arduino/libraries/Simple_FOC/src/communication/StepDirListener.cpp:1:
/Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/cores/arduino/api/Common.h:113:6: note: candidate: void attachInterrupt(pin_size_t, voidFuncPtr, PinStatus)
void attachInterrupt(pin_size_t interruptNumber, voidFuncPtr callback, PinStatus mode);
^~~~~~~~~~~~~~~
/Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/cores/arduino/api/Common.h:113:6: note: conversion of argument 3 would be ill-formed:
/Users/…/Arduino/libraries/Simple_FOC/src/communication/StepDirListener.cpp:16:59: error: invalid conversion from ‘int’ to ‘PinStatus’ [-fpermissive]
attachInterrupt(digitalPinToInterrupt(pin_step), doA, polarity);
^~~~~~~~
In file included from /Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/cores/arduino/Arduino.h:127:0,
from /Users/…/Arduino/libraries/Simple_FOC/src/communication/StepDirListener.h:4,
from /Users/…/Arduino/libraries/Simple_FOC/src/communication/StepDirListener.cpp:1:
/Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/cores/arduino/overloads.h:35:6: note: candidate: void attachInterrupt(PinName, voidFuncPtr, PinStatus)
void attachInterrupt(PinName interruptNumber, voidFuncPtr callback, PinStatus mode);
^~~~~~~~~~~~~~~
/Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/cores/arduino/overloads.h:35:6: note: conversion of argument 3 would be ill-formed:
/Users/…/Arduino/libraries/Simple_FOC/src/communication/StepDirListener.cpp:16:59: error: invalid conversion from ‘int’ to ‘PinStatus’ [-fpermissive]
attachInterrupt(digitalPinToInterrupt(pin_step), doA, polarity);
^~~~~~~~
In file included from /Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/cores/arduino/api/ArduinoAPI.h:29:0,
from /Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/cores/arduino/Arduino.h:27,
from /Users/…/Arduino/libraries/Simple_FOC/src/communication/StepDirListener.h:4,
from /Users/…/Arduino/libraries/Simple_FOC/src/communication/StepDirListener.cpp:1:
/Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/cores/arduino/api/Interrupts.h:38:27: note: candidate: template void arduino::attachInterrupt(pin_size_t, arduino::voidTemplateFuncPtrParam<T*>, PinStatus, T*)
template void attachInterrupt(pin_size_t interruptNum, voidTemplateFuncPtrParam<T*> userFunc, PinStatus mode, T* param) {
^~~~~~~~~~~~~~~
/Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/cores/arduino/api/Interrupts.h:38:27: note: template argument deduction/substitution failed:
/Users/…/Arduino/libraries/Simple_FOC/src/communication/StepDirListener.cpp:16:67: note: candidate expects 1 argument, 0 provided
attachInterrupt(digitalPinToInterrupt(pin_step), doA, polarity);
^
In file included from /Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/cores/arduino/api/ArduinoAPI.h:29:0,
from /Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/cores/arduino/Arduino.h:27,
from /Users/…/Arduino/libraries/Simple_FOC/src/communication/StepDirListener.h:4,
from /Users/…/Arduino/libraries/Simple_FOC/src/communication/StepDirListener.cpp:1:
/Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/cores/arduino/api/Interrupts.h:21:27: note: candidate: template void arduino::attachInterrupt(pin_size_t, arduino::voidTemplateFuncPtrParam, PinStatus, T&)
template void attachInterrupt(pin_size_t interruptNum, voidTemplateFuncPtrParam userFunc, PinStatus mode, T& param) {
^~~~~~~~~~~~~~~
/Users/…/Library/Arduino15/packages/arduino/hardware/mbed_nano/4.0.2/cores/arduino/api/Interrupts.h:21:27: note: template argument deduction/substitution failed:
/Users/…/Arduino/libraries/Simple_FOC/src/communication/StepDirListener.cpp:16:67: note: candidate expects 1 argument, 0 provided
attachInterrupt(digitalPinToInterrupt(pin_step), doA, polarity);
^

Yeah it sounds like interrupts are done differently, possibly they are used by the BLE so they are different. you could try compiling for another arduino and see if that works.

A common recommendation is the g431 nucleo board, I think it is advisable. for $15 you can’t really go wrong. A nano is profoundly limited anyway.

Hi Chuck,

It’s been a long time since I tested on the BLE, which should be supported.

So thanks for reporting it!

I assume its due to some framework changes on the Arduino side, sounds like you’re on the most recent IDE and presumably also board manager files?

I‘ll look into it in the next weeks and restore compatibility… but right now I’m on vacation.

1 Like

Did you ever get a chance to look into this?

Sorry, yes, I lost track of this thread, but I actually did look into this:

  • Nano 33 BLE did not work for me at all in platformio. Seems the platformIO support for the Nordic MCUs is broken.
  • But on Arduino IDE, after upgrading everything to the newest versions, I was able to get it working.

I had to fix the compile error you found, and the fix for this is on the dev branch of the library. So you could clone the dev branch of the library from GitHub and use this by replacing the downloaded version, or you can wait for the next release… hopefully that won’t be too long now!