STM32 with Eclipse, STM32Cube, GNU ARM and J-Link.

Development environment specific, Arduino, Eclipse, VS2013,Em::Blocks etc
User avatar
ahull
Posts: 1630
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

STM32 with Eclipse, STM32Cube, GNU ARM and J-Link.

Post by ahull » Tue Aug 22, 2017 10:08 am

Youtube suggested this three part tutorial to me.

They look pretty useful, however my lack of free time precludes me from going through them.







Let me know your thoughts. :D
- Andy Hull -

User avatar
Rick Kimball
Posts: 1040
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: STM32 with Eclipse, STM32Cube, GNU ARM and J-Link.

Post by Rick Kimball » Tue Aug 22, 2017 8:53 pm

I took a quick look at the beginning of the first video and he is focused on using a strange mix of eclipse + gnu eclipse plugin + jlink tools. This might have been a reasonable approach some 5 years ago.

The path of least resistance solution in 2017 is:
Once you have everything installed you end up with the STM32CubeMX code generator that is integrated with SW4STM32 with a gnu-arm-none-eabi toolchain w/openocd already configured for st-link devices. STM32CubeMX will generate code for SW4STM32 and then offer you the option to launch an eclipse project after the end of code generation. All you need to provide is any stm32 dev board and an st-link programmer device. The easiest route for those in the US is to buy a Nucleo-F103RB board (assuming you also want to work stm32duino/libmaple) or buy a BluePill and an ST-Link Clone from ebay.

SW4STM32 is an eclipse distribution that includes all the required binary tools and configuration files for STM32 chips integrated as a single download. It has been put together by http://www.ac6.fr/ and "I think/I'm guessing" funded by ST.

While Jan is providing a way that works, it is certainly more painful than the above solution.
-rick

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

Re: STM32 with Eclipse, STM32Cube, GNU ARM and J-Link.

Post by RogerClark » Tue Aug 22, 2017 10:01 pm

I briefly looked at the videos, but found them very slow and yet did not explain clearly what he was doing.

In addition to what Rick said..
On Windows you can download and use Atollic True Studio for free, and the STMCube directly outputs project files for it.
AFIK, The license on True Studio allows full free use of the basic version without and restrictions e.g allows for commercial dev.

zmemw16
Posts: 1449
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: STM32 with Eclipse, STM32Cube, GNU ARM and J-Link.

Post by zmemw16 » Tue Aug 29, 2017 3:25 am

@Rick,
surprisingly easy, hal stm32f103ze from cubemx compiled, etc, etc.
debug, just watching a variable changing, nothing further.

any ideas on how i can apply it's already configured debug setup with an arduino stm32 elf/bin ?
another thought is how would i export the arduino source tree into sw4stm32 ?

stephen

User avatar
Rick Kimball
Posts: 1040
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: STM32 with Eclipse, STM32Cube, GNU ARM and J-Link.

Post by Rick Kimball » Tue Aug 29, 2017 3:59 am

zmemw16 wrote:
Tue Aug 29, 2017 3:25 am
any ideas on how i can apply it's already configured debug setup with an arduino stm32 elf/bin ?
another thought is how would i export the arduino source tree into sw4stm32 ?
A long time ago I posted an eclipse project that imported the stm32 arduino libmaple stuff. It is a lot of work to keep it up to date. You have to setup all the configuration variables / settings / paths ... not worth the effort.

Sloeber is an attempt to make using the eclipse + arduino a simple thing. However, that seems to have its own set of issues.

My personal take is that if you want to do arduino, you should just use arduino. If you want to do HAL coding just do HAL coding and use STM32CUBEMX + SW4STM32. You can always use an external editor to make the coding easier for Arduino.
-rick

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

Re: STM32 with Eclipse, STM32Cube, GNU ARM and J-Link.

Post by Pito » Tue Aug 29, 2017 7:58 am

What are the issues with Sloeber actually?
Pukao Hats Cleaning Services Ltd.

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

Re: STM32 with Eclipse, STM32Cube, GNU ARM and J-Link.

Post by RogerClark » Tue Aug 29, 2017 8:00 am

Pito wrote:
Tue Aug 29, 2017 7:58 am
What are the issues with Sloeber actually?
There is are several threads about Sloeber issues already. Its probably best not to go through things all over again in this thread

Its best to not go too far off topic, as this thread is about those videos that were recommended (by youtube) for Andy

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

Re: STM32 with Eclipse, STM32Cube, GNU ARM and J-Link.

Post by Pito » Tue Aug 29, 2017 8:05 am

A rhetorical question.. :)
Pukao Hats Cleaning Services Ltd.

zmemw16
Posts: 1449
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: STM32 with Eclipse, STM32Cube, GNU ARM and J-Link.

Post by zmemw16 » Tue Aug 29, 2017 11:22 am

easy to in arduino, array of pa8,pb7,pc4 etc, set all as outputs and high in a loop, sweep over them with a low and and high. checks the wiring and easy to check on logic sniffer - blips in a nice row of ducks across & down the screen - doddle
even after umteen years i still have to work at c/really hard for c++,, bare metal even in cubemx and sw4stm32;it's still a bit steep. all the little snippets just to get to a serial o/p, printf - keep going et al; all freebies in arduino.

stephen

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

Re: STM32 with Eclipse, STM32Cube, GNU ARM and J-Link.

Post by ag123 » Sat Nov 11, 2017 4:42 pm

well i'm actually using gnu-arm-eclipse, less that stm32cube, j-link etc and no sloeber
i did not actually try out SW4STM32, but the videos on that in youtube looks good
as for gnu-arm-eclipse (which apparently has been renamed to gnu-mcu-eclipse)
https://gnu-mcu-eclipse.github.io/
it so happened that i ran into it initially when i'm searching for a way to build arduino_stm32 in eclipse and more importantly i'm impressed with the debug offerings and the emulator in gnu-arm-eclipse
however, the emulator isn't perfect and would probably work for only the simplest of sketches, the boot loader would also cause problem and emulation may mean having to build for it to run at start of flash 0x8000000
that funky emulator actually emulates a *led blink*, yup that works with real code, but beyond that e.g. if you want the boot loader etc, there are lots of challenges to be overcome etc. And apparently only some of the series e,g. stm32f103 is supported
of course the holy grail is to be able to emulate the stm32 mcu in most aspects so that you would be able to test and debug a sketch or any firmware virtually in the emulator itself, but it could be an up hill task to enhance that open sourced emulator to do just that

i've wanted the emulator to do spi and ili9341 emulation but it seemed a pretty (very) difficult challenge, 1st is the need to build the codes for the spi emulator parts of it, then to intepret ili9341 commands and show the graphics. but if this challenge can be overcome, we'd be able to literally emulate and test full gui codes of a stm32 with ili9341

Post Reply