2017-08-08 09:56 AM
Hi,
I would like to programm my mcu (stm32f4) directly with the reference manual. Are there some examples from ST to see how it is done? I would need for the start examples of: I'C and GPIO.
Hope you could help me,
thank you
#stm32f4 #stm32 #reference-manual #register-level-stm322017-08-08 10:18 AM
Hello !
You mean to write directly to registers. with no any kind of higher level structure?
If yes, there is no such code published.
But for your need, to help you learn or understand better register level programming , exists the LL recenly released firmware from ST. (LOW LEVEL)
You can find
a lot of examples , I2c, GPIOs etcYou can also use
to produce initialization code for your project at LowLevel code .2017-08-08 10:54 AM
Hi,
For that kind of programming, Reference Manual is your best companion. You should read the section you are interested in for a few times (let say GPIO) and then you will start to understand it. At the beginning it takes some time, but for each further use, you will be much more familiar. I started like this and I don't even look to the HAL/LL confusion any more. Code is much more cleaner, smaller, faster and when you are familiar with those registers, it becomes more readable too. At least for me. In RM you have very precise description how to do things and detailed description of each bit in each register. It could not be more straight forward than that.
Best regards.
2017-08-08 10:59 AM
There are such examples at the end of the 'F0/L0 RMs, eg. RM0091. The same is in the Snippets library for F0 and L0.
I have some barebones examples (although not specifically for 'F4) on efton.sk/STM32 .
JW
PS. Do you have a debugger? There's lots of fun doing this kind of things directly in the debugger, blink LEDs, set up timers etc.
2017-08-08 02:21 PM
Hi,
thank you for all your hints, very good!
One question, I only can produce HAL Code with CubeMX. How can I get LL working? In settings, I can only choose HAL. How to add LL?
Thank you
2017-08-08 05:26 PM
Hi again!.
You have right. LL produced by cube is not available.
take a look at
from community2017-08-08 06:41 PM
Review the source code for the SPL to understand register level interactions. You can look at the HAL also, but it is macro heavy.