IDE with Eclipse with Jantje's plugin

Development environment specific, Arduino, Eclipse, VS2013,Em::Blocks etc
ag123
Posts: 634
Joined: Thu Jul 21, 2016 4:24 pm

Re: IDE with Eclipse with Jantje's plugin

Post by ag123 » Wed Apr 19, 2017 3:22 pm

hi pito

this is a some notes i made for myself when compiling the codes for F4 branch (in particular the black F4 branch), i'm setting all these pretty much manually in eclipse. i think sloeber would really help but i hope some of these notes may help find what may need to be patched into platforms.txt or boards.txt.

note that those defines are gathered by examining platforms.txt and boards.txt for my particular board. in particular i copy the defines or variables whole sale from a set for maple mini and i later add those that ends with undefined variable compile errors if i hit them. hence there could be mistakes or redundant variables

for eclipse itself, in particular the include directories, i need to make sure that the includes are defined as well as the defines/variables are defined or i'd get lots of build errors. arduino ide seem to be able to figure out the include directories and i'm now sure how arduino ide figured that out.

the defines are either in platforms.txt for shared defines e.g. SERIAL_USB or in boards.txt in the relevant variable for the board

i still couldn't figure out how arduino ide figure out that a particular sketch and board combination should use the source and includes in a particular directory/folder, as if all the sources and includes for f1 and f4 are mixed up, there will most likely be conflicts

just 2 cents

Code: Select all

stm32duino defines-includes

Debug 
target processor:
arm-family: cortex-m4
architecture: toolchain default
instruction set: -mthumb
optimization:
opt level: opt for debug (-Og)
cflags:
-fmessage-length=0
-fsigned-char
-ffunction-sections
-fdata-sections
-ffreestanding
-fno-move-loop-invariants
Warnings:
cflags:
-Wall
-Wextra
Debug:
debug level: -g
format: toochain default

assembler
defines:
STM32_HIGH_DENSITY
STM32F4
BOARD_black_f4
VECT_TAB_ADDR=0x8000000
VECT_TAB_BASE
includes:
"${workspace_loc:/${ProjName}/STM32F4/cores/maple}"
"${workspace_loc:/${ProjName}/STM32F4/cores/maple/libmaple}"
"${workspace_loc:/${ProjName}/STM32F4/cores/maple/libmaple/include}"

c
defines:
STM32_HIGH_DENSITY
STM32F4
BOARD_black_f4
CONFIG_MAPLE_MINI_NO_DISABLE_DEBUG
DEBUG_LEVEL=DEBUG_NONE
VECT_TAB_ADDR=0x8000000
VECT_TAB_BASE
F_CPU=168000000L
SERIAL_USB
USB_VID=0x1EAF
USB_PID=0x0004
USB_MANUFACTURER="Unknown"
includes:
"${workspace_loc:/${ProjName}/STM32F4/cores/maple}"
"${workspace_loc:/${ProjName}/STM32F4/cores/maple/libmaple}"
"${workspace_loc:/${ProjName}/STM32F4/cores/maple/libmaple/usbF4/VCP}"
"${workspace_loc:/${ProjName}/STM32F4/cores/maple/libmaple/usbF4/STM32_USB_OTG_Driver/inc}"
"${workspace_loc:/${ProjName}/STM32F4/cores/maple/libmaple/usbF4/STM32_USB_Device_Library/Core/inc}"
"${workspace_loc:/${ProjName}/STM32F4/cores/maple/libmaple/usbF4/STM32_USB_Device_Library/Class/cdc/inc}"
"${workspace_loc:/${ProjName}/STM32F4/variants/black_f407vet6}"
cflags:
--std=gnu11

c++
defines:
STM32_HIGH_DENSITY
STM32F4
BOARD_black_f4
CONFIG_MAPLE_MINI_NO_DISABLE_DEBUG
DEBUG_LEVEL=DEBUG_NONE
VECT_TAB_ADDR=0x8000000
VECT_TAB_BASE
F_CPU=168000000L
SERIAL_USB
USB_VID=0x1EAF
USB_PID=0x0004
USB_MANUFACTURER="Unknown"
includes:
"${workspace_loc:/${ProjName}/STM32F4/cores/maple}"
"${workspace_loc:/${ProjName}/STM32F4/cores/maple/libmaple}"
"${workspace_loc:/${ProjName}/STM32F4/cores/maple/libmaple/usbF4/VCP}"
"${workspace_loc:/${ProjName}/STM32F4/cores/maple/libmaple/usbF4/STM32_USB_OTG_Driver/inc}"
"${workspace_loc:/${ProjName}/STM32F4/cores/maple/libmaple/usbF4/STM32_USB_Device_Library/Core/inc}"
"${workspace_loc:/${ProjName}/STM32F4/cores/maple/libmaple/usbF4/STM32_USB_Device_Library/Class/cdc/inc}""${workspace_loc:/${ProjName}/STM32F4/variants/black_f407vet6}"
cflags:
-fno-exceptions
-fno-rtti
-fno-use-cxa-atexit
-fno-threadsafe-statics

linker
ldscript:flash.ld
lib search path:../ldscripts
cflags:
-nostdlib
-Xlinker --gc-sections
--specs=nano.specs

victor_pv
Posts: 1263
Joined: Mon Apr 27, 2015 12:12 pm

Re: IDE with Eclipse with Jantje's plugin

Post by victor_pv » Fri Apr 21, 2017 1:03 pm

Pito wrote:While trying to compile a naked arduino sketch in Sloeber for the F407 I get zillion errors like:

Code: Select all

..
C:/Users/pito/MyCode/Sloeber/WhetstoneSP/Release/arduino.ar(rccF2.c.o): In function `rcc_clk_enable':
C:\Users\pito\MyCode\Arduino\hardware\Arduino_STM32\STM32F4\cores\maple\libmaple/rccF2.c:653: multiple definition of `rcc_clk_enable'
C:\Users\pito\MyCode\Sloeber\WhetstoneSP\Release\arduino.ar(rccF2.c.o):C:\Users\pito\MyCode\Arduino\hardware\Arduino_STM32\STM32F4\cores\maple\libmaple/rccF2.c:653: first defined here
C:/Users/pito/MyCode/Sloeber/WhetstoneSP/Release/arduino.ar(rccF2.c.o): In function `rcc_clk_disable':
C:\Users\pito\MyCode\Arduino\hardware\Arduino_STM32\STM32F4\cores\maple\libmaple/rccF2.c:653: multiple definition of `rcc_clk_disable'
C:\Users\pito\MyCode\Sloeber\WhetstoneSP\Release\arduino.ar(rccF2.c.o):C:\Users\pito\MyCode\Arduino\hardware\Arduino_STM32\STM32F4\cores\maple\libmaple/rccF2.c:653: first defined here
..
C:/Users/pito/MyCode/Sloeber/WhetstoneSP/Release/arduino.ar(systick.c.o): In function `systick_enable':
C:\Users\pito\MyCode\Arduino\hardware\Arduino_STM32\STM32F4\cores\maple\libmaple/systick.c:64: multiple definition of `systick_enable'
C:\Users\pito\MyCode\Sloeber\WhetstoneSP\Release\arduino.ar(systick.c.o):C:\Users\pito\MyCode\Arduino\hardware\Arduino_STM32\STM32F4\cores\maple\libmaple/systick.c:64: first defined here
..
Basically all definition you can imagine are "multiple definitions".
But it always points to the same function in the same file :?

It compiles fine F407 under Arduino IDE. It compiles fine for F103 under Sloeber.
The structure of the ..\Arduino\hardware\Arduino_STM32\STM32F4 is similar to ..\Arduino\hardware\Arduino_STM32\STM32F1 but not identical. Any idea what went wrong here, plz?
I just started trying to compile for the F407 in sloeber and found the same errors. That is due to the "recipe" settings in platform.txt.
For the F103 the whole-archive flag was removed because it was pulling too many things into the .bin. Some corrections had to be made in the core, but I dont remember them, we will have to dig in old threads. The F407 platform.txt still includes the whole-archive flag, which is likely what causes those warnings.
I took it out to test, and the warnings go away, but I haven't tried the resulting bin, likely will not work and the core will need some corrections.

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

Re: IDE with Eclipse with Jantje's plugin

Post by Pito » Fri Apr 21, 2017 2:52 pm

I removed the 2 archive flags 2d back.. Took me a day to found the issue.. It works fine since then. Working with Sloeber.
viewtopic.php?f=41&t=655&start=100#p26636

PS: improved the Hint on how Sloeber takes over the platform.txt settings...
Pukao Hats Cleaning Services Ltd.

victor_pv
Posts: 1263
Joined: Mon Apr 27, 2015 12:12 pm

Re: IDE with Eclipse with Jantje's plugin

Post by victor_pv » Fri Apr 21, 2017 3:53 pm

Pito wrote:I removed the 2 archive flags 2d back.. Took me a day to found the issue.. It works fine since then. Working with Sloeber.
viewtopic.php?f=41&t=655&start=100#p26636

PS: improved the Hint on how Sloeber takes over the platform.txt settings...
Cool, I missed that post. I was trying to find how you got Sloeber to work with J-Link, would you mind pointing to the relevant post if you remember?

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

Re: IDE with Eclipse with Jantje's plugin

Post by Pito » Fri Apr 21, 2017 3:59 pm

Here you are :)
Guide:
viewtopic.php?f=41&t=655&start=40#p25805
Important as well - SWD enable:
viewtopic.php?f=41&t=655&start=50#p25866

You still have to start the J-link Server first (as the External tool - see the guide).
Ask when any issue, it works fine even with 407.

Outstanding issues:
1. How to start the Jlink Server by the green bug click :) - seems to be gnu arm eclipse issue
2. New: I cannot get F407 device from the installed STM32F4 PACK into
Project Properties C/C++Build Settings Devices
But debugging works with 407 (no peripheral registers imported in the view, however)..
Pukao Hats Cleaning Services Ltd.

victor_pv
Posts: 1263
Joined: Mon Apr 27, 2015 12:12 pm

Re: IDE with Eclipse with Jantje's plugin

Post by victor_pv » Fri Apr 21, 2017 5:33 pm

Pito wrote:Here you are :)
Guide:
viewtopic.php?f=41&t=655&start=40#p25805
Important as well - SWD enable:
viewtopic.php?f=41&t=655&start=50#p25866

You still have to start the J-link Server first (as the External tool - see the guide).
Ask when any issue, it works fine even with 407.

Outstanding issues:
1. How to start the Jlink Server by the green bug click :) - seems to be gnu arm eclipse issue
2. New: I cannot get F407 device from the installed STM32F4 PACK into
Project Properties C/C++Build Settings Devices
But debugging works with 407 (no peripheral registers imported in the view, however)..
Thanks, I want to use it for the 407. I'll post if I get any progress with those issues.

ag123
Posts: 634
Joined: Thu Jul 21, 2016 4:24 pm

Re: IDE with Eclipse with Jantje's plugin

Post by ag123 » Fri Apr 21, 2017 6:46 pm

i'd think it is a good idea to work in eclipse either with the addition of jantje's plugin or perhaps system workbench or in eclipse + gnu arm eclipse
i think each environment has their plus and minus and in fact eclipse would support arduino directly in the cdt in neon and oxygen (currently with a plugin) releases
https://marketplace.eclipse.org/content ... de-arduino

we can then 'back test' those sketches in the arduino ide subsequently, i'd think that'd be a good hybrid of both worlds

just 2 cents

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

Re: IDE with Eclipse with Jantje's plugin

Post by Pito » Fri Apr 21, 2017 6:51 pm

Outstanding issues:
1. How to start the Jlink Server by the green bug click :) - seems to be gnu arm eclipse issue
2. New: I cannot get F407 device from the installed STM32F4 PACK into
Project Properties C/C++Build Settings Devices
But debugging works with 407 (no peripheral registers imported in the view, however)..
Issue 2. solved.
I had to update the Packs plugin from http://gnuarmeclipse.sourceforge.net/updates-test repo, and I reinstalled F407 package from version 2.9.0 to 2.11.0.
Now I can see the peripheral registers of F407 while in debug, it seems.
Pukao Hats Cleaning Services Ltd.

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

Re: IDE with Eclipse with Jantje's plugin

Post by Pito » Tue Apr 25, 2017 5:52 pm

This is a script for flashing the .bin into mcu via JLink.exe.
You may use it as a "Flash Only" action from the External Tools (ie. when not using the debugger, which uploads).
Save it in "load.jlink" and copy it into your active project directory (an example):

Code: Select all

device STM32F407ZE
si 1
speed 4000
loadbin C:\Users\your_path\Blink407\Release\Blink407.bin, 0x08000000
r
g
q
and configure JLInk.exe in External tool configurations for "Flash Only" with following parameter

Code: Select all

-commanderscript ${project_loc}\load.jlink
PS: I've tried also w/ relative addresses in load.jlink, but with no luck. Any hint?
Pukao Hats Cleaning Services Ltd.

victor_pv
Posts: 1263
Joined: Mon Apr 27, 2015 12:12 pm

Re: IDE with Eclipse with Jantje's plugin

Post by victor_pv » Wed Apr 26, 2017 3:36 pm

Pito wrote:
Outstanding issues:
1. How to start the Jlink Server by the green bug click :) - seems to be gnu arm eclipse issue
2. New: I cannot get F407 device from the installed STM32F4 PACK into
Project Properties C/C++Build Settings Devices
But debugging works with 407 (no peripheral registers imported in the view, however)..
Issue 2. solved.
I had to update the Packs plugin from http://gnuarmeclipse.sourceforge.net/updates-test repo, and I reinstalled F407 package from version 2.9.0 to 2.11.0.
Now I can see the peripheral registers of F407 while in debug, it seems.
I got the different packs installed, and after a couple of hours fighting with the debugger settings in my case the GDB server launches fine, at least the GUI one, but the GDB client doesn't ever launch.

First it was giving me an error and not opening anything:
"Error while launching command: gdb --version"

The path for gdb is shown as:

Code: Select all

${cross_prefix}gdb${cross_suffix}
I could not see those variables anywhere, so I modified that to the path where the gdb executable is (same path as gcc, etc)

After thatit doesn't show the "gdb --version" error, it opens the GDB server (GUI)correctly, that connects to the target, and shows a message "waiting for client connection" at the bottom. After a while waiting eclipse shows an error with a timeout. Forgot to write down that error message.

Now I just found this link, which talks about those paths, so I will try to see when I get home if it helps me.
http://gnuarmeclipse.github.io/toolchain/path/

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests