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.

[参考译文] TMS320F28379D:接收 CAN 消息时出现问题

Guru**** 2539500 points


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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1367591/tms320f28379d-trouble-receiving-can-messages

器件型号:TMS320F28379D

工具与软件:

大家好、我刚刚接触 TI 的 MCU、我正尝试使用以下程序从 MCP 2515发送一条 CAN 消息。 我确定将_LAUNCHXL_F28379D 定义为我的预定义符号、并且我在下面附上了相关代码和我的.syscfg 文件的副本。 我已尝试查看 sprace5a 中提供的调试提示;但是、我尚未找到任何可以解决我的问题的方法。 非常感谢您的帮助。

//
// Included Files
//
#include "board.h"
#include "c2000ware_libraries.h"


volatile unsigned int recievedData = 0;

//
// Main
//
void main(void)
{

    //
    // Initialize device clock and peripherals
    //
    Device_init();

    //
    // Disable pin locks and enable internal pull-ups.
    //
    Device_initGPIO();

    //
    // Initialize PIE and clear PIE registers. Disables CPU interrupts.
    //
    Interrupt_initModule();

    //
    // Initialize the PIE vector table with pointers to the shell Interrupt
    // Service Routines (ISR).
    //
    Interrupt_initVectorTable();

    //
    // PinMux and Peripheral Initialization
    //
    Board_init();

    //
    // C2000Ware Library initialization
    //
    C2000Ware_libraries_init();

    //
    // Enable Global Interrupt (INTM) and real time interrupt (DBGM)
    //
    EINT;
    ERTM;

    CAN_startModule(myCAN0_BASE);
    uint16_t rxMsgData[8];

    while(1)
    {
        if (CAN_readMessage(myCAN0_BASE, 2, rxMsgData))
            recievedData = 1;
    }
}

//
// End of File
//

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

    Jean-Pierre,

                   请报告您在 SPRACE5A 中提供的每一个调试技巧的发现。

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

    更正 CAN_readMessage 函数调用以使用正确的 Objid (1)修复了我的问题