]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/commitdiff
FlexRay commands description for halt, abort and restart communication modified,...
authorMichal Horn <hornmich@fel.cvut.cz>
Wed, 11 Sep 2013 14:07:24 +0000 (16:07 +0200)
committerMichal Horn <hornmich@fel.cvut.cz>
Wed, 11 Sep 2013 14:07:24 +0000 (16:07 +0200)
commands/cmd_fr_basic_test.c
commands/fray_demo.txt
rpp-lib

index 454b81487b163d5146b6e6d5fb53c6ef32244514..3daea06a51572d61983678127fb750626949a828 100644 (file)
@@ -91,7 +91,7 @@ static Fr_TMS570LS_ClusterConfigType Fr_cluster_config = {
  */
 static Fr_TMS570LS_NodeConfigType Fr_node_A_config = {
        .pAllowHaltDueToClock = 0,
-       .pAllowPassiveToActive = FALSE,
+       .pAllowPassiveToActive = 0xF,
        .pChannels = FR_CHANNEL_AB,
        .pClusterDriftDamping = 0x1,
        .pDelayCompensationA = 0x3,
@@ -126,7 +126,7 @@ static Fr_TMS570LS_NodeConfigType Fr_node_A_config = {
  */
 static Fr_TMS570LS_NodeConfigType Fr_node_B_config = {
                .pAllowHaltDueToClock = 0,
-               .pAllowPassiveToActive = FALSE,
+               .pAllowPassiveToActive = 0xF,
                .pChannels = FR_CHANNEL_AB,
                .pClusterDriftDamping = 0x1,
                .pDelayCompensationA = 0x3,
@@ -678,20 +678,19 @@ int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
        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;
        }
@@ -726,10 +725,6 @@ int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
                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;
@@ -740,18 +735,17 @@ int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
                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;
@@ -932,8 +926,15 @@ int cmd_do_fr_init(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
                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);
@@ -2022,9 +2023,7 @@ cmd_des_t const cmd_des_fr_start={
        "=== 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"
@@ -2084,8 +2083,8 @@ cmd_des_t const cmd_des_fr_halt={
        "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"
@@ -2109,7 +2108,8 @@ cmd_des_t const cmd_des_fr_abort={
        "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"
index 9cd74adcf9adb54ce00b8bcc4df3bebc45393d17..9e77dbf9a737c39c7ad020882325e55f1d1f71e2 100644 (file)
@@ -33,7 +33,7 @@ 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 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
@@ -47,7 +47,7 @@ Node init:
        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
@@ -55,7 +55,7 @@ Node init:
 
        #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
@@ -69,7 +69,7 @@ Node init:
        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
@@ -77,7 +77,7 @@ Node init:
 
        #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
@@ -165,7 +165,7 @@ Node B is sending a message in single-shot mode in slot 5. This message is recei
 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
@@ -178,7 +178,7 @@ Node C is sending a message in single shot mode in slot 6. This message is recei
 
        #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
@@ -194,7 +194,7 @@ Node C is sending a message in single shot mode in slot 6. This message is recei
 
        #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
diff --git a/rpp-lib b/rpp-lib
index 37677f28fcc03f7ff2d6dc408c26833c4a1cb2f9..e28f38065bc466fdd1b880038a5368ddc50ede4c 160000 (submodule)
--- a/rpp-lib
+++ b/rpp-lib
@@ -1 +1 @@
-Subproject commit 37677f28fcc03f7ff2d6dc408c26833c4a1cb2f9
+Subproject commit e28f38065bc466fdd1b880038a5368ddc50ede4c