I would like to implement some kind of fault handling mechanism, which would store some CPU registers, PC, etc. in flash if error occurs.
I tried to store SP value within HardFault Handler like this:
MRS r0, MSP
Then, I would branch to another function called FaultHandler_Common, where I would have current SP available as a function argument.
Everything compile, except that Keil shows 2 messages:
1. At the line 1 (in upper example) it shows: " error: expected '(' after 'asm' "
2. At the line 3 (in upper example) it shows: " error: use of undeclared identifier 'MRS' "
Do I have to change something thate those messages will not be shown?