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

...?T and ...?A

The following comment is on a website for the pC/OS RTOS kernel (http://www.embedded-os.de/)


The port of the pC/OS Kernel on AT91SAM7Sxx is now finished.
As Toolchain the IAR Embedded Workbench was used. Sorry to Keil, with "...?T" and "...?A" it's not really possible to create a good port for ARM and Thumb mode.


If anyone knows what this means, will you please explain it?

Thanks.

Parents
  • Frank,

    Your code snipped shows -

      ...
      F000    bl      AppTickInit(0x00101290) - Part #1
      F8DE    bl      AppTickInit(0x00101290) - Part #2
      ...
    

    The opcodes indicate that the code is runing in thumb mode. But the target of the 'BL' shows 0x00101290, this is Arm-mode (even address, thumb mode would be 0x00101291).
    In this case, you need an interwork-stub, that is code that changes from thumb- to arm-mode.

    Here is an example of how that looks like:

    //--- Thumb-mode:
     ...
     01000CCE  3001      ADD         R0,#0x1
     01000CD0  3102      ADD         R1,#0x2
     01000CD2  F7FF      BL          AppTickInit?T  ; T=0x1000C71  (1)
     01000CD4  FFCD      BL          AppTickInit?T  ; T=0x1000C71  (2)
     ...
    
    //--- Thumb to Arm Interwork-Stub:
     01000C70          AppTickInit?T PROC THUMB
     01000C70  4778      BX          R15
     01000C72  46C0      NOP         ; MOV R8,R8
     01000C74          ENDP
    
    //--- Arm Function:
     01000C74          AppTickInit?A:  ; FUNCTION START
      257: int ArmF (int n1, int n2) __arm {
     01000C74  E1A03001  MOV         R3,R1 ; n2
     01000C78  ---- Variable 'n2' assigned to Register 'R3' ----
     01000C78  E1A02000  MOV         R2,R0 ; n1
     01000C7C  ---- Variable 'n1' assigned to Register 'R2' ----
      258:   return (n1 * n2 + n1 * n2);
     01000C7C  E1A01003  MOV         R1,R3 ; n2
     01000C80  E1A00002  MOV         R0,R2 ; n1
     01000C84  E0000091  MUL         R0,R1,R0 ; n2
     01000C88  E0800000  ADD         R0,R0,R0
      259: }
     01000C8C  E12FFF1E  BX          R14
     01000C90            ; END 'AppTickInit?A'
    

    Peter

Reply
  • Frank,

    Your code snipped shows -

      ...
      F000    bl      AppTickInit(0x00101290) - Part #1
      F8DE    bl      AppTickInit(0x00101290) - Part #2
      ...
    

    The opcodes indicate that the code is runing in thumb mode. But the target of the 'BL' shows 0x00101290, this is Arm-mode (even address, thumb mode would be 0x00101291).
    In this case, you need an interwork-stub, that is code that changes from thumb- to arm-mode.

    Here is an example of how that looks like:

    //--- Thumb-mode:
     ...
     01000CCE  3001      ADD         R0,#0x1
     01000CD0  3102      ADD         R1,#0x2
     01000CD2  F7FF      BL          AppTickInit?T  ; T=0x1000C71  (1)
     01000CD4  FFCD      BL          AppTickInit?T  ; T=0x1000C71  (2)
     ...
    
    //--- Thumb to Arm Interwork-Stub:
     01000C70          AppTickInit?T PROC THUMB
     01000C70  4778      BX          R15
     01000C72  46C0      NOP         ; MOV R8,R8
     01000C74          ENDP
    
    //--- Arm Function:
     01000C74          AppTickInit?A:  ; FUNCTION START
      257: int ArmF (int n1, int n2) __arm {
     01000C74  E1A03001  MOV         R3,R1 ; n2
     01000C78  ---- Variable 'n2' assigned to Register 'R3' ----
     01000C78  E1A02000  MOV         R2,R0 ; n1
     01000C7C  ---- Variable 'n1' assigned to Register 'R2' ----
      258:   return (n1 * n2 + n1 * n2);
     01000C7C  E1A01003  MOV         R1,R3 ; n2
     01000C80  E1A00002  MOV         R0,R2 ; n1
     01000C84  E0000091  MUL         R0,R1,R0 ; n2
     01000C88  E0800000  ADD         R0,R0,R0
      259: }
     01000C8C  E12FFF1E  BX          R14
     01000C90            ; END 'AppTickInit?A'
    

    Peter

Children