Skip to main content
HSX.1
Associate
December 8, 2020
Question

Does STM32L431 support bit band operation

  • December 8, 2020
  • 7 replies
  • 2872 views

What are the SRAM bit band area address and its bit band alias area address, and the peripheral bit band area address and its bit band alias area address, if supported?

This topic has been closed for replies.

7 replies

gregstm
Senior II
December 8, 2020
TDK
December 8, 2020

Bit banding addresses are shown in the programming manual. Not everything is bit banded.

0693W000006EwFfQAK.png 

Source:

https://www.st.com/resource/en/programming_manual/dm00046982-stm32-cortexm4-mcus-and-mpus-programming-manual-stmicroelectronics.pdf

"If you feel a post has answered your question, please click ""Accept as Solution""."
HSX.1
HSX.1Author
Associate
December 8, 2020

Therefore, STM32L431 does not support bit band operations

waclawek.jan
Super User
December 8, 2020

How did you come to that conclusion?

JW

HSX.1
HSX.1Author
Associate
December 8, 2020

I guess it, I didn't get

gregstm
Senior II
December 8, 2020

"Does STM32L431 support bit band operation?" - yes (it does)

HSX.1
HSX.1Author
Associate
December 8, 2020

My programming looks like this, but it doesn't work0693W000006Ex3QQAS.jpg

gregstm
Senior II
December 8, 2020

as Uwe mentions below, you don't need bit banding for the GPIO registers - use the BSRR register. From the reference manual "The purpose of the GPIOx_BSRR and GPIOx_BRR registers is to allow atomic read/modify accesses to any of the GPIOx_ODR registers."

waclawek.jan
Super User
December 8, 2020

So, are the GPIO addresses within the area which is bit-banded (see TDK's post above)?

JW

HSX.1
HSX.1Author
Associate
December 8, 2020

These are the GPIO address0693W000006ExT4QAK.jpg

TDK
December 8, 2020

Are those addresses within the bit banded region of the above table?

"If you feel a post has answered your question, please click ""Accept as Solution""."
waclawek.jan
Super User
December 8, 2020

So?

Uwe Bonnes
Chief
December 8, 2020

b.t.w. no need to bitband access GPIO_ODR. Use GPIO_BSRR instead! And for reading GPIO, simple use IDR and mask out the bit.