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

SVC_Handler for Cortex M0

Note: This was originally posted on 25th October 2012 at http://forums.arm.com

Hello

we are trying to find  a short implementation for the SVCHandler interrupt.
I want to do exactly like described here, but then a working version for the Cortex-m0:

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0203j/BABFGEFG.html

and here:

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0179b/ar01s02s07.html

we have no experts at assembly and the only thing we need is to get the svc number and arguments.
But if someone can explain me how the svc handler works I would be greatly helped.
And maybe someone can point me in the right direction on how to return values : "[font=Verdana, Tahoma, Arial, Helvetica, sans-serif][size=2]Any return value must also be passed back to the caller by modifying the stacked register values[/size][/font]".

Thank you in advance!

Martijn
Parents
  • Note: This was originally posted on 26th October 2012 at http://forums.arm.com

    Thank you for your response!!

    yes I do use KEIL MDK-ARM.
    when it try to compile it gives me an error:
    error: A1163E: Unknown opcode stacking_used_MSP , expecting opcode or Macro


    But just a moment ago it found this:


    SVC_Handler  PROC
            ;EXPORT  SVC_Handler         [WEAK]
    IMPORT SVC_Handler_main
    MOV R0,SP
    B SVC_Handler_main
            ENDP


    It works exactly how I want it to,but is this the right way to do this?

    The rest works great And i think I understand what is happening.
    Th only thing i do not really get is :
    svc_number = ((char *)svc_args[6])[-2];
    Does It takes  few bits from the link register?

    Thnx!
Reply
  • Note: This was originally posted on 26th October 2012 at http://forums.arm.com

    Thank you for your response!!

    yes I do use KEIL MDK-ARM.
    when it try to compile it gives me an error:
    error: A1163E: Unknown opcode stacking_used_MSP , expecting opcode or Macro


    But just a moment ago it found this:


    SVC_Handler  PROC
            ;EXPORT  SVC_Handler         [WEAK]
    IMPORT SVC_Handler_main
    MOV R0,SP
    B SVC_Handler_main
            ENDP


    It works exactly how I want it to,but is this the right way to do this?

    The rest works great And i think I understand what is happening.
    Th only thing i do not really get is :
    svc_number = ((char *)svc_args[6])[-2];
    Does It takes  few bits from the link register?

    Thnx!
Children
No data