|
Post by emachine on Sept 15, 2022 10:17:32 GMT
Dear forum members, I would like to ask a specific question in relation to the CANbus functionality on ShieldBuddy TC275 and TC375. I am using ShieldBuddy TC275 and TC375 boards and would like to start using the CAN bus on these boards for real. If possible please point to a simple example Arduino sketch that upon Uploading onto any of these two boards will demonstrate that CANbus send and receive functionality is working trouble free. Basically, Upload -> Reset -> serial port prints the CAN frames being sent and received.I have the necessary hardware support, the ShieldBuddy boards, some transceivers and other electronic components that are needed to set up the system on the breadboard. Having seen some of the Q and A posts in this section of the forum (most are historical, well past the latest revisions and updates) I conclude that it is best to ask a fresh question regarding CANbus operation on these two boards.
Thank you in advance.
|
|
sinai1
Junior Member

Posts: 65
|
Post by sinai1 on Sept 23, 2022 18:16:59 GMT
|
|
|
Post by emachine on Sept 29, 2022 17:14:59 GMT
Hello sinai1,
thank you for your help, it is appreciated.
I have tried to compile on Arduino IDE, but the following errors were found (please see all the way to the bottom of the compiler output):
************************************************************************************************************************************* *************************************************************************************************************************************
Arduino: 1.8.19 (Windows 7), Board: "ShieldBuddyTC275_Dx"
In file included from E:\...\TC275-CANFD_Lib\TC275-CANFD_Lib.ino:3:0: E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h: In function 'void CAN_Test_RX()': E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:46:291: warning: format '%X' expects argument of type 'unsigned int', but argument 4 has type 'uint32 {aka long unsigned int}' [-Wformat=] sprintf(outstr1, "RX Stat:%02X / ID:%03X / Send:%02X / Responce:%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X", RxStatus, msg1.id, (CANFD_TX.bytes[0] - 1), CAN_RX.bytes[0], CAN_RX.bytes[1], CAN_RX.bytes[2], CAN_RX.bytes[3], CAN_RX.bytes[4], CAN_RX.bytes[5], CAN_RX.bytes[6], CAN_RX.bytes[7]); ^ E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:46:291: warning: format '%X' expects argument of type 'unsigned int', but argument 4 has type 'uint32 {aka long unsigned int}' [-Wformat=] E:\...\TC275-CANFD_Lib\TC275-CANFD_Lib.ino: In function 'void setup()': E:\...\TC275-CANFD_Lib\TC275-CANFD_Lib.ino:16:47: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] String_To_SerialDebug("Serial Debug Init OK"); ^ E:\...\TC275-CANFD_Lib\TC275-CANFD_Lib.ino:19:44: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] String_To_SerialDebug("CAN0 BUS init ok!"); ^ E:\...\TC275-CANFD_Lib\TC275-CANFD_Lib.ino:21:44: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] String_To_SerialDebug("CAN3 BUS init ok!"); ^ E:\...\TC275-CANFD_Lib\TC275-CANFD_Lib.ino:24:43: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] String_To_SerialDebug("CAN0 TX init ok!"); ^ E:\...\TC275-CANFD_Lib\TC275-CANFD_Lib.ino:27:43: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] String_To_SerialDebug("CAN3 RX init ok!"); ^ In file included from E:\...\TC275-CANFD_Lib\TC275-CANFD_Lib.ino:3:0: E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h: In function 'void CAN_Test_RX()': E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:32:21: warning: array subscript is above array bounds [-Warray-bounds] CAN_RX.dword[2] = msg1.data[2]; ^ E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:33:21: warning: array subscript is above array bounds [-Warray-bounds] CAN_RX.dword[3] = msg1.data[3]; ^ E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:34:21: warning: array subscript is above array bounds [-Warray-bounds] CAN_RX.dword[4] = msg1.data[4]; ^ E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:35:21: warning: array subscript is above array bounds [-Warray-bounds] CAN_RX.dword[5] = msg1.data[5]; ^ E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:36:21: warning: array subscript is above array bounds [-Warray-bounds] CAN_RX.dword[6] = msg1.data[6]; ^ E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:37:21: warning: array subscript is above array bounds [-Warray-bounds] CAN_RX.dword[7] = msg1.data[7]; ^ E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:38:21: warning: array subscript is above array bounds [-Warray-bounds] CAN_RX.dword[8] = msg1.data[8]; ^ E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:39:21: warning: array subscript is above array bounds [-Warray-bounds] CAN_RX.dword[9] = msg1.data[9]; ^ E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:40:22: warning: array subscript is above array bounds [-Warray-bounds] CAN_RX.dword[10] = msg1.data[10]; ^ E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:41:22: warning: array subscript is above array bounds [-Warray-bounds] CAN_RX.dword[11] = msg1.data[11]; ^ E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:42:22: warning: array subscript is above array bounds [-Warray-bounds] CAN_RX.dword[12] = msg1.data[12]; ^ E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:43:22: warning: array subscript is above array bounds [-Warray-bounds] CAN_RX.dword[13] = msg1.data[13]; ^ E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:44:22: warning: array subscript is above array bounds [-Warray-bounds] CAN_RX.dword[14] = msg1.data[14]; ^ E:\...\TC275-CANFD_Lib\02-CANFD-TC275.h:45:22: warning: array subscript is above array bounds [-Warray-bounds] CAN_RX.dword[15] = msg1.data[15]; ^ In file included from C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:132:0, from <command-line>:0: C:\Program Files (x86)\Arduino\hardware\aurduino_Dx\aurix\variants\TC275\MultiCAN.cpp: In function 'void CAN0_SendMessage_dword(uint32, uint32, uint32, IfxMultican_DataLengthCode)': C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/AurixLiteTC275.h:136:31: error: redefinition of 'void CAN0_SendMessage_dword(uint32, uint32, uint32, IfxMultican_DataLengthCode)' #define CAN_SendMessage_dword CAN0_SendMessage_dword ^ C:\Program Files (x86)\Arduino\hardware\aurduino_Dx\aurix\variants\TC275\MultiCAN.cpp:1036:6: note: in expansion of macro 'CAN_SendMessage_dword' void CAN_SendMessage_dword(uint32 CAN_Id, uint32 Lowdata, uint32 Highdata, IfxMultican_DataLengthCode dlc) ^ C:\Program Files (x86)\Arduino\hardware\aurduino_Dx\aurix\variants\TC275\MultiCAN.cpp:234:6: note: 'void CAN0_SendMessage_dword(uint32, uint32, uint32, IfxMultican_DataLengthCode)' previously defined here void CAN0_SendMessage_dword(uint32 CAN_Id, uint32 Lowdata, uint32 Highdata, IfxMultican_DataLengthCode dlc) ^ In file included from C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/Variant.h:132:0, from <command-line>:0: C:\Program Files (x86)\Arduino\hardware\aurduino_Dx\aurix\variants\TC275\MultiCAN.cpp: In function 'int CAN0_SendMessage(uint32, CANMessagePayloadType*, IfxMultican_DataLengthCode)': C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/variants/tc275/AurixLiteTC275.h:135:26: error: redefinition of 'int CAN0_SendMessage(uint32, CANMessagePayloadType*, IfxMultican_DataLengthCode)' #define CAN_SendMessage CAN0_SendMessage ^ C:\Program Files (x86)\Arduino\hardware\aurduino_Dx\aurix\variants\TC275\MultiCAN.cpp:1049:5: note: in expansion of macro 'CAN_SendMessage' int CAN_SendMessage(uint32 CAN_Id, CANMessagePayloadType *msg1, IfxMultican_DataLengthCode dlc) ^ C:\Program Files (x86)\Arduino\hardware\aurduino_Dx\aurix\variants\TC275\MultiCAN.cpp:247:5: note: 'int CAN0_SendMessage(uint32, CANMessagePayloadType*, IfxMultican_DataLengthCode)' previously defined here int CAN0_SendMessage(uint32 CAN_Id, CANMessagePayloadType *msg1, IfxMultican_DataLengthCode dlc) ^ exit status 1 Error compiling for board ShieldBuddyTC275_Dx.
************************************************************************************************************************************* *************************************************************************************************************************************
Could you help with these errors?
Regards.
|
|
sinai1
Junior Member

Posts: 65
|
Post by sinai1 on Oct 3, 2022 17:13:34 GMT
|
|