2016-04-19 02:33 AM
Bit-banding is a fine approach for manipulating bits, especially GPIO.
In STM32L476 GPIO are located in AHB2 address space. However, AHB2 address space is located far beyond bit-band region: 0x40000000 APB1, APB2, AHB1 0x42000000 Bit band region (for APB1, APB2, AHB1) 0x48000000 AHB2 Therefore my question is: where is location of AHB2 bit band region, if any? Regards, Serafim #bit-banding-stm32l42016-04-19 03:53 AM
>> Bit-banding is a fine approach for manipulating bits, especially GPIO. Only for reading, Write is not save, use bitbang (BSS, BSSR registers).
Bit-band is only for AHB1 & APBx.2016-04-19 04:36 AM
Hi,
Only AHB1 and all APB can be bitbanded. AHB2 not support bitband.Bitband on STM32L4 can be used on GPIO. For GPIO pin control it is easy to use the BRR+BSRR registers.You can check in programming Manual bitband region address : Section 2.2.5 Bit-bandingRegards2016-04-19 05:15 AM
Great thanks!
>> Bit-band is only for AHB1 & APBx. I see.. But it is not written explicitly somewhere, is it? BRR/BSRR is a good approach too. However, using bit-band (in other series) is faster as it doesn't require condition checking. Moreover, you do not need to have two parameters (Port, pin) for a single entitiy (pin), but only one. Why are the bit-band writes not safe? I didn't see that in manuals. Regards, Serafim2016-04-19 06:30 AM
>>But it is not written explicitly somewhere, is it?
Many info is writen not directly. Check BitBand address range. >>However, using bit-band (in other series) is faster as it doesn't require condition checking. Not neccesary. BB access is longer (ldr with take more time). >>Why are the bit-band writes not safe? I didn't see that in manuals. Read is save. BB is still RMW access but done by BUS not core. So when periperal can change value of register.... Basicly ISR flag clearing by BB is very not save.