IDE with Eclipse with Jantje's plugin

Development environment specific, Arduino, Eclipse, VS2013,Em::Blocks etc
Post Reply
nicoverduin
Posts: 5
Joined: Wed Oct 14, 2015 6:25 pm

IDE with Eclipse with Jantje's plugin

Post by nicoverduin » Wed Oct 14, 2015 6:29 pm

Ik know I had it working quite some time ago, but cannot find my notes. If I compile through Eclipse with IDE 1.6.4 I get the following messages (and termination).

Code: Select all

make all 
Building file: ../testSTM32.cpp
Starting C++ compile
"D:/arduino-1.6.4-windows/arduino-1.6.4/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -DDEBUG_LEVEL=DEBUG_NONE -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOB -DERROR_LED_PIN=1  -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10604 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1     -DMCU_STM32F103CB  -mthumb  -march=armv7-m -D__STM32F1__  -DMCU_STM32F103CB  -mthumb  -march=armv7-m -D__STM32F1__  "-I/libmaple" "-I/libmaple/include" "-I/libmaple/stm32f1/include"                                                           "-I/libmaple/usb/stm32f1" "-I/libmaple/usb/usb_lib"    -I"D:\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple" -I"D:\Documents\Arduino\hardware\Arduino_STM32\STM32F1\variants\generic_stm32f103c" -MMD -MP -MF"testSTM32.cpp.d" -MT"testSTM32.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "../testSTM32.cpp"  -o  "testSTM32.cpp.o"   -Wall
In file included from D:\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple/Arduino.h:30:0,
                 from ../testSTM32.cpp:39:
D:\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple/wirish.h:51:28: fatal error: libmaple/stm32.h: No such file or directory
 #include <libmaple/stm32.h>
                            ^
compilation terminated.
make: *** [testSTM32.cpp.o] Error 1
With the standard 1.6.4 it compiles fine.
Do I need to adjust one of the text files?

Oh and btw, I run it under Windows 7 professional

User avatar
martinayotte
Posts: 1182
Joined: Mon Apr 27, 2015 1:45 pm

Re: IDE with Eclipse with Jantje's plugin

Post by martinayotte » Fri Oct 16, 2015 9:18 pm

As we can see in the following extract of your compile output, there is a wrong path defined or missing.
I'm not familiar with Eclipse plugin, but there must be a variable, maybe "PLATFORM_PATH" or something similar that is not defined in you environment, so the compiler cannot concatenate proper INCLUDE path as see here :

Code: Select all

"-I/libmaple" "-I/libmaple/include" "-I/libmaple/stm32f1/include" "-I/libmaple/usb/stm32f1" "-I/libmaple/usb/usb_lib"
It should be ending with something like :

Code: Select all

"-ID:\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple/libmaple" "-ID:\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple/libmaple/include" "-ID:\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple/libmaple/stm32f1/include" "-ID:\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple/libmaple/usb/stm32f1" "-ID:\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple/libmaple/usb/usb_lib"

nicoverduin
Posts: 5
Joined: Wed Oct 14, 2015 6:25 pm

Re: IDE with Eclipse with Jantje's plugin

Post by nicoverduin » Mon Oct 19, 2015 5:32 am

Hi Martin
Thanks for the response. However that didn't do the job. There was an additional parameter needed so I hard coded that in the platform files. The mappings are correct, but maybe I am still missing a few paths :)
Kindest regards
Nico

User avatar
electrozest
Posts: 3
Joined: Mon Jan 25, 2016 3:54 pm
Location: Northumberland, UK
Contact:

Re: IDE with Eclipse with Jantje's plugin

Post by electrozest » Thu Feb 04, 2016 1:55 pm

Hi,
Today I also was also very keen to use Jantje's plugin under Eclipse (Mars.1 Release 4.5.1) on macosx for compiling to the Maple Mini target board using Arduino for STM32.

After installing the Jantje plugin, the first issue under Eclipse was that in usb_core.c, the compiler could not find the definitions for NULL. I had to add the following include at the top of this file:
#include <stddef.h>

There were various other compile errors for which I started to add additional include paths to the following sections based on the reported missing files:
Eclipse->Project->Properties->C/C++ Build->Tool Settings->Arduino C++ Compiler->Include Folders
Eclipse->Project->Properties->C/C++ Build->Tool Settings->Arduino C Compiler->Include Folders

I eventually added the following "Include Folders" to both the C++ and C compiler sections:

Code: Select all

"${workspace_loc:/test_sketch/arduino/core}"
"${workspace_loc:/test_sketch/arduino/variant}"
/Applications/Arduino.app/Contents/Java/hardware/Arduino_STM32/STM32F1/system
/Applications/Arduino.app/Contents/Java/hardware/Arduino_STM32/STM32F1/cores/maple/libmaple
/Applications/Arduino.app/Contents/Java/hardware/Arduino_STM32/STM32F1/system/libmaple/stm32f1/include
/Applications/Arduino.app/Contents/Java/hardware/Arduino_STM32/STM32F1/system/libmaple/libmaple/stm32.h
/Applications/Arduino.app/Contents/Java/hardware/Arduino_STM32/STM32F1/system/libmaple
/Applications/Arduino.app/Contents/Java/hardware/Arduino_STM32/STM32F1/system/libmaple/usb/usb_lib
/Applications/Arduino.app/Contents/Java/hardware/Arduino_STM32/STM32F1/system/libmaple/usb/stm32f1
I then had a problem compiling the .S assembly language files which used the #include paths. I had assumed the above paths set in the Eclipse settings were the ones being used , but for the .S files, Eclipse was generating the include paths in a different way. The .S files consequently would not compile under Eclipse because the expanded gcc statement for the assembly files was referenced to the root directory.

I managed to solve the problem and get the STM32 Arduino source to compile for Maple Mini target using the following steps:

Eclipse->Project->Properties->C/C++ Build->Build Variables->Add
I then added a variable called "A.BUILD.SYSTEM.PATH" which on my mac needs to point to the following path: "/Applications/Arduino.app/Contents/Java/hardware/Arduino_STM32/STM32F1/system"

On other operating systems this path will be different depending on where the Arduino application was installed and where the Arduino_STM32 code was copied into the application.

I also noticed that the plugin assumes by default that the user is using Windows and that the upload tools are the Windows versions. In the Jantje plugin I could not see an option to select the machine OS type for the upload tools, so I worked around this by adding two symbolic links from the tools/win directory to the tools/macosx directory so that eclipse and the plugin could find them :

cd /Applications/Arduino.app/Contents/Java/hardware/Arduino_STM32/tools/win
ln -s ../macosx/maple_upload maple_upload
ln -s ../macosx/upload-reset upload-reset

With the above, my code compiled and was downloaded to the target, but at first the target was unresponsive. I suspected that the binary file for the maple_upload was incorrect, but then I eventually worked out that it was not actually compiling my sketch as the .ino sketch file was in a subfolder of the Eclipse project, and this was not actually been compiled at all, so the resultant binary effectively had empty void setup() and void loop() functions. Once I realised this, I moved the sketch into the top level of the selected Eclipse project recompiled and the hit the upload button and it all worked well. Hurray, now I can do some development work...

Regards,
Martin T

User avatar
electrozest
Posts: 3
Joined: Mon Jan 25, 2016 3:54 pm
Location: Northumberland, UK
Contact:

Re: IDE with Eclipse with Jantje's plugin

Post by electrozest » Fri Feb 05, 2016 7:06 am

Hi,
After my previous post I found that it is very useful in Eclipse to enable the method/function mappings for Arduino files by setting the following:

Eclipse->Preferences->C/C++->Filetypes->Add "*.ino" as "C++ Source File".

Best Regards,
Martin T

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

Re: IDE with Eclipse with Jantje's plugin

Post by stevestrong » Wed Oct 05, 2016 9:35 am

I finally managed to get Eclipse with Arduino plugin V2 (don't take V3.0!) to build the stm32duino sources on Windows 10.

Necessary were all these previous comments (thanks @electrozest!).
- set "*.ino" as C++ source file
- add an extra variable called "A.BUILD.COMPILER.PATH", which in my case points to the compiler path used by Arduino 1.6.5:
C:/Users/[user]/AppData/Local/Arduino15/...
- 4 or 5 extra path entries for some not found headers, needed by the C++ compiler
- 2 extra path entries to enable assembly file compiling - these had to be included in the Arduino assembler call parameter list directly.

Additionally I am trying to upload and debug with STlink V2 (ali clone), is not working at the moment and this needs some additional effort.

I think we should put these infos on the wiki.

EDIT
I just realized that I was not using the Jentje's plugin, but the Eclipse project Eclipse C++ IDE for Arduino from marketplace.

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

Re: IDE with Eclipse with Jantje's plugin

Post by RogerClark » Wed Oct 05, 2016 7:52 pm

Steve if you dont have an account for the wiki let me know, as I will need to create one.

I tried enabling creation of wiki accounts by users, but got spam-botted with hundreds of fake users and pages, so I had to disable account creation again :-(

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

Re: IDE with Eclipse with Jantje's plugin

Post by stevestrong » Wed Oct 05, 2016 8:01 pm

Roger, i dont have wiki account, it would be nice if you could set up one for me.

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

Re: IDE with Eclipse with Jantje's plugin

Post by RogerClark » Wed Oct 05, 2016 11:13 pm

OK

I'll create one now.

You will get some emails from the wiki, as I use MediaWiki and its not possible to disable these

You may need to validate your email address (I'll go into the admin on the forum and grab the email address that you used to register here)

User avatar
electrozest
Posts: 3
Joined: Mon Jan 25, 2016 3:54 pm
Location: Northumberland, UK
Contact:

Re: IDE with Eclipse with Jantje's plugin

Post by electrozest » Thu Oct 06, 2016 9:33 am

Hi Steve,
A few months ago I also wanted to use STlink V2 to upload to the Maple Mini via the jtag/swd pins and debug directly from Eclipse, but at the time did not work out how to do so.

I just had a look again and noticed that there is a build variable which selects the linker script. By default this is configured to bootloader_20.ld which I assume creates the binary .elf file with the addresses aligned for use by the bootloader via the USB upload method:

Project-Explorer -> Properties -> C/C++ Build -> Environment -> A.BUILD.LDSCRIPT = ld/bootloader_20.ld

I notice that the arduino/variant/ld directory contains the following possible linker script variants:

bootloader_20.ld
flash_c8.ld
jtag_c8.ld
ram_c8.ld
flash.ld
jtag.ld
ram.ld

I assume to use the ST Link v2, before compiling, you need to switch the selected linker script in Eclipse by changing the A.BUILD.LDSCRIPT variable possibly to one of the jtag ones? Some of these linker options might possibly create a binary .elf which directly overwrites the bootloader?

Regards,
Martin T

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests