Cannot compile with core 2.0.0 and Sloeber

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
SigP226
Posts: 4
Joined: Sat Apr 24, 2021 8:34 pm

Cannot compile with core 2.0.0 and Sloeber

Post by SigP226 »

Hello,

Configuration : eclipse 2021-03 + GNU MCU + Sloeber + core STMicroelectronic 2.0.0
Board : Bluepill

when I launch a compilation of a test (TFT_eSPI, keypad 320x240) it fails.

Error:
error.JPG
error.JPG (68.44 KiB) Viewed 6562 times
reason :
in file variant.h : #include VARIANT_H
the value of VARIANT_H seems never declared.

should be : variant_PILL_F103Cx.h.

an environment variable exist : A.BUILD.VARIANT_H with the good value but I cannot find where it is used in any makefile.
Capture2.JPG
Capture2.JPG (54.14 KiB) Viewed 6562 times
Any idea?
ag123
Posts: 1797
Joined: Thu Dec 19, 2019 5:30 am
Answers: 28

Re: Cannot compile with core 2.0.0 and Sloeber

Post by ag123 »

welcome
hope you have read these first
viewtopic.php?f=2&t=3
viewtopic.php?f=2&t=301

eclipse / sloeber etc is deemed 'non-standard' hence 'we are on our own'
i had some success using eclipse and a makefile (no sloeber)
viewtopic.php?f=41&t=183

a trouble is this is only tested in Linux.
and note my makefile has only been tested in 1.9.x
to use make you would need to find a gnu make equivalent in *Windows*.
otherwise, you may like to share more info about the logs and erorrs and maybe we could make some guesses.

if you bother to review the makefile, chances are that it could offer clues on how to setup the eclipse/sloeber build as well.
i used a makefile for a simple reason. to create a new project. i simply have a blinky project with the makefile.
i simply copy the whole folder across and that's my new project. sometimes for a non change scenario it takes less than a minute to make a new project that way.

for make, accordingly WSL may help
https://stackoverflow.com/questions/608 ... on-windows
https://docs.microsoft.com/en-us/window ... tall-win10
ag123
Posts: 1797
Joined: Thu Dec 19, 2019 5:30 am
Answers: 28

Re: Cannot compile with core 2.0.0 and Sloeber

Post by ag123 »

there is something i wanted to try but have not gone the distance
try to use stm32cube IDE for the build, that one has HAL after all
https://www.st.com/en/development-tools ... beide.html
stm32cube IDE is eclipse, which a big add on which is STM32Cube MX itself (HAL code generation).

i'd guess in linux it may just work with my makefile. However, for windows i'm not sure how it is done.
BennehBoy
Posts: 138
Joined: Sat Jan 04, 2020 2:38 am
Answers: 1

Re: Cannot compile with core 2.0.0 and Sloeber

Post by BennehBoy »

There's no reason why a makefile shouldn't work in windows as long as you have a usable make in your path, and also the arm-none-eabi binaries in your path.

I have msys2 installed which provides the make element - but this has to manually be added to your path, in my case it's c:\msys2\usr\bin

As for gcc, that's supplied as part of 2.0.0 - and lives in C:\Users\%YOUR_USER_NAME%\AppData\Local\Arduino15\packages\STMicroelectronics\tools\xpack-arm-none-eabi-gcc\9.3.1-1.3\bin

You'll need to edit the above to reflect your user dir

This works a charm for building self contained stm32 code, for example bootloaders. So given the correct makefile, should work from within eclipse.
BennehBoy
Posts: 138
Joined: Sat Jan 04, 2020 2:38 am
Answers: 1

Re: Cannot compile with core 2.0.0 and Sloeber

Post by BennehBoy »

Also some makefiles will make use of the GCC_PATH env variable - in this case you need to set the path to gcc but make sure you use unix / instead of windows \
SigP226
Posts: 4
Joined: Sat Apr 24, 2021 8:34 pm

Re: Cannot compile with core 2.0.0 and Sloeber

Post by SigP226 »

Hi,

Thanks for your answer both,

ag123, you're right, the post in the wrong forum, I think the issue is more related to sloeber+eclipse which generate a wrong makefile configuration. Generation of makefile is automatic.
I'am on Win7

I have tried a the "blink" example with the same bad result.

I have tested the example TFT_eSPI on Arduino IDE and it works fine.
ag123
Posts: 1797
Joined: Thu Dec 19, 2019 5:30 am
Answers: 28

Re: Cannot compile with core 2.0.0 and Sloeber

Post by ag123 »

actually there is Gradle
https://gradle.org/
https://docs.gradle.org/current/usergui ... jects.html
for some reason the 'arduino industry' has not taken on with this, i'm not too sure why.
maybe due to some licensing issues
ag123
Posts: 1797
Joined: Thu Dec 19, 2019 5:30 am
Answers: 28

Re: Cannot compile with core 2.0.0 and Sloeber

Post by ag123 »

SigP226 wrote: Sun Apr 25, 2021 3:19 pm Hi,

Thanks for your answer both,

ag123, you're right, the post in the wrong forum, I think the issue is more related to sloeber+eclipse which generate a wrong makefile configuration. Generation of makefile is automatic.
I'am on Win7

I have tried a the "blink" example with the same bad result.

I have tested the example TFT_eSPI on Arduino IDE and it works fine.
what is the 'make' in windows, is there something in the log or setups e.g. the builder configs in project properties that suggest what is that make.exe app?
i'd suppose it is a ported version of gnu make. Windows and Linux are after all different as far as the os commands goes.
e.g. in linux delete a file is rm while in windows it is del.
there is nmake but that's normally associated with visual studio (e.g. for c++) set of apps.

what Arduino has done is to do arduino-cli
https://github.com/arduino/arduino-cli
which is pretty much a 'custom' make tool written with go
SigP226
Posts: 4
Joined: Sat Apr 24, 2021 8:34 pm

Re: Cannot compile with core 2.0.0 and Sloeber

Post by SigP226 »

Still not find the final root cause, but I am on good the way.

There is a mismatch in the generation of the command line for the compiler

the " is not a the right place which cause the compiler to forget the include path

"-IF:\Eclipse\arduinoPlugin\packages\STMicroelectronics\tools\CMSIS\5.7.0/CMSIS/DSP/PrivateInclude"
-I"F:\Eclipse\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.0.0\cores\arduino"
-I"F:\Eclipse\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.0.0\variants\STM32F1xx\F103C8T_F103CB(T-U)"

I am going to check the issue with Sloeber team.
ag123
Posts: 1797
Joined: Thu Dec 19, 2019 5:30 am
Answers: 28

Re: Cannot compile with core 2.0.0 and Sloeber

Post by ag123 »

stm core setups are (a lot) 'more complex' than say for arduino uno and uses features from platforms.txt and boards.txt
along with various gcc flags for the build. hence, it is likely some changes may be needed in Sloeber to adapt for the stm core
Post Reply

Return to “IDE's”