简体   繁体   中英

Why I got error A1616E when compile in DS-5 with embedded assembly

I got below error message when compile a simple c file with an __asm function. It seems "MSP" is not recognized. I can build after comment out "MRS R0, MSP". What I am missing here? Thanks.

Invoking: Arm C Compiler for Embedded 5.6.6'

armcc.exe --cpu=Cortex-R5 --arm --apcs=interwork -O0 -g --md --depend_format=unix_escaped -c -o "main.o" "main.c"

"main.c", line 26: Error: A1616E: Instruction, offset, immediate or register combination is not supported by the current instruction set
   26 00000000  MRS R0, MSP

My main.c :

__asm uint32_t A( void )
{
    MRS R0, MSP
    LDR R0, [R0,#8]
    BX  lr
}

int main()
{
    A();
    return 0;
}

I received below answer from ARM forum/community (Thanks to Ronan), and verified it (I am having a system with mixed Cortex-M/R cores). To quote

"You are building for Cortex-R5, which does not support MSP (Main Stack Pointer). MSP is only provided on Cortex-M processors."

https://community.arm.com/support-forums/f/armds-forum/52130/a1616e-armcc-compile-error/175598#175598

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM