Page 1 of 1

[libmaple] -DARDUINO_ARCH_ issue

Posted: Sun Jul 16, 2017 4:55 pm
by Pito
What should be the final name of this flag (in platform.txt):

Code: Select all

-DARDUINO_ARCH_{build.arch}
??
It seems to me it copies the name of the folder where the repo is located on my local disk (ie STM32F1), and what I see for example in the compiler's log is

Code: Select all

...-mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10802 -DARDUINO_GENERIC_STM32F103Z -DARDUINO_ARCH_STM32F1
or, when working in STM32DE1 folder I get -DARDUINO_ARCH_STM32DE1, while we use for example in SdFat "ARDUINO_ARCH_STM32"..

Re: [libmaple] -DARDUINO_ARCH_ issue

Posted: Sun Jul 16, 2017 9:41 pm
by RogerClark
AFIK

The IDE builds this from the folder name.

It's not something we can change

Re: [libmaple] -DARDUINO_ARCH_ issue

Posted: Mon Jul 17, 2017 7:21 am
by Pito
It's not something we can change
Arduino_Arch carved in the stone :)
Mind you use STM32F1, STM32F3, STM32F4 as the names of the folders..

Re: [libmaple] -DARDUINO_ARCH_ issue

Posted: Mon Jul 17, 2017 7:39 am
by RogerClark
I think the folder names are a clear description of what they contain

Re: [libmaple] -DARDUINO_ARCH_ issue

Posted: Mon Jul 17, 2017 7:54 am
by danieleff
RogerClark wrote:
Mon Jul 17, 2017 7:39 am
I think the folder names are a clear description of what they contain
With the official implementation around, this is not exactly true. (I mean the folder name: kinda clear. The compile flag it creates: not that clear)

ARDUINO_ARCH_STM32F1 (and __STM32F1__) meant that it was the Arduino implementation for STM32F1 chips (the only implementation).

But now it means that it is the Arduino implementation for STM32F1 chips using libmaple register names, and libmaple functions.

While ARDUINO_ARCH_STM32 means Arduino implementation for STM32 chips using HAL register names, and HAL functions (and official extensions).

Re: [libmaple] -DARDUINO_ARCH_ issue

Posted: Mon Jul 17, 2017 8:27 am
by RogerClark
Perhaps as STM's version is the new kid on the block it should include HAL in its name
(I think Leaflabs wrote libmaple as far back as 2012)

I think its impractical to change the libmaple folder names now, as I don't know how may libraries have been written to use the libmaple core
This would seriously alienate a whole bunch of users if I did that.

Re: [libmaple] -DARDUINO_ARCH_ issue

Posted: Mon Jul 17, 2017 8:32 am
by Pito
@Roger - show me a single usage of
ARDUINO_ARCH_STM32F1
ARDUINO_ARCH_STM32F3
ARDUINO_ARCH_STM32F4
within your libmaple repository.

In turn I will show you the flag ARDUINO_ARCH_STM32 used..

Re: [libmaple] -DARDUINO_ARCH_ issue

Posted: Mon Jul 17, 2017 8:46 am
by stevestrong
I think, at the time libmaple was developed (2012), the "ARDUINO_ARCH_..." define was not yet introduced by Arduino.

Btw, I don't see any issue here.
And anyway, ARDUINO_ARCH_STM32 would not differentiate the F1 from F4, so one has to use the different directories and the corresponding automatically generated defines.