yeah, changing the board files is definately an advanced topic!
As a note, and I am not sure it will work for you, but in theory these PinMaps are defined with “WEAK”. This means you should be able to copy the whole PinMap structure into your sketch (at the top) and remove the “WEAK”. Then you can make changes in your copy in your sketch, and in theory it should prefer the non-weak version of the PinMap.
You can probably even create a file “mypinmap.cpp” in your sketch folder and put it there, to keep things tidy.
Using it is a combination of having the PinMap with the correct assignments of SPI peripherals to pins, and then initializing an SPI object that uses those pins.
That’s pretty cool, I’ll have to give that a try. I was using this code to set the pins at one point.
SPI.setSCLK();
SPI.setMISO();
SPI.setMOSI();
SPI.setSSEL();
SPI.begin();
Awesome plan! There’s a couple of us here working on designs with the STSPIN32G4, including myself
let us know how it goes!
Have you shared your design anywhere? I’ve mostly been using the reference designs for the B-G431B-ESC1, STSPIN32G4, EVSPIN32G4, and MA730 along with the information here:
https://community.simplefoc.com/t/stspin32g4-support/2027
It’s going to be tight since this if for a 35mm OD motor.