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,
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 here a lot of examples , I2c, GPIOs etc
You can also use this to produce initialization code for your project at LowLevel code .
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.
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 .
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.
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?
You have right. LL produced by cube is not available.
take a look at this from community
Review the source code for the SPL to understand register level interactions. You can look at the HAL also, but it is macro heavy.
Retrieving data ...