TI E2E™ 设计支持论坛将于 5 月 30 日至 6 月 1 日进行维护。如果您在此期间需要技术支持,请联系 TI 的客户支持中心寻求帮助。

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.

我用的是F28377s,官网下载的controlSUIT,底层驱动从里面调用的,按道理用没有错误,但是编译之后出现了如下错误,希望熟悉F28X系列的大佬指点一下,谢谢!

Other Parts Discussed in Thread: CONTROLSUITE

Problem:

Description Resource Path Location Type
#20 identifier "CanaRegs" is undefined F2837xS_can.c /My_test/drv/source line 32 C/C++ Problem

F2837XS_can.c中的代码:

......

CanaRegs.CAN_CTL.bit.Init = 1;  //这句报错!

......

F2837XS_Can_defines.h中的代码:

#define CAN_CTL_INIT 0x00000001 // Initialization
#define CAN_CTL_IE0 0x00000002 // Interrupt Enable 0
#define CAN_CTL_SIE 0x00000004 // Status Interrupt Enable
#define CAN_CTL_EIE 0x00000008 // Error Interrupt Enable
#define CAN_CTL_DAR 0x00000020 // Disable Automatic-Retransmission
#define CAN_CTL_CCE 0x00000040 // Configuration Change Enable
#define CAN_CTL_TEST 0x00000080 // Test Mode Enable
#define CAN_CTL_IDS 0x00000100 // Interruption Debug Support Enable
#define CAN_CTL_ABO 0x00000200 // Auto-Bus On Enable
#define CAN_CTL_PMD_S 10
#define CAN_CTL_PMD_M 0x00003C00 // Parity/SECDED Enable
#define CAN_CTL_SWR 0x00008000 // Software Reset Enable
#define CAN_CTL_INITDBG 0x00010000 // Debug Mode Status
#define CAN_CTL_IE1 0x00020000 // Interrupt Enable 1
#define CAN_CTL_PDR 0x01000000 // Power Down Mode Request
#define CAN_CTL_WUBA 0x02000000 // Wake Up on Bus Activity

应该已经定义了啊,为什么错误显示未定义?

  • 是缺少F2837xS_can.h么。
  • 直接打开CCS导入controlSUITE里面的工程 编译看看 应该没有错
    你这个是不是拷贝到其他地方了 导致库文件找不见了
    可以将相关文件拷贝到你的工程下 然后在工程属性下设计搜索路径
  • #define CAN_CTL_INIT 0x00000001 // Initialization
    #define CAN_CTL_IE0 0x00000002 // Interrupt Enable 0
    #define CAN_CTL_SIE 0x00000004 // Status Interrupt Enable
    #define CAN_CTL_EIE 0x00000008 // Error Interrupt Enable
    #define CAN_CTL_DAR 0x00000020 // Disable Automatic-Retransmission
    #define CAN_CTL_CCE 0x00000040 // Configuration Change Enable
    #define CAN_CTL_TEST 0x00000080 // Test Mode Enable
    #define CAN_CTL_IDS 0x00000100 // Interruption Debug Support Enable
    #define CAN_CTL_ABO 0x00000200 // Auto-Bus On Enable
    #define CAN_CTL_PMD_S 10
    #define CAN_CTL_PMD_M 0x00003C00 // Parity/SECDED Enable
    #define CAN_CTL_SWR 0x00008000 // Software Reset Enable
    #define CAN_CTL_INITDBG 0x00010000 // Debug Mode Status
    #define CAN_CTL_IE1 0x00020000 // Interrupt Enable 1
    #define CAN_CTL_PDR 0x01000000 // Power Down Mode Request
    #define CAN_CTL_WUBA 0x02000000 // Wake Up on Bus Activity
    这个是宏定义,与CanaRegs结构体没有任何关系。
    打开例程试试吧
  • 他说报错的是这句 CanaRegs.CAN_CTL.bit.Init = 1; //这句报错!
    建议在工程中敲这句配置 看看能否自动补全
  • 您好,我用的是F28377s,controlSUITE中以工程文件形式打不开这些例程,所以我就把程序拷出来,自己编译
  • 您好,谢谢您的回答,我是dsp新手,请问怎么配置啊具体代码是什么?
  • 我直接打开了E:\ti\controlSUITE\device_support\f2833x\v142\DSP2823x_examples_ccsv5\watchdog,编译还是出现了一样的问题