9 years ago.

Direct register manipulation

Hello, Today I just got stared with ARM development on STM32F411RE. I have a fair amount of experience with AVR and PIC. I see that most of the operations are done using libraries rather than modifying the registers directly which is not surprising consider the large number of bits you have to modify to get something done. But I would like to know about direct port manipulation without using any functions or libraries. I just cant get any info on the register involved with GPIO. Googled a lot. Can someone point me in the right direction.

Thank You

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F411RET6 microcontroller.

1 Answer

9 years ago.

Here you can find an example from the mbed source code: http://developer.mbed.org/users/mbed_official/code/mbed-src/file/01cb89f68337/targets/hal/TARGET_STM/TARGET_STM32F4XX (the two gpio files).

They use some of the STM functions but also direct register address for fast functions (you just need to have alot of patience when switching between input and output there).

And here you got the defines for FastIO for the F411: http://developer.mbed.org/users/Sissors/code/FastIO/file/327ae1d5fecb/Devices/FastIO_NUCLEO_F4X1.h. For both it is the case that the functions have to fit in a framework to be compatible with other devices, so if you just want to toggle a pin on your MCU it will actually result in a bit easier code. Still as you can see, it requires a few bits to do what it needs to do.

Accepted Answer

Does anyone have a reference manual which outlines all the registers and their functions. I searched a lot but couldn't find one. I ended up with equivalent manuals of other stm32 devices.

posted by Sreedev K 11 Apr 2015

Here it is under design resources tab, reference manual: http://www.st.com/web/catalog/mmc/FM141/SC1169/SS1577/LN1877/PF260049?s_searchtype=partnumber#

posted by Erik - 12 Apr 2015