FlexRay simple test of the connection =========================================== This test starts a new FlaxRay network communication. Node A sends 100 messages, one message each 10th communication cycle, and node B is suppose to receive all of the messages correctly. Node A: fraytestA Node B: fraytestB FlexRay motor remote controlling =========================================== Connection: control panel is connected to the node A. black - AIN1 (Low) green - AIN1 (High) white - GND red - 12V yellow - DIN0 blue - DIN1 DC motor is connected to the node B to the HBR outputs. Node A: demomotctrl Node B: demomotdrive Node C simulink demo fray_motor_demo FlexRay commands example =========================================== Node init: ------------ #Node A configuration frbtconfigcluster 0x2 0xF 0x15E0 0xF 0xF 0xC 0x15A 0x8 0xAE4 0x9 0xF 0x4 0x43 0x1 0x4 0x2 0xAE3 0x0 0x56 0xA 0x12 0x12 0x4C 0xB4 0x3C frbtconfignode 0x0 0xF 0x2 0x1 0x3 0x3 0x0 0x0 0x1 0x1 0x10D 0x6 0x6 0x18 0x18 0x36B00 0xCD 0x151 0x0 0x1 0x0 0x2 0x81 0x36DA2 0x151 0x33 0x0 0x0 ## Stat buffer TX - continuous mode frbtcfgbufS0 slot1 AB cyc0 tx max9 continuous ppi0 int1 ## Receiving stat buffer from B frbtcfgbufS1 slot2 AB cyc0 rx max9 continuous ppi0 int1 ## Buffer sending message to FIFO in node B - single shot mode frbtcfgbufS2 slot3 B cyc0 tx max9 single ppi0 int1 ## NM vector sending and receiving frbtcfgbufS3 slot5 AB cyc0 rx max9 continuous ppi1 int1 frbtcfgbufS4 slot4 AB cyc0 tx max9 continuous ppi1 int1 ## Dynamic buffers for TX and RX, single shot mode frbtcfgbufD0 slot9 A cyc0 tx max9 single ppi0 int0 frbtcfgbufD1 slot10 A cyc0 rx max9 single ppi0 int0 ## RX FIFO buffer to accept messages from all aother slots frbtcfgfifo rejslot0 slotmask0 depth5 AB cyc0 max0x20 rejnull accstat # FlexRay start frbtinitU frbtstart frbtallslots #Node B configuration frbtconfigcluster 0x2 0xF 0x15E0 0xF 0xF 0xC 0x15A 0x8 0xAE4 0x9 0xF 0x4 0x43 0x1 0x4 0x2 0xAE3 0x0 0x56 0xA 0x12 0x12 0x4C 0xB4 0x3C frbtconfignode 0x0 0xF 0x2 0x1 0x3 0x3 0x0 0x0 0x1 0x1 0x10D 0x6 0x6 0x18 0x18 0x36B00 0xCD 0x151 0x0 0x1 0x0 0x2 0x81 0x36DA2 0x151 0x33 0x0 0x0 ## Stat buffer TX - continuous mode frbtcfgbufS0 slot2 AB cyc0 tx max9 continuous ppi0 int1 ## Receiving stat buffer from A frbtcfgbufS1 slot1 AB cyc0 rx max9 continuous ppi0 int1 ## Buffer sending to FIFO in node A frbtcfgbufS2 slot6 A cyc0 tx max9 single ppi0 int1 ## NM vector sending and receiving frbtcfgbufS3 slot4 AB cyc0 rx max9 continuous ppi1 int1 frbtcfgbufS4 slot5 AB cyc0 tx max9 continuous ppi1 int1 ## Dynamic buffers for TX and RX, single shot mode frbtcfgbufD0 slot9 A cyc0 rx max9 single ppi0 int0 frbtcfgbufD1 slot10 A cyc0 tx max9 single ppi0 int0 ## RX FIFO buffer to accept messages from all buffers except 0x#9, 0x#B, 0x#D, 0x#F frbtcfgfifo rejslot9 slotmask6 depth5 B cyc0 max0x20 rejnull accstat # FlexRay start frbtinitU frbtstart frbtallslots #Node C configuration (receive network management) frbtconfigcluster 0x2 0xF 0x15E0 0xF 0xF 0xC 0x15A 0x8 0xAE4 0x9 0xF 0x4 0x43 0x1 0x4 0x2 0xAE3 0x0 0x56 0xA 0x12 0x12 0x4C 0xB4 0x3C frbtconfignode 0x0 0xF 0x2 0x1 0x3 0x3 0x0 0x0 0x1 0x1 0x10D 0x6 0x6 0x18 0x18 0x36B00 0xCD 0x151 0x0 0x1 0x0 0x2 0x81 0x36DA2 0x151 0x33 0x0 0x0 ## Stat buffer TX - continuous mode ## NM vector sending and receiving frbtcfgbufS0 slot7 AB cyc0 tx max9 continuous ppi0 int1 frbtcfgbufS1 slot4 AB cyc0 rx max9 continuous ppi1 int1 frbtcfgbufS2 slot5 AB cyc0 rx max9 continuous ppi1 int1 # FlexRay start frbtinitU frbtstart frbtallslots # NM Vector demo frbtnmwatch Test static segment: -------------------- Starts sending a message from A in every cycle in Slot 1. The message is received by node B. After the message is sent from A, When the frbtreceive1 command on the node B is called every communication cycle after slot 1 has passed, the newly received message should be retrieved. Node A: frbttransmit1 AA Node B: frbtreceive1 Test dynamic segment: -------------------- Sends a message from node A in slot 9, which is in dynamic segment of the communication cycle. The buffer for this slot is configured as single-shot mode, so the message is sent only once. The message is received by node B. When the command frbtreceive9 is called after the message was sent from the A node, the newly received message should be retrieved. Every later calling should return with a 'No message received'. Node A: frbttransmit9 99 99 99 99 99 NodeB: frbtreceive9 Test FIFO: -------------------- Sends 6 messages from node A in the slot 3, which is in static segment of the communication cycle. Node B is configured to receive messages from slot 3 in a FIFO RX buffer. The FIFO has storage space for 5 messages, which means that the first message will be thrown away. Calling the frbtreceive0 command 5 times after all messages were sent from node A should retrieve the last 5 received messages. First 4 calling should return with 'More messages are still in FIFO', the last calling should return with 'Received message'. Every later calling should return with the 'No message received'. Node A: frbttransmit3 12 12 12 12 12 frbttransmit3 34 34 34 34 34 frbttransmit3 56 56 56 56 56 frbttransmit3 78 78 78 78 78 frbttransmit3 90 90 90 90 90 frbttransmit3 AB AB AB AB AB Node B: frbtreceive3 Test Network management vector: -------------------- Starts sending a network management vector. The vector has to be manualy sent by the command frbttransmit4 from the node A. It is then received and processed automaticaly by the node B. Processed network management vector can be obtained by calling the command frbtnmvector on the node B. Node A: frbttransmit4 FF 00 00 00 00 00 00 00 00 00 00 00 Node B: frbttransmit5 00 FF 00 00 00 00 00 00 00 00 00 00 Node C: frbtnmvector Canceling continuous TX: -------------------- When message was sent on the slot 4 ba calling the command frbttransmit4 on the node A and buffer assigned to the slot 4 is configured as continuous mode, it can be canceled by calling the command frbtcanceltx4 on the node A. If the frbtreceive4 command is called on the node B after message was sent for the first time from the node A, it shoud retrieved the newly received message. If the frbtreceive4 command is called after frbtcanceltx4, the last received message should be retrieved and for later calling it should return with 'No message received'. Node A: frbttransmit4 12 34 56 78 90 AB CD EF EE EE EE EE frbtcanceltx4 Node B: frbtreceive4 Buffer reconfiguration example: -------------------- Reconfigures message buffer on the node A to transmit in slot 11 channel B instead of slot 9 channel A Reconfigures message buffer on the node B to receive from slot 11 channel B instead of slot 9 channel A. Node A: frbtreconfigurebuf id9 slot11 B cycset1 cycoffset0 max9 Node B: frbtreconfigurebuf id9 slot11 B cycset1 cycoffset0 max9 Three nodes test =========================================== Node A is sending a message in single-shot mode in slot 4. This message is received by nodes B and C into the static segment RX buffer. Node B is sending a message in single-shot mode in slot 5. This message is received by node A into the static segment RX buffer. Node C is sending a message in single shot mode in slot 6. This message is received by node B into the FIFO RX buffer. #Node A configuration frbtconfigcluster 0x2 0xF 0x15E0 0xF 0xF 0xC 0x15A 0x8 0xAE4 0x9 0xF 0x4 0x43 0x1 0x4 0x2 0xAE3 0x0 0x56 0xA 0x12 0x12 0x4C 0xB4 0x3C frbtconfignode 0x0 0xF 0x2 0x1 0x3 0x3 0x0 0x0 0x1 0x1 0x10D 0x6 0x6 0x18 0x18 0x36B00 0xCD 0x151 0x0 0x1 0x0 0x2 0x81 0x36DA2 0x151 0x33 0x0 0x0 ## Stat buffer TX frbtcfgbufS0 slot1 AB cyc0 tx max9 continuous ppi0 int1 frbtcfgbufS1 slot4 AB cyc0 tx max9 single ppi0 int1 ## Stat buffer RX frbtcfgbufS2 slot5 AB cyc0 rx max9 single ppi0 int1 # FlexRay start frbtinitU frbtstart frbtallslots #Node B configuration frbtconfigcluster 0x2 0xF 0x15E0 0xF 0xF 0xC 0x15A 0x8 0xAE4 0x9 0xF 0x4 0x43 0x1 0x4 0x2 0xAE3 0x0 0x56 0xA 0x12 0x12 0x4C 0xB4 0x3C frbtconfignode 0x0 0xF 0x2 0x1 0x3 0x3 0x0 0x0 0x1 0x1 0x10D 0x6 0x6 0x18 0x18 0x36B00 0xCD 0x151 0x0 0x1 0x0 0x2 0x81 0x36DA2 0x151 0x33 0x0 0x0 ## Stat buffer TX frbtcfgbufS0 slot2 AB cyc0 tx max9 continuous ppi0 int1 frbtcfgbufS1 slot5 AB cyc0 tx max9 single ppi0 int1 ## Stat buffer RX frbtcfgbufS2 slot4 AB cyc0 rx max9 single ppi0 int1 ## RX FIFO buffer # dpt ch cyc pl rnf rsf fid frbtcfgfifo rejslot0 slotmask0 depth5 AB cyc0 max0x20 rejnull accstat # FlexRay start frbtinitU frbtstart frbtallslots #Node C configuration frbtconfigcluster 0x2 0xF 0x15E0 0xF 0xF 0xC 0x15A 0x8 0xAE4 0x9 0xF 0x4 0x43 0x1 0x4 0x2 0xAE3 0x0 0x56 0xA 0x12 0x12 0x4C 0xB4 0x3C frbtconfignode 0x0 0xF 0x2 0x1 0x3 0x3 0x0 0x0 0x1 0x1 0x10D 0x6 0x6 0x18 0x18 0x36B00 0xCD 0x151 0x0 0x1 0x0 0x2 0x81 0x36DA2 0x151 0x33 0x0 0x0 ## Stat buffer TX frbtcfgbufS0 slot3 AB cyc0 tx max9 continuous ppi0 int1 frbtcfgbufS1 slot6 A cyc0 tx max9 single ppi0 int1 ## Stat buffer RX frbtcfgbufS2 slot4 AB cyc0 rx max9 single ppi0 int1 # FlexRay start frbtinitU frbtstart frbtallslots Test of the broadcast -------------------- Sends a message from node A in slot 4. The message should be received by node A and B, once on each of the nodes. Node A: frbttransmit4 AA BB CC Node B: frbtreceive4 Node C: frbtreceive4 Test of the A-B exclusive communication -------------------- Sends a message from the node B in slot 5. The message should be received only by node A. Node B: frbttransmit5 BB AA Node A: frbtreceive5 Node C: frbtreceive5 Test of the B-C exclusive communication and the FIFO RX buffer -------------------- Sends a messages from the node C in slot 6. 5 latest messages should be received only by node B. Node C: frbttransmit6 CC BB 01 frbttransmit6 CC BB 02 frbttransmit6 CC BB 03 frbttransmit6 CC BB 04 frbttransmit6 CC BB 05 frbttransmit6 CC BB 06 Node A: frbtreceive0 Node B: frbtreceive0 frbtreceive0 frbtreceive0 frbtreceive0 frbtreceive0 frbtreceive0