This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Fast bitband access Cortex M3

Hi every one !

I normal use macro : #define x_bit(var,bit) *(__IO uint32_t *)(SRAM_BB_BASE|(((uint32_t)&(var)-SRAM_BASE)<< 5)| ((bit) << 2)) to calculate address of bit in variable.I'm using STM32f103 from ST.

Global variable normal has fixed address and Bit position is const number .So above macro can generate const address. But compiler calculates address from real address of variable(that cause 2 instructions are added). I want to generate bit-band address direct without using real address of variable. Some one can help me ?