This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/AWR1642: Can ti-cgt-arm_16.9.6.LTS support embedded assemble in C ?

Part Number: AWR1642
Other Parts Discussed in Thread: AWR1843

Tool/software: TI C/C++ Compiler

Hi champion,
    My customer is using ti-cgt-arm_16.9.6.LTS in the program of R4F of TI mmwave device AWR1843. They want to know whether this compiler support embedded assembler like below. They tried it, but the compiler returned error. I checked on ARM website, it says this kind of grammar is supported by GNU compiler. Could you help to check it is supported in TI compiler?

osEE_get_SP (

void

) {

  VAR(OsEE_addr, AUTOMATIC) temp;

  OSEE_GET_SP(temp);

  return temp;

}

 

#define     OSEE_GET_SP(SP)             \

         __asm­­__ volatile (" mov %0, sp" : "=r" (SP))

Thanks,

Adam

  • Unfortunately, the TI ARM compiler does not support the asm statement provided by the GCC ARM compiler.  Instead, a much simpler form of the asm statement is supported.  For further detail, please search the TI ARM compiler manual for the sub-chapter titled The __asm Statement.

    Thanks and regards,

    -George

  • Hi George,
         I am clear now. Thanks a lot for your help!

    Best regards,
    Adam

  • Hi George:

    I still use __asm ​​and asm statement to try to compile and still fail to report error message:
    Line 101: error #18: expected a ")".
    I doubt it is that (" mov %0, sp" : "=r" (SP)) command format compiler does not support, we just want to get the value of sp, do you have any suggestions?
  • Hi George:

    I tried to use __asm and asm to compile and still report an error, information follows:
    Error #18: expected a ")"
    The same CCS environment executes the statement asm (" CPSIE I"); there is no error, I suspect that the instruction (" mov %0, sp" : "=r" (SP)) is not supported by the compiler, what advice do you have?

    Thanks
  • Hi Adam,
    correct syntax is like this:

    __asm(" assembler text ");

    The compiler copies the argument string directly into your output file. The assembler text must be enclosed in double quotes. All the usual character string escape codes retain their definitions. For example, you can insert a .byte directive that contains quotes as follows:

    __asm("STR: .byte \"abc\"");