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/TMS320F28377D: sgen illegal isr trap in CPU2

Part Number: TMS320F28377D
Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE

Tool/software: Code Composer Studio

sgen function is working fine in CPU1 but NOT working in CPU2.

sgen illegal ISR trap error is coming while executing "sgen.calc(&sgen);" in CPU2. kindly resolve the issue.

  • Hi Arunbabu,
    I am working to find the appropriate expert to help you. This may take some time to reach the right person depending on availability. Please expect an update after this weekend. I appreciate your patience.
  • Arunbabu,

    I’ll work with you to resolve this. I’ll get back to you on this by Tuesday.

    Thanks
    Sira
  • Arunbabu,

    I'd like some additional information on this issue please:

    1. Are you using C2000Ware or ControlSUITE? Which version?
    2. I presume you are using the 28377D device?
    3. Are you using a TI example project or your own project? I presume you are using your own project, because C2000Ware v1.06 has SGEN examples only for the 2833x device. So you probably ported over the example to the 28377D device?

    Without additional context on this issue, my thinking would be that you probably have some issues in the CPU2 linker cmd file. If you look at this link, it shows possible reasons for an illegal ISR trap error to occur. Foremost among them is the execution of an invalid instruction opcode, which can occur if there is a memory problem (E.g. stack overflow).

    Please look at the disassembly of your program as you step through and debug, and this may give you some hints.

    processors.wiki.ti.com/.../Interrupt_FAQ_for_C2000

    I look forward to your feedback.

    Thanks,
    Sira
    • CPU2 hangs while executing at "sgen.calc(&sgen);", using controlsuite sgen library file.
    • yes i am using 28377D.
    • i am using my own project. yes ported the example to 28377D. i am attaching CPU1  and CPU2 lnkr cmd file. SGEN working fine with CPU1 but not working in CPU2.
      2837xD_FLASH_lnk_cpu2.txt
      Fullscreen
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      53
      54
      55
      56
      57
      58
      59
      60
      61
      62
      63
      64
      65
      66
      67
      MEMORY
      {
      PAGE 0 :
      /* BEGIN is used for the "boot to SARAM" bootloader mode */
      BEGIN : origin = 0x080000, length = 0x000002
      RAMD0 : origin = 0x00B000, length = 0x000800
      RAMLS0 : origin = 0x008000, length = 0x000800
      RAMLS1 : origin = 0x008800, length = 0x000800
      RAMLS2 : origin = 0x009000, length = 0x000800
      RAMLS3 : origin = 0x009800, length = 0x000800
      RAMLS4 : origin = 0x00A000, length = 0x000800
      RESET : origin = 0x3FFFC0, length = 0x000002
      /* Flash sectors */
      FLASHA : origin = 0x080002, length = 0x001FFE
      FLASHB : origin = 0x082000, length = 0x036000
      /* FLASHC : origin = 0x084000, length = 0x002000
      FLASHD : origin = 0x086000, length = 0x002000
      FLASHE : origin = 0x088000, length = 0x008000
      FLASHF : origin = 0x090000, length = 0x008000
      FLASHG : origin = 0x098000, length = 0x008000
      FLASHH : origin = 0x0A0000, length = 0x008000
      FLASHI : origin = 0x0A8000, length = 0x008000
      FLASHJ : origin = 0x0B0000, length = 0x008000 */
      FLASHK : origin = 0x0B8000, length = 0x002000
      FLASHL : origin = 0x0BA000, length = 0x002000
      FLASHM : origin = 0x0BC000, length = 0x002000
      FLASHN : origin = 0x0BE000, length = 0x002000
      PAGE 1 :
      BOOT_RSVD : origin = 0x000002, length = 0x00007E /* Part of M0, BOOT rom will use this for stack */
      RAMM0 : origin = 0x000080, length = 0x000380
      RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */
      RAMD1 : origin = 0x00B800, length = 0x000800
      RAMLS5 : origin = 0x00A800, length = 0x000800
      RAMGS0 : origin = 0x00C000, length = 0x001000
      RAMGS1 : origin = 0x00D000, length = 0x001000
      RAMGS2 : origin = 0x00E000, length = 0x001000
      RAMGS3 : origin = 0x00F000, length = 0x001000
      RAMGS4 : origin = 0x010000, length = 0x001000
      RAMGS5 : origin = 0x011000, length = 0x001000
      RAMGS6 : origin = 0x012000, length = 0x005DFE
      //SINTBL_RESERVE : origin = 0x017DFF, length = 0x000200
      /*RAMGS7 : origin = 0x013000, length = 0x001000
      RAMGS8 : origin = 0x014000, length = 0x001000
      RAMGS9 : origin = 0x015000, length = 0x001000
      RAMGS10 : origin = 0x016000, length = 0x001000
      RAMGS11 : origin = 0x017000, length = 0x001000*/
      RAMGS12 : origin = 0x018000, length = 0x001000 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
      RAMGS13 : origin = 0x019000, length = 0x001000 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
      RAMGS14 : origin = 0x01A000, length = 0x001000 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
      RAMGS15 : origin = 0x01B000, length = 0x001000 /* Only Available on F28379D, F28377D, F28375D devices. Remove line on other devices. */
      CPU2TOCPU1RAM : origin = 0x03F800, length = 0x000400
      CPU1TOCPU2RAM : origin = 0x03FC00, length = 0x000400
      }
      SECTIONS
      {
      /* Allocate program areas: */
      .cinit : > FLASHB PAGE = 0, ALIGN(4)
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      2837xD_FLASH_lnk_cpu1.txt
      Fullscreen
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      53
      54
      55
      56
      57
      58
      59
      60
      61
      62
      63
      64
      65
      66
      67
      MEMORY
      {
      PAGE 0 : /* Program Memory */
      /* Memory (RAM/FLASH) blocks can be moved to PAGE1 for data allocation */
      /* BEGIN is used for the "boot to Flash" bootloader mode */
      BEGIN : origin = 0x080000, length = 0x000002
      RAMM0 : origin = 0x000122, length = 0x0002DE
      RAMD0 : origin = 0x00B000, length = 0x000800
      RAMLS0 : origin = 0x008000, length = 0x000800
      RAMLS1 : origin = 0x008800, length = 0x000800
      RAMLS2 : origin = 0x009000, length = 0x000800
      RAMLS3 : origin = 0x009800, length = 0x000800
      RAMLS4 : origin = 0x00A000, length = 0x000800
      RESET : origin = 0x3FFFC0, length = 0x000002
      /* Flash sectors */
      FLASHA : origin = 0x080002, length = 0x001FFE /* on-chip Flash */
      FLASHB : origin = 0x082000, length = 0x002000 /* on-chip Flash */
      FLASHC : origin = 0x084000, length = 0x002000 /* on-chip Flash */
      FLASHD : origin = 0x086000, length = 0x002000 /* on-chip Flash */
      FLASHE : origin = 0x088000, length = 0x008000 /* on-chip Flash */
      FLASHF : origin = 0x090000, length = 0x008000 /* on-chip Flash */
      FLASHG : origin = 0x098000, length = 0x008000 /* on-chip Flash */
      FLASHH : origin = 0x0A0000, length = 0x008000 /* on-chip Flash */
      FLASHI : origin = 0x0A8000, length = 0x008000 /* on-chip Flash */
      FLASHJ : origin = 0x0B0000, length = 0x008000 /* on-chip Flash */
      FLASHK : origin = 0x0B8000, length = 0x002000 /* on-chip Flash */
      FLASHL : origin = 0x0BA000, length = 0x002000 /* on-chip Flash */
      FLASHM : origin = 0x0BC000, length = 0x002000 /* on-chip Flash */
      FLASHN : origin = 0x0BE000, length = 0x002000 /* on-chip Flash */
      PAGE 1 : /* Data Memory */
      /* Memory (RAM/FLASH) blocks can be moved to PAGE0 for program allocation */
      BOOT_RSVD : origin = 0x000002, length = 0x000120 /* Part of M0, BOOT rom will use this for stack */
      RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */
      RAMD1 : origin = 0x00B800, length = 0x000800
      RAMLS5 : origin = 0x00A800, length = 0x000800
      /*
      RAMGS0 : origin = 0x00C000, length = 0x001000
      RAMGS1 : origin = 0x00D000, length = 0x001000
      RAMGS2 : origin = 0x00E000, length = 0x001000
      RAMGS3 : origin = 0x00F000, length = 0x001000
      RAMGS4 : origin = 0x010000, length = 0x001000
      RAMGS5 : origin = 0x011000, length = 0x001000
      RAMGS6 : origin = 0x012000, length = 0x001000
      RAMGS7 : origin = 0x013000, length = 0x001000
      RAMGS8 : origin = 0x014000, length = 0x001000
      RAMGS9 : origin = 0x015000, length = 0x001000
      RAMGS10 : origin = 0x016000, length = 0x001000
      RAMGS11 : origin = 0x017000, length = 0x001000
      RAMGS12 : origin = 0x018000, length = 0x001000
      RAMGS13 : origin = 0x019000, length = 0x001000
      RAMGS14 : origin = 0x01A000, length = 0x001000
      RAMGS15 : origin = 0x01B000, length = 0x001000 */
      CPU2TOCPU1RAM : origin = 0x03F800, length = 0x000400
      CPU1TOCPU2RAM : origin = 0x03FC00, length = 0x000400
      }
      SECTIONS
      {
      /* Allocate program areas: */
      .cinit : > FLASHB PAGE = 0, ALIGN(4)
      .pinit : > FLASHB, PAGE = 0, ALIGN(4)
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Arunbabu,

    I notice you have extended the length of FLASHB in CPU2 and eliminated FLASHC through FLASHJ. Any particular reason for doing this?

    I would suggest using the traditional definitions of the FLASH sectors for CPU2 as well and seeing if that fixes the issue.

    I would also suggest reviewing the linker command file closely and checking if CPU2 is accessing any memory resources not assigned to CPU2.

    Thanks,
    Sira
  • Do you have any updates? If your questions have been answered, I would like to go ahead and mark the issue as resolved. It would help if you could mark my Answer as Verified as well. Thanks! -Sira
  • traditional definitions of the FLASH sectors for CPU2 also did not resolve the issue
  • If possible, can you send me your project for me to try at my end?

    Thanks,
    Sira
  • hi, any update pls.. for the code which i attached before.

  • Arun,

    No, I could not identify the issue.

    Thanks,
    Sira
  • Arun,

    I have tried running the code you sent in an earlier post from RAM on CPU2 and it does seem to run. I am not getting an ITRAP when I run the call sgen.calc().

    Can you try this please:
    1. Place a break-point on the call the sgen.calc() and run to it.
    2. "Assembly step into" (Ctrl+Shift+F5) through the code to the LCR *XAR7 instruction. What does XAR7 hold at this point?
    3. "Assembly step into" one more time to enter the function. What happens?

    Thanks.

    Regards,

    Richard
  • Arunbabu,

    We are going to go ahead and mark the issue as resolved. The issue has been open more than 30 days and we have not received feedback from you in a timely manner in order to troubleshoot the issue. If you have more questions, please open a new issue, but first please try Richard's suggestions.
    Thanks.