Author Topic: So how do you even start working with STM32 without paying an arm and a leg?  (Read 32199 times)

0 Members and 1 Guest are viewing this topic.

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Have you tried to raise a bug or support issue with ARM ?
No, but I have filed several bug reports with the GCC project, where it's seen by the people doing the actual development work.

Quote
ARM's primary focus is on selling cpu cores via licensing NOT developing software. They do it as a necessary support in order to maintain sales.
Precisely. ARM have realized their products are useless without software to run on them, which is why they're investing so much in tool support.

Offline BurnedResistor

  • Regular Contributor
  • *
  • Posts: 192
  • Country: at


If you are gonna go the Eclipse ARM GNU/OpenOCD route, by the far the best guide for getting up and running I have come across was this:

https://leanpub.com/mastering-stm32

The free sample includes a complete tutorial on how to setup the toolchain start to finish.

I highly recommend you go an buy the book however.

It walks you through using more advanced features like semihosting,
explains the stm32cube HAL,
explains how to integrate the cube mx software with the whole toolchain,
etc

It is a really great resource, plus if you google the authors name you will find his website where there is similar info on the topic!
 It might be strange to buy an unfinished book, but you receive any new chapters as they come out. Besides what is there is already easily worth the twenty bucks the thing is gonna cost you.

Anyway, I highly recommend it
 

Offline ez24

  • Super Contributor
  • ***
  • Posts: 3082
  • Country: us
  • L.D.A.
YouTube and Website Electronic Resources ------>  https://www.eevblog.com/forum/other-blog-specific/a/msg1341166/#msg1341166
 

Offline Kilrah

  • Supporter
  • ****
  • Posts: 1852
  • Country: ch
One of the most insiduous issues facing the software industry is the apparent lack of value associated with software. [...] The large amount of free software helps to diminish the value of maintaining teams of people developing and maintaining software. ARM's primary focus is on selling cpu cores via licensing NOT developing software. They do it as a necessary support in order to maintain sales.

You've managed to say in the same paragraph that software's lack of apparent value makes it hard to fund, and prove the opposite by giving an example of a company whose core business isn't software but who can both recognise its value and fund its development. Congrats...  :-DD
 

Offline OZ1LQB

  • Regular Contributor
  • *
  • Posts: 51
  • Country: dk
Hi..
As others have said get the Mastering STM32 book..
i have only had it for a day and it have helped me understand a few things
i had problems understanding before i got it. is well worth its price
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
One of the most insiduous issues facing the software industry is the apparent lack of value associated with software. [...] The large amount of free software helps to diminish the value of maintaining teams of people developing and maintaining software. ARM's primary focus is on selling cpu cores via licensing NOT developing software. They do it as a necessary support in order to maintain sales.

You've managed to say in the same paragraph that software's lack of apparent value makes it hard to fund, and prove the opposite by giving an example of a company whose core business isn't software but who can both recognise its value and fund its development. Congrats...  :-DD
I could not have put it better.
Open source software isn't free but a collaborated effort to create a piece of software the individual parties cannot fund alone. In case of GCC ARM builds on the foundations made by others so they don't have to start from scratch.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline jnshadow

  • Newbie
  • Posts: 7
  • Country: us
Ok, so back to the OP -- I too advocate using Eclipse for hobbyist stuff; if you are working a startup or plan to eventually sell what you build, then you can gain efficiencies from the infrastructure of product testing, standardized training, software configuration management, etc. from the for-fee pro development tool kits.

It is the same as building a shed -- it's one thing to do it on a weekend with your tools one time; it's a whole different thing to do it professionally over and over again at multiple sites and different weather conditions to put food on the table for your family.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
@jnshadow: you clearly overlooked the fact the Eclipse has been made to do just that: large scale software development. The regular IDEs fall very short when it comes to actually managing code (versioning system integration for example).
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Rithers

  • Newbie
  • Posts: 8
  • Country: us
https://leanpub.com/mastering-stm32

wow what a great book.   The ocean of information out there (the documents on ST's website alone!)  makes it very difficult to get started,
what a pleasure to have something laid out step-by-step in such great detail. 

for those willing to switch boards for ARM,  Ive been taking the "Embedded Systems: Shape the world" course:
https://www.edx.org/course/embedded-systems-shape-world-utaustinx-ut-6-03x
Which uses the T.I. Launchpad TM4C123 and Keil uVision for their labs.   A time commitment for sure, but they go into all the details.

As a result of that course I am most "at home" working with a Texas Instruments chip, however ST's bells&whistles, coupled with their very
sexy graphic design team,  keep me going back for more in spite of their wormhole of documentation.

/etienne
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Quote
Ive been taking the "Embedded Systems: Shape the world"
Yes - it's a good course.  They do fairly generic bare-metal ARM programming, rather than relying on vendor libraries, so it's worth looking at even if you have little interest in TI MCUs.
 

Offline jnshadow

  • Newbie
  • Posts: 7
  • Country: us
@nctnico -- agree, Eclipse has gotten very capable over time.
 

Offline parasole

  • Contributor
  • Posts: 48
  • Country: md
https://leanpub.com/mastering-stm32
...Anyway, I highly recommend it
Me too
Confirm, I did setup the tool-chain in half an hour by following the book, it is awesome!
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
I wrote a series of "getting started on ..." blog posts and quite a few touch on the Cortex-M chips across a wide spectrum of vendors and toolchains.

Most of those take 10 - 20 steps to finish, some far less.

Setting up a project in an IDE is a simple task and surprisingly similar across tool chains. It always amazes me that people could struggle on something like that.
================================
https://dannyelectronics.wordpress.com/
 

Offline ez24

  • Super Contributor
  • ***
  • Posts: 3082
  • Country: us
  • L.D.A.
https://leanpub.com/mastering-stm32

Confirm, I did setup the tool-chain in half an hour by following the book, it is awesome!

 |O  It took me a week  |O  (too many dead brain cells)  and the wrong LED blinked, the power LED (suppose to be impossible)

YouTube and Website Electronic Resources ------>  https://www.eevblog.com/forum/other-blog-specific/a/msg1341166/#msg1341166
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
https://leanpub.com/mastering-stm32

Confirm, I did setup the tool-chain in half an hour by following the book, it is awesome!

 |O  It took me a week  |O  (too many dead brain cells)  and the wrong LED blinked, the power LED (suppose to be impossible)



Are you sure you didn't look at the ST-Link LEDs? Those do blink when the device is communicating with OpenOCD (for example).

Otherwise, one can certainly make the power LED blink too with a bit of hardware prep - by shorting the power supply with an MCU pin. That will trigger reset and thus make it "blink". Not a recommended way to implement a blinky LED, though!
 

Offline krish2487

  • Frequent Contributor
  • **
  • Posts: 500
  • Country: dk
@op
As someone who was in your shoes a couple of months ago, I totally sympathise with you.


Just my 2cents, try platformio. It pretty much takes the pain out of setting up any toolchain. Works off gcc and has support for mbed, CMSIS, SPL and opencm3. Oh and has support for a variety of boards and manufacturers.


I d suggest you go with openCM3 for the library support. Pretty easy to use for a beginner. It pretty much plug and play. and quite a lot of examples floating around.


PS: I am not affiliated to platformio in anyway. Just had a good experience and trying to share them with the people here. :-)
If god made us in his image,
and we are this stupid
then....
 
The following users thanked this post: parasole

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Did anyone try this: http://www.openstm32.org ?
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
@op
As someone who was in your shoes a couple of months ago, I totally sympathise with you.


Just my 2cents, try platformio. It pretty much takes the pain out of setting up any toolchain. Works off gcc and has support for mbed, CMSIS, SPL and opencm3. Oh and has support for a variety of boards and manufacturers.


I d suggest you go with openCM3 for the library support. Pretty easy to use for a beginner. It pretty much plug and play. and quite a lot of examples floating around.


PS: I am not affiliated to platformio in anyway. Just had a good experience and trying to share them with the people here. :-)

Does Platformio support libopencm3 now? I didn't the last I have checked (but they supported ChibiOS). I don't like their "automagic" SCons based build system though - it makes it messy to integrate external libs or tools.

Otherwise, libopencm3 is very good, indeed. Just be careful about some limitations - e.g. no I2C support on F0 series (there is a pending patch), some hw support is incomplete, etc. Also the documentation could be better - you often have to "reverse engineer" how to do certain things from the examples and tests, there is very little documentation. However, it is a good starting point - e.g. bringing up an USB device from scratch using libopencm3 has been the least painful I have seen so far and that even doesn't use an RTOS. It just worked. And code size tends to be a lot smaller than STDPeriph or HAL.
 
The following users thanked this post: krish2487

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Did anyone try this: http://www.openstm32.org ?

That is ST's site for their System Workbench (SWSTM32). It is basically Eclipse + plugins to support ARM and ST's micros, using GCC as compiler, targeting their Cube/HAL ecosystem. It works, but it isn't really any different from using Eclipse + GNU Arm plugins and GCC.
 

Offline mpavlov

  • Contributor
  • Posts: 25
  • Country: bg
Two free IDEs

I have tried both
http://www.emblocks.org/
Very easy to start, support ST-Link and J-Link


http://www.coocox.org/
you have to install gcc toolchain for yourself 
but works fine also
« Last Edit: August 18, 2016, 07:22:35 pm by mpavlov »
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Emblocks and coide (1.x) are my favorite ides.
================================
https://dannyelectronics.wordpress.com/
 

Offline Miyuki

  • Frequent Contributor
  • **
  • Posts: 905
  • Country: cz
    • Me on youtube
Hi I want to ask
Have someone experience with built in bootloader over UART and use with simple USB to 3.3V UART adapter ?

Does it work fine? Have it any limitations ?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
I have used with stm32f0. Fairly straight forward but does need a little bit of manual intervention for the boot pin and reset pin. If you go through the ghetto thread you may find more details

A better approach is to find one with USB bootloader's. Nucleo and some NXP boards support that. I used a lpcxprrsso 1769 board to experiment back when it was introduced.

So the message is 1. It works 2. Not the best or the most convenient solution.
================================
https://dannyelectronics.wordpress.com/
 

Offline Miyuki

  • Frequent Contributor
  • **
  • Posts: 905
  • Country: cz
    • Me on youtube
I want it to flash own board without other interface I think I can live without debug interface
 

Offline krish2487

  • Frequent Contributor
  • **
  • Posts: 500
  • Country: dk


I am sorry for delay in response, thank you for the heads up regarding the incomplete libraries. :-)
It does support openCM3 now, and they have recently introduced platformio 3 which adds support for unit testing :-)
However, try as I might, I am unable to get it to work.. :-(. Maybe one of these days when I am sufficiently free though...
You are right though, I did have to reverse engineer some examples to start coding and understanding them.
The team is fairly prompt in responding to the queries posted on the forum and helpful.


Quote from: janoc on August 18, 2016, 04:02:06 AM


>Quote from: krish2487 on August 15, 2016, 08:29:01 PM
@op
As someone who was in your shoes a couple of months ago, I totally sympathise with you.


Just my 2cents, try platformio. It pretty much takes the pain out of setting up any toolchain. Works off gcc and has support for mbed, CMSIS, SPL and opencm3. Oh and has support for a variety of boards and manufacturers.


I d suggest you go with openCM3 for the library support. Pretty easy to use for a beginner. It pretty much plug and play. and quite a lot of examples floating around.


PS: I am not affiliated to platformio in anyway. Just had a good experience and trying to share them with the people here. :-)



Does Platformio support libopencm3 now? I didn't the last I have checked (but they supported ChibiOS). I don't like their "automagic" SCons based build system though - it makes it messy to integrate external libs or tools.

Otherwise, libopencm3 is very good, indeed. Just be careful about some limitations - e.g. no I2C support on F0 series (there is a pending patch), some hw support is incomplete, etc. Also the documentation could be better - you often have to "reverse engineer" how to do certain things from the examples and tests, there is very little documentation. However, it is a good starting point - e.g. bringing up an USB device from scratch using libopencm3 has been the least painful I have seen so far and that even doesn't use an RTOS. It just worked. And code size tends to be a lot smaller than STDPeriph or HAL.


If god made us in his image,
and we are this stupid
then....
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf