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.

CCS/TMS570LS0914: memset - undefEntry after program change

Part Number: TMS570LS0914


Tool/software: Code Composer Studio

Program was working fine, but when i changed something there it crashes at some point. The problem seems to be memset... do I need to include it in the memory, if yes why was it working before?

Somewhere in the main method:

...

uint8_t data[8] = {0}; 0800 8E8C MOV R1, #0x00 0800 8E90 ADD R0, SP, #0x18 0800 8E94 MOV R2, #0x08 0800 8E98 BL 0x08009018

when you step into it you get the following:

$ARM
0800 9018 LDR    R12, =memset    ; [0x08009020] =0x000200C3
0800 901c BX     R12

and it jumps into undefEntry and crashes.

  • It looks like you are executing code from RAM as well as Flash. Is the memset routine located at address 0x000200C3? Can you force the functions to be aligned to a 32-bit-aligned address?

    Also, when the CPU is at the underEntry, you can look at the link register (R14) to identify the instruction that caused the undefined instruction exception. This will give you a better hint for what caused the error.

    Regards, Sunil

  • Sunil Oak said:

    It looks like you are executing code from RAM as well as Flash.

    Yes exactly. Most of the functions are located in RAM (for example main)

    Sunil Oak said:

    Is the memset routine located at address 0x000200C3?

    Yes, the program tries to access a function that is stored in Flash from RAM code

    Sunil Oak said:

    Can you force the functions to be aligned to a 32-bit-aligned address?

    How can we do that?

    Sunil Oak said:

    Also, when the CPU is at the underEntry, you can look at the link register (R14) to identify the instruction that caused the undefined instruction exception. This will give you a better hint for what caused the error.

    The exact line that causes the undefEntry is the following:

    0800 9018 LDR    R12, =memset    ; [0x08009020] =0x000200C3

  • You can align sections using the linker command file constructs. See the "align" keyword for linker command files in this document: 

    Do you have valid code at address 0x0800_9018? Did the application program this location with the valid code to jump to the memset routine?