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.

TMS320F280049C: LIN寄存器查看(View->Registers)显示异常

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE, LAUNCHXL-F280049C

使用官方例程\C2000Ware_4_01_00_00\driverlib\f28004x\examples\lin\lin_ex1_loopback_interrupts进行调试

问题1:LIN寄存器显示的值与程序中的配置对不上,如下图SCIGCR1寄存器,被置1的位在手册上均为保留位

问题2:Memory Browser窗口内查看LIN寄存器地址内容无法显示

  • 您好,您的图片看得不太清楚,能重新发两张清晰的看一下吗?

  • 1. 我认为可以不用关心保留位的变化。

    2. 您暂停之后再试着查看一下。

    一般来说寄存器的值是通过registers来查看。

  • 使用单步运行,对可读可写寄存器位进行写1操作,从registers窗口查看对应寄存器位始终为0无变化

  • Memory Browser是暂停后查看的

  • 对可读可写寄存器位进行写1操作

    您是怎么进行写1操作的?哪个寄存器位?

  • 官方例程,单步执行

  • 请您提供一下具体是哪个例程,我帮您看一下

  • \C2000Ware_4_01_00_00\driverlib\f28004x\examples\lin\lin_ex1_loopback_interrupts

  • 是这个例程吗?我在这个例程中并没有找到您截图中的代码。

  • 是这个,step into单步执行

  • 我这边是正常的:

    例程没有问题。

  • 写的值对不上,0x00600000对应不到程序中写1的寄存器位,而且程序中只对SCIGCR1操作,但是SCIGCR2也变化了

  • 您看一下这个帖子,里面遇到的问题和您的类似:

    https://e2echina.ti.com/support/microcontrollers/c2000/f/c2000-microcontrollers-forum/216235/tms320f280025-lin

    并请按照里面的建议先试一下 lin_ex2_sci_loopback.c 这个例程。

  • 您说的这个帖子之前也看了,并没有解决位域显示不正确的问题

    调试了 lin_ex2_sci_loopback.c 例程,例程功能没问题,但也存在registers窗口显示的寄存器值不正确的问题

    我在例程的基础上进行修改实现LIN的其他功能时调试不正确,希望通过查看寄存器找问题但是registers窗口显示的值错误不能作为参考,分析受阻

  • 我已经向资深工程师寻求帮助了。再请问您一下,您使用的硬件和调试器是什么?

  • 用的LAUNCHXL-F280049C

    板载 XDS110 

  • 好的,有了结果我会第一时间回复您

  • LIN 寄存器 xml 文件中的寄存器偏移量不正确。请使用附加的 xml 文件并将其替换在以下文件夹中:

    <CCSInstallDir>\ccs\ccs_base\common\targetdb\Modules\C2000

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    <module id="LIN_REGS" HW_revision="" description="LIN Registers">
    <register id="SCIGCR0" width="32" page="1" offset="0x0" internal="0" description="Global Control Register 0">
    <bitfield id="RESET" description="LIN Module reset bit" begin="0" end="0" width="1" rwaccess="RW"/>
    </register>
    <register id="SCIGCR1" width="32" page="1" offset="0x2" internal="0" description="Global Control Register 1">
    <bitfield id="COMMMODE" description="SCI/LIN communications mode bit" begin="0" end="0" width="1" rwaccess="RW"/>
    <bitfield id="TIMINGMODE" description="SCI timing mode bit. Should be set to 1 for SCI mode." begin="1" end="1" width="1" rwaccess="RW"/>
    <bitfield id="PARITYENA" description="Parity enable" begin="2" end="2" width="1" rwaccess="RW"/>
    <bitfield id="PARITY" description="SCI parity odd/even selection" begin="3" end="3" width="1" rwaccess="RW"/>
    <bitfield id="STOP" description="SCI number of stop bits" begin="4" end="4" width="1" rwaccess="RW"/>
    <bitfield id="CLK_Master" description="LIN Master/Slave selection and SCI clock enable" begin="5" end="5" width="1" rwaccess="RW"/>
    <bitfield id="LINMODE" description="LIN Mode enable/disable" begin="6" end="6" width="1" rwaccess="RW"/>
    <bitfield id="SWnRST" description="Software reset" begin="7" end="7" width="1" rwaccess="RW"/>
    <bitfield id="SLEEP" description="SCI sleep (SCI compatibility mode)" begin="8" end="8" width="1" rwaccess="RW"/>
    <bitfield id="ADAPT" description="Automatic baudrate adjustment control(LIN mode)" begin="9" end="9" width="1" rwaccess="RW"/>
    <bitfield id="MBUFMODE" description="Multi-buffer mode" begin="10" end="10" width="1" rwaccess="RW"/>
    <bitfield id="CTYPE" description="Checksum type (LIN mode)" begin="11" end="11" width="1" rwaccess="RW"/>
    <bitfield id="HGENCTRL" description="Mask filtering comparison control (LIN mode)" begin="12" end="12" width="1" rwaccess="RW"/>
    <bitfield id="STOPEXTFRAME" description="Stop extended frame communication (LIN mode)" begin="13" end="13" width="1" rwaccess="RW"/>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • 感谢回复,更换文件后问题依然存在

    更换 xml文件后调试:

    修改gel文件后调试:

  • 比较两个xml文件,仅page="n"字段不一样,所以修改了gel文件

  • 好的,我已经反馈回去了

  • 试一下这个:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    <module id="LIN_REGS" HW_revision="" description="LIN Registers">
    <register id="SCIGCR0" width="32" page="1" offset="0x0" internal="0" description="Global Control Register 0">
    <bitfield id="RESET" description="LIN Module reset bit" begin="0" end="0" width="1" rwaccess="RW"/>
    </register>
    <register id="SCIGCR1" width="32" page="1" offset="0x4" internal="0" description="Global Control Register 1">
    <bitfield id="COMMMODE" description="SCI/LIN communications mode bit" begin="0" end="0" width="1" rwaccess="RW"/>
    <bitfield id="TIMINGMODE" description="SCI timing mode bit. Should be set to 1 for SCI mode." begin="1" end="1" width="1" rwaccess="RW"/>
    <bitfield id="PARITYENA" description="Parity enable" begin="2" end="2" width="1" rwaccess="RW"/>
    <bitfield id="PARITY" description="SCI parity odd/even selection" begin="3" end="3" width="1" rwaccess="RW"/>
    <bitfield id="STOP" description="SCI number of stop bits" begin="4" end="4" width="1" rwaccess="RW"/>
    <bitfield id="CLK_Master" description="LIN Master/Slave selection and SCI clock enable" begin="5" end="5" width="1" rwaccess="RW"/>
    <bitfield id="LINMODE" description="LIN Mode enable/disable" begin="6" end="6" width="1" rwaccess="RW"/>
    <bitfield id="SWnRST" description="Software reset" begin="7" end="7" width="1" rwaccess="RW"/>
    <bitfield id="SLEEP" description="SCI sleep (SCI compatibility mode)" begin="8" end="8" width="1" rwaccess="RW"/>
    <bitfield id="ADAPT" description="Automatic baudrate adjustment control(LIN mode)" begin="9" end="9" width="1" rwaccess="RW"/>
    <bitfield id="MBUFMODE" description="Multi-buffer mode" begin="10" end="10" width="1" rwaccess="RW"/>
    <bitfield id="CTYPE" description="Checksum type (LIN mode)" begin="11" end="11" width="1" rwaccess="RW"/>
    <bitfield id="HGENCTRL" description="Mask filtering comparison control (LIN mode)" begin="12" end="12" width="1" rwaccess="RW"/>
    <bitfield id="STOPEXTFRAME" description="Stop extended frame communication (LIN mode)" begin="13" end="13" width="1" rwaccess="RW"/>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • 位域显示还是不对

  • 您好,我已经反馈回去了,目前还在等回复