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:ESM FIQ内的UNDEF中止

Guru**** 656470 points
Other Parts Discussed in Thread: HALCOGEN, TMS570LC4357
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1097294/tms570lc4357-undef-abort-within-esm-fiq

部件号:TMS570LC4357
主题中讨论的其他部件:HALCOGEN

我正在使用TMDX570LC4357HDK板,CCS v.11.1 0.0 .0.0012万和TI 20.2 .5.LTS编译器。

我的应用程序正在HalCoGen生成的esmHighInterrupt()函数的原型中生成UNDEF异常中止。

我在esmHighInterrupt()处理程序的开头添加了一个静态计数器变量,以确定在UNDEF中止之前执行该处理程序的次数。

我的程序在大约18秒后中止,并且处理程序已执行1.8198万 时间,因此大约 为1000Hz。

以下是 ISR程序的ASM:

esmHighInterrupt():
0.1743万c:E92D500F push {r0, r1, r2, r3,r12, R14}
1.744万:EEF8CA10 vmrs R12,fpexc.
1.7444万:E92D1000 stmdb R13!,{R12}
1.7448万:EEF1CA10 vmrs R12,fpscr.
0.1744万c:E92D1000 stmdb R13!,{R12}
1.745万:ED2D0B10 vpush{d0,d1,d2,d3,d4, d5,d6,d7}
1.7454万:E24DD008 SUB R13,R13,#8

r14_und为0x0.1744万C,因此上面的粗体行。 我认为这意味 着UNDEF中止应该是在之前的指令上生成的:  vmrs r12,fpscr.

这对我来说似乎很奇怪,因为虽然在禁用FPU的情况下使用FPU指令会导致UNDEF中止,但这是teh处理程序中的第二个FPU指令,并且处理程序已成功执行多次。

我已检查内存浏览器以确保拆卸过程正确显示闪存中有哪些说明-因此我知道没有任何东西损坏了该说明。

我相信ESM中断的来源是一致的:ESM状态2寄存器始终为8,而ESM中断偏移高寄存器始终为0x24。 根据 《TMS570LC43x技术参考手册》的16.4 部分,这意味着它是组2通道15错误。 TMS570LC4357数据表声明此错误为'保留'(表6-45)。

我一定是在某处犯了一个错误,但我看不出在哪里。 导致此UNDEF中止的原因是什么? 还是某种程度上是一种红鲱鱼?

提前感谢!

亚当

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    ESM4357 ESM状态2始终为8,ESM寄存器偏移高寄存器始终为0x24[/报价]。

    这是ESM组2的通道3

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你说得对,我看到我犯的错误。

    现在的问题是:如何防止这些错误? 我能找到应该纠正此问题的声音的唯一设置是在我的调试配置->目标->闪存设置中

    我已尝试设置'Auto ECC Generation'(自动ECC生成)选项,我认为该选项可以解决问题,但没有解决。

    我尝试让链接程序生成ECC (--ecc=on),但没有结果。 我不知道在链接程序脚本中定义的ECC部分的放置位置。

    在我的内存部分中,我有以下闪存扇区:

    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

    我有相应的ECC扇区:

    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
    }

    如果ECC部分稍后也在链接程序脚本中定义:

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

    我还设置了以下调试配置设置:

    我找不到使用链接器生成ECC信息的指南,因此我从多个来源将其拼凑在一起。

    这将成功编译,并且在尝试调试时从控制台获得以下输出:

    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
     

    但是,我不在调试会话中-我不能暂停执行,只能停止执行。

    我错过了什么步骤或犯了什么错误?

    非常感谢,

    亚当

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好,Adam:

    请参阅有关链接器ECC的注释:

    https://software-dl.ti.com/hercules/hercules_docs/latest/hercules/How_to_Guides/HowToGuides.html#launchxl2-570lc43-rm57 l -linkereccre嘉 奖

    这是我的例子:

    e2e.ti.com/.../7762.HL_5F00_sys_5F00_link.cmd