2 * Copyright (C) 2012-2013 Czech Technical University in Prague
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 * File : cmd_fr_basic_test.c
25 * The file contains a set of commands to control the FlexRay driver.
26 * Those commands can be used to configure RPP board as a FlexRay node,
27 * configure a set of TX and RX buffers, get status of the buffers and
28 * the FlexRay controller, manipulate with timers and control the transmission
33 #include "cmd_fr_basic_test.h"
38 #include "cmdproc_utils.h"
44 #define printf rpp_sci_printf
46 static inline int badpar(const char *msg)
49 return -CMDERR_BADPAR;
54 * This structure contains global FlexRay configuration.
55 * All nodes in the network have to use the same values for
56 * all parameters of this structure.
58 static Fr_TMS570LS_ClusterConfigType Fr_cluster_config = {
59 .gColdStartAttempts = 0x2,
61 .gMacroPerCycle = 0x15E0, // (cycle period, 5.6us)
62 .gMaxWithoutClockCorrectionFatal = 0xF,
63 .gMaxWithoutClockCorrectionPassive = 0xF,
64 .gNetworkManagementVectorLength = 12,
65 .gNumberOfMinislots = 0x15A,
66 .gNumberOfStaticSlots = 0x8,
67 .gOffsetCorrectionStart = 0xAE4,
68 .gPayloadLengthStatic = 0x9,
70 .gdActionPointOffset = 0x4,
71 .gdCASRxLowMax = 0x43,
72 .gdDynamicSlotIdlePhase = 0x1,
74 .gdMinislotActionPointOffset = 0x2,
76 .gdSampleClockPeriod = 0, // 10mbit/sec
78 .gdTSSTransmitter = 0xA,
79 .gdWakeupSymbolRxIdle = 18,
80 .gdWakeupSymbolRxLow = 18,
81 .gdWakeupSymbolRxWindow = 76,
82 .gdWakeupSymbolTxIdle = 180,
83 .gdWakeupSymbolTxLow = 60
87 * This structure contains local configuration of the FlexRay node A.
88 * All nodes in the network shall have their own local configuraion,
89 * but it does not matters if they share some together, until their
90 * buffer configuration differs.
92 static Fr_TMS570LS_NodeConfigType Fr_node_A_config = {
93 .pAllowHaltDueToClock = 0,
94 .pAllowPassiveToActive = FALSE,
95 .pChannels = FR_CHANNEL_AB,
96 .pClusterDriftDamping = 0x1,
97 .pDelayCompensationA = 0x3,
98 .pDelayCompensationB = 0x3,
99 .pExternOffsetCorrection = 0,
100 .pExternRateCorrection = 0,
101 .pKeySlotUsedForStartup = TRUE,
102 .pKeySlotUsedForSync = TRUE,
104 .pMacroInitialOffsetA = 0x6,
105 .pMacroInitialOffsetB = 0x6,
106 .pMicroInitialOffsetA = 0x18,
107 .pMicroInitialOffsetB = 0x18,
108 .pMicroPerCycle = 0x36B00,
109 .pRateCorrectionOut = 0xCD,
110 .pOffsetCorrectionOut = 0x151,
111 .pSamplesPerMicrotick = 0, // 10 mbit/sec
112 .pSingleSlotEnabled = TRUE,
113 .pWakeupChannel = FR_CHANNEL_A,
115 .pdAcceptedStartupRange = 0x81,
116 .pdListenTimeout = 0x36DA2,
118 .pDecodingCorrection = 0x33
122 * This structure contains local configuration of the FlexRay node B.
123 * All nodes in the network shall have their own local configuraion,
124 * but it does not matters if they share some together, until their
125 * buffer configuration differs.
127 static Fr_TMS570LS_NodeConfigType Fr_node_B_config = {
128 .pAllowHaltDueToClock = 0,
129 .pAllowPassiveToActive = FALSE,
130 .pChannels = FR_CHANNEL_AB,
131 .pClusterDriftDamping = 0x1,
132 .pDelayCompensationA = 0x3,
133 .pDelayCompensationB = 0x3,
134 .pExternOffsetCorrection = 0,
135 .pExternRateCorrection = 0,
136 .pKeySlotUsedForStartup = TRUE,
137 .pKeySlotUsedForSync = TRUE,
139 .pMacroInitialOffsetA = 0x6,
140 .pMacroInitialOffsetB = 0x6,
141 .pMicroInitialOffsetA = 0x18,
142 .pMicroInitialOffsetB = 0x18,
143 .pMicroPerCycle = 0x36B00,
144 .pRateCorrectionOut = 0xCD,
145 .pOffsetCorrectionOut = 0x151,
146 .pSamplesPerMicrotick = 0, // 10 mbit/sec
147 .pSingleSlotEnabled = TRUE,
148 .pWakeupChannel = FR_CHANNEL_A,
150 .pdAcceptedStartupRange = 0x81,
151 .pdListenTimeout = 0x36DA2,
153 .pDecodingCorrection = 0x33
156 static Fr_TMS570LS_MsgRAMConfig Fr_node_A_msgRAM_config = {
157 .dynSegmentBufferCount = 3,
158 .fifoBufferCount = 5,
159 .secureBuffers = FR_SB_RECONFIG_ENABLED,
160 .statSegmentBufferCount = 5,
161 .syncFramePayloadMultiplexEnabled = 0
164 static Fr_TMS570LS_MsgRAMConfig Fr_node_B_msgRAM_config = {
165 .dynSegmentBufferCount = 3,
166 .fifoBufferCount = 5,
167 .secureBuffers = FR_SB_RECONFIG_ENABLED,
168 .statSegmentBufferCount = 5,
169 .syncFramePayloadMultiplexEnabled = 0
172 static Fr_TMS570LS_BufferConfigType Fr_node_A_static_buffers_config[] = {
174 .channel = FR_CHANNEL_AB,
175 .cycleCounterFiltering = 0,
178 .msgBufferInterrupt = TRUE,
179 .payloadPreambleIndicatorTr = FALSE,
180 .rejectNullFrames = FALSE,
181 .rejectStaticSegment = FALSE,
182 .singleTransmit = FALSE,
186 .channel = FR_CHANNEL_AB,
187 .cycleCounterFiltering = 0,
190 .msgBufferInterrupt = TRUE,
191 .payloadPreambleIndicatorTr = FALSE,
192 .rejectNullFrames = FALSE,
193 .rejectStaticSegment = FALSE,
194 .singleTransmit = FALSE,
198 .channel = FR_CHANNEL_AB,
199 .cycleCounterFiltering = 0,
202 .msgBufferInterrupt = TRUE,
203 .payloadPreambleIndicatorTr = FALSE,
204 .rejectNullFrames = FALSE,
205 .rejectStaticSegment = FALSE,
206 .singleTransmit = TRUE,
210 .channel = FR_CHANNEL_AB,
211 .cycleCounterFiltering = 0,
214 .msgBufferInterrupt = TRUE,
215 .payloadPreambleIndicatorTr = FALSE,
216 .rejectNullFrames = FALSE,
217 .rejectStaticSegment = FALSE,
218 .singleTransmit = TRUE,
222 .channel = FR_CHANNEL_AB,
223 .cycleCounterFiltering = 0,
226 .msgBufferInterrupt = TRUE,
227 .payloadPreambleIndicatorTr = TRUE,
228 .rejectNullFrames = FALSE,
229 .rejectStaticSegment = FALSE,
230 .singleTransmit = FALSE,
236 static Fr_TMS570LS_BufferConfigType Fr_node_B_static_buffers_config[] = {
238 .channel = FR_CHANNEL_AB,
239 .cycleCounterFiltering = 0,
242 .msgBufferInterrupt = TRUE,
243 .payloadPreambleIndicatorTr = FALSE,
244 .rejectNullFrames = FALSE,
245 .rejectStaticSegment = FALSE,
246 .singleTransmit = FALSE,
250 .channel = FR_CHANNEL_AB,
251 .cycleCounterFiltering = 0,
254 .msgBufferInterrupt = TRUE,
255 .payloadPreambleIndicatorTr = FALSE,
256 .rejectNullFrames = FALSE,
257 .rejectStaticSegment = FALSE,
258 .singleTransmit = FALSE,
262 .channel = FR_CHANNEL_AB,
263 .cycleCounterFiltering = 0,
266 .msgBufferInterrupt = TRUE,
267 .payloadPreambleIndicatorTr = FALSE,
268 .rejectNullFrames = FALSE,
269 .rejectStaticSegment = FALSE,
270 .singleTransmit = TRUE,
274 .channel = FR_CHANNEL_AB,
275 .cycleCounterFiltering = 0,
278 .msgBufferInterrupt = TRUE,
279 .payloadPreambleIndicatorTr = FALSE,
280 .rejectNullFrames = FALSE,
281 .rejectStaticSegment = FALSE,
282 .singleTransmit = TRUE,
286 .channel = FR_CHANNEL_AB,
287 .cycleCounterFiltering = 0,
290 .msgBufferInterrupt = TRUE,
291 .payloadPreambleIndicatorTr = TRUE,
292 .rejectNullFrames = FALSE,
293 .rejectStaticSegment = FALSE,
294 .singleTransmit = FALSE,
299 static Fr_TMS570LS_BufferConfigType Fr_node_A_dynamic_buffers_config[] = {
301 .channel = FR_CHANNEL_A,
302 .cycleCounterFiltering = 0,
305 .msgBufferInterrupt = TRUE,
306 .payloadPreambleIndicatorTr = FALSE,
307 .rejectNullFrames = FALSE,
308 .rejectStaticSegment = FALSE,
309 .singleTransmit = FALSE,
313 .channel = FR_CHANNEL_B,
314 .cycleCounterFiltering = 0,
317 .msgBufferInterrupt = TRUE,
318 .payloadPreambleIndicatorTr = FALSE,
319 .rejectNullFrames = FALSE,
320 .rejectStaticSegment = FALSE,
321 .singleTransmit = FALSE,
325 .channel = FR_CHANNEL_A,
326 .cycleCounterFiltering = 0,
329 .msgBufferInterrupt = TRUE,
330 .payloadPreambleIndicatorTr = FALSE,
331 .rejectNullFrames = FALSE,
332 .rejectStaticSegment = FALSE,
333 .singleTransmit = TRUE,
339 static Fr_TMS570LS_BufferConfigType Fr_node_B_dynamic_buffers_config[] = {
341 .channel = FR_CHANNEL_B,
342 .cycleCounterFiltering = 0,
345 .msgBufferInterrupt = TRUE,
346 .payloadPreambleIndicatorTr = FALSE,
347 .rejectNullFrames = FALSE,
348 .rejectStaticSegment = FALSE,
349 .singleTransmit = TRUE,
353 .channel = FR_CHANNEL_A,
354 .cycleCounterFiltering = 0,
357 .msgBufferInterrupt = TRUE,
358 .payloadPreambleIndicatorTr = FALSE,
359 .rejectNullFrames = FALSE,
360 .rejectStaticSegment = FALSE,
361 .singleTransmit = TRUE,
365 .channel = FR_CHANNEL_A,
366 .cycleCounterFiltering = 0,
369 .msgBufferInterrupt = TRUE,
370 .payloadPreambleIndicatorTr = FALSE,
371 .rejectNullFrames = FALSE,
372 .rejectStaticSegment = FALSE,
373 .singleTransmit = TRUE,
378 static Fr_TMS570LS_BufferConfigType Fr_node_A_fifo_buffers_config[] = {
380 .channel = FR_CHANNEL_AB,
381 .cycleCounterFiltering = 0,
384 .msgBufferInterrupt = FALSE, // Recomended for FIFO buffers
385 .payloadPreambleIndicatorTr = FALSE,
386 .rejectNullFrames = TRUE,
387 .rejectStaticSegment = FALSE,
388 .singleTransmit = FALSE,
392 .channel = FR_CHANNEL_AB,
393 .cycleCounterFiltering = 0,
396 .msgBufferInterrupt = FALSE, // Recomended for FIFO buffers
397 .payloadPreambleIndicatorTr = FALSE,
398 .rejectNullFrames = TRUE,
399 .rejectStaticSegment = FALSE,
400 .singleTransmit = FALSE,
404 .channel = FR_CHANNEL_AB,
405 .cycleCounterFiltering = 0,
408 .msgBufferInterrupt = FALSE, // Recomended for FIFO buffers
409 .payloadPreambleIndicatorTr = FALSE,
410 .rejectNullFrames = TRUE,
411 .rejectStaticSegment = FALSE,
412 .singleTransmit = FALSE,
416 .channel = FR_CHANNEL_AB,
417 .cycleCounterFiltering = 0,
420 .msgBufferInterrupt = FALSE, // Recomended for FIFO buffers
421 .payloadPreambleIndicatorTr = FALSE,
422 .rejectNullFrames = TRUE,
423 .rejectStaticSegment = FALSE,
424 .singleTransmit = FALSE,
428 .channel = FR_CHANNEL_AB,
429 .cycleCounterFiltering = 0,
432 .msgBufferInterrupt = FALSE, // Recomended for FIFO buffers
433 .payloadPreambleIndicatorTr = FALSE,
434 .rejectNullFrames = TRUE,
435 .rejectStaticSegment = FALSE,
436 .singleTransmit = FALSE,
441 static Fr_TMS570LS_BufferConfigType Fr_node_B_fifo_buffers_config[] = {
443 .channel = FR_CHANNEL_AB,
444 .cycleCounterFiltering = 0,
447 .msgBufferInterrupt = FALSE, // Recommended for FIFO buffers
448 .payloadPreambleIndicatorTr = FALSE,
449 .rejectNullFrames = TRUE,
450 .rejectStaticSegment = FALSE,
451 .singleTransmit = FALSE,
452 .slotId = 0 // No Frame is rejected
455 .channel = FR_CHANNEL_AB,
456 .cycleCounterFiltering = 0,
459 .msgBufferInterrupt = FALSE, // Recommended for FIFO buffers
460 .payloadPreambleIndicatorTr = FALSE,
461 .rejectNullFrames = TRUE,
462 .rejectStaticSegment = FALSE,
463 .singleTransmit = FALSE,
464 .slotId = 0 // No Frame is rejected
467 .channel = FR_CHANNEL_AB,
468 .cycleCounterFiltering = 0,
471 .msgBufferInterrupt = FALSE, // Recommended for FIFO buffers
472 .payloadPreambleIndicatorTr = FALSE,
473 .rejectNullFrames = TRUE,
474 .rejectStaticSegment = FALSE,
475 .singleTransmit = FALSE,
476 .slotId = 0 // No Frame is rejected
479 .channel = FR_CHANNEL_AB,
480 .cycleCounterFiltering = 0,
483 .msgBufferInterrupt = FALSE, // Recommended for FIFO buffers
484 .payloadPreambleIndicatorTr = FALSE,
485 .rejectNullFrames = TRUE,
486 .rejectStaticSegment = FALSE,
487 .singleTransmit = FALSE,
488 .slotId = 0 // No Frame is rejected
491 .channel = FR_CHANNEL_AB,
492 .cycleCounterFiltering = 0,
495 .msgBufferInterrupt = FALSE, // Recommended for FIFO buffers
496 .payloadPreambleIndicatorTr = FALSE,
497 .rejectNullFrames = TRUE,
498 .rejectStaticSegment = FALSE,
499 .singleTransmit = FALSE,
500 .slotId = 0 // No Frame is rejected
505 * This is an unifying configuration structure for the node A.
506 * It joins all the configuration structure together.
508 static Fr_ConfigType Fr_config_node_A= {
509 .clusterConfiguration = &Fr_cluster_config,
510 .dynamicBufferConfigs = Fr_node_A_dynamic_buffers_config,
511 .fifoBufferConfigs = Fr_node_A_fifo_buffers_config,
512 .msgRAMConfig = &Fr_node_A_msgRAM_config,
513 .nodeConfiguration = &Fr_node_A_config,
514 .staticBufferConfigs = Fr_node_A_static_buffers_config
518 * This is an unifying configuration structure for the node A.
519 * It joins all the configuration structure together.
521 static Fr_ConfigType Fr_config_node_B= {
522 .clusterConfiguration = &Fr_cluster_config,
523 .dynamicBufferConfigs = Fr_node_B_dynamic_buffers_config,
524 .fifoBufferConfigs = Fr_node_B_fifo_buffers_config,
525 .msgRAMConfig = &Fr_node_B_msgRAM_config,
526 .nodeConfiguration = &Fr_node_B_config,
527 .staticBufferConfigs = Fr_node_B_static_buffers_config
530 /* User configuration */
532 static Fr_TMS570LS_ClusterConfigType user_cluster_config;
533 static Fr_TMS570LS_NodeConfigType user_node_config;
534 static Fr_TMS570LS_MsgRAMConfig user_msg_ram_config;
535 static Fr_TMS570LS_BufferConfigType user_static_buffer_config[RPP_FR_MAX_STATIC_BUF_CNT];
536 static Fr_TMS570LS_BufferConfigType user_dynamic_buffer_config[RPP_FR_MAX_DYNAMIC_BUF_CNT];
537 static Fr_TMS570LS_BufferConfigType user_fifo_buffer_config[RPP_FR_MAX_FIFO_BUF_DEPTH];
538 static Fr_ConfigType user_configuration = {
539 .clusterConfiguration = &user_cluster_config,
540 .nodeConfiguration = &user_node_config,
541 .msgRAMConfig = &user_msg_ram_config,
542 .staticBufferConfigs = user_static_buffer_config,
543 .dynamicBufferConfigs = user_dynamic_buffer_config,
544 .fifoBufferConfigs = user_fifo_buffer_config,
547 #define USER_CONFIG_NOT_DONE 0x0
548 #define USER_CONFIG_CLUSTER 0x1
549 #define USER_CONFIG_NODE 0x2
551 static uint8_t user_configuration_state = USER_CONFIG_NOT_DONE;
552 static uint8_t user_static_buffer_configured = 0;
553 static uint8_t user_dynamic_buffer_configured = 0;
554 static uint8_t user_fifo_buffer_depth = 0;
557 * Split string into numbers
559 * The function takes a string with hexadecimal numbers,
560 * separated by spaces, and converts it into an array of numbers.
562 * For example "0x2 0xA 0XDD 0xABCD" -> {0x2, 0xA, 0XDD, 0xABCD}
564 * @param [in] params Address of the string which will be converted
565 * @param [in] params_cnt A number of parameters, which should be found and converted from the string params
566 * @param [out] tmp_params Address, where converted array of numbers will be stored
568 * @return SUCCESS when all parameters were converted to the array of numbers,
569 * FAILURE when the string was too short, too long or some other error occurred.
571 static int8_t cmd_fr_parse_params(const char* params, uint32_t params_cnt, uint32_t* tmp_params) {
572 char cpy_params[256];
576 if (params == NULL || tmp_params == NULL) {
579 strncpy(cpy_params, params, 256);
580 token = strtok(cpy_params, " ");
584 for (i = 0; i < params_cnt; i++) {
585 if (sscanf(token, "%i", &tmp_params[i]) == EOF) { // No number found
588 if ((token = strtok(NULL, " ")) == NULL && i < params_cnt-1) { // Not enough parameters in the string
595 int8_t cmd_fr_config_cluster_params(const char* params) {
596 uint32_t tmp_params[FR_CLUSTER_PARAMS_CNT];
598 if (cmd_fr_parse_params(params, FR_CLUSTER_PARAMS_CNT, tmp_params) == FAILURE) {
602 user_cluster_config.gColdStartAttempts = tmp_params[0];
603 user_cluster_config.gListenNoise = tmp_params[1];
604 user_cluster_config.gMacroPerCycle = tmp_params[2];
605 user_cluster_config.gMaxWithoutClockCorrectionFatal = tmp_params[3];
606 user_cluster_config.gMaxWithoutClockCorrectionPassive = tmp_params[4];
607 user_cluster_config.gNetworkManagementVectorLength = tmp_params[5];
608 user_cluster_config.gNumberOfMinislots = tmp_params[6];
609 user_cluster_config.gNumberOfStaticSlots = tmp_params[7];
610 user_cluster_config.gOffsetCorrectionStart = tmp_params[8];
611 user_cluster_config.gPayloadLengthStatic = tmp_params[9];
612 user_cluster_config.gSyncNodeMax = tmp_params[10];
613 user_cluster_config.gdActionPointOffset = tmp_params[11];
614 user_cluster_config.gdCASRxLowMax = tmp_params[12];
615 user_cluster_config.gdDynamicSlotIdlePhase = tmp_params[13];
616 user_cluster_config.gdMinislot = tmp_params[14];
617 user_cluster_config.gdMinislotActionPointOffset = tmp_params[15];
618 user_cluster_config.gdNIT = tmp_params[16];
619 user_cluster_config.gdSampleClockPeriod = tmp_params[17];
620 user_cluster_config.gdStaticSlot = tmp_params[18];
621 user_cluster_config.gdTSSTransmitter = tmp_params[19];
622 user_cluster_config.gdWakeupSymbolRxIdle = tmp_params[20];
623 user_cluster_config.gdWakeupSymbolRxLow = tmp_params[21];
624 user_cluster_config.gdWakeupSymbolRxWindow = tmp_params[22];
625 user_cluster_config.gdWakeupSymbolTxIdle = tmp_params[23];
626 user_cluster_config.gdWakeupSymbolTxLow = tmp_params[24];
628 user_configuration_state |= USER_CONFIG_CLUSTER;
632 int8_t cmd_fr_config_node_params(const char* params) {
633 uint32_t tmp_params[FR_NODE_PARAMS_CNT+2]; // +2 because two more parameters from message RAM structure are expected in the string.
634 Fr_ChannelType channels[3] = {FR_CHANNEL_A, FR_CHANNEL_B, FR_CHANNEL_AB};
635 Fr_TMS570LS_SecureBuffersType secure[4] = {FR_SB_RECONFIG_ENABLED, FR_SB_STAT_REC_DISABLED_STAT_TR_DISABLED, FR_SB_ALL_REC_DISABLED, FR_SB_ALL_REC_DISABLED_STAT_TR_DISABLED};
637 if (cmd_fr_parse_params(params, FR_NODE_PARAMS_CNT+2, tmp_params) == FAILURE) {
641 user_node_config.pAllowHaltDueToClock = tmp_params[0];
642 user_node_config.pAllowPassiveToActive = tmp_params[1];
643 if (tmp_params[2] > 2) return FAILURE;
644 user_node_config.pChannels = channels[ tmp_params[2] ];
645 user_node_config.pClusterDriftDamping = tmp_params[3];
646 user_node_config.pDelayCompensationA = tmp_params[4];
647 user_node_config.pDelayCompensationB = tmp_params[5];
648 user_node_config.pExternOffsetCorrection = tmp_params[6];
649 user_node_config.pExternRateCorrection = tmp_params[7];
650 user_node_config.pKeySlotUsedForStartup = tmp_params[8];
651 user_node_config.pKeySlotUsedForSync = tmp_params[9];
652 user_node_config.pLatestTx = tmp_params[10];
653 user_node_config.pMacroInitialOffsetA = tmp_params[11];
654 user_node_config.pMacroInitialOffsetB = tmp_params[12];
655 user_node_config.pMicroInitialOffsetA = tmp_params[13];
656 user_node_config.pMicroInitialOffsetB = tmp_params[14];
657 user_node_config.pMicroPerCycle = tmp_params[15];
658 user_node_config.pRateCorrectionOut = tmp_params[16];
659 user_node_config.pOffsetCorrectionOut = tmp_params[17];
660 user_node_config.pSamplesPerMicrotick = tmp_params[18];
661 user_node_config.pSingleSlotEnabled = tmp_params[19];
662 if (tmp_params[20] > 1) return FAILURE;
663 user_node_config.pWakeupChannel = channels[ tmp_params[20] ];
664 user_node_config.pWakeupPattern = tmp_params[21];
665 user_node_config.pdAcceptedStartupRange = tmp_params[22];
666 user_node_config.pdListenTimeout = tmp_params[23];
667 user_node_config.pdMaxDrift = tmp_params[24];
668 user_node_config.pDecodingCorrection = tmp_params[25];
669 user_msg_ram_config.syncFramePayloadMultiplexEnabled = tmp_params[26];
670 if (tmp_params[27] > 3) return FAILURE;
671 user_msg_ram_config.secureBuffers = secure[ tmp_params[27] ];
673 user_configuration_state |= USER_CONFIG_NODE;
677 int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
678 Fr_TMS570LS_BufferConfigType* fifo_buffer_ptr = &user_fifo_buffer_config[0];
680 char channel[3], rej_static_frames[8], rej_null_frames[8];
681 unsigned depth, slot, cycleset, maxpayload, intr;
682 Fr_TMS570LS_BufferConfigType tmp_buffer;
684 ret = sscanf(param[2], "slot%i depth%i %2s cyc%i max%i %10s %10s int%i",
695 printf("Error parsing parameter %d\n", ret+1);
696 return -CMDERR_BADPAR;
699 if (depth < 1 || depth >= RPP_FR_MAX_FIFO_BUF_DEPTH)
700 return badpar("Depth too high\n");
701 user_fifo_buffer_depth = depth;
704 return badpar("Invalid slot number\n");
705 tmp_buffer.slotId = slot;
706 if (strcmp(channel, "A") == 0) tmp_buffer.channel = FR_CHANNEL_A;
707 else if (strcmp(channel, "B") == 0) tmp_buffer.channel = FR_CHANNEL_B;
708 else if (strcmp(channel, "AB") == 0) tmp_buffer.channel = FR_CHANNEL_AB;
709 else return badpar("Channel parsing error\n");
711 if (cycleset >= 0x80)
712 return badpar("Cycle set must be less than 0x80.\n");
713 tmp_buffer.cycleCounterFiltering = cycleset;
715 if (maxpayload >= 128)
716 return badpar("Maximum payload in half-words must be less than 128\n");
717 tmp_buffer.maxPayload = maxpayload;
719 if (strcmp(rej_null_frames, "rejnull") == 0) tmp_buffer.rejectNullFrames = true;
720 else if (strcmp(rej_null_frames, "accnull") == 0) tmp_buffer.rejectNullFrames = false;
721 else return badpar("Reject/accept NULL frames parsing error\n");
723 if (strcmp(rej_static_frames, "rejstat") == 0)
724 tmp_buffer.rejectStaticSegment = true;
725 else if (strcmp(rej_static_frames, "accstat") == 0)
726 tmp_buffer.rejectStaticSegment = false;
727 else return badpar("Invalid reject/accept static frame parameter");
730 return badpar("Interrupt parameter must be 0 or 1");
731 tmp_buffer.msgBufferInterrupt = intr;
733 for (i = 0; i < user_fifo_buffer_depth; i++) {
734 fifo_buffer_ptr[i].slotId = tmp_buffer.slotId;
735 fifo_buffer_ptr[i].maxPayload = tmp_buffer.maxPayload;
736 fifo_buffer_ptr[i].channel= tmp_buffer.channel;
737 fifo_buffer_ptr[i].cycleCounterFiltering = tmp_buffer.cycleCounterFiltering;
738 fifo_buffer_ptr[i].isTx = FALSE;
739 fifo_buffer_ptr[i].singleTransmit = FALSE;
740 fifo_buffer_ptr[i].payloadPreambleIndicatorTr = FALSE;
741 fifo_buffer_ptr[i].rejectNullFrames = tmp_buffer.rejectNullFrames;
742 fifo_buffer_ptr[i].rejectStaticSegment = tmp_buffer.rejectStaticSegment;
743 fifo_buffer_ptr[i].msgBufferInterrupt = tmp_buffer.msgBufferInterrupt;
746 printf("frbtcfgfifo slot%i depth%i %2s cyc%i max%i %10s %10s int%i\n",
760 int cmd_do_fr_config_bufer(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
762 Fr_TMS570LS_BufferConfigType *cfg;
765 char buf_type, channel[3],rxtx[3], single_continuous[11];
766 unsigned buffer, slot, cycleset, maxpayload, intr, preamb;
768 ret = sscanf(param[1], "%c%i slot%i %2s cyc%i %2s max%i %10s ppi%i int%i",
781 printf("Error parsing parameter %d\n", ret+1);
782 return -CMDERR_BADPAR;
788 if (buffer >= RPP_FR_MAX_STATIC_BUF_CNT)
789 return badpar("Buffer index too high\n");
790 cfg = &user_static_buffer_config[buffer];
793 if (buffer >= RPP_FR_MAX_DYNAMIC_BUF_CNT)
794 return badpar("Buffer index too high\n");
795 cfg = &user_dynamic_buffer_config[buffer];
798 return badpar("Invalid buffer type (S, D)\n");
801 if (slot < 1 || slot > 2047)
802 return badpar("Invalid slot number\n");
805 if (strcmp(channel, "A") == 0) cfg->channel = FR_CHANNEL_A;
806 else if (strcmp(channel, "B") == 0) cfg->channel = FR_CHANNEL_B;
807 else if (strcmp(channel, "AB") == 0) cfg->channel = FR_CHANNEL_AB;
808 else return badpar("Channel parsing error\n");
809 if (buf_type == 'D' && cfg->channel == FR_CHANNEL_AB)
810 return badpar("Dynamic segment buffers cannot have AB channels.\n");
812 if (cycleset >= 0x80)
813 return badpar("Cycle set must be less than 0x80.\n");
814 cfg->cycleCounterFiltering = cycleset;
816 if (strcmp(rxtx, "tx") == 0) cfg->isTx = true;
817 else if (strcmp(rxtx, "rx") == 0) cfg->isTx = false;
818 else return badpar("RX/TX parsing error\n");
820 if (maxpayload >= 128)
821 return badpar("Maximum payload in half-words must be less than 128\n");
822 cfg->maxPayload = maxpayload;
824 if (0 == strcmp(single_continuous, "single") ||
825 0 == strcmp(single_continuous, "s"))
826 cfg->singleTransmit = true;
827 else if (0 == strcmp(single_continuous, "continuous") ||
828 0 == strcmp(single_continuous, "c"))
829 cfg->singleTransmit = false;
830 else return badpar("Invalid single/continuous parameter");
833 return badpar("Payload preamble indicator must be 0 or 1");
834 cfg->payloadPreambleIndicatorTr = preamb;
837 return badpar("Interrupt parameter must be 0 or 1");
838 cfg->msgBufferInterrupt = intr;
842 if (buffer >= user_static_buffer_configured)
843 user_static_buffer_configured = buffer + 1;
846 if (buffer >= user_dynamic_buffer_configured)
847 user_dynamic_buffer_configured = buffer + 1;
851 printf("frbtcfgbuf%c%i slot%i %2s cyc%i %2s max%i %10s ppi%i int%i\n",
870 * @brief Do the user configuration of the FlexRay cluster parameters
872 * @param[in] cmd_io Pointer to IO stack
873 * @param[in] des Pointer to command descriptor
874 * @param[in] param Parameters of command
875 * @return 0 when OK or error code
877 int cmd_do_fr_user_config(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
879 token = strtok(param[1], " ");
880 if (strcmp(token, "cluster") == 0) {
881 if (cmd_fr_config_cluster_params(param[2]) == FAILURE) {
882 rpp_sci_printf("FlexRay cluster configuration not accepted.\n");
883 return -CMDERR_BADPAR;
885 rpp_sci_printf("FlexRay cluster configuration accepted.\n");
887 else if (strcmp(token, "node") == 0) {
888 if (cmd_fr_config_node_params(param[2]) == FAILURE) {
889 rpp_sci_printf("FlexRay node configuration not accepted.\n");
890 return -CMDERR_BADPAR;
892 rpp_sci_printf("FlexRay node configuration accepted.\n");
895 return -CMDERR_BADPAR;
902 * @brief Initialize the device as FlexRay node.
904 * @param[in] cmd_io Pointer to IO stack
905 * @param[in] des Pointer to command descriptor
906 * @param[in] param Parameters of command
907 * @return 0 when OK or error code
909 int cmd_do_fr_init(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
910 const Fr_ConfigType* Fr_ConfigPtr = NULL;
911 int8_t retVal = SUCCESS;
912 uint32_t error = ERR_PARAM_NO_ERROR;
914 if (*param[1] == 'A') {
915 Fr_ConfigPtr = &Fr_config_node_A;
917 else if (*param[1] == 'B') {
918 Fr_ConfigPtr = &Fr_config_node_B;
920 else if (*param[1] == 'U') { // Select the user configuration - call config commands first
921 user_msg_ram_config.statSegmentBufferCount = user_static_buffer_configured;
922 user_msg_ram_config.dynSegmentBufferCount = user_dynamic_buffer_configured;
923 user_msg_ram_config.fifoBufferCount= user_fifo_buffer_depth;
924 Fr_ConfigPtr = &user_configuration;
927 return -CMDERR_BADPAR;
930 retVal = rpp_fr_init_driver(Fr_ConfigPtr, &error);
931 if (retVal == SUCCESS) {
932 rpp_sci_printf("FlexRay driver initialized.\r\n");
935 rpp_sci_printf("FlexRay needs to be configured before initialization.\r\n");
936 return -CMDERR_BADCFG;
939 retVal = rpp_fr_init_controller(0, &error);
940 if (retVal == SUCCESS) {
941 rpp_sci_printf("FlexRay controller initialized.\r\n");
944 if (error & FR_INIT_ERR_CLUSTER_CONFIG) {
945 rpp_sci_printf("Cluster configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
947 else if (error & FR_INIT_ERR_NODE_CONFIG) {
948 rpp_sci_printf("Node configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
950 else if (error & FR_INIT_ERR_MSGRAM_CONFIG) {
951 rpp_sci_printf("Message RAM configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
953 else if (error & FR_INIT_ERR_BUFFPARAM_CONFIG) {
954 rpp_sci_printf("Buffer configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
956 else if (error & (uint32_t)FR_INIT_ERR_BUFF_CONFIG) {
957 rpp_sci_printf("Buffer configuration error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
960 rpp_sci_printf("POC state switching error.\r\n");
962 return -CMDERR_BADCFG;
968 * @brief Starts FlexRay communication
970 * @param[in] cmd_io Pointer to IO stack
971 * @param[in] des Pointer to command descriptor
972 * @param[in] param Parameters of command
973 * @return 0 when OK or error code
975 int cmd_do_fr_start(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
976 int8_t retVal = SUCCESS;
977 uint32_t error = ERR_PARAM_NO_ERROR;
979 retVal = rpp_fr_start_communication(0, &error);
980 if (retVal == SUCCESS) {
981 rpp_sci_printf("FlexRay communication is running.\r\n");
984 if (error & FR_STARTUP_ERR_SW_STUP_FOLLOW) {
985 rpp_sci_printf("Can not switch POC to RUN state.\r\n");
987 else if (error & FR_STARTUP_ERR_CSINH_DIS) {
988 rpp_sci_printf("Cold start inhibit disabled error.\r\n");
990 else if (error & FR_STARTUP_ERR_SW_STUP_READY) {
991 rpp_sci_printf("Can not switch back to READY from STARTUP.\r\n");
993 else if (error & FR_STARTUP_ERR_SW_STUP_AS_NCOLD) {
994 rpp_sci_printf("Can not switch to STARTUP as non-coldstarter.\r\n");
997 rpp_sci_printf("General error.\r\n");
999 return -CMDERR_BADCFG;
1005 * @brief Invokes POC command ALL_SLOTS
1007 * @param[in] cmd_io Pointer to IO stack
1008 * @param[in] des Pointer to command descriptor
1009 * @param[in] param Parameters of command
1010 * @return 0 when OK or error code
1012 int cmd_do_fr_allslots(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1013 int8_t retVal = ERR_PARAM_NO_ERROR;
1014 retVal = rpp_fr_all_slots(0);
1015 if (retVal == SUCCESS) {
1016 rpp_sci_printf("FlexRay node started communication in all slots.\r\n");
1019 rpp_sci_printf("General error.\r\n");
1020 return -CMDERR_BADCFG;
1026 * @brief Halt FlexRay communication
1028 * @param[in] cmd_io Pointer to IO stack
1029 * @param[in] des Pointer to command descriptor
1030 * @param[in] param Parameters of command
1031 * @return 0 when OK or error code
1033 int cmd_do_fr_halt(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1034 int8_t retVal = ERR_PARAM_NO_ERROR;
1035 retVal = rpp_fr_halt_communication(0);
1036 if (retVal == SUCCESS) {
1037 rpp_sci_printf("FlexRay node communication halted.\r\n");
1040 rpp_sci_printf("General error.\r\n");
1041 return -CMDERR_BADCFG;
1047 * @brief Abort FlexRay communication
1049 * @param[in] cmd_io Pointer to IO stack
1050 * @param[in] des Pointer to command descriptor
1051 * @param[in] param Parameters of command
1052 * @return 0 when OK or error code
1054 int cmd_do_fr_abort(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1055 int8_t retVal = ERR_PARAM_NO_ERROR;
1056 retVal = rpp_fr_abort_communication(0);
1057 if (retVal == SUCCESS) {
1058 rpp_sci_printf("FlexRay node communication aborted.\r\n");
1061 rpp_sci_printf("General error.\r\n");
1062 return -CMDERR_BADCFG;
1068 * @brief Send wake up pattern
1070 * @param[in] cmd_io Pointer to IO stack
1071 * @param[in] des Pointer to command descriptor
1072 * @param[in] param Parameters of command
1073 * @return 0 when OK or error code
1075 int cmd_do_fr_sendwup(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1076 int8_t retVal = ERR_PARAM_NO_ERROR;
1077 retVal = rpp_fr_send_wup(0);
1078 if (retVal == SUCCESS) {
1079 rpp_sci_printf("Wake up pattern has been sent.\r\n");
1082 rpp_sci_printf("General error.\r\n");
1083 return -CMDERR_BADCFG;
1089 * @brief Set channel for wake up pattern sending.
1091 * @param[in] cmd_io Pointer to IO stack
1092 * @param[in] des Pointer to command descriptor
1093 * @param[in] param Parameters of command
1094 * @return 0 when OK or error code
1096 int cmd_do_fr_setwuchannel(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1097 int8_t retVal = ERR_PARAM_NO_ERROR;
1098 Fr_ChannelType channel = FR_CHANNEL_A;
1100 if (*param[1] == 'A') {
1101 channel = FR_CHANNEL_A;
1103 else if (*param[1] == 'B') {
1104 channel = FR_CHANNEL_B;
1107 return -CMDERR_BADPAR;
1109 retVal = rpp_fr_set_wu_channel(0, channel);
1110 if (retVal == SUCCESS) {
1111 rpp_sci_printf("Wake up channel has been set.\r\n");
1114 rpp_sci_printf("General error.\r\n");
1115 return -CMDERR_BADCFG;
1121 * @brief Get and print POC status of the FlexRay controller.
1123 * @param[in] cmd_io Pointer to IO stack
1124 * @param[in] des Pointer to command descriptor
1125 * @param[in] param Parameters of command
1126 * @return 0 when OK or error code
1128 int cmd_do_fr_getpocstatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1129 int8_t retVal = ERR_PARAM_NO_ERROR;
1130 Fr_POCStatusType status;
1131 char* ErrorModeStrings[] = {"ACTIVE", "HALT", "PASSIVE"};
1132 char* SlotModeStrings[] = {"KEYSLOT", "ALL_PENDING", "ALL"};
1133 char* StartupStateStrings[] = {
1134 "UNDEFINED", "COLDSTART_LISTEN", "COLDSTART_CHECK", "COLDSTART_JOIN",
1135 "COLDSTART_CONSISTENCY_CHECK", "INTEGRATION_LISTEN", "INITIALIZE_SCHEDULE", "INTEGRATION_CONSISTENCY_CHECK",
1136 "COLDSTART_GAP", "EXTERNAL_STARTUP", "ABORT", "COLDSTART_COLLISION_RESOLUTION",
1139 char* StateStrings[] = {
1140 "CONFIG", "DEFAULT_CONFIG", "HALT", "NORMAL_ACTIVE",
1141 "NORMAL_PASSIVE", "READY", "STARTUP", "LOOPBACK",
1144 char* WakeupStatusStrings[] = {
1145 "UNDEFINED", "RECEIVED_HEADER", "RECEIVED_WUP", "COLLISION_HEADER",
1146 "COLLISION_WUP", "COLLISION_UNKNOWN", "TRANSMITTED"
1149 retVal = rpp_fr_get_poc_status(0, &status);
1150 if (retVal == SUCCESS) {
1151 rpp_sci_printf("POC status:\r\n");
1152 rpp_sci_printf("CHIHaltRequest: %s\r\n", (status.CHIHaltRequest == TRUE) ? "TRUE" : "FALSE");
1153 rpp_sci_printf("CHIReadyRequest: %s\r\n", (status.CHIReadyRequest == TRUE) ? "TRUE" : "FALSE");
1154 rpp_sci_printf("ColdstartNoise: %s\r\n", (status.ColdstartNoise == TRUE) ? "TRUE" : "FALSE");
1155 rpp_sci_printf("Freeze: %s\r\n", (status.Freeze == TRUE) ? "TRUE" : "FALSE");
1156 rpp_sci_printf("ErrorMode: %s\r\n", ErrorModeStrings[status.ErrorMode]);
1157 rpp_sci_printf("SlotMode: %s\r\n", SlotModeStrings[status.SlotMode]);
1158 rpp_sci_printf("StartupState: %s\r\n", StartupStateStrings[status.StartupState]);
1159 rpp_sci_printf("State: %s\r\n", StateStrings[status.State]);
1160 rpp_sci_printf("WakeupStatus: %s\r\n", WakeupStatusStrings[status.WakeupStatus]);
1163 rpp_sci_printf("General error.\r\n");
1164 return -CMDERR_BADCFG;
1170 * @brief Send given data through the FlexRay in selected slot.
1172 * @param[in] cmd_io Pointer to IO stack
1173 * @param[in] des Pointer to command descriptor
1174 * @param[in] param Parameters of command
1175 * @return 0 when OK or error code
1177 int cmd_do_fr_transmittxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1178 int8_t retVal = ERR_PARAM_NO_ERROR;
1181 int values[MAX_PARAM_VALUES_NUM];
1182 uint8_t data[MAX_PARAM_VALUES_NUM];
1185 if (sscanf(param[1], "%d", &slotID) != 1) {
1186 return -CMDERR_BADPAR;
1188 if (sscanf(param[2], " %2x", &values[0]) != 1) {
1189 return -CMDERR_BADPAR;
1191 data[0] = (uint8_t)values[0];
1192 token = strtok(param[2], " ");
1193 token = strtok(NULL, " ");
1195 while (dataLength < MAX_PARAM_VALUES_NUM && token != NULL) {
1196 if (sscanf(token, "%2x", &values[dataLength]) == EOF) {
1199 data[dataLength] = (uint8_t)values[dataLength];
1200 token = strtok(NULL, " ");
1204 retVal = rpp_fr_transmit_lpdu(0, slotID, data, dataLength);
1205 if (retVal == SUCCESS) {
1206 rpp_sci_printf("Data were set for transmission.\r\n");
1209 rpp_sci_printf("General error.\r\n");
1210 return -CMDERR_BADCFG;
1216 * @brief Cancel the transmission in the selected slot.
1218 * @param[in] cmd_io Pointer to IO stack
1219 * @param[in] des Pointer to command descriptor
1220 * @param[in] param Parameters of command
1221 * @return 0 when OK or error code
1223 int cmd_do_fr_canceltxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1224 int8_t retVal = ERR_PARAM_NO_ERROR;
1227 if (sscanf(param[1], "%d", &slotID) != 1) {
1228 return -CMDERR_BADPAR;
1230 if (param[2] != NULL) {
1231 return -CMDERR_BADPAR;
1234 retVal = rpp_fr_cancel_transmit_lpdu(0, slotID);
1235 if (retVal == SUCCESS) {
1236 rpp_sci_printf("Transmission canceled.\r\n");
1239 rpp_sci_printf("General error.\r\n");
1240 return -CMDERR_BADCFG;
1246 * @brief Receive data from selected slot.
1248 * @param[in] cmd_io Pointer to IO stack
1249 * @param[in] des Pointer to command descriptor
1250 * @param[in] param Parameters of command
1251 * @return 0 when OK or error code
1253 int cmd_do_fr_receiverxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1254 int8_t retVal = ERR_PARAM_NO_ERROR;
1256 uint8_t data[cPayloadLengthMax];
1257 Fr_RxLPduStatusType status;
1258 uint8_t receivedLength = 0;
1261 if (sscanf(param[1], "%d", &slotID) != 1) {
1262 return -CMDERR_BADPAR;
1264 if (param[2] != NULL) {
1265 return -CMDERR_BADPAR;
1268 memset(data, 0, sizeof(data));
1270 retVal = rpp_fr_receive_lpdu(0, slotID, data, &status, &receivedLength);
1271 if (retVal == SUCCESS) {
1273 case FR_RECEIVED_MORE_DATA_AVAILABLE:
1274 rpp_sci_printf("More messages are still in FIFO:\r\n");
1276 rpp_sci_printf("Received message (%d B):\r\n", receivedLength);
1277 for (i = 0; i < receivedLength; i++) {
1278 rpp_sci_printf(" %02x", data[i]);
1280 rpp_sci_printf("\r\n");
1283 rpp_sci_printf("No message received.\r\n");
1288 rpp_sci_printf("General error.\r\n");
1289 return -CMDERR_BADCFG;
1295 * @brief Returns TX LPdu status.
1297 * @param[in] cmd_io Pointer to IO stack
1298 * @param[in] des Pointer to command descriptor
1299 * @param[in] param Parameters of command
1300 * @return 0 when OK or error code
1302 int cmd_do_fr_checktxlpdustatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1303 int8_t retVal = ERR_PARAM_NO_ERROR;
1305 Fr_TxLPduStatusType status;
1306 char* statusStrings[] = {"is not", "is"};
1308 if (sscanf(param[1], "%d", &slotID) != 1) {
1309 return -CMDERR_BADPAR;
1311 if (param[2] != NULL) {
1312 return -CMDERR_BADPAR;
1315 retVal = rpp_fr_check_tx_lpdu_status(0, slotID, &status);
1316 if (retVal == SUCCESS) {
1317 rpp_sci_printf("Message transmission %s pending.\r\n", statusStrings[status]);
1320 rpp_sci_printf("General error.\r\n");
1321 return -CMDERR_BADCFG;
1327 * @brief Disable buffer.
1329 * @param[in] cmd_io Pointer to IO stack
1330 * @param[in] des Pointer to command descriptor
1331 * @param[in] param Parameters of command
1332 * @return 0 when OK or error code
1334 int cmd_do_fr_disablelpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1335 int8_t retVal = ERR_PARAM_NO_ERROR;
1338 if (sscanf(param[1], "%d", &slotID) != 1) {
1339 return -CMDERR_BADPAR;
1341 if (param[2] != NULL) {
1342 return -CMDERR_BADPAR;
1345 retVal = rpp_fr_disable_lpdu(0, slotID);
1346 if (retVal == SUCCESS) {
1347 rpp_sci_printf("Buffer disabled.\r\n");
1350 rpp_sci_printf("General error.\r\n");
1351 return -CMDERR_BADCFG;
1357 * @brief Print global time of the FlexRay network.
1359 * @param[in] cmd_io Pointer to IO stack
1360 * @param[in] des Pointer to command descriptor
1361 * @param[in] param Parameters of command
1362 * @return 0 when OK or error code
1364 int cmd_do_fr_getglobaltime(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1365 int8_t retVal = ERR_PARAM_NO_ERROR;
1367 uint16_t macroTick = 0;
1369 retVal = rpp_fr_get_global_time(0, &cycle, ¯oTick);
1370 if (retVal == SUCCESS) {
1371 rpp_sci_printf("Cycle number: %d\r\nMacrotick number: %d\r\n", cycle, macroTick);
1374 rpp_sci_printf("General error.\r\n");
1375 return -CMDERR_BADCFG;
1381 * @brief Print network management vector of the FlexRay node.
1383 * @param[in] cmd_io Pointer to IO stack
1384 * @param[in] des Pointer to command descriptor
1385 * @param[in] param Parameters of command
1386 * @return 0 when OK or error code
1388 int cmd_do_fr_getnmvector(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1389 int8_t retVal = ERR_PARAM_NO_ERROR;
1390 uint8_t nmVector[12];
1393 retVal = rpp_fr_get_network_management_vector(0, nmVector);
1394 if (retVal == SUCCESS) {
1395 rpp_sci_printf("Network management vector:");
1396 for (i = 0; i < Fr_cluster_config.gNetworkManagementVectorLength; i++) {
1397 rpp_sci_printf(" %x", nmVector[i]);
1399 rpp_sci_printf("\r\n");
1402 rpp_sci_printf("General error.\r\n");
1403 return -CMDERR_BADCFG;
1408 int cmd_do_fr_nmwatch(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1409 int8_t retVal = ERR_PARAM_NO_ERROR;
1410 uint8_t nmVector[12];
1413 // Calculate wait time in OS ticks
1414 static const portTickType freq_ticks = 100 /* ms */ / portTICK_RATE_MS;
1415 portTickType last_wake_time = xTaskGetTickCount();
1417 while(cmd_io->getc(cmd_io) < 0) {
1418 retVal = rpp_fr_get_network_management_vector(0, nmVector);
1419 if (retVal == SUCCESS) {
1420 rpp_sci_printf("Network management vector:");
1421 for (i = 0; i < Fr_cluster_config.gNetworkManagementVectorLength; i++) {
1422 rpp_sci_printf(" %02x", nmVector[i]);
1424 rpp_sci_printf("\r");
1427 rpp_sci_printf("General error.\r\n");
1428 return -CMDERR_BADCFG;
1430 vTaskDelayUntil(&last_wake_time, freq_ticks);
1432 rpp_sci_printf("\n");
1437 * @brief Print both channels status of the FlexRay node.
1439 * @param[in] cmd_io Pointer to IO stack
1440 * @param[in] des Pointer to command descriptor
1441 * @param[in] param Parameters of command
1442 * @return 0 when OK or error code
1444 int cmd_do_fr_getchannelstatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1445 int8_t retVal = ERR_PARAM_NO_ERROR;
1448 char* decodeStrings[] = {
1449 "aggregated channel status vSS!ValidFrame",
1450 "aggregated channel status vSS!SyntaxError",
1451 "aggregated channel status vSS!ContentError",
1452 "aggregated channel status additional communication",
1453 "aggregated channel status vSS!Bviolation",
1454 "aggregated channel status vSS!TxConflict",
1457 "symbol window status data vSS!ValidMTS",
1458 "symbol window status data vSS!SyntaxError",
1459 "symbol window status data vSS!Bviolation",
1460 "symbol window status data vSS!TxConflict",
1461 "NIT status data vSS!SyntaxError",
1462 "NIT status data vSS!Bviolation",
1466 char* channelNames[] = {"A", "B"};
1467 char* boolStrings[] = {"FALSE", "TRUE"};
1468 uint16_t channelStatuses[2];
1470 retVal = rpp_fr_get_channel_status(0, &channelStatuses[0], &channelStatuses[1]);
1471 if (retVal == SUCCESS) {
1472 for (channel = 0; channel < 2; channel++) {
1473 rpp_sci_printf("Channel %s status:\r\n", channelNames[channel]);
1474 for (index = 0; index < 16; index++) {
1475 rpp_sci_printf("\t%s: %s\r\n", decodeStrings[index], boolStrings[ (channelStatuses[channel] >> index) & 0x1 ] );
1480 rpp_sci_printf("General error.\r\n");
1481 return -CMDERR_BADCFG;
1487 * @brief Print clock correction of the FlexRay node
1489 * @param[in] cmd_io Pointer to IO stack
1490 * @param[in] des Pointer to command descriptor
1491 * @param[in] param Parameters of command
1492 * @return 0 when OK or error code
1494 int cmd_do_fr_getclockcorrection(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1495 int8_t retVal = ERR_PARAM_NO_ERROR;
1496 int16_t rateCorrection;
1497 int32_t offsetCorrection;
1499 retVal = rpp_fr_get_clock_correction(0, &rateCorrection, &offsetCorrection);
1500 if (retVal == SUCCESS) {
1501 rpp_sci_printf("Rate correction: %d\r\nOffset correction: %d\r\n", rateCorrection, offsetCorrection);
1504 rpp_sci_printf("General error.\r\n");
1505 return -CMDERR_BADCFG;
1511 * @brief Print list of syncframec transmitted on both channels via the even and odd cycle.
1513 * @param[in] cmd_io Pointer to IO stack
1514 * @param[in] des Pointer to command descriptor
1515 * @param[in] param Parameters of command
1516 * @return 0 when OK or error code
1518 int cmd_do_fr_getsyncframelist(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1519 int8_t retVal = ERR_PARAM_NO_ERROR;
1520 uint16_t channelAEvenList[FR_MAX_SYNC_FRAME_LIST_SIZE];
1521 uint16_t channelBEvenList[FR_MAX_SYNC_FRAME_LIST_SIZE];
1522 uint16_t channelAOddList[FR_MAX_SYNC_FRAME_LIST_SIZE];
1523 uint16_t channelBOddList[FR_MAX_SYNC_FRAME_LIST_SIZE];
1524 uint32_t listSize = 0;
1527 if (sscanf(param[1], "%d", &listSize) != 1) {
1528 return -CMDERR_BADPAR;
1530 if (param[2] != NULL) {
1531 return -CMDERR_BADPAR;
1533 if (listSize > FR_MAX_SYNC_FRAME_LIST_SIZE) {
1534 return -CMDERR_BADPAR;
1537 retVal = rpp_fr_get_sync_frame_list(0, listSize, channelAEvenList, channelBEvenList, channelAOddList, channelBOddList);
1538 if (retVal == SUCCESS) {
1539 rpp_sci_printf("| Channel A even | channel B even | channel A odd | channel B odd |\r\n");
1540 rpp_sci_printf("|----------------|----------------|----------------|----------------|\r\n");
1541 for (i = 0; i < listSize; i++) {
1542 rpp_sci_printf("| %-14x | %-14x | %-14x | %-14x |\r\n", channelAEvenList[i], channelBEvenList[i], channelAOddList[i], channelBOddList[i]);
1544 rpp_sci_printf("|----------------|----------------|----------------|----------------|\r\n");
1548 rpp_sci_printf("General error.\r\n");
1549 return -CMDERR_BADCFG;
1555 * @brief Print status of wakeup on each channels (wakeup received on channel or not yet received).
1557 * @param[in] cmd_io Pointer to IO stack
1558 * @param[in] des Pointer to command descriptor
1559 * @param[in] param Parameters of command
1560 * @return 0 when OK or error code
1562 int cmd_do_fr_getwakeuprxstatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1563 int8_t retVal = ERR_PARAM_NO_ERROR;
1565 char* statusStrings[] = {"was not yet", "was"};
1566 char* channelNames[] = {"A", "B"};
1569 retVal = rpp_fr_get_wakeup_rx_status(0, &status);
1570 if (retVal == SUCCESS) {
1571 for (i = 0; i < 2; i++) {
1572 rpp_sci_printf("Wake up pattern %s received on channel %s.\r\n", statusStrings[(status >> i) & 0x1], channelNames[i]);
1576 rpp_sci_printf("General error.\r\n");
1577 return -CMDERR_BADCFG;
1583 * @brief Set and start absolute timer.
1585 * @param[in] cmd_io Pointer to IO stack
1586 * @param[in] des Pointer to command descriptor
1587 * @param[in] param Parameters of command
1588 * @return 0 when OK or error code
1590 int cmd_do_fr_settimer(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1591 int8_t retVal = ERR_PARAM_NO_ERROR;
1596 if (sscanf(param[1], "%i %i %i", &timer, &cycle, &offset) != 3) {
1597 return -CMDERR_BADPAR;
1600 retVal = rpp_fr_set_timer(0, timer, cycle, offset);
1601 if (retVal == SUCCESS) {
1603 while (i && (cycle & i) == 0)
1608 rpp_sci_printf("Timer was set for every %d-th cycle, offset %d, macrotick %d\n",
1609 i, cycle & ~i, offset);
1612 rpp_sci_printf("General error.\r\n");
1613 return -CMDERR_BADCFG;
1619 * @brief Cancel selected timer
1621 * @param[in] cmd_io Pointer to IO stack
1622 * @param[in] des Pointer to command descriptor
1623 * @param[in] param Parameters of command
1624 * @return 0 when OK or error code
1626 int cmd_do_fr_canceltimer(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1627 int8_t retVal = ERR_PARAM_NO_ERROR;
1630 if (sscanf(param[1], "%d", &timer) != 1) {
1631 return -CMDERR_BADPAR;
1634 if (param[2] != NULL) {
1635 return -CMDERR_BADPAR;
1638 retVal = rpp_fr_cancel_timer(0, timer);
1639 if (retVal == SUCCESS) {
1640 rpp_sci_printf("Timer was canceled.\r\n");
1643 rpp_sci_printf("General error.\r\n");
1644 return -CMDERR_BADCFG;
1650 * @brief Enable/disable, acknowledge, get timer IRQ
1652 * @param[in] cmd_io Pointer to IO stack
1653 * @param[in] des Pointer to command descriptor
1654 * @param[in] param Parameters of command
1655 * @return 0 when OK or error code
1657 int cmd_do_fr_timerirq(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1658 int8_t retVal = ERR_PARAM_NO_ERROR;
1661 boolean_t status = FALSE;
1662 char* boolStrings[] = {"FALSE", "TRUE"};
1665 if (sscanf(param[1], "%d", &timer) != 1) {
1666 return -CMDERR_BADPAR;
1669 if (param[2] == NULL) { // Get timer IRQ
1670 retVal = rpp_fr_get_timer_irq_status(0, timer, &status);
1671 if (retVal == SUCCESS) {
1672 rpp_sci_printf("IRQ = %s\r\n", boolStrings[status]);
1675 rpp_sci_printf("General error.\r\n");
1676 return -CMDERR_BADCFG;
1679 else { // Some set action
1680 if (sscanf(param[2], "%4s", str) != 1) {
1681 return -CMDERR_BADPAR;
1683 if (strcmp(str, "EN") == 0) { // Enable IRQ
1684 retVal = SUCCESS; // No interrupts imlemented
1686 else if (strcmp(str, "DIS") == 0) { // Disable IRQ
1687 retVal = SUCCESS; // No interrupts implemented
1689 else if (strcmp(str, "ACK") == 0) { // Clear IRQ
1690 retVal = rpp_fr_clear_timer_irq(0, timer);
1692 else { // Bad argument
1693 return -CMDERR_BADPAR;
1696 if (retVal == SUCCESS) {
1697 rpp_sci_printf("OK\r\n");
1700 rpp_sci_printf("General error.\r\n");
1701 return -CMDERR_BADCFG;
1708 * @brief Print FlexRay driver version info.
1710 * @param[in] cmd_io Pointer to IO stack
1711 * @param[in] des Pointer to command descriptor
1712 * @param[in] param Parameters of command
1713 * @return 0 when OK or error code
1715 int cmd_do_fr_getversioninfo(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1716 Std_VersionInfoType versionInfo;
1718 rpp_fr_get_driver_version(&versionInfo);
1719 rpp_sci_printf("vendorID: %#x\r\n", versionInfo.vendorID);
1720 rpp_sci_printf("moduleID: %#x\r\n", versionInfo.moduleID);
1721 rpp_sci_printf("sw_major_version: %#x\r\n", versionInfo.sw_major_version);
1722 rpp_sci_printf("sw_minor_version: %#x\r\n", versionInfo.sw_minor_version);
1723 rpp_sci_printf("sw_patch_version: %#x\r\n", versionInfo.sw_patch_version);
1729 * @brief Print value of FlexRay configuratoin parameter.
1731 * @param[in] cmd_io Pointer to IO stack
1732 * @param[in] des Pointer to command descriptor
1733 * @param[in] param Parameters of command
1734 * @return 0 when OK or error code
1736 int cmd_do_fr_readcconfig(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
1737 int8_t retVal = ERR_PARAM_NO_ERROR;
1741 if (sscanf(param[1], "%d", &index) != 1) {
1742 return -CMDERR_BADPAR;
1745 if (param[2] != NULL) {
1746 return -CMDERR_BADPAR;
1749 retVal = rpp_fr_read_com_ctrl_config(0, index, &value);
1750 if (retVal == SUCCESS) {
1751 rpp_sci_printf("Value = %#x\r\n", value);
1754 rpp_sci_printf("General error.\r\n");
1755 return -CMDERR_BADCFG;
1762 /** Command descriptor for FlexRay user config cluster command */
1763 cmd_des_t const cmd_des_fr_user_config={
1765 "frbtconfig*","Set the user configuration parameters",
1766 "=== Command syntax ===\n"
1768 " frbtconfig<TYPE> <PARAMS>\n"
1770 "* <TYPE> is a string specifying the type of parameters to be set. It can be: \"cluster\" or \"node\"\n"
1771 "* <PARAMS> is a sequence of numbers separated by spaces. Each number stands for one parameter.\n"
1773 "=== Description ===\n"
1775 "The command takes the configuration parameters in the form of a string\n"
1776 "and sets the appropriate type of the FlexRay parameters. It is\n"
1777 "necessary to configure parameters of at least cluster, and node and\n"
1778 "one static buffer (see frbtcfgbuf command). The parameters set by this\n"
1779 "command are applied by the frbtinitU command. Once frbtinit is called,\n"
1780 "it is no longer possible to change the parameters.\n"
1782 "The type of the parameters can be selected by the <TYPE> selector.\n"
1784 "Type \"cluster\" sets global FlexRay network parameters. It expects a\n"
1785 "sequence of 25 parameters in this order:\n"
1786 "* 1) gColdStartAttempts\n"
1787 "* 2) gListenNoise\n"
1788 "* 3) gMacroPerCycle\n"
1789 "* 4) gMaxWithoutClockCorrectionFatal\n"
1790 "* 5) gMaxWithoutClockCorrectionPassive\n"
1791 "* 6) gNetworkManagementVectorLength\n"
1792 "* 7) gNumberOfMinislots\n"
1793 "* 8) gNumberOfStaticSlots\n"
1794 "* 9) gOffsetCorrectionStart\n"
1795 "* 10) gPayloadLengthStatic\n"
1796 "* 11) gSyncNodeMax\n"
1797 "* 12) gdActionPointOffset\n"
1798 "* 13) gdCASRxLowMax\n"
1799 "* 14) gdDynamicSlotIdlePhase\n"
1800 "* 15) gdMinislot\n"
1801 "* 16) gdMinislotActionPointOffset\n"
1803 "* 18) gdSampleClockPeriod\n"
1804 "* 19) gdStaticSlot\n"
1805 "* 20) gdTSSTransmitter\n"
1806 "* 21) gdWakeupSymbolRxIdle\n"
1807 "* 22) gdWakeupSymbolRxLow\n"
1808 "* 23) gdWakeupSymbolRxWindow\n"
1809 "* 24) gdWakeupSymbolTxIdle\n"
1810 "* 25) gdWakeupSymbolTxLow\n"
1812 "Type \"node\" sets local FlexRay network parameters. It expects a\n"
1813 "sequence of 28 parameters in this order:\n"
1814 "* 1) pAllowHaltDueToClock\n"
1815 "* 2) pAllowPassiveToActive\n"
1816 "* 3) pChannels (0 - A, 1 - B, 2 - AB)\n"
1817 "* 4) pClusterDriftDamping\n"
1818 "* 5) pDelayCompensationA\n"
1819 "* 6) pDelayCompensationB\n"
1820 "* 7) pExternOffsetCorrection\n"
1821 "* 8) pExternRateCorrection\n"
1822 "* 9) pKeySlotUsedForStartup\n"
1823 "* 10) pKeySlotUsedForSync\n"
1825 "* 12) pMacroInitialOffsetA\n"
1826 "* 13) pMacroInitialOffsetB\n"
1827 "* 14) pMicroInitialOffsetA\n"
1828 "* 15) pMicroInitialOffsetB\n"
1829 "* 16) pMicroPerCycle\n"
1830 "* 17) pRateCorrectionOut\n"
1831 "* 18) pOffsetCorrectionOut\n"
1832 "* 19) pSamplesPerMicrotick\n"
1833 "* 20) pSingleSlotEnabled\n"
1834 "* 21) pWakeupChannel (0 - A, 1 - B)\n"
1835 "* 22) pWakeupPattern\n"
1836 "* 23) pdAcceptedStartupRange\n"
1837 "* 24) pdListenTimeout\n"
1838 "* 25) pdMaxDrift\n"
1839 "* 26) pDecodingCorrection\n"
1840 "* 27) syncFramePayloadMultiplexEnabled\n"
1841 "* 28) secureBuffers (0 - FR_SB_RECONFIG_ENABLED, 1 - FR_SB_STAT_REC_DISABLED_STAT_TR_DISABLED, 2 - FR_SB_ALL_REC_DISABLED, 3 - FR_SB_ALL_REC_DISABLED_STAT_TR_DISABLED)\n"
1845 " --> 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\n"
1846 " FlexRay cluster configuration accepted.\n"
1847 " --> 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\n"
1848 " FlexRay node configuration accepted.\n",
1849 CMD_HANDLER(cmd_do_fr_user_config), (void *)&cmd_list_fr_basic_test
1852 cmd_des_t const cmd_des_fr_config_buffer={
1854 "frbtcfgbuf?*","Configure a message buffer in the user configuration",
1855 "=== Command syntax ===\n"
1857 " frbtcfgbuf<TYPE><NUM> slot<SLOT> <CHN> cyc<CYC> <RXTX> max<MAX> <REP> ppi<PPI> int<INT>\n"
1859 "* <TYPE> is 'S' for static segment buffers and 'D' for dynamic segment buffers,\n"
1860 "* <NUM> is the number of the buffer. Both static and dynamic buffers are numbered independently starting from zero,\n"
1861 "* <SLOT> is the number of the slot,\n"
1862 "* <CHN> is one of 'A', 'B' or 'AB' and identifies the used channel,\n"
1863 "* <CYC> is the cycle set when to send the buffer,\n"
1864 "* <RXTX> is either string \"rx\" or \"tx\",\n"
1865 "* <MAX> is the number determining the maximum payload (in hald-words),\n"
1866 "* <REP> is a string \"s\" or \"single\" for single transmission or \"c\" or \"continuous\" for continuous transmission,\n"
1867 "* <PPI> is 0 or 1 determining whether the payload preamble indicator is set,\n"
1868 "* <INT> is 0 or 1 and is currently ignored.\n"
1870 "=== Description ===\n"
1872 "The command sets the configuration parameters for static or dynamic\n"
1873 "buffers in user configuration. The parameters set by this command are\n"
1874 "applied by the frbtinitU command. Once frbtinit is called, it is no\n"
1875 "longer possible to change the parameters.\n"
1879 " --> frbtcfgbufS0 slot2 AB cyc0 tx max9 continous ppi0 int1\n"
1880 " frbtcfgbufS0 slot2 AB cyc0 tx max9 continous ppi0 int1\n"
1881 " --> frbtcfgbufS1 slot1 AB cyc0 rx max9 continuous ppi0 int1\n"
1882 " frbtcfgbufS1 slot1 AB cyc0 rx max9 continuous ppi0 int1\n"
1883 " --> frbtcfgbufD0 slot9 A cyc0 rx max0x40 single ppi0 int0\n"
1884 " frbtcfgbufD0 slot9 A cyc0 rx max64 single ppi0 int0\n"
1885 " --> frbtcfgbufD1 slot10 A cyc0 tx max0x40 single ppi0 int0\n"
1886 " frbtcfgbufD1 slot10 A cyc0 tx max64 single ppi0 int0\n",
1887 CMD_HANDLER(cmd_do_fr_config_bufer), (void *)&cmd_list_fr_basic_test
1890 cmd_des_t const cmd_des_fr_config_fifo={
1892 "frbtcfgfifo*","Configure a RX FIFO message buffer in the user configuration",
1893 "=== Command syntax ===\n"
1895 " frbtcfgfifo slot<SLOT> depth<DEPTH> <CHN> cyc<CYC> max<MAX> <REJNULL> <REJSTAT> int<INT>\n"
1897 "* <SLOT> is the number of the slot,\n"
1898 "* <DEPTH> is a number specifying the depth of the FIFO,\n"
1899 "* <CHN> is one of 'A', 'B' or 'AB' and identifies the used channel,\n"
1900 "* <CYC> is the cycle set when to send the buffer,\n"
1901 "* <MAX> is the number determining the maximum payload (in hald-words),\n"
1902 "* <REJNULL> is a string \"rejnull\" for rejecting NULL frames or \"accnull\" for accepting NULL frames,\n"
1903 "* <REJSTAT> is a string \"rejstat\" for rejecting frames in static segment or \"accstat\" for accepting frames from static segment,\n"
1904 "* <INT> is 0 or 1 and is currently ignored.\n"
1906 "=== Description ===\n"
1908 "The command sets the configuration parameters for RX FIFO buffer\n"
1909 "in user configuration. The parameters set by this command are\n"
1910 "applied by the frbtinitU command. Once frbtinit is called, it is no\n"
1911 "longer possible to change the parameters.\n"
1915 " --> frbtcfgfifo slot0 depth5 AB cyc0 max20 rejnull accstat int1\n"
1916 " frbtcfgfifo slot0 depth5 AB cyc0 max20 rejnull accstat int1\n",
1917 CMD_HANDLER(cmd_do_fr_config_fifo), (void *)&cmd_list_fr_basic_test
1920 /** Command descriptor for FlexRay init command */
1921 cmd_des_t const cmd_des_fr_init={
1923 "frbtinit?","Initialize a FlexRay node",
1924 "=== Command syntax ===\n"
1928 "where <CFG> identifies the configuration to use. It can be one of A, B\n"
1929 "or U. The A and B are predefined configurations. If U is specified,\n"
1930 "the user configuration previously set by frbtconfig command is used.\n"
1932 "=== Description ===\n"
1934 "The command stands for Fr_Init and Fr_ControllerInit functions from\n"
1935 "the Autosar specification. It initializes the internal data structures\n"
1936 "of the driver and then, based on those data, the controller\n"
1937 "configuration is done. During the controller configuration the\n"
1938 "parameters of the cluster, node, message RAM and buffers are checked.\n"
1939 "If anything goes bad, the command returns an error number, which can\n"
1940 "be decoded by macros defined in driver header file fr_tms570.h with\n"
1941 "prefix ERR_PARAM. If all parameters are OK, all necessary registers of\n"
1942 "the controller are initialized according to the specified\n"
1943 "configuration parameters. At the end of the command, the FlexRay\n"
1944 "controller is switched into READY state and all buffers are configured\n"
1945 "to send NULL frames. This command should be called as the very first\n"
1946 "command, when trying to communicate over the FlexRay bus.\n"
1951 " FlexRay driver initialized.\n"
1952 " FlexRay controller initialized.\n",
1953 CMD_HANDLER(cmd_do_fr_init), (void *)&cmd_list_fr_basic_test
1956 /** Command descriptor for FlexRay controller init command */
1957 cmd_des_t const cmd_des_fr_start={
1959 "frbtstart","Start a new FlexRay network or join to the existing one",
1960 "=== Command syntax ===\n"
1964 "=== Description ===\n"
1966 "The command stands for Fr_StartCommunication function from the Autosar\n"
1967 "specification. If the FlexRay node is configured as a coldstarter node\n"
1968 "(as for example by frbtinitA/B command), then the command first listen\n"
1969 "on the bus. When it does not detect any existing bus communication, it\n"
1970 "tries to initiate a new network. If the initiation fails, the FlexRay\n"
1971 "controller is switched back to the ready state for another attempt\n"
1972 "(calling frbtstart again). If the FlexRay node is configured as\n"
1973 "non-coldstarter, it is listening on the bus until some existing\n"
1974 "communication is detected.\n"
1976 "The command should be called after the frbtinit command.\n"
1981 " FlexRay communication is running.\n",
1982 CMD_HANDLER(cmd_do_fr_start), (void *)&cmd_list_fr_basic_test
1985 /** Command descriptor for FlexRay controller all slots command */
1986 cmd_des_t const cmd_des_fr_allslots={
1988 "frbtallslots","Enables communication for all frames",
1989 "=== Command syntax ===\n"
1993 "=== Description ===\n"
1995 "The command stands for Fr_AllSlots function from the Autosar\n"
1998 "The node can be configured to communicate only on key frames by\n"
1999 "default (as in the case of frbtinitA/B). This command can be used to\n"
2000 "allow the communication on all configured frames. The command invokes\n"
2001 "the FlexRay POC command ALL_SLOTS which enables the communication on\n"
2002 "all frames. The command can be called after the controller\n"
2007 " --> frbtallslots\n"
2008 " FlexRay node started communication on all slots.\n",
2009 CMD_HANDLER(cmd_do_fr_allslots), (void *)&cmd_list_fr_basic_test
2012 /** Command descriptor for FlexRay controller halt command */
2013 cmd_des_t const cmd_des_fr_halt={
2015 "frbthalt","Halt FlexRay communication after the end of the actual communication cycle",
2016 "=== Command syntax ===\n"
2020 "=== Description ===\n"
2022 "The command stands for Fr_HaltCommunication function from the Autosar\n"
2023 "specification. The command invokes the FlexRay POC command HALT, which\n"
2024 "means that communication is stopped after the end of the actual\n"
2025 "communication cycle. On the opposite side, there is a frbtfreeze\n"
2026 "command, which stops the communication immediately. To start the\n"
2027 "communication again, the device has to be reset.\n"
2032 " FlexRay node communication halted.\n",
2033 CMD_HANDLER(cmd_do_fr_halt), (void *)&cmd_list_fr_basic_test
2036 /** Command descriptor for FlexRay controller abort command */
2037 cmd_des_t const cmd_des_fr_abort={
2039 "frbtabort","Abort FlexRay communication immediately",
2040 "=== Command syntax ===\n"
2044 "=== Description ===\n"
2046 "The command stands for Fr_AbortCommunication function from the Autosar\n"
2047 "specification. The command invokes the FlexRay POC command FREEZE,\n"
2048 "which means that the communication is stopped immediately. On the\n"
2049 "opposite side there is a frbthalt command, which stops the\n"
2050 "communication after the end of the actual communication cycle. To\n"
2051 "start the communication again, the device has to be reset.\n"
2056 " FlexRay node communication aborted.\n",
2057 CMD_HANDLER(cmd_do_fr_abort), (void *)&cmd_list_fr_basic_test
2060 /** Command descriptor for FlexRay controller send wake up pattern command */
2061 cmd_des_t const cmd_des_fr_sendwup={
2063 "frbtwup","Initiate the wake up procedure",
2064 "=== Command syntax ===\n"
2068 "=== Description ===\n"
2070 "The command stands for Fr_SendWUP function from the Autosar\n"
2071 "specification. It initiates the wake up procedure by switching FlexRay\n"
2072 "controller state machine to WAKEUP state.\n"
2077 " Wake up pattern has been sent.\n",
2078 CMD_HANDLER(cmd_do_fr_sendwup), (void *)&cmd_list_fr_basic_test
2081 /** Command descriptor for FlexRay controller sent wake up pattern channel command */
2082 cmd_des_t const cmd_des_fr_setwuchannel={
2084 "frbtsetwuch?","Set wake up channel",
2085 "=== Command syntax ===\n"
2087 " frbtsetwuch<CHANNEL>\n"
2089 "where <CHANNEL> is a character A or B, specifying the channel.\n"
2091 "=== Description ===\n"
2093 "The command stands for Fr_SetWakeupChannel function from the Autosar\n"
2094 "specification. Wake up channel is the channel, where Wake Up Pattern\n"
2095 "is sent. The channel can be set after the driver and controller are\n"
2096 "initialized and before the communication is running. The actual\n"
2097 "wake-up pattern is sent by the frbtwup command.\n"
2101 " --> frbtsetwuchA\n"
2102 " Wake up channel has been set.\n",
2103 CMD_HANDLER(cmd_do_fr_setwuchannel), (void *)&cmd_list_fr_basic_test
2106 /** Command descriptor for FlexRay controller get POC status command */
2107 cmd_des_t const cmd_des_fr_getpocstatus={
2109 "frbtgetpocst","Print FlexRay POC status",
2110 "=== Command syntax ===\n"
2114 "=== Description ===\n"
2116 "The command stands for Fr_GetPOCStatus function from the Autosar\n"
2117 "specification. It prints the main FlexRay POC status values in the\n"
2118 "form of a table. The command should be called after the frbtinit\n"
2123 " --> frbtgetpocst\n"
2125 " CHIHaltRequest: FALSE\n"
2126 " CHIReadyRequest: FALSE\n"
2127 " ColdstartNoise: FALSE\n"
2129 " ErrorMode: ACTIVE\n"
2131 " StartupState: UNDEFINED\n"
2133 " WakeupStatus: UNDEFINED\n",
2134 CMD_HANDLER(cmd_do_fr_getpocstatus), (void *)&cmd_list_fr_basic_test
2137 /** Command descriptor for FlexRay transmit tx lpdu command */
2138 cmd_des_t const cmd_des_fr_transmittxlpdu={
2140 "frbttransmit*","Transmit data in selected frame",
2141 "=== Command syntax ===\n"
2143 " frbttransmit<FRID> <DATA>\n"
2145 "* <FRID> is a decimal number specifying the ID of the frame for which a buffer has been configured.\n"
2146 "* <DATA> is a sequence of hexadecimal numbers separated by spaces. Each number represents one byte of the message.\n"
2148 "=== Description ===\n"
2150 "The command stands for Fr_TransmitTxLPdu function from the Autosar\n"
2151 "specification. The command finds the first buffer assigned to the\n"
2152 "specified frame ID and copies the given data into its data section in\n"
2153 "the message RAM. Transmit request is set after the data are copied, so\n"
2154 "transmission starts at the next occurrence of the frame in the\n"
2155 "communication cycle.\n"
2159 " --> frbttransmit1 12 34 56 AA BB CC\n"
2160 " Data were set for transmission.\n",
2161 CMD_HANDLER(cmd_do_fr_transmittxlpdu), (void *)&cmd_list_fr_basic_test
2164 /** Command descriptor for FlexRay cancel tx lpdu command */
2165 cmd_des_t const cmd_des_fr_canceltxlpdu={
2167 "frbtcanceltx*","Stop the transmission of the frame",
2168 "=== Command syntax ===\n"
2170 " frbtcanceltx<FRID>\n"
2172 "where <FRID> is a decimal number specifying the ID of the frame for\n"
2173 "which a buffer has been configured.\n"
2175 "=== Description ===\n"
2177 "The command stands for Fr_CancelTxLPdu function from the Autosar\n"
2178 "specification. The command finds all buffers assigned to the specified\n"
2179 "frame ID and reconfigures them to stop transmitting data. The command\n"
2180 "finishes successfully only if reconfiguration is allowed in message\n"
2181 "RAM configuration (secureBuffers configuration parameter). Only TX\n"
2182 "buffers and buffers not used for startup frames can be canceled.\n"
2186 " --> frbtcanceltx3\n"
2187 " Transmission canceled.\n",
2188 CMD_HANDLER(cmd_do_fr_canceltxlpdu), (void *)&cmd_list_fr_basic_test
2191 /** Command descriptor for FlexRay receive rx lpdu command */
2192 cmd_des_t const cmd_des_fr_receiverxlpdu={
2194 "frbtreceive*","Receive a new message",
2195 "=== Command syntax ===\n"
2197 " frbtreceive<FRID>\n"
2199 "where <FRID> is a decimal number specifying the ID of the frame for\n"
2200 "which a buffer was configured.\n"
2202 "=== Description ===\n"
2204 "The command stands for Fr_ReceiveRxLPdu function from the Autosar\n"
2205 "specification. The command finds the first buffer assigned to the\n"
2206 "specified frame ID, determines if a new message has been received and\n"
2207 "reads it out of the buffer. If no message was received, \"No message\n"
2208 "received\" is printed. If a new message was received, all message data\n"
2209 "are printed as a hexadecimal values. If a new message was retrieved\n"
2210 "from a FIFO buffer and more messages are available in it, \"More\n"
2211 "messages are still in FIFO\" is printed.\n"
2215 " --> frbtreceive0\n"
2216 " More messages are still in FIFO:\n"
2217 " Received message (32 B):\n"
2218 " ee ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n",
2219 CMD_HANDLER(cmd_do_fr_receiverxlpdu), (void *)&cmd_list_fr_basic_test
2222 /** Command descriptor for FlexRay check TX LPdu status command */
2223 cmd_des_t const cmd_des_fr_checktxlpdustatus={
2225 "frbtchecktx*","Print the status of the transmit buffer",
2226 "=== Command syntax ===\n"
2228 " frbtchecktx<FRID>\n"
2230 "where <FRID> is a decimal number specifying the ID of the frame for\n"
2231 "which a buffer has been configured.\n"
2233 "=== Description ===\n"
2235 "The command stands for Fr_CheckTxLPduStatus function from the Autosar\n"
2236 "specification. The command finds the first buffer assigned to the\n"
2237 "specified frame ID, reads its status and prints it. The buffer can be\n"
2238 "in one of the two states:\n"
2239 "* Message transmission is pending, which means that the buffer has not yet sent its message in single shot mode or that it is in continuous mode.\n"
2240 "* No message transmission is pending, which means that the buffer is in single shot mode and the message has already been sent.\n"
2244 " --> frbtchecktx1\n"
2245 " Message transmission is not pending.\n",
2246 CMD_HANDLER(cmd_do_fr_checktxlpdustatus), (void *)&cmd_list_fr_basic_test
2249 /** Command descriptor for FlexRay disable LPdu command */
2250 cmd_des_t const cmd_des_fr_disablelpdu={
2252 "frbtdisable*","Disable the buffers assigned to the frame",
2253 "=== Command syntax ===\n"
2255 " frbtdisable<FRID>\n"
2257 "where <FRID> is a decimal number specifying the ID of a frame. The\n"
2258 "buffers configure for this frame will be disabled.\n"
2260 "=== Description ===\n"
2262 "The command stands for Fr_DisableLPdu function from the Autosar\n"
2263 "specification. The command finds all buffers assigned to the specified\n"
2264 "frame ID and disables them. This means that those buffers will be\n"
2265 "unavailable for the communication until their reconfiguration (which\n"
2266 "is not yet implemented). Buffers used for startup frames and FIFO RX\n"
2267 "buffers cannot be disabled.\n"
2271 " --> frbtdisable3\n"
2272 " Buffer disabled.\n",
2273 CMD_HANDLER(cmd_do_fr_disablelpdu), (void *)&cmd_list_fr_basic_test
2276 /** Command descriptor for FlexRay get global time command */
2277 cmd_des_t const cmd_des_fr_getglobaltime={
2279 "frbtglobtime","Print actual global time of the network",
2280 "=== Command syntax ===\n"
2284 "=== Description ===\n"
2286 "The command stands for Fr_GetGlobalTime function from the Autosar\n"
2287 "specification. The command prints the time as a number of the current\n"
2288 "cycle and the offset in the cycle in macroticks.\n"
2292 " --> frbtglobtime\n"
2293 " Cycle number: 23\n"
2294 " Macrotick number: 6\n",
2295 CMD_HANDLER(cmd_do_fr_getglobaltime), (void *)&cmd_list_fr_basic_test
2298 /** Command descriptor for FlexRay get network management vector command */
2299 cmd_des_t const cmd_des_fr_getnmvector={
2301 "frbtnmvector","Print network management vector of the node",
2302 "=== Command syntax ===\n"
2306 "=== Description ===\n"
2308 "The command stands for Fr_GetNmVector function from the Autosar\n"
2309 "specification. It prints the values of the network management vector\n"
2310 "as hexadecimal numbers.\n"
2314 " --> frbtnmvector\n"
2315 " Network management vector: 0 0 0 0 0 0 0 0 0 0 0 0\n",
2316 CMD_HANDLER(cmd_do_fr_getnmvector), (void *)&cmd_list_fr_basic_test
2319 /** Command descriptor for FlexRay get network management vector command */
2320 cmd_des_t const cmd_des_fr_nmwatch={
2322 "frbtnmwatch","Watch the changes of the network managment vector in real-time",
2323 "=== Command syntax ===\n"
2327 "=== Description ===\n"
2329 "Reads the network management vector every 100 ms and prints it out.\n"
2333 " --> frbtnmwatch\n"
2334 " Network management vector: 0 0 0 0 0 0 0 0 0 0 0 0\n",
2335 CMD_HANDLER(cmd_do_fr_nmwatch), (void *)&cmd_list_fr_basic_test
2338 /** Command descriptor for FlexRay get channel status command */
2339 cmd_des_t const cmd_des_fr_getchannelstatus={
2341 "frbtchstat","Print channel A and B status",
2342 "=== Command syntax ===\n"
2346 "=== Description ===\n"
2348 "The command stands for Fr_GetChannelStatus function from the Autosar\n"
2354 " Channel A status:\n"
2355 " aggregated channel status vSS!ValidFrame: TRUE\n"
2356 " aggregated channel status vSS!SyntaxError: FALSE\n"
2357 " aggregated channel status vSS!ContentError: FALSE\n"
2358 " aggregated channel status additional communication: FALSE\n"
2359 " aggregated channel status vSS!Bviolation: FALSE\n"
2360 " aggregated channel status vSS!TxConflict: FALSE\n"
2361 " Not used (0): FALSE\n"
2362 " Not used (0): FALSE\n"
2363 " symbol window status data vSS!ValidMTS: FALSE\n"
2364 " symbol window status data vSS!SyntaxError: FALSE\n"
2365 " symbol window status data vSS!Bviolation: FALSE\n"
2366 " symbol window status data vSS!TxConflict: FALSE\n"
2367 " NIT status data vSS!SyntaxError: FALSE\n"
2368 " NIT status data vSS!Bviolation: FALSE\n"
2369 " Not used (0): FALSE\n"
2370 " Not used (0): FALSE\n"
2371 " Channel B status:\n"
2372 " aggregated channel status vSS!ValidFrame: TRUE\n"
2373 " aggregated channel status vSS!SyntaxError: FALSE\n"
2374 " aggregated channel status vSS!ContentError: FALSE\n"
2375 " aggregated channel status additional communication: FALSE\n"
2376 " aggregated channel status vSS!Bviolation: FALSE\n"
2377 " aggregated channel status vSS!TxConflict: FALSE\n"
2378 " Not used (0): FALSE\n"
2379 " Not used (0): FALSE\n"
2380 " symbol window status data vSS!ValidMTS: FALSE\n"
2381 " symbol window status data vSS!SyntaxError: FALSE\n"
2382 " symbol window status data vSS!Bviolation: FALSE\n"
2383 " symbol window status data vSS!TxConflict: FALSE\n"
2384 " NIT status data vSS!SyntaxError: FALSE\n"
2385 " NIT status data vSS!Bviolation: FALSE\n"
2386 " Not used (0): FALSE\n"
2387 " Not used (0): FALSE\n",
2388 CMD_HANDLER(cmd_do_fr_getchannelstatus), (void *)&cmd_list_fr_basic_test
2391 /** Command descriptor for FlexRay get clock correction command */
2392 cmd_des_t const cmd_des_fr_getclockcorrection={
2394 "frbtclkcor","Print clock correction (rate and offset)",
2395 "=== Command syntax ===\n"
2399 "=== Description ===\n"
2401 "The command stands for Fr_GetClockCorrection function from the Autosar\n"
2407 " Rate correction: 0\n"
2408 " Offset correction: 0\n",
2409 CMD_HANDLER(cmd_do_fr_getclockcorrection), (void *)&cmd_list_fr_basic_test
2412 /** Command descriptor for FlexRay get sync frame list command */
2413 cmd_des_t const cmd_des_fr_getsyncframelist={
2415 "frbtgetsyncfrlist*","Print the list of sync frames transmitted on both channels via the odd and even communication cycle",
2416 "=== Command syntax ===\n"
2418 " frbtgetsyncfrlist<LENGTH>\n"
2420 "where <LENGTH> is a decimal number in range 0 - 15, specifying the\n"
2421 "length of the list to be printed.\n"
2423 "=== Description ===\n"
2425 "The command stands for Fr_GetSyncFrameList function from the Autosar\n"
2430 " --> frbtgetsyncfrlist2\n"
2431 " | Channel A even | channel B even | channel A odd | channel B odd |\n"
2432 " |----------------|----------------|----------------|----------------|\n"
2433 " | 1 | 1 | 1 | 1 |\n"
2434 " | 2 | 2 | 2 | 2 |\n"
2435 " |----------------|----------------|----------------|----------------|\n",
2436 CMD_HANDLER(cmd_do_fr_getsyncframelist), (void *)&cmd_list_fr_basic_test
2439 /** Command descriptor for FlexRay get sync frame list command */
2440 cmd_des_t const cmd_des_fr_getwakeuprxstatus={
2442 "frbtgetwurxstat","Prints whether the wake up pattern has been or has not been received",
2443 "=== Command syntax ===\n"
2445 " frbtgetwurxstat\n"
2447 "=== Description ===\n"
2449 "The command stands for Fr_GetWakeupRxStatus function from the Autosar\n"
2450 "specification. The status of the wake up receiving is bitcoded in the\n"
2451 "controller. This command decodes and prints it in a readable format.\n"
2455 " --> frbtgetwurxstat\n"
2456 " Wake up pattern was not yet received on channel A.\n"
2457 " Wake up pattern was not yet received on channel B.\n",
2458 CMD_HANDLER(cmd_do_fr_getwakeuprxstatus), (void *)&cmd_list_fr_basic_test
2461 /** Command descriptor for FlexRay set absolute timer command */
2462 cmd_des_t const cmd_des_fr_settimer={
2464 "frbtsettimer*","Set and start timer",
2465 "=== Command syntax ===\n"
2467 " frbtsettimer<TMID> <CYCLE> <OFFSET>\n"
2469 "* <TMID> is a number (0, 1) specifying the timer.\n"
2470 "* <CYCLE> is a 7-bit number (0 - 127) specifying the set of cycles, in which timer interrupt should be requested. The first set bit determines the period (1, 2, ..., 64) and the lower bits determine the offset in cycles within the period.\n"
2471 "* <OFFSET> is a decimal number (0 - 16383) specifying the offset in macroticks, where precisely in the cycle should be the timer interrupt requested.\n"
2473 "=== Description ===\n"
2475 "The command is similar to Fr_SetAbsoluteTimer function from the\n"
2476 "Autosar specification. The difference is that the command allows to\n"
2477 "specify a set of cycles, not only one of 64 cycles. It sets the timer\n"
2478 "selected by the parameter and enables it.\n"
2480 "Before using this command, FlexRay communication has to be started\n"
2481 "(see frbtstart).\n"
2485 " --> frbtsettimer0 32 50\n"
2486 " Timer was set for every 32-th cycle, offset 0, macrotick 50\n"
2487 " --> frbtsettimer0 31 50\n"
2488 " Timer was set for every 16-th cycle, offset 15, macrotick 50\n"
2489 " --> frbtsettimer0 0x42 0\n"
2490 " Timer was set for every 64-th cycle, offset 2, macrotick 0\n",
2491 CMD_HANDLER(cmd_do_fr_settimer), (void *)&cmd_list_fr_basic_test
2494 /** Command descriptor for FlexRay cancel absolute timer command */
2495 cmd_des_t const cmd_des_fr_canceltimer={
2497 "frbtcanceltimer*","Stop the timer",
2498 "=== Command syntax ===\n"
2500 " frbtcanceltimer<TMID>\n"
2501 "where <TMID> is a number (0 or 1) specifying the timer.\n"
2503 "=== Description ===\n"
2505 "The command stands for Fr_CancelAbsoluteTimer function from the\n"
2506 "Autosar specification. It stops the timer selected by the parameter.\n"
2510 " --> frbtcanceltimer0\n"
2511 " Timer was canceled.\n",
2512 CMD_HANDLER(cmd_do_fr_canceltimer), (void *)&cmd_list_fr_basic_test
2515 /** Command descriptor for FlexRay absolute timer irq manipulation command */
2516 cmd_des_t const cmd_des_fr_timerirq={
2518 "frbttimerirq*","Perform selected action on the timer IRQ",
2519 "=== Command syntax ===\n"
2521 " frbttimerirq<TMID> <ACTION> - Run the <ACTION> on specified timer\n"
2522 " frbttimerirq<TMID> - Get timer IRQ status\n"
2525 "* <TMID> is a number (0, 1) specifying the timer.\n"
2526 "* where <ACTION> is a string specifying the action to be performed on the selected timer IRQ.\n"
2528 "<ACTIONS> can be one of:\n"
2529 "* EN - Enable the IRQ on the selected timer\n"
2530 "* DIS - Disable the IRQ on the selected timer\n"
2531 "* ACK - Acknowledge the IRQ on the selected timer (reset flag in the register).\n"
2533 "=== Description ===\n"
2535 "The command stands for Fr_EnableAbsoluteTimerIRQ,\n"
2536 "Fr_AckAbsoluteTimerIRQ, Fr_DisableAbsoluteTimerIRQ and\n"
2537 "Fr_GetAbsoluteTimerIRQStatus functions from the Autosar specification.\n"
2538 "It masks or demasks the IRQ for the timer, or acknowledges the\n"
2539 "interrupt request. If no action is specified it prints whether the IRQ\n"
2540 "is pending for the timer.\n"
2544 " --> frbttimerirq0\n"
2547 " --> frbttimerirq0 EN\n"
2549 CMD_HANDLER(cmd_do_fr_timerirq), (void *)&cmd_list_fr_basic_test
2552 /** Command descriptor for FlexRay get version info command */
2553 cmd_des_t const cmd_des_fr_getversioninfo={
2555 "frbtversion","Print FlexRay driver version information",
2556 "=== Command syntax ===\n"
2560 "=== Description ===\n"
2562 "The command stands for Fr_GetVersionInfo function from the Autosar\n"
2564 "It reads and prints the information about vendor, module and version of\n"
2565 "the FlexRay driver\n"
2569 " --> frbtversion\n"
2570 " vendorID: 0xAAAA\n"
2571 " moduleID: 0xBBBB\n"
2572 " sw_major_version: 0x1\n"
2573 " sw_minor_version: 0x2\n"
2574 " sw_patch_version: 0x4\n",
2575 CMD_HANDLER(cmd_do_fr_getversioninfo), (void *)&cmd_list_fr_basic_test
2578 /** Command descriptor for FlexRay get controller configuration command */
2579 cmd_des_t const cmd_des_fr_readcconfig={
2581 "frbtccconfig*","Print value of a FlexRay cluster and node configuration parameter",
2582 "=== Command syntax ===\n"
2584 " frbtccconfig<INDEX>\n"
2586 "where <INDEX> is an identifier of the parameter.\n"
2588 "=== Description ===\n"
2590 "The command stands for Fr_ReadCCConfig function from the Autosar\n"
2591 "specification. The driver stores the configuration parameters as an\n"
2592 "array. Each parameter can be indexed and returned by this command. See\n"
2593 "Autosar specification of the FlexRay driver\n"
2594 "(http://www.autosar.org/download/R4.1/AUTOSAR_SWS_FlexRayDriver.pdf),\n"
2595 "section 8.2.1 for parameter indexes.\n"
2599 " --> frbtccconfig1\n"
2601 CMD_HANDLER(cmd_do_fr_readcconfig), (void *)&cmd_list_fr_basic_test
2604 /** List of commands for flexRay, defined as external */
2605 cmd_des_t const *cmd_list_fr_basic_test[]={
2606 &cmd_des_fr_user_config,
2607 &cmd_des_fr_config_buffer,
2608 &cmd_des_fr_config_fifo,
2611 &cmd_des_fr_allslots,
2614 &cmd_des_fr_sendwup,
2615 &cmd_des_fr_setwuchannel,
2616 &cmd_des_fr_getpocstatus,
2617 &cmd_des_fr_transmittxlpdu,
2618 &cmd_des_fr_canceltxlpdu,
2619 &cmd_des_fr_receiverxlpdu,
2620 &cmd_des_fr_checktxlpdustatus,
2621 &cmd_des_fr_disablelpdu,
2622 &cmd_des_fr_getglobaltime,
2623 &cmd_des_fr_getnmvector,
2624 &cmd_des_fr_nmwatch,
2625 &cmd_des_fr_getchannelstatus,
2626 &cmd_des_fr_getclockcorrection,
2627 &cmd_des_fr_getsyncframelist,
2628 &cmd_des_fr_getwakeuprxstatus,
2629 &cmd_des_fr_settimer,
2630 &cmd_des_fr_canceltimer,
2631 &cmd_des_fr_timerirq,
2632 &cmd_des_fr_getversioninfo,
2633 &cmd_des_fr_readcconfig,