Skip to content

Conversation

@RudolphRiedel
Copy link
Contributor

There is a linker error when trying to compile projects with not only an .ino but also .c and .cpp files.
"multiple definition of `pin_Map'"

And the cause for this is that pins_arduino.h for has this in it:
const PIN_MAP pin_Map[] = {
{ GPIOA, GPIO_PIN_0, PA0, DIO|PWM2|_SPI_SS},
{ GPIOA, GPIO_PIN_1, PA1, DIO|ADC1|PWM3}, // JTAG_CK
...

As this is an declaration of a variable you end up with multiple copes of pin_Map across the object files.

This pull request fixes the issue by moving the declaration of pin_Map to Arduino.c.

This project did not link before the fix and not it does build for W801, W806 and Air103:
EVE_HelloWorld_Arduino_IDE.zip

It may not work though, but that is something for me to explore, now that it builds.

@board707
Copy link
Owner

board707 commented Aug 5, 2023

Hi
Thanks for the PR.
I like the idea of describing the changes in the location of the pins in different versions of the boards through defines like MUX_PA11.
I'm willing to consider accepting your code into the master branch. However, there is a problem - it seems that you used an outdated version of the package as the base of your PR.
Please merge the hal-v0.6.0 branch into your branch to make changes to the analog pin definitions, add functionality yield() etc

@RudolphRiedel
Copy link
Contributor Author

Oh, damn, I took the files from the fresh arduino installation, sorry, I will check and update the pull-request.

…nges, reverted uintended changes, applied updates
@RudolphRiedel
Copy link
Contributor Author

Sorry again, that should be it.
And I replaced the whole Arduino installation with the latest files from this repository now, what I should have done to begin with.

What I am actually interested in is the SPI and from the first look with the logic analyzer, the SPI is surprisingly slow, I'll have a look at that.

@board707
Copy link
Owner

board707 commented Aug 6, 2023

that should be it.

Thank you, looks good. I need a time to investigate it.

What I am actually interested in is the SPI and from the first look with the logic analyzer, the SPI is surprisingly slow, I'll have a look at that.

Could you please open an issue and share your observations?

@board707 board707 changed the base branch from hal-v0.6.0 to test_pinmap August 11, 2023 09:09
@board707 board707 merged commit 1fc4ce5 into board707:test_pinmap Aug 11, 2023
@board707
Copy link
Owner

Hi @RudolphRiedel

I have merged your PR to test branch test_pinmap to make it easier to test it.
If no incompatibilities are found, it will be merged into the main branch.
Thank for your contribution.
Dmitry

@board707
Copy link
Owner

Accepted in default branch.

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

Successfully merging this pull request may close these issues.

2 participants