sinai1
Junior Member
Posts: 81
|
Post by sinai1 on Apr 23, 2019 20:55:14 GMT
Hello Admins, I really need more CAN IfxMultican_MsgObjId, The manual says that we only have 16, but if add more on "MultiCAN.h" this will works?. example:
enum { MsgObject0, MsgObject1, MsgObject2, MsgObject3, MsgObject4, MsgObject5, MsgObject6, MsgObject7,
MsgObject8, MsgObject9, MsgObject10, MsgObject11, MsgObject12, MsgObject13, MsgObject14, MsgObject15, MsgObject16, MsgObject17, MsgObject18, MsgObject19, MsgObject20, MsgObject21, MsgObject22, MsgObject23, MsgObject24, MsgObject25, MsgObject26, MsgObject27, MsgObject28, MsgObject29, MsgObject30, MsgObject31, NO_OFAVAILABLECANMESSAGESLOTS } ;
/** CAN information */
typedef struct
{
struct
{
IfxMultican_Can can; /**< \brief CAN driver handle */
IfxMultican_Can_Node canNode0; /**< \brief CAN Node 0 */
IfxMultican_Can_Node canNode1; /**< \brief CAN Node 1 */
IfxMultican_Can_Node canNode3; /**< \brief CAN Node 3 */
IfxMultican_Can_MsgObj UserCanMessages[31]; /**< \brief CAN Destination Message object */
uint32 UserCanTxIds[NO_OFAVAILABLECANMESSAGESLOTS];
uint32 UserCanRxIds[NO_OFAVAILABLECANMESSAGESLOTS];
}drivers;
} App_MulticanBasic;
|
|
|
Post by Admin on Apr 24, 2019 7:38:27 GMT
Yes this might ork if you had the ShieldBuddy CAN driver MultiCAN.cpp and MultiCAN.h (attached). Copy the .c file to C:\Program Files (x86)\Arduino\hardware\aurduino\aurix\system\libaurix\source and the .h file to C:\Program Files (x86)\Arduino\hardware\aurduino\aurix\system\libaurix\include MultiCAN.cpp (17.52 KB) MultiCAN.h (2.66 KB)
|
|
sinai1
Junior Member
Posts: 81
|
Post by sinai1 on Apr 24, 2019 17:14:26 GMT
Dont works. I replace the files it still works ok on IDs 0-15 but not on any over that. this dont works: //Kostia TR&RX MSGs CAN0_TxInit(Id_TX_Kostia, 0x7FFFFFFFUL, 8, 11, 16);//ID 0x608 CAN0_RxInit(Id_RX_Kostia, 0x7FFFFFFFUL, 8, 11, 17);//ID 0x609 Here are the files im using: Terrain_CANTC275.zip (6.68 KB)
|
|
sinai1
Junior Member
Posts: 81
|
Post by sinai1 on Apr 24, 2019 17:31:05 GMT
I add added a error to the .c "Serial.prinln("someting");" without "t" to confirm if the compiler is running with the correct .c file, but any error came out, i suspect that the compiler is not identifying the file. Maybe i need to edith another .h to redirect to that .c?
|
|
sinai1
Junior Member
Posts: 81
|
Post by sinai1 on Apr 25, 2019 15:51:43 GMT
I edith the .h to add the not only the declaration of the function but also the funtions itself to track where is previously declared, the file and the compiler track the error to:
Linking everything together... C:/HighTec/toolchains/tricore/v4.9.1.0-infineon-2.0/bin/tricore-g++ -mcpu=tc27xx -nocrt0 "-TC:\\Program Files (x86)\\Arduino\\hardware\\aurduino_Dx\\aurix\\variants\\TC275/linker_scripts/gcc/iROM.ld" "-Wl,-Map,C:\\Users\\medina07\\AppData\\Local\\Temp\\arduino_build_305646/Terrain_CANTC275.ino.map" -o "C:\\Users\\medina07\\AppData\\Local\\Temp\\arduino_build_305646/Terrain_CANTC275.ino.elf" "-LC:\\Users\\medina07\\AppData\\Local\\Temp\\arduino_build_305646" -Wl,--cref -Wl,--gc-sections -Wl,--start-group "C:\\Users\\medina07\\AppData\\Local\\Temp\\arduino_build_305646\\sketch\\Terrain_CANTC275.ino.cpp.o" "C:\\Users\\medina07\\AppData\\Local\\Temp\\arduino_build_305646\\core\\cint_tc2x.c.o" "C:\\Users\\medina07\\AppData\\Local\\Temp\\arduino_build_305646\\core\\cinttab.c.o" "C:\\Users\\medina07\\AppData\\Local\\Temp\\arduino_build_305646\\core\\crt0-tc2x.c.o" "C:\\Users\\medina07\\AppData\\Local\\Temp\\arduino_build_305646\\core\\net.cpp.o" "C:\\Program Files (x86)\\Arduino\\hardware\\aurduino_Dx\\aurix\\variants\\TC275/libiLLD_Lib_Make.a" "C:\\Program Files (x86)\\Arduino\\hardware\\aurduino_Dx\\aurix\\variants\\TC275/libAurduino.a" "C:\\Program Files (x86)\\Arduino\\hardware\\aurduino_Dx\\aurix\\variants\\TC275/libTrilib.a" "C:\\Users\\medina07\\AppData\\Local\\Temp\\arduino_build_305646/core\\core.a" -Wl,--end-group -Wl,--cref -Wl,--mem-holes -fshort-double C:\Users\medina07\AppData\Local\Temp\arduino_build_305646\core\cint_tc2x.c.o: In function `CAN0_Init':
C:\Users\medina07\AppData\Local\Temp\arduino_build_305646\sketch\Terrain_CANTC275.ino.cpp.o:C:\Program Files (x86)\Arduino\hardware\aurduino_Dx/aurix/system/libaurix/include/Multican.h:77: first defined here
C:\Users\medina07\AppData\Local\Temp\arduino_build_305646\core\cint_tc2x.c.o: In function `CAN0_Init':
It seems that the functions are already compiled on the files of the hightec tricore. Can please help me to solve this?
|
|
|
Post by Admin on Apr 25, 2019 16:45:16 GMT
We tried adding the Multican.cpp and .h files as instructed and it compiled OK. You are using the Dx version of the ShieldBuddy so please copy the .c file to C:\Program Files (x86)\Arduino\hardware\aurduino_Dx\aurix\system\libaurix\source and the .h file to C:\Program Files (x86)\Arduino\hardware\aurduino_Dx\aurix\system\libaurix\include
|
|
sinai1
Junior Member
Posts: 81
|
Post by sinai1 on Apr 25, 2019 22:43:36 GMT
Yeah this compiles but it dont use the .C on Source, if you try to use ID 16 or over CAN dont works.
|
|
|
Post by Admin on Apr 26, 2019 7:36:48 GMT
Please try moving MultiCAN.cpp to:
C:\Program Files (x86)\Arduino\hardware\aurduino\aurix\variants\tc275
and
C:\Program Files (x86)\Arduino\hardware\aurduino_DX\aurix\variants\tc275
This seems to fix it.
Please let us know if it works!
|
|
sinai1
Junior Member
Posts: 81
|
Post by sinai1 on Apr 29, 2019 20:52:24 GMT
Hello Work wonders but I made some changes to improve the library for my needs, in case anyone need it, here is attached: MultiCAN.zip (3.5 KB) Improvements: -Change from 16 MsgObj_Id to 64 MsgObj_Id -Reduced the waiting time for CAN_Receive functions -Added waiting time for CAN_SendMessage functions Without this, the program stops when nothing is connected. -Change CAN0_SendMessage data from 2 uint32 to 1 CANMessagePayloadType Message, this helps to use the same variables for TX and RX - old function:
void CAN0_SendMessage_dword (uint32 CAN_Id, uint32 Lowdata, uint32 Highdata, uint8 dlc)
- new function:
int CAN0_SendMessage (uint32 CAN_Id, CANMessagePayloadType * msg1, uint8 dlc)
I hope this is useful for someone.
|
|
|
Post by Admin on Apr 30, 2019 7:18:36 GMT
Thanks. We will incorporate this in the next ShieldBuddy add-in release.
|
|