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.

TMS570LC4357: Undef abort within esm FIQ

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN,

I am using a TMDX570LC4357HDK board, CCS v11.1.0.0.00012, and the TI 20.2.5.LTS compiler.

My application is generating an undef abort in the prologue of the esmHighInterrupt() function generated by HalCoGen.

I added a static counter variable at the start of the esmHighInterrupt() handler to determine the number of times this handler is executed before the undef abort.

My program gets this abort after approximately 18 seconds, and the handler has been executes 18,198 times, so approximately 1000Hz.

Here is the asm for the ISR prologue:

esmHighInterrupt():
0001743c: E92D500F push {r0, r1, r2, r3, r12, r14}
00017440: EEF8CA10 vmrs r12, fpexc
00017444: E92D1000 stmdb r13!, {r12}
00017448: EEF1CA10 vmrs r12, fpscr
0001744c: E92D1000 stmdb r13!, {r12}
00017450: ED2D0B10 vpush {d0, d1, d2, d3, d4, d5, d6, d7}
00017454: E24DD008 sub r13, r13, #8

The r14_UND is 0x0001744C, so the bold line above. I believe this means that the undef abort should have been generated on the previous instruction:  vmrs r12, fpscr

This seems odd to me because although using an FPU instruction with the FPU disabled can cause an undef abort, that's the second FPU instruction in teh handler, and the handler has been successfully executed many times.

I have checked the memory browser to ensure that the disassembly is correctly showing me what instructions are there in flash - so I know that nothing has somehow corrupted that instruction.

I believe that the source of the esm interrupt is consistent: the ESM status 2 register is always 8 and the ESM Interrupt Offset High Register is always 0x24. According to section 16.4 of the TMS570LC43x Technical Reference Manual, this means that it is a group 2 channel 15 error. The TMS570LC4357 datasheet claims that this error is 'Reserved' (Table 6-45).

I must be making a mistake somewhere, but I cannot see where. What is causing this undef abort? Or is it a red herring somehow?

Thanks in advance,

Adam

  • the ESM status 2 register is always 8 and the ESM Interrupt Offset High Register is always 0x24.

    This is channel 3 of ESM Group 2

  • You're right, I see the mistake I made.

    The question is now: how do I prevent these errors? The only settings that I can find that sound like they should correct this are in my Debug Configuration -> Target -> Flash Settings

    I have tried setting the 'Auto ECC Generation' option which I thought would solve the issue but it does not.

    I have tried to get the linker to generate the ECC (--ecc=on) but to no avail. I do not know where to place the ECC sections I am defining in my linker script.

    Within my MEMORY section, I have the following flash sectors:

    VECTORS (X) : origin=0x00000000 length=0x00000080
    KERN_FUNC (RX) : origin=0x00000080 length=0x0000FF80
    FLASH0 (RX) : origin=0x00010000 length=0x001F0000
    FLASH1 (RX) : origin=0x00200000 length=0x00200000

    And I have corresponding ECC sectors:

    VECTORS_ECC : origin=0x01000000, length=0x10, ECC = {
      input_range = VECTORS,
      input_page = 0,
      algorithm = my_Algo_f021,
      fill = true
    }

    KERN_FUNC_ECC : origin=0x01000010, length=0x1FF0, ECC = {
      input_range = KERN_FUNC,
      input_page = 0,
      algorithm = my_Algo_f021,
      fill = true
    }

    FLASH0_ECC : origin=0x01002000, length=0x3e000, ECC = {
      input_range = FLASH0,
      input_page = 0,
      algorithm = my_Algo_f021,
      fill = true
    }

    FLASH1_ECC : origin=0x01040000, length=0x40000, ECC = {
      input_range = FLASH1,
      input_page = 0,
      algorithm = my_Algo_f021,
      fill = true
    }

    With an ECC section also defined later on in the linker script:

    ECC
    {
      my_Algo_f021: address_mask = 0x003ffff8
      hamming_mask=R4
      parity_mask = 0x0c
      mirroring = F021
    }

    And I have also set the following debug config settings:

    I could not find a guide for generating ECC info with the linker, so I cobbled this together from multiple sources.

    This successfully compiles and I get the following output from the console when attempting to debug:

    CortexR5: GEL Output: Memory Map Setup for Flash @ Address 0x0CortexR5: GEL Output: Memory Map Setup for Flash @ Address 0x0 due to System Reset
    CortexR5: GEL Output: Memory Map Setup for Flash @ Address 0x0 due to System Reset
    CortexR5: Writing Flash @ Address 0x00000000 of Length 0x00000060
    CortexR5: Erasing Flash Bank 0, Sector 0
    CortexR5: Writing Flash @ Address 0x00000080 of Length 0x00005554
    CortexR5: Erasing Flash Bank 0, Sector 1
    CortexR5: Writing Flash @ Address 0x00010000 of Length 0x00007ff0
    CortexR5: Erasing Flash Bank 0, Sector 4
    CortexR5: Erasing Flash Bank 0, Sector 5
    CortexR5: Writing Flash @ Address 0x00017ff0 of Length 0x00003330
    CortexR5: Erasing Flash Bank 0, Sector 6
    CortexR5: Loader: One or more sections of your program falls into a memory region that is not writable. These regions will not actually be written to the target. Check your linker configuration and/or memory map.
    CortexR5: GEL Output: Memory Map Setup for Flash @ Address 0x0 due to System Reset
     

    But then I am not in a debug session - I cannot pause execution, only stop it.

    What step have I missed or what mistake have I made?

    Many thanks,

    Adam

  • Hi Adam,

    Please refer to the note regarding the Linker ECC:

    https://software-dl.ti.com/hercules/hercules_docs/latest/hercules/How_to_Guides/HowToGuides.html#launchxl2-570lc43-rm57l-linkereccrecommendation

    This is my example:

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/7762.HL_5F00_sys_5F00_link.cmd