Skip to main content
Gary Rubin
Associate II
April 29, 2017
Solved

Program STM32F103C8T6 with Eclipse on a Windows 10 machine

  • April 29, 2017
  • 11 replies
  • 3158 views
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

    This topic has been closed for replies.
    Best answer by Gary Rubin
    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!

    11 replies

    Elkin Granados
    Associate II
    May 2, 2017
    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.

    Gary Rubin
    Associate II
    May 3, 2017
    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. 

    AvaTar
    Senior III
    May 3, 2017
    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 ;) ).

    AvaTar
    Senior III
    May 2, 2017
    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.

    Gary Rubin
    Associate II
    May 7, 2017
    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?

    AvaTar
    Senior III
    May 8, 2017
    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.

    Gary Rubin
    Gary RubinAuthorBest answer
    Associate II
    May 9, 2017
    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!

    Gary Rubin
    Associate II
    May 13, 2017
    Posted on May 13, 2017 at 22:00

    This thread was prematurely marked as ANSWERED and it was not by me, but that is perfectly ok. It was my fault because I layered another related issue on top of the original posted issue/question. Fact is, both issues are solved. The Java App crash issue by me, and now the original issue, by me again!

    I could not get System Workbench to work for me. Not because the software is faulty, it is because my routes to success were flawed in some way, maybe outdated or misinformation. I DID get my Eclipse to be able to build, flash, and debug my board though using the GNU-ARM approach with separately configured software and components. It took a lot of tweaking, but it works great with my STM32L152C Discovery board configured as an ST-LINK adapter for external use (jumpers pulled and SWD interface used) and attached “Blue Pill� STM32F103C8T6 development board. For anyone that asks, I will post what I did. I am writing that up this weekend actually so I do not forget the hoops I had to jump through.

    I have not tested this with my Nucleo F411RE board just yet. That is coming this weekend. I have 2 each of the Nucleo and Discovery boards mentioned. At least now I can program AND DEBUG my target board and processor and not be dependent of the hand-holding of Arduino IDE. It is great for what it did for me and countless others, but I have moved to a higher plane.

    Thanks again to the contributors of my thread!! I appreciate your time and knowledge!