Author Topic: EEVblog #900 - STM32 ARM Development Board  (Read 29372 times)

0 Members and 1 Guest are viewing this topic.

Offline EEVblog

  • Administrator
  • *****
  • Posts: 31396
  • Country: au
    • EEVblog
EEVblog #900 - STM32 ARM Development Board
« on: July 13, 2016, 11:41:46 pm »
Dave takes a look at the ST STM32 L1 series low power ARM chips, and gets a cheap STM32L152C development board up and running with the IAR Embedded workbench compiler and STLINK/V2 interface.
Also a look at the STMcubeMX code initialisation application.

http://amzn.to/29CrU47
32L152CDISCOVERY  http://bit.ly/29wtzqH
Schematic & User Manual: http://bit.ly/2aaEXWo

PIC32MX: http://www.microchip.com/wwwproducts/en/PIC32MX320F128L

 
The following users thanked this post: jancumps, AF6LJ, OldTechUK

Offline vlad777

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: 00
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #1 on: July 14, 2016, 12:23:03 am »
Is this it ?

GNU Tools for ARM Embedded Processors

https://launchpad.net/gcc-arm-embedded/

Mind over matter. Pain over mind. Boss over pain.
-------------------------
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12135
  • Country: gb
    • Mike's Electric Stuff
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #2 on: July 14, 2016, 12:28:48 am »
EWARM is nice but don't get too used to it unless you have a few K to spend on the full version once you need more code space.
Not sure if it's current but Future are showing $3395 for "baseline", which is up to  256K code.

Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Online ebclr

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: 00
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #3 on: July 14, 2016, 02:16:32 am »
 

Online ebclr

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: 00
 

Offline boffin

  • Supporter
  • ****
  • Posts: 958
  • Country: ca
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #5 on: July 14, 2016, 03:37:28 am »
Thanks for the video Dave, interesting to watch.

I note you're a big fan of opening new tabs, and wanted to point out that holding down CTRL while clicking a link does the same thing as rightclick and selecting "open in new window"

Ooh, and almost forgot to ask, what software are you using for the multi source screen capture? It seems to work really well.

 

Offline vlad777

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: 00
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #6 on: July 14, 2016, 03:44:09 am »
Thanks for the video Dave, interesting to watch.

I note you're a big fan of opening new tabs, and wanted to point out that holding down CTRL while clicking a link does the same thing as rightclick and selecting "open in new window"

Ooh, and almost forgot to ask, what software are you using for the multi source screen capture? It seems to work really well.

Center click (mouse 3) on the link opens it in new tab also.
Mind over matter. Pain over mind. Boss over pain.
-------------------------
 
The following users thanked this post: ebclr

Offline Hemogloben

  • Newbie
  • Posts: 2
  • Country: us
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #7 on: July 14, 2016, 03:57:56 am »
Atollic TrueSTUDIO is an Eclipse based GCC dev environment.  I'm unwilling to go back and find the exact timestamp but the first document that mentioned GCC specifically mentioned Atollic TrueSTUDIO as the supported platform, Dave just didn't read the full line.

STCube only directly supports GCC via Atollic TrueSTUDIO, ie the only GCC version you get a proj file for is TrueSTUDIO.  I suspect this is because TrueSTUDIO is a simple installer whereas any eclipse cdt environment requires multiple installs and configs (even though GNU ARM Eclipse is a totally awesome effort).  Nice things about TrueSTUDIO include an unlimited version for even commercial development.  Pro / paid version has features that even include features that GNU ARM Eclipse don't include: Live variables, ITM console support / profiling, ETB support etc.

Not a shill; got a job at a new company and had to evaluate EVERY major Embedded IDE and I found TrueSTUDIO the most cost effective and laughed at Dave running into every major confusion I had.

Aside quick reviews of major tool chains:
  • Keil: Great config, probably great compiler.  Great debug support.  Editor sucks.
  • Crossworks: Beautiful editor with fantastic configuration screen. Okay editor.  Lacking Debug support.
  • IAR: Editor sucks.  Great everything else.  Too damn expensive.
  • TrueSTUDIO: Great compromise for the company I work for.  They recently changed corporate strategy and seem to be in flux; bit of a risk but they have many debug features and their free version is awesome.  Plus it's based on eclipse so tons of plugins.
  • Eclipse + GNU ARM Eclipse: Really tolerable environment.  Used it for 1.5 years before TrueSTUDIO.  Free and many plugins tools to help / fix problems.  Only issue is lack of advanced debug features and the fact that Liviu is likely stretched thin.

FINAL EDIT: We were looking for cross vendor ARM Cortex-M solutions so I didn't check out any vendor specific IDEs though SIlabs Simplicity and NXP both seem like feature-full options if you're willing to lock-in.
« Last Edit: July 14, 2016, 04:02:56 am by Hemogloben »
 
The following users thanked this post: bitwelder


Offline jesuscf

  • Regular Contributor
  • *
  • Posts: 230
  • Country: ca
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #9 on: July 14, 2016, 04:25:51 am »
Great video!

Very recently (like five days ago) I went to the very same process for the NXP LPC824 (ARM Cortex-M0).  Very quickly I got frustrated with LPCXpresso for exactly the same reasons as Dave in the video;  and that makes me feel less stupid!  One question for NXP: why do I have to register with you in order to use the GCC and Eclipse included with LPCXpresso?  Aren't those two supposed to be free and open?  Anyhow, I ditched LPCXpresso and went old school with GCC,  makefiles, and linker scripts.  It took me a couple of days to do what I wanted to do.  I used GCC from https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads.   Now I want to do the same for the STM32F051 or a similar processor with comparable price and package options.
Homer: Kids, there's three ways to do things; the right way, the wrong way and the Max Power way!
Bart: Isn't that the wrong way?
Homer: Yeah, but faster!
 


Offline calin

  • Regular Contributor
  • *
  • Posts: 226
  • Country: us
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #11 on: July 14, 2016, 04:41:58 am »
Here .. the real ARM GCC for Cortex M - officially supported by ARM https://launchpad.net/gcc-arm-embedded

[/size]You can always grab Eclipse IDE for C/C++ from here - http://www.eclipse.org/downloads/eclipse-packages

If you want you can install Eclipse Arm Plugin from here - http://gnuarmeclipse.github.io/ and have projects managed by eclipse. [/font]

These do rally give you a full complete C/C++ dev environment with HW debugging options and all. There are literally hundreds of plugins for Eclipse, What to use .. depends what you like. Now one word of advice, you want to be on your own feet, DO NOT RELY ON THE IDE .. real developers use make and control how the project is built, organized, compiler options etc. IDE is good for editing and visual stuff and can be used in parallel with your own make. Trust me .. is frustrating at the beginning to set your project build process but it will pay for your efforts then times what you invest.


BTW .. the GCC is slow is utter FUD and bull$#^ sold by guys like IAR and other "compiler vendors". They sell snake oil. Yes there are differences in code size, instruction order etc but no compiler is king @ everything. There are areas where on compiler gens marginally better code and is beaten in other hands down. There is no clear winner when you compare them - if you manage to get in that area where the compiler do really matter you are either really f-ing good @ this or have gone mad :) I still have to find one project in 20 years of career where the compiler is an issue for speed .. 99.99999999 % is the bad programmer :)

 

Offline gnasirator

  • Contributor
  • Posts: 32
  • Country: nz
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #12 on: July 14, 2016, 06:40:49 am »
STM32 = Use TrueStudio!

I'm actually working designing µC PCBs and programming them using TrueStudio in the free version and it's great. No registration required, simply download and it's an eclipse based environment so supports standard plugins and the usual code navigation I love so much about eclipse. You can even get CubeMX as a plugin to run it inside TrueStudio :)

So yes, I'm a big fanboy of the CubeMX + TrueStudio combo!
Btw, the included FreeRTOS is awesome, too (freertos.org) and works a treat!

The Pro version offers some advanced features for debugging and code analysis but I've never needed any of those. Might come in handy for larger RTOS based firmwares.
Only downside to TrueStudio is that there is no (default) download and run button. All you an do is download and debug, so you have to stop debugging right away if you only want to download.
There is a way to fix it, though. Just let me know if you're interested.

So Dave (or anyone else), if you want to make your life easier, just use TrueStudio for your project :)
« Last Edit: July 14, 2016, 06:49:08 am by gnasirator »
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2188
  • Country: au
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #13 on: July 14, 2016, 09:04:35 am »
Btw, never despair when you encounter a 404. Just go to www.archive.org. I took the link from digikey, pasted it into the WayBackMachine at www.archive.org, and I got back the ZIP file containing the schematic as a PDF (which looks the same as the links already posted), plus original Altium .SchDoc files.
 

Online Quarlo Klobrigney

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: pt
  • Behind every alfoil hat is a genius
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #14 on: July 14, 2016, 10:47:37 am »
Dave, I must concur, use Eclipse (yes I said Eclipse) with GCC as per Carmine's excellent starter book Mastering STM32 linked somewhere here. I suggest reading it as an eye (and mind) opener. I'm not a shill, but a guy who was banging his head to understand the architecture, trying every compiler - tutorial - video how to, etc. before "the book". Thanks Carmine and keep up the good work :-+.
Voltage does not flow, nor does it go.
 

Offline iromero

  • Supporter
  • ****
  • Posts: 26
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #15 on: July 14, 2016, 12:02:54 pm »
For STM32 development i use SW4STM32 with STM32Cube, it does work pretty well (though the code generated by cube is really ugly). One thing I'd like is that stm32cube didn't generate main.c and let me just call their functions instead, so that i don't need to edit generated files, and so that regenerating from the cube does not (potentially) clobber my stuff and introduce a lot of changes for git.
 
The following users thanked this post: rs20

Offline invzim

  • Contributor
  • Posts: 22
  • Country: 00
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #16 on: July 14, 2016, 03:14:54 pm »
Great video!  Got a couple of discovery boards a couple of years back, and they have been living in a drawer since as I got totally confused about which IDE/compiler to use, where to get it and how to set it up.  At that point I think the cube stuff didn't support GCC - which it does now?

 

Offline Tantalum

  • Regular Contributor
  • *
  • Posts: 56
  • Country: 00
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #17 on: July 14, 2016, 03:21:22 pm »
Well the L1 series is quiet "old".

The new L4 series (M4) is much more powerful, and much more power efficient (~100µA/MHz vs 240µA/MHz).
 

Offline iromero

  • Supporter
  • ****
  • Posts: 26
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #18 on: July 14, 2016, 03:40:37 pm »
Great video!  Got a couple of discovery boards a couple of years back, and they have been living in a drawer since as I got totally confused about which IDE/compiler to use, where to get it and how to set it up.  At that point I think the cube stuff didn't support GCC - which it does now?
It used to be the case, and STM32 is still very annoying due to the huge array of half assed choices to develop with the things. It definitely would be much better if ST put a higher priority on making a "premier" IDE available to everyone and support it officially, like Microchip does with MPLabX, TI with their Code Composer or Cypress does with PSoc Creator. On the other hand, SW4STM32 (which i linked above) seems to be something pointing in that direction, it's Eclipse/GCC based and freely available for Windows, Linux and Mac and it does work very well once you get it set up.
« Last Edit: July 14, 2016, 03:42:52 pm by iromero »
 

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 10838
  • Country: 00
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #19 on: July 14, 2016, 05:21:10 pm »
I note you're a big fan of opening new tabs, and wanted to point out that holding down CTRL while clicking a link does the same thing as rightclick and selecting "open in new window"

Or just click with the middle button.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 3501
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #20 on: July 14, 2016, 06:58:52 pm »
https://youtu.be/mkx4qZCCHqI?t=1650
https://youtu.be/mkx4qZCCHqI?t=1755
The look of pure joy  :-+
I remember making an advanced excel sheet for a few days for pinmap hell, one month later they released their Cube tool.  |O

Great video!  Got a couple of discovery boards a couple of years back, and they have been living in a drawer since as I got totally confused about which IDE/compiler to use, where to get it and how to set it up.  At that point I think the cube stuff didn't support GCC - which it does now?
Everybody has that drawer.
Using GCC is hell since there are dozens of different IDE's it can link with. And all the different flavours of Eclipse.
Not to mention the major revision you've missed if you shelf the project for a few months.
 

Online janoc

  • Super Contributor
  • ***
  • Posts: 3110
  • Country: fr
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #21 on: July 14, 2016, 07:07:00 pm »
Dave, I strongly suggest you read the loongish thread on the STM32 Cube ecosystem being terrible before you get too invested in the Cube & STM HAL.

It really is a horrible buggy mess. The Cube UI is nice, but better write your own code instead of using the HAL. Or you will spend days trying to debug issues in ST Micro's libraries and cutting down on code bloat so that you don't run out of flash.

This is the thread I am talking about:
https://www.eevblog.com/forum/microcontrollers/st's-(stm32cube)-software-ecosystem-is-terrible-how-can-we-fix-it/
« Last Edit: July 14, 2016, 07:10:59 pm by janoc »
 

Online thm_w

  • Super Contributor
  • ***
  • Posts: 2154
  • Country: ca
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #22 on: July 14, 2016, 07:33:02 pm »
STCube only directly supports GCC via Atollic TrueSTUDIO, ie the only GCC version you get a proj file for is TrueSTUDIO.  I suspect this is because TrueSTUDIO is a simple installer whereas any eclipse cdt environment requires multiple installs and configs (even though GNU ARM Eclipse is a totally awesome effort).  Nice things about TrueSTUDIO include an unlimited version for even commercial development.  Pro / paid version has features that even include features that GNU ARM Eclipse don't include: Live variables, ITM console support / profiling, ETB support etc.
Single install here: http://www.openstm32.org/About+OpenSTM32
Was mentioend by iomero, also someones already linked this to dave in the YT video, and he said he will try it out.
 

Offline TheDirty

  • Frequent Contributor
  • **
  • Posts: 440
  • Country: ca
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #23 on: July 14, 2016, 07:34:20 pm »
  • Crossworks: Beautiful editor with fantastic configuration screen. Okay editor.  Lacking Debug support.
What debug support is lacking in Crossworks?  I'm using crossworks, just wondering if there is something I'm missing.
Mark Higgins
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12135
  • Country: gb
    • Mike's Electric Stuff
Re: EEVblog #900 - STM32 ARM Development Board
« Reply #24 on: July 14, 2016, 07:35:51 pm »
Glancing at the init code shown in the video looks like it sets up registers a bit(field) at a time instead of combining all bits in each register into words, or creating an efficient const array.
By all means include comments documenting the settings in case you need to tweak them, but just spewing out a zillion bit settings is so lazy & inefficient.
 
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf