Author Topic: Getting Started with STM32 (ARM CORTEX)  (Read 5340 times)

0 Members and 1 Guest are viewing this topic.

Offline Gibson486

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: us
Re: Getting Started with STM32 (ARM CORTEX)
« Reply #25 on: July 02, 2018, 01:16:18 pm »
My advice would be just to get something working. The SPL is no longer supported and it looks like cube is here to stay. You will see a bunch of people who says learn SPL because it is better...well, they need to to learn to get with the times. Part of being an engineer is learning new tools, whether you like them or not.

I understand that there is a sense of pride in getting stuff working from the ground up, but you will find that once your start with the HAL, there will be something you do not like and you will have to change it anyways. Yeah, there is some crappy code in the HAL, but I work with a bunch firmware people who have the mentality of hating the HAL and well, debugging there code is no better than debugging the HAL.

As for being too upper level? Not really. So instead of pushing bits directly to registers, now you have a function (that is well used by other places) that now pushes bits into registers. I can see why people do not like the I2C library (yeah, that one sucks), but everything else is not bad at all.
« Last Edit: July 02, 2018, 01:17:53 pm by Gibson486 »
 

Offline Dubbie

  • Supporter
  • ****
  • Posts: 1115
  • Country: nz
Re: Getting Started with STM32 (ARM CORTEX)
« Reply #26 on: July 02, 2018, 08:59:38 pm »
Thanks for your thoughts Gibson486.

Sometimes I think that I must be the only person in the world who doesn't have a big problem with the cube HAL.
It's nice to hear that I'm not crazy. (well for that reason anyway)
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: Getting Started with STM32 (ARM CORTEX)
« Reply #27 on: July 02, 2018, 10:53:53 pm »
Sometimes I think that I must be the only person in the world who doesn't have a big problem with the cube HAL.
You and the guy who wrote it.

 :-DD


PS. sorry  :-X
 
The following users thanked this post: Dubbie

Offline apblog

  • Regular Contributor
  • *
  • Posts: 108
  • Country: us
Re: Getting Started with STM32 (ARM CORTEX)
« Reply #28 on: July 03, 2018, 02:14:41 am »
I love CubeMX.  I use it to plan pinouts and to generate clock tree and system setup code.

Then I see what it did, copy the register setups to my code, and throw out the cube code. Best of both worlds.

Of course I read the bits and make the effort to understand what is being done.  But starting with generated code as an example is a lot easier and faster than trying to understand every nuance of features that
I do and don’t need before I can start writing code
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3358
  • Country: nl
Re: Getting Started with STM32 (ARM CORTEX)
« Reply #29 on: July 03, 2018, 07:59:02 pm »
Just curious, what do you think about CMSIS?
I sort of like the idea of a vendor independent framework. There seems to be some support from ARM, TI, ST, NXP, Keil, Atmel/Microchip and others. But somehow I get the idea that a lot of stuff is old and/or deprecated.

For the moment I think I'll start with MBED.
Platformio supports the MBED platform for the "Blue Pill" board and there seem to be lots of libraries for external chips, for example TFT controllers.
[ Rant]
I've always disliked the "arduino" stuff. The java contraption they use an "IDE" is easy to avoid with platformio, and the horrible pinout also if you buy something that fits on a breadboard. What is still annoying is the "digitalWrite()" which is sprinkled everywhere ( 45% speed penalty for already slow TFT library (Adafruit / AVR)) and the mixed bag with C and C++ and all kinds of pre intstantiated objects for hardware I want to use differently.
[ /Rant]

In mbed you have to declare objects yourself, so you only declare the objects you need, and this also makes it easy to plug in a homebrew alternative class if needed.
This example looks pretty clean:
Code: [Select]
#include "mbed.h"

Serial pc(USBTX, USBRX); // tx, rx

int main() {
    pc.printf("Hello World!\n\r");
    while(1) {
        pc.putc(pc.getc() + 1); // echo input back to terminal
    }
}

Most important is probably to "just start somewhere", as said before in this post. With platformio & mbed I can postpone having to dive into the low level stuff and get some fun projects going and gradually build knowledge of the peripherals I find interesting.
I by no means see mbed as the platform I want to use for the next 10 years, but just a starting point to ease the learning curve a bit and that is something I need badly because I've been skidding down that curve for more then a year.

Just a thought:
Another way to start / pick a framework is to find a project you are intersted in on github / gitlab / elsewhere and that compiles cleanly. (inclusive project / makefile / schematic etc), and then adopt whatever is used in that project and build from there.


 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf