Skip to content
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

"dadamachines - M4" package links missing symbols - analogWrite broken #6

Open
mcclure opened this issue Jan 31, 2020 · 0 comments
Open

Comments

@mcclure
Copy link

mcclure commented Jan 31, 2020

Consider the following code

#define VCA 7
void setup() {
    pinMode(VCA,OUTPUT);
}    
void loop() {
    static int i = 0;
    analogWrite(VCA, i++);
}

Normally in Arduino C analogWrite is used on digital pins to engage a PWM mode where the pin oscillates 0 and 1 outputs rapidly so as to be "on average" the specified voltage. If you add an RC filter this can be a way of getting analog values out of digital pins. I've used this before on Atmel chips and it is a documented feature of the Cortex used in the Doppler.

If you compile this program for the dadamachines - M4 board, you get this link error

../arduino_cache_743729/core/core_dadamachines - M4_samd_doppler_cache_on_372425e7815a96db1ec07b293caaf52c.a(wiring_analog.c.o): In function `analogWrite':
/Users/mcc/Library/Arduino15/packages/dadamachines - M4/hardware/samd/1.3.1/cores/arduino/wiring_analog.c:523: undefined reference to `GCLK_CLKCTRL_IDs'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board dadamachines doppler.

In other words the dadamachines - M4 board package exposes an analogWrite function, but the binary for this function links against this GCLK_CLKCTRL_IDs value which is not included in dadamachines - M4.

I asked around and I'm told this is normally something defined in the "Arduino SAMD Boards" header. I tried reinstalling the packages starting with "Arduino SAMD Boards" but I got the same error. I think either the dadamachines - M4 is not flagging a dependency it needs that would supply the GCLK_CLKCTRL_IDs symbol, or dadamachines - M4 did not port everything it needs from the cortex board definitions it's based on.

I would attempt to hack a fix myself but I don't really understand how the build system in Arduino IDE works or what documentation I should read to learn more. I tried asking about all this on the forum but didn't hear back.

@mcclure mcclure changed the title dadamachines - M4 package links missing symbols dadamachines - M4 package links missing symbols - analogWrite broken Aug 15, 2022
@mcclure mcclure changed the title dadamachines - M4 package links missing symbols - analogWrite broken "dadamachines - M4" package links missing symbols - analogWrite broken Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant