Skip to content

[BUG] RP2040 ADC Engine missing include for arduino-pico core #264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nanoparticle opened this issue Mar 22, 2023 · 4 comments
Closed

[BUG] RP2040 ADC Engine missing include for arduino-pico core #264

nanoparticle opened this issue Mar 22, 2023 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@nanoparticle
Copy link
Contributor

Using the Ardiuno IDE 2 with latest SimpleFOC library and latest Arduino-Pico core, with my RP2040 based board, and the current sense code fails to compile with the following error:

c:\Users\...\Documents\Arduino\libraries\Simple_FOC\src\current_sense\hardware_specific\rp2040\rp2040_mcu.cpp:19:44: error: 'ADC_CS_START_ONCE_BITS' was not declared in this scope
19 | alignas(32) const uint32_t trigger_value = ADC_CS_START_ONCE_BITS; // start once

Several more errors follow, but they are a consequence of this error and go away when it is resolved.

It looks like rp2040_mcu.cpp in the current_sense folder is missing this include statement:
#include "hardware/adc.h"

When I add this line everything compiles and runs successfully. There is even a drastic improvement in the smoothness of motor compared to last release of SimpleFOC, thanks so much for the development effort! 😄

@runger1101001
Copy link
Member

I looked into this again today. I have added the line you suggest.

The code compiles for me now using:

  • ArduinoIDE 2 and Arduino Pico MBed Core 4.0.2
  • PlatformIO and Arduino Pico Platform 1.9.0
  • PlatformIO and Earlehillpower Platform 1.7.0+sha.0c33219

It's really confusing with all these different framework versions for the same MCU :-(

@runger1101001 runger1101001 added this to the 2.3.1_Release milestone May 12, 2023
@runger1101001 runger1101001 added bug Something isn't working and removed possible bug labels May 12, 2023
@runger1101001 runger1101001 self-assigned this May 12, 2023
runger1101001 pushed a commit to runger1101001/Arduino-FOC that referenced this issue May 12, 2023
@nanoparticle
Copy link
Contributor Author

Is there a particular Arduino core that is supported/preferred by SimpleFOC?

@runger1101001
Copy link
Member

Well we’d like to support the “official” one but they don’t seem to do to good a job of keeping it updated :-(
So many people seem to like alternative cores.

the current dev branch code should work with both the official core and the earlephilhower one.

please let me know if you find it doesn’t work for you.

@nanoparticle
Copy link
Contributor Author

Thanks, I'll post an update in a couple of weeks when the new boards arrive and I have had a chance to check compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants