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

ARM, C and Assembly

Hi,
I want to write some subroutines with µVision3 in assembler and use this in my C-Funktions (Philips LPC2148). For example I have wrote(copied) this one:

//--------------------------------------------
//cpu_asm.asm 
//--------------------------------------------

NO_INT          EQU     0xC0

AREA    OSCPUSRSave, CODE
        PUBLIC  __OSCPUSRSave

__OSCPUSRSave   PROC    CODE32


    MRS     R0,CPSR
    ORR     R1,R0,#NO_INT
    MSR     CPSR_c,R1

    MRS     R1,CPSR
    AND     R1,R1,#NO_INT
    CMP     R1,#NO_INT

    BNE     __OSCPUSRSave
    BX      LR

ENDP

END

//--------------------------------------------


After that i declared in a C-File:

extern void __OSCPUSRSave(void);

Now i get every time the error Message: ***Warning L123: UNRESOLVED EXTERNAL SYMBOLS and ***ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: __OSCPUSave?T ADDRESS: 000003AAH I think the linker have to find the procedur because i wrote: PUBLIC __OSCPUSRSave , but he didn't.
I hope someone can help me, thanks.

Parents
  • Hi,

    yeah i'm from croatia and i have solved the problem. When you want to port µC/OS you can visit the homepage http://www.micrium.com. There you can find a lot of portations. I have writen a OSEK conform OS based on µC/OS 2 knowlage.

    I have forgot how i solved my problem but here is the source code which i'm using now:

    AREA    OSCPU, CODE
    ...
    PUBLIC __OSCPUSRSave?A
    ...
    
    
    __OSCPUSRSave?A         PROC    CODE32
    
       STMFD   SP!, {R1}
       MRS     R0,CPSR
       ORR     R1,R0,#NO_INT
       MSR     CPSR_c,R1
    
       MRS     R1,CPSR
       AND     R1,R1,#NO_INT
       CMP     R1,#NO_INT
       BNE     __OSCPUSRSave?A
    
       LDMFD   SP!, {R1}
       BX      LR
    
    
    ENDP
    
    

    When you have some other questions you can write me a mail. I hope it help you

Reply
  • Hi,

    yeah i'm from croatia and i have solved the problem. When you want to port µC/OS you can visit the homepage http://www.micrium.com. There you can find a lot of portations. I have writen a OSEK conform OS based on µC/OS 2 knowlage.

    I have forgot how i solved my problem but here is the source code which i'm using now:

    AREA    OSCPU, CODE
    ...
    PUBLIC __OSCPUSRSave?A
    ...
    
    
    __OSCPUSRSave?A         PROC    CODE32
    
       STMFD   SP!, {R1}
       MRS     R0,CPSR
       ORR     R1,R0,#NO_INT
       MSR     CPSR_c,R1
    
       MRS     R1,CPSR
       AND     R1,R1,#NO_INT
       CMP     R1,#NO_INT
       BNE     __OSCPUSRSave?A
    
       LDMFD   SP!, {R1}
       BX      LR
    
    
    ENDP
    
    

    When you have some other questions you can write me a mail. I hope it help you

Children