cancel
Showing results for 
Search instead for 
Did you mean: 

Program STM32F103C8T6 with Eclipse on a Windows 10 machine

Gary Rubin
Associate III
Posted on April 29, 2017 at 04:09

OK, I am sold on STM32 big time. The devices I am using are on a development board, but it's the STM32F103C8T6 at the core. It is the same device used to program using STLINK V2 from a discovery board.

When I can program this device, I plan to production run my own board using this device. 

What I am having lots of issues with is programming the device with other than the Arduino IDE. I want to use Eclipse on a Windows 10 machine, and maybe use my home Debian Linux server but it has no GUI. I do not want to CLI or Command Line Interface this board for now.

I have gone through numerous tutorials and posts about using OpenOCD with Eclipse, but nothing I have followed has worked.

I am using a STM32 discovery board to program my STM32F103C8T6 and it works fine with Arduino IDE. I want to break out of the Ardiuno IDE though and use Eclipse. I am interested in using my Eclipse Neon 3 build to program everything I have embedded that supports SWD.

I don't want my hand held in doing this. Just a link to a working tutorial would be good enough for me. Advice in addition would be cool, but I know all of you are so busy.

Thank you for your time!

Sincerely,

Hop

1 ACCEPTED SOLUTION

Accepted Solutions
Posted on May 09, 2017 at 01:47

I solved it. I had a windows God Mode shortcut on my desktop. Apparently, that is all that was needed to crash java apps dependent on JRE. See my stack overflow post here.

http://stackoverflow.com/questions/43836174/java-applications-crash-when-browse-control-used

Something worth putting into OneNote for sure. I removed the shortcut and now all my java apps work again. YAY! This caused me a day of research into my goal, but certainly vindicates the software recommended here. It looks like I will be able to build my IDE or use System Workbench to reach my goal and finally close this thread. Thank you again AvaTar for your help and advice!

View solution in original post

11 REPLIES 11
Posted on May 02, 2017 at 17:26

Hi Gary,

A few days ago a made a test of one mini board with this same microcontrollers using System Workbench for STM32, this is an IDE based on eclipse and for me have worked quite well. You can download from this web site:

http://www.openstm32.org/System+Workbench+for+STM32

 

Just register and download!

To take advantage of this software I'm using also ST32CubeMx to initialize the peripherals, the CubeMX create the project, and then you import in the IDE.

If you have any dude don't hesitate to consult me, have a nice day.

AvaTar
Lead
Posted on May 02, 2017 at 17:57

I think you need to install the ST-Link drivers, as found on the ST website.

Your IDE will (probably) recognize and use it automatically.

And, the ST-Link utility, a software provided by ST, comes with a CLI version as well.

Posted on May 03, 2017 at 01:03

Yes, thank you Elkin. Coincidence has it that I did stumble onto Workbench for STM32 but I did not do the standalone version. I did the plugin into Eclipse Neon 3 CPP and was wondering how to utilize it. And there is a CubeMX Eclipse plugin (also installed) but not sure how to implement that either. I really like CubeMX by the way!! I wish they had something like that for Microchip PIC processors back in the day.

It seems I am on the right path though, thank you for the info!! And I sincerely appreciate the offer of help if I need it. I have been stumbling around in the dark since I started my break from Arduino IDE. Many people have taken this path and get it working, but they either want to keep it to themselves or they write a tutorial but it is dated or missing important pieces. Of course, if I were to write one after I get this working, it will probably look that way to most I am sure.

One thing you can answer for me now though... do I need OpenOCD to upload to the device or is the STM32 Utility enough?  And if so... should I install it on its own or would it work inside a Cygwin install? You see, I have fragments of several different approaches and tutorials. The last thing I want to have to do is use a separate app to burn a binary or hex file. And I want to take advantage of debugging,. And I wonder if I can do that with SWD or do I have to use JTAG. As you may already know, the blue pill STM32F103C8T6 board I have only sports a 4 pin SWD interface. 5 or 6 pins if I break out to other locations on the board. The SWD interface on my STM32L152C Discovery board is 6 pins for STLINK v2.0.

Sorry for the info and question flood. 

Posted on May 03, 2017 at 07:51

do I need OpenOCD to upload to the device or is the STM32 Utility enough?

No. This is an alternative driver software for the ST-Link debug pod. If the original (ST) drivers work for you, stick to it.

 And if so... should I install it on its own or would it work inside a Cygwin install?

The OpenOCD firmware was originally written for Linux. trying to bring it to Windows via Cygwin would IMHO be a little ... backward.

And I wonder if I can do that with SWD or do I have to use JTAG.

...

The SWD interface on my STM32L152C Discovery board is 6 pins for STLINK v2.0.

Of course, all the Cortex-M JTAG adapters I know support SWD as well.

The ST-Link on the discovery boards support only SWD.

But IMHO, a board with an onboard ST-Link adapter would have suited you better, at least to get started.

Like the discovery or Nucleo boards.

Just install the drivers, plug it in,and it works (... most of the time 😉 ).

Posted on May 03, 2017 at 16:59

Hi Gary,

Well, I'm not an expert on this topic, but what I could said to you is the following:

I have just install the st-link drivers in my computer, and those works fine with System Workbench, I can program the microcontroller from the IDE, just a few configurations (select if st-link is V2 or V2-1 and well done), I can make debug from the IDE (I think that this is the most useful and powerfull tool of the IDE in compare with the arduino IDE, it has helped to me A LOT). I have used as programmer (just for testing and prototyping) the ST-Link of a Discovery Board, of a Nucleo Board, and a ST-Link V2, and all of those works fine. I think that the IDE is almost complete, I would like to mount a video explaining how to use all development environment (CubeMX, SW4STM32, ST-Link), hope to could do it soon, but my english is not really good, hehe...

Could you attach an image with the board and the programmer that you are using, just for reference!

Posted on May 05, 2017 at 01:03

Cygwin, backwards maybe. I thought about that too. The thing is, all my Debian Linux installs are servers, LAMP or otherwise. I do not have a GUI with any of them. I need an IDE however and netbeans 8.1 taught me that when I was working on web apps for my main home server. So my main programming environment was going to have to be on Windows 10, but all of the CLI goodies were Linux. So that is why Cygwin, at least for my current level of understanding in this exciting game. 

Where I am at now though is I am trying out both STM32 System Workbench AND a GNU ARM ECLIPSE Plug-ins approach. I am being careful to keep them isolated. I just received my Nucleo-F411RE boards to go with my STM32L152C Discovery boards. I'll leave the STM32F103C8T6 out of the picture for now until I get it all working, and decide which environment causes the most pain and suffering, or enlightenment. I am hoping to know more by the end of tomorrow.

Posted on May 05, 2017 at 01:09

Hi Elkin, your English looks just fine to me save for a grammatical error or two. Nicely done!

Did you want an image of the STM32F103C8T6 board I am using and what I am using for the STLINK V2? I will up it that also shows my connection strategy. I used Arduino IDE to program the blue pill board I have, but like you, I was unhappy on how it limited me. The STLINK I am using is through the STM32L152C Discovery. I pulled the jumpers so the SWD interface was active, not the on-board development targeted MCU. I am not using a full STLINK device or a clone. At least not yet. I see the connections with the dedicated STLINK device are a bit more busy than the 5 pin SWD I am using. I assume this is for JTAG and I have not fully explored that interface just yet.

Gary Rubin
Associate III
Posted on May 07, 2017 at 04:17

Well I have run into some interesting issues. At first, I was trying to set up Eclipse Neon3 CPP to do what I wanted, but I could not get OpenOCD to work. Then I went to the STM32 System Workbench, but not I have a totally new and terrible issue. It seems that every JRE dependent application I have crashes when I click a browse control, or a link that browses... like for example... STM32CUBEMX. If I click on load a project, the application closes. Same thing happened with the install_sw4stm32_win_64bits-v1.14.0.exe app. When I clicked browse to find a new location, the app just closed, or crashed. I cannot find any JRE logs to give me a clue on what happened.

I uninstalled the latest JRE and reinstalled, yet the problem continued. I then went back from  8.131 to 7.80 and still the same problem. I went into the Java Console and cleared the cache but still not working.

Does anyone have any ideas on what could have gone wrong or at least where to see some Java Runtime Environment logs to diagnose this issue?

Posted on May 08, 2017 at 09:53

I would try a Java / Eclipse-related forum.

I uninstalled the latest JRE and reinstalled, yet the problem continued.

Applications often leave harmful remains in the Window$ registry after deinstallation.

Perhaps a registry cleaner would help.

Or for testing purposes, a test install on another, clean machine.

Does anyone have any ideas on what could have gone wrong or at least where to see some Java Runtime Environment logs to diagnose this issue?

AFAIK, these logs are somewhere in the user directory. But I remember that logs not used to be very descriptive and helpful.