ARM Thumb interworking in inline assembly __asm

Asked by Prasanth Subramani

hello,

i'm having problem with compiling inline assembly code.
The error is as below
"Error: selected processor does not support Thumb mode `mrc p15,0,r3,c1,c0,0'"

the code snippet is
__asm volatile("mrc p15,0,r3,c1,c0,0");

i'm compiling the C file in thumb mode with (-mthumb)

i have tried using the attribute to switch to ARM mode( "__attribute__((target("arm")))" ) as well but this has no effect.

error log :
C:\Users\PRASHA~1\AppData\Local\Temp\ccIbsb68.s: Assembler messages:
C:\Users\PRASHA~1\AppData\Local\Temp\ccIbsb68.s:27: Error: selected processor does not support Thumb mode `mrc p15,0,r3,c1,c0,0'
C:\Users\PRASHA~1\AppData\Local\Temp\ccIbsb68.s:38: Error: selected processor does not support Thumb mode `mcr p15,0,r3,c1,c0,0'
C:\Users\PRASHA~1\AppData\Local\Temp\ccIbsb68.s:208: Error: selected processor does not support Thumb mode `mrc p15,0,r3,c1,c0,0'
C:\Users\PRASHA~1\AppData\Local\Temp\ccIbsb68.s:219: Error: selected processor does not support Thumb mode `mcr p15,0,r3,c1,c0,0'

-Thanks,
Prasanth Subramani

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Prasanth Subramani
Solved:
Last query:
Last reply:
Revision history for this message
Prasanth Subramani (prasanth-s-0) said :
#1

problem solved by putting the code in separate function with attribute "__attribute__((target("arm")))"