cancel
Showing results for 
Search instead for 
Did you mean: 

BITBANDING ADDRESS CALCULATION

Oahme.1
Associate III

I wanted to toggle an LED in STM32 , there's this GPIOx_BSRR ,The boundry address for the GPIOC is 0x4001 1000 and the register (GPIOx_BSRR) is on the offset 0x10,I wanted to toggle the led_13 using bitbanding but Im not getting to the alias address

0x4200 0000 + (0x40011010-0x40000000)*0x20 + (13)*4 = 0x42220252

this isnt giving the right address to me ? can someone tell me why its wrong ?? thanks

2 REPLIES 2

How can anything that's a multiple of 4 have a least significant digit of 2??

Take 0x11010 multiply that by 32, add 13*4 and add 0x42000000​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

+1 to what Clive said above.

Here is a calculator you can check your results against.

But, regardless, don't use bitbanding for GPIO_BSRR. Write directly into it.

JW