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
Parents
  • Hi,

    I'm using the Keil 5 that contains the compiler versión 5.06. Do you think that could be the problema?

    I did it as you suggested and i get the same problem.

    It says it expect a ) so it seems that it's not understanding i'm using assembly.

    Any idea of what is happening.

    Thanks,

    Juan

Reply
  • Hi,

    I'm using the Keil 5 that contains the compiler versión 5.06. Do you think that could be the problema?

    I did it as you suggested and i get the same problem.

    It says it expect a ) so it seems that it's not understanding i'm using assembly.

    Any idea of what is happening.

    Thanks,

    Juan

Children