easy5 pts · first answer countsfirmwarec-language
Why registers are volatile
A driver polls a status register through a pointer. With optimisation on, the loop never exits even though the hardware sets the flag. What is the most likely fix?
uint32_t *SR = (uint32_t *)0x40011000;
while ((*SR & (1u << 5)) == 0) { }Discussion 0
Join free to post in the discussion.
Related questions
- First words read after resetEmbedded Systems Engineer
- Value of an uninitialised globalEmbedded Systems Engineer
- Where initialised globals come fromEmbedded Systems Engineer
- Signals used by SWDEmbedded Systems Engineer
- Garbage characters on the consoleEmbedded Systems Engineer
- I2C lines sitting at 0 VEmbedded Systems Engineer
- What a watchdog timer doesEmbedded Systems Engineer
- ELF file or raw binaryEmbedded Systems Engineer