Question
Bit-banding on STM32L series
Posted on June 03, 2011 at 11:50
Hi,
I'm trying to get bit-banding to work on STM32L series. It seems that some header definitions have changed between STM32F and STM32L so it's not clear how bit-banding should be implemented. I've tried the following: &sharpdefine BITBAND_PERI_REF 0x40000000 &sharpdefine BITBAND_PERI_BASE 0x42000000 &sharpdefine BITBAND_PERI(a,b) ((BITBAND_PERI_BASE + (a-BITBAND_PERI_REF)*32 + (b*4))) // Convert PERI address //Offset of ODR in GPIO_TypeDef = 0x14? //GPIOA ODR = 0x40000000 + 0x00020000 + 0x000 + 0x14 //GPIOB ODR = 0x40000000 + 0x00020000 + 0x400 + 0x14 //GPIOC ODR = 0x40000000 + 0x00020000 + 0x800 + 0x14 //GPIOD ODR = 0x40000000 + 0x00020000 + 0xC00 + 0x14 &sharpdefine GPIOA_BB(b) *((volatile uint32_t *)(BITBAND_PERI(0x40020014,b))) &sharpdefine GPIOB_BB(b) *((volatile uint32_t *)(BITBAND_PERI(0x40020414,b))) &sharpdefine GPIOC_BB(b) *((volatile uint32_t *)(BITBAND_PERI(0x40020814,b))) &sharpdefine GPIOD_BB(b) *((volatile uint32_t *)(BITBAND_PERI(0x40020C14,b))) But it doesn't seem to work. Any ideas on how we can solve this? Thanks. #bit-banding-stm32l