[libmaple] -DARDUINO_ARCH_ issue

Cores are the underlying magic that make the Arduino API possible
Post Reply
User avatar
Pito
Posts: 1499
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

[libmaple] -DARDUINO_ARCH_ issue

Post by Pito » Sun Jul 16, 2017 4:55 pm

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"..
Pukao Hats Cleaning Services Ltd.

User avatar
RogerClark
Posts: 6692
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: [libmaple] -DARDUINO_ARCH_ issue

Post by RogerClark » Sun Jul 16, 2017 9:41 pm

AFIK

The IDE builds this from the folder name.

It's not something we can change

User avatar
Pito
Posts: 1499
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [libmaple] -DARDUINO_ARCH_ issue

Post by Pito » Mon Jul 17, 2017 7:21 am

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..
Pukao Hats Cleaning Services Ltd.

User avatar
RogerClark
Posts: 6692
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: [libmaple] -DARDUINO_ARCH_ issue

Post by RogerClark » Mon Jul 17, 2017 7:39 am

I think the folder names are a clear description of what they contain

danieleff
Posts: 336
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: [libmaple] -DARDUINO_ARCH_ issue

Post by danieleff » Mon Jul 17, 2017 7:54 am

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).

User avatar
RogerClark
Posts: 6692
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: [libmaple] -DARDUINO_ARCH_ issue

Post by RogerClark » Mon Jul 17, 2017 8:27 am

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.

User avatar
Pito
Posts: 1499
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [libmaple] -DARDUINO_ARCH_ issue

Post by Pito » Mon Jul 17, 2017 8:32 am

@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..
Pukao Hats Cleaning Services Ltd.

stevestrong
Posts: 1510
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: [libmaple] -DARDUINO_ARCH_ issue

Post by stevestrong » Mon Jul 17, 2017 8:46 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests