2025-11-10 11:05 PM - last edited on 2025-11-11 2:04 AM by mƎALLEm
Bit-banding Alternatives for Modern ARM Cores
Background Information:
The bit-banding feature available in ARM Cortex-M cores (ARMv7-M architecture including Cortex-M3 and Cortex-M4) provides hardware-level mapping of individual bits within a 1 MB memory region to words in a 32 MB alias region. This mechanism enables atomic bit manipulation without requiring read-modify-write operations.
Specific Query:
For ARM Cortex cores beyond M7 architecture that do not support the bit-banding feature, could you please provide detailed information regarding:
2025-11-11 12:34 AM - edited 2025-11-11 2:03 AM
Hello,
Indeed bit-banding is not available on Cortex-M7. According to ARM community from this post, the reason is the following:
Regarding an available alternative, I think the only solution is to use CMSIS:
void atomic_set_bit(volatile uint32_t *addr, uint32_t bit) {
uint32_t old, status;
do {
old = __LDREXW(addr);
old |= (1U << bit);
status = __STREXW(old, addr);
} while (status != 0);
}
Use __LDREXW/__STREXW for 32-bit, __LDREXH/__STREXH for 16-bit, and __LDREXB/__STREXB for 8-bit operations.
I don't think there is specific documentation regarding this subject