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

Invalid operand for instruction for armv7-a architecture

Hi,

I am seeing the below errors when I try to compile my code in Arm Compiler 6. Can you please help me to resolve this issue? 

error: invalid operand for instruction
MRS r0, PSP

error: invalid operand for instruction
MRS r0, MSP

Environment are below:

CORE = cortex-m4
FPU = fpv4-sp-d16
ARCH = armv7-a

Pradeep

Parents
  • Hi Ronan,

    I am seeing the below errors during linking. Can you help me to resolve the issue?

    Warning: L6340W: options first and last are ignored for link type of scattered
    Error: L6218E: Undefined symbol __ecc_init_sram_end_address (referred from startup.o).
    Error: L6218E: Undefined symbol __ecc_init_sram_start_address (referred from startup.o).
    Error: L6218E: Undefined symbol __bss_end (referred from startup_cm4.o).
    Error: L6218E: Undefined symbol __bss_start (referred from startup_cm4.o).
    Error: L6218E: Undefined symbol __data_end (referred from startup_cm4.o).
    Error: L6218E: Undefined symbol __data_lma (referred from startup_cm4.o).
    Error: L6218E: Undefined symbol __data_start (referred from startup_cm4.o).
    Error: L6218E: Undefined symbol __stack_end (referred from startup_cm4.o).

    Pradeep

Reply
  • Hi Ronan,

    I am seeing the below errors during linking. Can you help me to resolve the issue?

    Warning: L6340W: options first and last are ignored for link type of scattered
    Error: L6218E: Undefined symbol __ecc_init_sram_end_address (referred from startup.o).
    Error: L6218E: Undefined symbol __ecc_init_sram_start_address (referred from startup.o).
    Error: L6218E: Undefined symbol __bss_end (referred from startup_cm4.o).
    Error: L6218E: Undefined symbol __bss_start (referred from startup_cm4.o).
    Error: L6218E: Undefined symbol __data_end (referred from startup_cm4.o).
    Error: L6218E: Undefined symbol __data_lma (referred from startup_cm4.o).
    Error: L6218E: Undefined symbol __data_start (referred from startup_cm4.o).
    Error: L6218E: Undefined symbol __stack_end (referred from startup_cm4.o).

    Pradeep

Children
  • Those symbols are defined in the linker script.

    You would need to #define them to match the equivalent symbols generated by scatterloading, such as:

    #define _bss_start Image$$ZI_REGION$$Base

    Where ZI_REGION is the name given to the execution region in your scatter file.