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

[BUG] samd21_mcu.cpp file ignored, builds using generic_mcu.cpp instead. Renaming to stsamd21_mcu works.

Open arturohernandez10 opened this issue 2 years ago • 4 comments

Describe the bug I am using a qtpy_mo adafruit board. While building the binary samd21_mcu.cpp is used instead of generic.mcu.cpp.

Details I soldered the swd pins and got my debugger working. As I step through the code when it calls _writeDutyCycle4PWM. The debugger steps into the generic_mcu.cpp version. I spent a good amount of time looking at how the compiler decides to use the different files in the hardware_specific folder. I suspect it's there is a file naming convention. And the Arduino documentation I found, was vague but seemed to say the same. I ended up looking at the klipper repo and saw the path has the atsamd name. I changed the all the files to prefix them with st locally (e.g. stsamd21_mcu.cpp ) and now I can step through writeSAMDDutyCycle. And my stepper is finally rotating as well!!!

I am happy to do any testing on this issue.

IDE you are using

  • Platformio

arturohernandez10 avatar Jun 06 '22 15:06 arturohernandez10

Do you have the option lib_archive = false In your platformio.ini ?

runger1101001 avatar Jun 07 '22 14:06 runger1101001

I will try it. Thanks!

arturohernandez10 avatar Jun 12 '22 20:06 arturohernandez10

hey @arturohernandez10, did you have time to test this?

askuric avatar Jul 08 '22 15:07 askuric

Disappeared?

ShangHTao avatar Aug 06 '22 09:08 ShangHTao

I'm closing this issue, @arturohernandez10 if you still have it feel free to reopen it.

askuric avatar Oct 15 '22 09:10 askuric