Documentation on low-level peripherals programming

Post here all questions related to LibMaple core if you can't find a relevant section!
Post Reply
Username:
Posts: 5
Joined: Thu Mar 05, 2020 11:07 am

Documentation on low-level peripherals programming

Post by Username: »

In an oscilloscope code I see directives like

Code: Select all

adc_set_sample_rate(ADC1, ADC_SMPR_1_5)
dma_setup_transfer(DMA1, DMA_CH1, &ADC1->regs->DR, DMA_SIZE_32BITS,...
Where are those documented?

stevestrong
Posts: 361
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 7
Location: Munich, Germany
Contact:

Re: Documentation on low-level peripherals programming

Post by stevestrong »

In the source code.

Username:
Posts: 5
Joined: Thu Mar 05, 2020 11:07 am

Re: Documentation on low-level peripherals programming

Post by Username: »

Sorry, don't understand.
I am asking because I want to make additions to the code.
It's impossible to guess :oops: for other statements concerning peripherals.
There should be some manual where those commands are summarized.
But where is that manual?

stevestrong
Posts: 361
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 7
Location: Munich, Germany
Contact:

Re: Documentation on low-level peripherals programming

Post by stevestrong »

There is no manual.
The software is maintained by people in their free time, and is subject to continuous change. People are commenting each addition as good as possible in the source files.
On the other hand, changes in core files are expected to be made by people who understand the underlying hardware and they are familiar with the software structure of the respective core.

Of course, we welcome any constructive change.
If you want to suggest a change, we can discuss it here (in a dedicated post), and then you should issue a pull request on Github.

racemaniac
Posts: 8
Joined: Wed Dec 18, 2019 6:53 pm

Re: Documentation on low-level peripherals programming

Post by racemaniac »

Username: wrote:
Thu Mar 12, 2020 2:34 pm
Sorry, don't understand.
I am asking because I want to make additions to the code.
It's impossible to guess :oops: for other statements concerning peripherals.
There should be some manual where those commands are summarized.
But where is that manual?
Ok, in short, if you want to learn about that stuff:

- read the datasheet of the microcontroller, how these peripherals work is documented there. After reading the datasheet, this code will probably start to make sense.
- how to know the exact code: once you understand the datasheet, you can have a look in the code of the frameworks, the naming usually matches the naming in the datasheet, and then you can start writing such code yourself
- if you want to start from zero, with the cubemx tool by stm, you can configure a microcontroller & its peripherals the way you want, and it'll generate code that sets everything up as you configured, and creates method to start/manage the peripherals. This code can be a good base to continue from.

And as someone who has done the above: it's very interesting, but be ready to spend a lot of time on it XD.

Username:
Posts: 5
Joined: Thu Mar 05, 2020 11:07 am

Re: Documentation on low-level peripherals programming

Post by Username: »

Thanks to both for the previous comments. I guess I got a little bit closer.
About 30 years ago I successfully introduced the ARM-Archimedes in my Lab... recognizing it was much faster than the 6502's, 68000's or so.
Now I restarted to upgrade an ATXMega project with the STM32's...
It became a total mess after a month of trials.
I went over about 5 different development platforms mostly incompatible with eachother.
Most of the attached examples don*t work due to frequently updated (incompatible) libraries, toolchains, or the platform IDE's.
Gigabytes are being downloaded, unzipped and installed, so 3 times the hard disk load. Had to chose a magnetic hard drive... What a mess.
I wonder who writes all these thousands of lines of code.
In STM32 forums people gave up.

Now trying Arduino where the peripheral configurations are hidden within the core libs.
But struggling with incorporating libmaple.
Don't know how to install it properly.
Anyway, by picking out some .h files I got some oscilloscope examples to work.
Now I have to find out how to change them to my needs.

ag123
Posts: 495
Joined: Thu Dec 19, 2019 5:30 am
Answers: 1

Re: Documentation on low-level peripherals programming

Post by ag123 »

some of the libmaple docs are available from the origin - leaflabs maple
http://docs.leaflabs.com/docs.leaflabs.com/index.html
a good part of it is still relevant today

it isn't necessary comprehensive and is more of a guide. things may have changed since then.
so one'd still need to review codes

rm0008 Reference manual
STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx andSTM32F107xx advanced Arm®-based 32-bit MCUs
https://www.st.com/content/ccc/resource ... 171190.pdf

is close to being the 'bible' for working with stm32f103 pill boards. reviewing the codes along with the manual would provide one invaluable insights on how those things works. one can also look in the libraries folders for examples.

there are actually some fully implemented projects they are literally simply a google search away
https://github.com/pingumacpenguin/STM32-O-Scope/wiki
https://satoshinm.github.io/blog/180105 ... tware.html
https://github.com/ag88/GirinoSTM32F103duino

Post Reply

Return to “General discussion”