*/
static Fr_TMS570LS_NodeConfigType Fr_node_A_config = {
.pAllowHaltDueToClock = 0,
- .pAllowPassiveToActive = FALSE,
+ .pAllowPassiveToActive = 0xF,
.pChannels = FR_CHANNEL_AB,
.pClusterDriftDamping = 0x1,
.pDelayCompensationA = 0x3,
*/
static Fr_TMS570LS_NodeConfigType Fr_node_B_config = {
.pAllowHaltDueToClock = 0,
- .pAllowPassiveToActive = FALSE,
+ .pAllowPassiveToActive = 0xF,
.pChannels = FR_CHANNEL_AB,
.pClusterDriftDamping = 0x1,
.pDelayCompensationA = 0x3,
Fr_TMS570LS_BufferConfigType* fifo_buffer_ptr = &user_fifo_buffer_config[0];
int ret, i;
char channel[3], rej_static_frames[8], rej_null_frames[8];
- unsigned depth, slot, cycleset, maxpayload, intr;
+ unsigned depth, slot, cycleset, maxpayload;
Fr_TMS570LS_BufferConfigType tmp_buffer;
- ret = sscanf(param[2], "slot%i depth%i %2s cyc%i max%i %10s %10s int%i",
+ ret = sscanf(param[2], "slot%i depth%i %2s cyc%i max%i %10s %10s",
&slot,
&depth,
channel,
&cycleset,
&maxpayload,
rej_null_frames,
- rej_static_frames,
- &intr
+ rej_static_frames
);
- if (ret != 8) {
+ if (ret != 7) {
printf("Error parsing parameter %d\n", ret+1);
return -CMDERR_BADPAR;
}
tmp_buffer.rejectStaticSegment = false;
else return badpar("Invalid reject/accept static frame parameter");
- if (intr > 1)
- return badpar("Interrupt parameter must be 0 or 1");
- tmp_buffer.msgBufferInterrupt = intr;
-
for (i = 0; i < user_fifo_buffer_depth; i++) {
fifo_buffer_ptr[i].slotId = tmp_buffer.slotId;
fifo_buffer_ptr[i].maxPayload = tmp_buffer.maxPayload;
fifo_buffer_ptr[i].payloadPreambleIndicatorTr = FALSE;
fifo_buffer_ptr[i].rejectNullFrames = tmp_buffer.rejectNullFrames;
fifo_buffer_ptr[i].rejectStaticSegment = tmp_buffer.rejectStaticSegment;
- fifo_buffer_ptr[i].msgBufferInterrupt = tmp_buffer.msgBufferInterrupt;
+ fifo_buffer_ptr[i].msgBufferInterrupt = 0;
}
- printf("frbtcfgfifo slot%i depth%i %2s cyc%i max%i %10s %10s int%i\n",
+ printf("frbtcfgfifo slot%i depth%i %2s cyc%i max%i %10s %10s\n",
slot,
depth,
channel,
cycleset,
maxpayload,
rej_null_frames,
- rej_static_frames,
- intr
+ rej_static_frames
);
return SUCCESS;
rpp_sci_printf("FlexRay driver initialized.\r\n");
}
else {
- rpp_sci_printf("FlexRay needs to be configured before initialization.\r\n");
- return -CMDERR_BADCFG;
+ retVal = rpp_fr_init_controller(0, &error);
+ if (retVal == SUCCESS) {
+ rpp_sci_printf("FlexRay controller reinitialized.\r\n");
+ return 0;
+ }
+ else {
+ rpp_sci_printf("FlexRay needs to be configured before initialization.\r\n");
+ return -CMDERR_BADCFG;
+ }
}
retVal = rpp_fr_init_controller(0, &error);
"=== Description ===\n"
"\n"
"The command stands for Fr_StartCommunication function from the Autosar\n"
- "specification. If the node was halted by previously called frbthalt\n"
- "or frbtabort command, the POC is switched automaticaly from HALT state\n"
- "to READY state to allow restart of the communication.\n"
+ "specification.\n"
"If the FlexRay node is configured as a coldstarter node\n"
"(as for example by frbtinitA/B command), then the command first listen\n"
"on the bus. When it does not detect any existing bus communication, it\n"
"specification. The command invokes the FlexRay POC command HALT, which\n"
"means that communication is stopped after the end of the actual\n"
"communication cycle. On the opposite side, there is a frbtfreeze\n"
- "command, which stops the communication immediately. To start the\n"
- "communication again, the frbtstart command has to be called.\n"
+ "command, which stops the communication immediately. To restart the\n"
+ "communication, the frbtinit and frbtstart commands have to be called.\n"
"\n"
"=== Example ===\n"
"\n"
"which means that the communication is stopped immediately. On the\n"
"opposite side there is a frbthalt command, which stops the\n"
"communication after the end of the actual communication cycle. To\n"
- "start the communication again, the frbtstart command has to be called.\n"
+ "restart the communication, the frbtinit and frbtstart commands have\n"
+ "to be called.\n"
"\n"
"=== Example ===\n"
"\n"
------------
#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 0x0 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
+ 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
frbtcfgbufD0 slot9 A cyc0 tx max0x40 single ppi0 int0
frbtcfgbufD1 slot10 A cyc0 rx max0x40 single ppi0 int0
## RX FIFO buffer
- frbtcfgfifo slot0 depth5 A cyc0 max0x20 rejnull accstat int0
+ frbtcfgfifo slot0 depth5 A cyc0 max0x20 rejnull accstat
# FlexRay start
frbtinitU
frbtstart
#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 0x0 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
+ 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
frbtcfgbufD0 slot9 A cyc0 rx max0x40 single ppi0 int0
frbtcfgbufD1 slot10 A cyc0 tx max0x40 single ppi0 int0
## RX FIFO buffer
- frbtcfgfifo slot0 depth5 A cyc0 max0x20 rejnull accstat int1
+ frbtcfgfifo slot0 depth5 AB cyc0 max0x20 rejnull accstat
# FlexRay start
frbtinitU
frbtstart
#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 0x0 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
+ 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
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 0x0 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
+ 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
#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 0x0 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
+ 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
#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 0x0 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
+ 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