We tried to execute a small assembly instruction function in .asm file for M7 core controller in GHS.
But it initiated a hard fault exception with INVSTATE (Invalid state usage fault) bit is set when code started to execute the first instruction of assembly function in arm file.
When this same assembly instruction function added as part of C file by using _asm assembler, this assembly routine executed well without any issues.
Why this happen?
Check if the asm file is in Thumb mode not Arm mode.
Hi Bastin Schick,
Thanks for your update.
Assembly file was in thumb mode.
Issue resolved and it was because we forgot to add end directive at the end of assembly function
View all questions in Cortex-M / M-Profile forum