We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
When I used armclang to compile the code of arm cm7, I found a surprising bug in armclang, which is manifested in the following assembly instructions generated under -O2/-Os/-Ofast/-O3/-Os/....:
__asm(
"ldr r5,=0x20010402"
);
"ldr r7,=0x55f4"
"strbt r7,[r5,#6]"
The CPU is in privileged mode all the time.when the CPU executes the STRBT instruction, it enters the memmanage_handler interrupt function.
Arm A-profile A32/T32 Instruction Set Architecture
solution: even in privileged mode, the MPU must be configured, as the machine instructions generated by the compiler may cause memmanage errors.
config all ram area: full access ,BUFFERABLE,CACHEABLE,SHAREABLE,LEVEL0
so I think it's a compiler bug.
armclang version:
.\armclang.exe -vProduct: MDK Professional 5.36Component: ARM Compiler 6.16Tool: armclang [5dfeb700]