RP2040-Zero Compilation error on dev version SimpleFOC

Hello,

RP2040-Zero no longer compiles in the dev version
Compilation is fine in master

RP2040-Zero: https://www.waveshare.com/wiki/RP2040-Zero

lib RP2040 ==> 3.7.1 installed GitHub - earlephilhower/arduino-pico: Raspberry Pi Pico Arduino core, for all RP2040 boards

Error:

    /home/***/Arduino/libraries/Arduino-FOC-dev/src/drivers/hardware_specific/rp2040/rp2040_mcu.cpp:22:10: fatal error: pinDefinitions.h: No such file or directory
   22 | #include <pinDefinitions.h>
      |          ^~~~~~~~~~~~~~~~~~
  compilation terminated.
  exit status 1
  Erreur de compilation pour la carte Waveshare RP2040 Zero

Thank you for reporting it! I think it’s a difference between earlephilhower core and the standard core. We’ll fix it for the next release.

1 Like

@runger I just ran across this issue with the earlephilhower core and looks like it’s the same in the dev branch. For now, I changed line 38 in rp2040_mcu.cpp to the following which seems to fix it as I believe there’s no pin remapping by default…

uint pin = pin_nr;

I’m sorry, I dropped the ball on this one and the fix did not make it into the recent release.

Your workaround is the correct solution for boards that don’t use Arduino style pin-numbering.

I have now merged a fix to the dev branch. fix RP2040 compile problems with earlehillpower by runger1101001 · Pull Request #397 · simplefoc/Arduino-FOC · GitHub

The problem was caused by fixing incompatibility with the Nano RP2040 Connect, which uses Arduino style pin numbers rather than RP2040 GPIO numbers. Unfortunately the earlephilhower core does not defined the digitalPinToPinName macro used for mapping between the two.