This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Modify SP register and PC register in Cortex-M1 using Keil

Hi,

I'm planning to do a bootloader for a Cortex-M1 processor but i'm having serious problems.

First of all, the Keil says it expect a ")" when writing this type of inline assembly:

        __asm__ __volatile__("mov sp,%0\n\t"
                "bx %1\n\t"
                : /* no output */
                : "r" (sp), "r" (pc)
                : "sp");
So it seems that it's not recognizing the assembly code.
On the other hand I just read that you cannot modify directly the value of the SP and PC register with inline assembly.
So I was wondering if someone could give me some hints on how to modify these registers to be able of code the bootloader.
Thanks in advance,
Juan