cancel
Showing results for 
Search instead for 
Did you mean: 

CUBE v Registers

Scott Dev
Senior
Posted on March 27, 2018 at 17:55

Hi

 I have been learning the STM32 for a short period now, and can use the CubeMX and also write code using registers only. I know there is more control using registers, but find that a project can be made a lot quicker using HAL/Cube. Is the CubeMX just for testing/learning, or can professional projects be written using HAL/Cube? What is every ones opinions?

Many Thanks

Scott

9 REPLIES 9
AvaTar
Lead
Posted on March 27, 2018 at 18:02

You want to start a flame war, do you  ?  😉

Andrew Neil
Chief II
Posted on March 27, 2018 at 18:10

Pretty much the same question just asked on the Atmel forum: 

https://community.atmel.com/forum/professionals-and-asf-arm

  

Is this a group exercise, with one posting in each manufacturer's forum, to see if you can find a consensus ... ?

AvaTar
Lead
Posted on March 27, 2018 at 19:17

About the same question had been asked here, if you make use of the search.

Those thread went the way religious discussions use to go...

Posted on March 27, 2018 at 18:16

Im not in that group, so never saw the post

henry.dick
Senior II
Posted on March 27, 2018 at 23:04

Think of using the registers as using assembly language: in the right hands, it is a powerful. In the wrong hands, it is much easier to make a mess.

Cube is very useful in getting you up and going on most jobs. However, debugging it can be a pain, and for those once in a while applications, going to the registers can be faster and less painful.

I use spl from time to time but mostly roll my own. I have never been asked by anyone to use cube.

Posted on March 28, 2018 at 00:32

Is the CubeMX just for testing/learning, or can professional projects be written using HAL/Cube?

Note that those are two separate things with some common interfaces - CubeMX is the setup/code generator program, and HAL/Cube is a 'library'.

And you've answered yourself:

I know there is more control using registers, but find that a project can be made a lot quicker using HAL/Cube.

So, CubeMX and Cube/HAL are good for projects which have to be made quickly (which happens if those projects match the 'usual' usage patterns supported in both) and don't require much control. And if they are paid for, they are by definition 'professional'.

JW

T J
Lead
Posted on March 28, 2018 at 01:15

its a question of complexity.

the complexity is squared for the chip size.

ie, LQFP 32   STM32F103, its an easy enough job by hand,

but when you have 176-240 pin STM32F7 I would guess it is extremely difficult by hand,

but don't forget the PCB.

I would say, from scratch, its very unlikely that you would be able to design a high density working board without the cube.

I use the cube to make my PCBs and then the initialisation code comes up and we get to while(1);

did you see the range of clock options inside the H7 part ?

very difficult to set the clock configuration without the cube.

0690X0000060AI4QAM.png0690X0000060AHLQA2.png
Posted on March 30, 2018 at 12:48

I see what you mean, I wouldnt fancy trying that one.

Thanks

Scott

Posted on March 30, 2018 at 12:49

Thanks for that, much appreciated

Scott