Closed Navjot0005 closed 11 months ago
Proprietary A.txt
into your main.c
file. Just parts of it.rules
how to read the data.simulation
mode.Open_SAE_J1939_Listen_For_Messages
should be inside your while loop in main.c
@DanielMartensson These are addresses for the charger??
/ Set Proprietary A for ECU 1 / j1939_1.this_proprietary.proprietary_A.data[0] = 0x48; / H / j1939_1.this_proprietary.proprietary_A.data[1] = 0x65; / e / j1939_1.this_proprietary.proprietary_A.data[2] = 0x6C; / l / j1939_1.this_proprietary.proprietary_A.data[3] = 0x6C; / l / j1939_1.this_proprietary.proprietary_A.data[4] = 0x6F; / o / j1939_1.this_proprietary.proprietary_A.data[5] = 0x20; / / j1939_1.this_proprietary.proprietary_A.data[6] = 0x54; / T / j1939_1.this_proprietary.proprietary_A.data[7] = 0x6F; / o / j1939_1.this_proprietary.proprietary_A.data[8] = 0x20; / / j1939_1.this_proprietary.proprietary_A.data[9] = 0x79; / Y / j1939_1.this_proprietary.proprietary_A.data[10] = 0x6F; / o / j1939_1.this_proprietary.proprietary_A.data[11] = 0x75; / u / j1939_1.this_proprietary.proprietary_A.data[12] = 0x21; / ! / j1939_1.this_proprietary.proprietary_A.data[13] = 0x0; / NULL / j1939_1.this_proprietary.proprietary_A.data[14] = 0x0; / NULL /
These are the data that you want to transfer between ECUs
@DanielMartensson Ok... Where shall I receive the incoming messages in the library from ECU's???
@DanielMartensson every incoming messages received in the "Open_SAE_J1939_Listen_For_Messages(&j1939);"???
@DanielMartensson if it is received in the "Open_SAE_J1939_Listen_For_Messages(&j1939);" have you enabled receive interrupt??
Yes
@DanielMartensson if it is received in the "Open_SAE_J1939_Listen_For_Messages(&j1939);" have you enabled receive interrupt??
@DanielMartensson ????
@DanielMartensson if it is received in the "Open_SAE_J1939_Listen_For_Messages(&j1939);" have you enabled receive interrupt??
@DanielMartensson ????
Yes. It should look like this: https://github.com/DanielMartensson/GoobySoft/blob/4de6ff0660ae916d5b5931a9b317357a278cc63b/GoobySoft/GoobySoft.cpp#L163
@DanielMartensson So that means I have to initialise the all basic parameters. Baudrate... Interuppts Sys_Clock(Internal/External)
@DanielMartensson So that means I have to initialise the all basic parameters. Baudrate... Interuppts Sys_Clock(Internal/External)
Yes.
Hi @DanielMartensson... I was studying "Proprietary A.txt" file you last provided me.. I have below some questions please support for that
Shall I copy "Proprietary A.txt" file into my "main.c"?
Do I need to initialise the CAN peripheral in MXCUBE or your library will do by itself?
Do I need to initialise sys_clk or your library will do by itself??
Do I need to make any change in "Request_Proprietary.c" ??
In "Proprietary A.txt" file why do you create two struct as shown below? / Create our J1939 structure with two ECU / J1939 j1939_1 = { 0 }; J1939 j1939_2 = { 0 };
From where do you get these ECU address shown below?? / Set the ECU address / j1939_1.information_this_ECU.this_ECU_address = 0x80; / From 0 to 253 because 254 = error address and 255 = broadcast address / j1939_2.information_this_ECU.this_ECU_address = 0x90;
/ Set Proprietary A for ECU 1 / j1939_1.this_proprietary.proprietary_A.data[0] = 0x48; / H / j1939_1.this_proprietary.proprietary_A.data[1] = 0x65; / e / j1939_1.this_proprietary.proprietary_A.data[2] = 0x6C; / l / j1939_1.this_proprietary.proprietary_A.data[3] = 0x6C; / l / j1939_1.this_proprietary.proprietary_A.data[4] = 0x6F; / o / j1939_1.this_proprietary.proprietary_A.data[5] = 0x20; / / j1939_1.this_proprietary.proprietary_A.data[6] = 0x54; / T / j1939_1.this_proprietary.proprietary_A.data[7] = 0x6F; / o / j1939_1.this_proprietary.proprietary_A.data[8] = 0x20; / / j1939_1.this_proprietary.proprietary_A.data[9] = 0x79; / Y / j1939_1.this_proprietary.proprietary_A.data[10] = 0x6F; / o / j1939_1.this_proprietary.proprietary_A.data[11] = 0x75; / u / j1939_1.this_proprietary.proprietary_A.data[12] = 0x21; / ! / j1939_1.this_proprietary.proprietary_A.data[13] = 0x0; / NULL / j1939_1.this_proprietary.proprietary_A.data[14] = 0x0; / NULL /
Also please explain this too / Also set its length / j1939_1.this_proprietary.proprietary_A.total_bytes = MAX_PROPRIETARY; //What does it mean?? j1939_2.from_other_ecu_proprietary.proprietary_A.total_bytes = MAX_PROPRIETARY;//What does it mean??
/ ECU 2 sending a request to ECU 1 about Proprietary A - which contains manufacturer specific data / SAE_J1939_Send_Request(&j1939_2, 0x80, PGN_PROPRIETARY_A); //What does 0x80 means??
/ Listen for messages - The reason why it looks like this is because ECU 1 and ECU 2 shares the same CAN-bus buffer - In CAN bus application, you don't need this mess / Open_SAE_J1939_Listen_For_Messages(&j1939_1); / ECU 1 is reading the request from ECU 2 / Open_SAE_J1939_Listen_For_Messages(&j1939_2); / ECU 2 read the response from ECU 1 and send back TP_CM with CTS / Open_SAE_J1939_Listen_For_Messages(&j1939_1); / ECU 1 read the TP_CM with CTS and send a RTS back with data / Open_SAE_J1939_Listen_For_Messages(&j1939_2); / ECU 2 read the TP_DT data / Open_SAE_J1939_Listen_For_Messages(&j1939_2); / ECU 2 read the TP_DT data / Open_SAE_J1939_Listen_For_Messages(&j1939_1); / ECU 1 read the ACK from ECU 2 when ECU 2 has read the complete TP_DT message /
Please support to answer above....Thanks for the support..