alfrond wrote: Thu Nov 26, 2020 4:38 pm
stevestrong wrote: Tue Nov 24, 2020 7:03 pm
Here you can find an example how to mix timer register settings on low and higher level using Libmaple core.
thanks alot, but libmaple seems obsolete (according even to their own github readme..). has anyone another clear example of mixed low and higher level timer register settings? It would be much appreciated!
well this thread is about bare metal stm programming isn't it, so besides libmaple there is always
RM0008
libmaple is nearly as bare (metal) as it can be, u'd need to code the rest yourself
the syntax in libmaple code and official core codes (in particular within HAL) are the examples of how to access registers.
they aren't simply examples, they actually work, the rest takes trial & error to learn them, e.g. try to blink the led from registers, not too difficult an example would be to do a code review of digitalWrite() dig down into the function calls till you see how the registers are accessed,
an IDE helps with this, e.g. doing reference jumps from function to function, eclipse, vscode etc has that
the other thing to get into 'bare metal' programming is get an st-link v2
https://www.st.com/en/development-tools/st-link-v2.html
https://www.adafruit.com/product/2548
https://octopart.com/search?q=st-link+v2&specs=0
learn to debug on a live processor
there are lots of blogs and webs about mcu programming e.g.
https://mcuoneclipse.com/
there is this eclipse plugin i tried
https://mcuoneclipse.com/2017/07/26/emb ... nd-oxygen/
https://sourceforge.net/projects/embsys ... iew/0.2.6/
debugging in eclipse with the plugin added gives a 'pro' view of what happens every instruction, you can step every line of C/C++ code and even the assembly instructions, and embsysregview literally lays out the whole suite of nicely labelled peripheral registers and their realtime values
it is invaluable for troubleshooting and learning stm32
it is possible to do the same with command line gdb and openocd, just more tedious and you won't get that everything on the panel look & feel