Skip to main content
luch
Associate II
January 30, 2019
Solved

Please help a confused soul

  • January 30, 2019
  • 13 replies
  • 2340 views

Hello everybody!

I've been watching/reading this forum for a while now, trying to enlighten myself, but without success. So, this is my first question...

While not being new to electronics, microcontrollers and programming, I am new to ARM. I've spent the last (more than) two weeks reading hundreds of pages (reference&technical manuals, etc.), forums, blogs, tutorials, you name it! At the end of all this, I thought I understood something... but it looks like the more I read, the more overwhelmed and confused I am... Anyways, I tried to apply my new and hard gained knowledge by writing some simple programs.

But how?! The some chaotic (to me) mountain of information about these micros, reigns in the software domain too. There is a myriad of IDEs and command line tools to choose from, then HAL/LL/Standard Library, etc. I've tried quite a few of them (Keil uVision, Eclipse, Cube[F1|MX]) without great reasonable results.

What I am trying to achieve is some intimate knowledge of the peripherals of these amazing micros and a set of software tools that would allow me to write decent programs for them. It would be great if the software would be able to simulate the programs, so I can run them step by step and... observe and learn!

I've purchased already a few boards (STM32F1 Value line discovery, STM32L476 Nucleo-64 and a couple of BluePills w. STM32F103C8T6), a Logic Analizer, a scope, etc. In other words, I'm ready! Only my mind refuses to participate!

And here come the question: where/with what should I start? what should I read/learn and, more important, what should I not? what tools do you recommend (I know this is a hard one)? By the way, while I use Ubuntu daily and I am not allergic to command line tools, I would prefer Windows and an IDE... Not because I don't hate myself enough, but because at least now, while learning, I'd like to be focused more on the controller itself than on the tools.

I apologize for the length of this post (it shows my frustration) and I'm looking forward to hearing your opinions!

Many thanks in advance!

    This topic has been closed for replies.
    Best answer by Imen.D

    Hello @luch​ ,

    I recommend you to review the online-education program: STM32 step-by-step makes the programming of STM32 and learning of ecosystem installation basics easier.

    https://community.st.com/s/question/0D50X00009nKcgoSAC/do-you-know-stm32-stepbystep-

    Kind Regards,

    Imen

    13 replies

    S.Ma
    Principal
    January 30, 2019

    Start from the nucleo. Read the reference manual and datasheet of the chip first.

    The reference manual describes the IPs in the chip

    The datasheet describes for a specific device and package the memory mapping, the pinouts and alternate functions (going to peripherals) and electrical/timing tables.

    Install cubemx.

    Browse the cube, find the nucleo and example code.

    There are several examples per peripherals showing the different ways to handle a peripheral.

    Examples demonstrate the peripheral functionality.

    To build an application with STM32 talking to other chips will be the next step.

    luch
    luchAuthor
    Associate II
    January 31, 2019

    Thanks for answering! Wow! - I started actually from the other (low) end - VLDiscovery. I thought learning things in increased complexity would be easier and faster. You might be right: once such a M4 beast is well understood, it would be probably child's play to learn the M3 league...

    I already have 'the Cube' installed; and speaking of - that's just another confusion - I have 2 installed: the CubeMX and the Cube1, which allegedly 'refers specifically to the STM32F1xx members of the family'. It is still not clear to me if this setup makes sense.

    AvaTar
    Senior III
    January 31, 2019

    If Cube is a the best thing to start with is a matter of debate. But the most often sought use cases should work, and relieve from poring over docs initially.

    I used to investigate the details of certain peripherals only after I got a ST example up and running. At that time, with the StandardLib, not yet Cube.

    > I've purchased already a few boards (STM32F1 Value line discovery, ...

    I would consider the VL discovery as obsolete. The STLink V1 on that board is a mess.

    > By the way, while I use Ubuntu daily and I am not allergic to command line tools, I would prefer Windows and an IDE...

    I suggest to check out Crossworks for ARM (Rowley). It supports Windows and Linux (and Mac), and has a limited free Versions. And, it has very reasonable prized private licenses.

    I'm using it mostly under Linux, but even the private license allows you to have multiple installations on different platforms.

    luch
    luchAuthor
    Associate II
    January 31, 2019

    Thanks AvaTar! I agree with you about Cube - it kind of walks you blind to a destination - it might be fast, but not necessarily optimal or helpful for learning. But I think I can ignore that for now - like you said, I need to get a simple (blinky) program running and start from there investigating the peripherals (Intrerupts, DMA, Timers, USART, ADC, etc.). It sounds simple, but it isn't quite! Once I've got there, using CubeMX and HAL, i was stumped at writing the first line of code: how do I refer to a peripheral? using HAL? LL? STDLib? what functions are available? were are they?...

    AvaTar
    Senior III
    January 31, 2019

    The StdLib is dead, at least for current MCU variants.

    For the F100 (the Vl Discovery) you could still get it, but in your case, I would rather switch to to LL variant.

    You are in control of your application framwork and resources (with CubeMX, you are clearly not), and not bound to the few use cases properly implemented by the code generator.

    If portability is of no specific interest to you, you can get directly into Jan's direct-register-access coding style.

    waclawek.jan
    Super User
    January 31, 2019

    Whichever IDE, I'd recommend to get a loopdelay-based blinky (aka embedded hello world) up and running as soon as possible. And evolve from that through timer-polled, timer-interrupt, direct-timer-output etc.

    I recommend against using Cube or any other such "library", as they IMO unnecessarily get into way so any initial perceived "speed gain" is paid back later often several times later; but my view is considered here extreme.

    JW

    luch
    luchAuthor
    Associate II
    January 31, 2019

    Thanks! I agree with you: this is also how I usually learn. I am old school - I prefer to read a (well written) book and take the time to understand it well, instead watching some half-backed 'explanation' on YouTube!

    And yes, nowadays, such an approach would be considered 'extreme'!

    However, like I mentioned in my answers to our other members, I would just use the Cube to reach my goals for now, being aware of its shortcomings.

    waclawek.jan
    Super User
    January 31, 2019

    Okay, so if I understand what you wrote above correctly, you got blinky working through CubeMX and don't know how to proceed. This is exactly what I'm talking about. And even if you'll learn all the Cube's lingo and whereabouts, you'll have hard time from time to time to synch all that to the manual.

    On my webpage efton.sk/STM32 there's a bunch of raw earth examples; the 'L476 blinky should work on the L4 Nucleo, maybe with a bit of tweaking. From there on, the path is through straighforward reading the respective chapters in the reference manual.

    JW

    waclawek.jan
    Super User
    January 31, 2019

    [erased double post]

    Imen.DBest answer
    ST Technical Moderator
    January 31, 2019

    Hello @luch​ ,

    I recommend you to review the online-education program: STM32 step-by-step makes the programming of STM32 and learning of ecosystem installation basics easier.

    https://community.st.com/s/question/0D50X00009nKcgoSAC/do-you-know-stm32-stepbystep-

    Kind Regards,

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    luch
    luchAuthor
    Associate II
    January 31, 2019

    Thanks Imen! I'm checking that right now. It looks interesting!