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.

[参考译文] TMS570LC4357:TI CCS

Guru**** 2455800 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1112581/tms570lc4357-ti-ccs

器件型号:TMS570LC4357

我无法在 CCS 中编译以下代码

static inline void *OsReadMainStackPtr(void)
{
  void *result = NULL;
  asm volatile( "MRS  R1, CPSR\n\t"
                "CPS #0x13\n\t"
                "MOV %0, SP\n\t"
                "MSR CPSR_c, R1\n\t" : "=r" (result)); 

  return result;
}

它抛出错误

 

error #18: expected a ")"

在 "MSR CPSR_c、r1\n\t":"=r"(结果);

在 IAR 中正确编译上述代码。