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.

TMS570LS0432: Interrupt and Exception Handle problem

Part Number: TMS570LS0432
Other Parts Discussed in Thread: TMS570LS3137

Hello

My program have safelibrary_lib and exception

void _excpt_vec_udef_instr()
#endif
#ifdef __IAR_SYSTEMS_ICC__
__irq __arm void _excpt_vec_udef_instr()
#endif
{
while(1);

}

But when I load my program,The program stops _excpt_vec_udef_instr directly,I don’t know where it is running ,found error. 

CCS software "Resume" can't  Click.

Now I want to know where I have errors in my program. No problem with program compilation and no special warnings.

Is there any way to find the error.

 

  • This is my cmd file

    /* */
    /*----------------------------------------------------------------------------*/
    /* USER CODE BEGIN (0) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Linker Settings */

    --retain="*(.intvecs)"
    --entry_point=_c_int00

    /* USER CODE BEGIN (1) */
    /* USER CODE END */

    /*----------------------------------------------------------------------------*/
    /* Memory Map */

    MEMORY
    {
    VECTORS (X) : origin=0x00000000 length=0x00000020 fill = 0xffffffff
    FLASH0 (RX) : origin=0x00000020 length=0x0005FFE0 fill = 0xffffffff
    STACKS (RW) : origin=0x08000000 length=0x00002C00
    RAM (RW) : origin=0x08003C00 length=0x00006B00

    /* USER CODE BEGIN (2) */
    /* USER CODE END */
    }

    /* USER CODE BEGIN (3) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Section Configuration */

    SECTIONS
    {
    .intvecs : START(ulFlashStartAddr) {} > VECTORS
    .text : {} > FLASH0
    .const : END(ulFlashEndAddr) {} > FLASH0
    .cinit : {} > FLASH0
    .pinit : {} > FLASH0
    .STACK_DATA_svc : {. += 1024;} > STACKS, RUN_START(StackModeSVC)
    .STACK_DATA_fiq : {. += 1024;} > STACKS, RUN_START(StackModeFIQ)
    .STACK_DATA_irq : {. += 1024;} > STACKS, RUN_START(StackModeIRQ)
    .STACK_DATA_abt : {. += 1024;} > STACKS, RUN_START(StackModeABT)
    .STACK_DATA_und : {. += 1024;} > STACKS, RUN_START(StackModeUND)
    .STACK_DATA_sys : {. += 1024;} > STACKS, RUN_START(StackModeSYS)
    .bss : {} > RAM
    .data : {} > RAM
    .sysmem : {} > RAM

    /* USER CODE BEGIN (4) */
    /* USER CODE END */
    }

  • example  ,but I see HAL soft RAM 

    0X08001000    leng 0x00000100

    0x08001100  leng  0x00000100

    。。。。。。

    .STACK_DATA_svc : {. += 1024;} > STACKS, RUN_START(StackModeSVC)
    .STACK_DATA_fiq : {. += 1024;} > STACKS, RUN_START(StackModeFIQ)
    .STACK_DATA_irq : {. += 1024;} > STACKS, RUN_START(StackModeIRQ)
    .STACK_DATA_abt : {. += 1024;} > STACKS, RUN_START(StackModeABT)
    .STACK_DATA_und : {. += 1024;} > STACKS, RUN_START(StackModeUND)
    .STACK_DATA_sys : {. += 1024;} > STACKS, RUN_START(StackModeSYS)

    0x00000100  is  256,why cmd 1024

  • It is the exception of Undefined Instruction.

    LS0432 is a fix point device, if you try to use the floating point instruction, it will generate UNDEF exception.

    When a privileged mode is required, an instruction that attempts to access a CP15 register (for example SCTLR, PMU register) in a nonprivileged mode takes the Undefined Instruction exception.

    When a number is divided by zero, it may generate UNDEF exception if DZ bit in SCTLR register is set.

  • Hello

    How can I solve it?

    above picture.. "is an assembly function"?

    Is it missing some reference?

  • The sl_asm_api.asm file has the following code:

            .if	_VFP_SUPPORT_ = 1
            mrc   p15,     #0x00,      r2,       c1, c0, #0x02
            orr   r2,      r2,         #0xF00000
            mcr   p15,     #0x00,      r2,       c1, c0, #0x02
            mov   r2,      #0x40000000
            fmxr  fpexc,   r2
    
            fmdrr d0,         r1,     r1
            fmdrr d1,         r1,     r1
            fmdrr d2,         r1,     r1
            fmdrr d3,         r1,     r1
            fmdrr d4,         r1,     r1
            fmdrr d5,         r1,     r1
            fmdrr d6,         r1,     r1
            fmdrr d7,         r1,     r1
            fmdrr d8,         r1,     r1
            fmdrr d9,         r1,     r1
            fmdrr d10,        r1,     r1
            fmdrr d11,        r1,     r1
            fmdrr d12,        r1,     r1
            fmdrr d13,        r1,     r1
            fmdrr d14,        r1,     r1
            fmdrr d15,        r1,     r1
            .endif
            BX      LR
        .endasmfunc
    

    The Undef instruction exception is caused by the first fmdrr instruction in the above conditional code. As you can see this code is conditional based on the _VFP_SUPPORT_ configuration. For TMS570LS0432 make sure that _VFP_SUPPORT_ is 0.

  • Thank you 

    Yes  I  Define it Name in Predefined Symbols,because I see TMS570LS3137 make it

     How to distinguish, which is setted 0,and which is 1

    Where is the document 

  • All pre-defined macro names are specified in the TI ARM compiler user guide: https://www.ti.com/lit/pdf/spnu151