]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/commitdiff
FlexRay config FIFO command updated, default configuration structures updated, demo...
authorMichal Horn <hornmich@fel.cvut.cz>
Tue, 17 Sep 2013 12:54:14 +0000 (14:54 +0200)
committerMichal Horn <hornmich@fel.cvut.cz>
Tue, 17 Sep 2013 12:54:14 +0000 (14:54 +0200)
rpp-lib
rpp-test-sw/commands/cmd_fr_basic_test.c
rpp-test-sw/commands/fray_demo.txt

diff --git a/rpp-lib b/rpp-lib
index 540efa4ccc80275575a0bc20c94785962f186dea..7721912500a51b0274d2163c205960a62dab8b37 160000 (submodule)
--- a/rpp-lib
+++ b/rpp-lib
@@ -1 +1 @@
-Subproject commit 540efa4ccc80275575a0bc20c94785962f186dea
+Subproject commit 7721912500a51b0274d2163c205960a62dab8b37
index 84ad56a8e280846cbf426b3d89e5800e53d6b357..5846fccd5af7962194f11dee5620298bf4d031ca 100644 (file)
@@ -177,6 +177,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_A_static_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = TRUE,
                .maxPayload = 9,
                .msgBufferInterrupt = TRUE,
@@ -189,6 +190,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_A_static_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 9,
                .msgBufferInterrupt = TRUE,
@@ -201,6 +203,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_A_static_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = TRUE,
                .maxPayload = 9,
                .msgBufferInterrupt = TRUE,
@@ -213,6 +216,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_A_static_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 9,
                .msgBufferInterrupt = TRUE,
@@ -225,6 +229,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_A_static_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = TRUE,
                .maxPayload = 9,
                .msgBufferInterrupt = TRUE,
@@ -241,6 +246,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_static_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = TRUE,
                .maxPayload = 9,
                .msgBufferInterrupt = TRUE,
@@ -253,6 +259,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_static_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 9,
                .msgBufferInterrupt = TRUE,
@@ -265,6 +272,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_static_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = TRUE,
                .maxPayload = 9,
                .msgBufferInterrupt = TRUE,
@@ -277,6 +285,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_static_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 9,
                .msgBufferInterrupt = TRUE,
@@ -289,6 +298,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_static_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 9,
                .msgBufferInterrupt = TRUE,
@@ -304,6 +314,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_A_dynamic_buffers_config[] = {
        {
                .channel = FR_CHANNEL_A,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = TRUE,
                .maxPayload = 64,
                .msgBufferInterrupt = TRUE,
@@ -316,6 +327,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_A_dynamic_buffers_config[] = {
        {
                .channel = FR_CHANNEL_B,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 32,
                .msgBufferInterrupt = TRUE,
@@ -328,6 +340,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_A_dynamic_buffers_config[] = {
        {
                .channel = FR_CHANNEL_A,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = TRUE,
                .maxPayload = 16,
                .msgBufferInterrupt = TRUE,
@@ -344,6 +357,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_dynamic_buffers_config[] = {
        {
                .channel = FR_CHANNEL_B,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = TRUE,
                .maxPayload = 32,
                .msgBufferInterrupt = TRUE,
@@ -356,6 +370,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_dynamic_buffers_config[] = {
        {
                .channel = FR_CHANNEL_A,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 64,
                .msgBufferInterrupt = TRUE,
@@ -368,6 +383,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_dynamic_buffers_config[] = {
        {
                .channel = FR_CHANNEL_A,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = TRUE,
                .maxPayload = 9,
                .msgBufferInterrupt = TRUE,
@@ -383,6 +399,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_A_fifo_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 127,
                .msgBufferInterrupt = FALSE, // Recomended for FIFO buffers
@@ -395,6 +412,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_A_fifo_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 127,
                .msgBufferInterrupt = FALSE, // Recomended for FIFO buffers
@@ -407,6 +425,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_A_fifo_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 127,
                .msgBufferInterrupt = FALSE, // Recomended for FIFO buffers
@@ -419,6 +438,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_A_fifo_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 127,
                .msgBufferInterrupt = FALSE, // Recomended for FIFO buffers
@@ -431,6 +451,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_A_fifo_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 127,
                .msgBufferInterrupt = FALSE, // Recomended for FIFO buffers
@@ -446,6 +467,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_fifo_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 64,
                .msgBufferInterrupt = FALSE, // Recommended for FIFO buffers
@@ -458,6 +480,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_fifo_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 64,
                .msgBufferInterrupt = FALSE, // Recommended for FIFO buffers
@@ -470,6 +493,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_fifo_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 64,
                .msgBufferInterrupt = FALSE, // Recommended for FIFO buffers
@@ -482,6 +506,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_fifo_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 64,
                .msgBufferInterrupt = FALSE, // Recommended for FIFO buffers
@@ -494,6 +519,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_fifo_buffers_config[] = {
        {
                .channel = FR_CHANNEL_AB,
                .cycleCounterFiltering = 0,
+               .fidMask = 0,
                .isTx = FALSE,
                .maxPayload = 64,
                .msgBufferInterrupt = FALSE, // Recommended for FIFO buffers
@@ -549,7 +575,7 @@ static Fr_ConfigType user_configuration = {
 };;
 
 #define USER_CONFIG_NOT_DONE           0x0
-#define USER_CONFIG_CLUSTER            0x1
+#define USER_CONFIG_CLUSTER                    0x1
 #define USER_CONFIG_NODE                       0x2
 
 static uint8_t user_configuration_state = USER_CONFIG_NOT_DONE;
@@ -682,7 +708,7 @@ 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;
+       unsigned depth, slot, cycleset, maxpayload, mask;
        Fr_TMS570LS_BufferConfigType tmp_buffer;
 
        if (fr_initialized) {
@@ -690,8 +716,9 @@ int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
                return -CMDERR_BADCFG;
        }
 
-       ret = sscanf(param[2], "slot%i depth%i %2s cyc%i max%i %10s %10s",
+       ret = sscanf(param[2], "rejslot%i slotmask%i depth%i %2s cyc%i max%i %10s %10s",
                     &slot,
+                    &mask,
                     &depth,
                     channel,
                     &cycleset,
@@ -699,7 +726,7 @@ int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
                     rej_null_frames,
                     rej_static_frames
                     );
-       if (ret != 7) {
+       if (ret != 8) {
                printf("Error parsing parameter %d\n", ret+1);
                return -CMDERR_BADPAR;
        }
@@ -711,6 +738,9 @@ int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
        if (slot > 2047)
                return badpar("Invalid slot number\n");
        tmp_buffer.slotId = slot;
+       if (slot > 2047)
+               return badpar("Invalid mask\n");
+       tmp_buffer.fidMask = mask;
        if (strcmp(channel, "A") == 0) tmp_buffer.channel = FR_CHANNEL_A;
        else if (strcmp(channel, "B") == 0) tmp_buffer.channel = FR_CHANNEL_B;
        else if (strcmp(channel, "AB") == 0) tmp_buffer.channel = FR_CHANNEL_AB;
@@ -736,6 +766,7 @@ int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
 
        for (i = 0; i < user_fifo_buffer_depth; i++) {
                fifo_buffer_ptr[i].slotId = tmp_buffer.slotId;  
+               fifo_buffer_ptr[i].fidMask = tmp_buffer.fidMask;
                fifo_buffer_ptr[i].maxPayload = tmp_buffer.maxPayload;
                fifo_buffer_ptr[i].channel= tmp_buffer.channel;
                fifo_buffer_ptr[i].cycleCounterFiltering = tmp_buffer.cycleCounterFiltering;
@@ -747,8 +778,9 @@ int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
                fifo_buffer_ptr[i].msgBufferInterrupt = 0;
        }
 
-       printf("frbtcfgfifo slot%i depth%i %2s cyc%i max%i %10s %10s\n",
+       printf("frbtcfgfifo rejslot%i slotmask%i depth%i %2s cyc%i max%i %10s %10s\n",
                     slot,
+                    mask,
                     depth,
                     channel,
                     cycleset,
@@ -1972,16 +2004,16 @@ cmd_des_t const cmd_des_fr_config_fifo={
        "frbtcfgfifo*","Configure a RX FIFO message buffer in the user configuration",
        "=== Command syntax ===\n"
        "\n"
-       "   frbtcfgfifo slot<SLOT> depth<DEPTH> <CHN> cyc<CYC> max<MAX> <REJNULL> <REJSTAT> int<INT>\n"
+       "   frbtcfgfifo rejslot<SLOT> slotmask<MASK> depth<DEPTH> <CHN> cyc<CYC> max<MAX> <REJNULL> <REJSTAT>\n"
        "where\n"
-       "* <SLOT> is the number of the slot,\n"
+       "* <SLOT> is the number of the slot that will be rejected. If it is 0, no slot will be rejected,\n"
+       "* <MASK> is a number specifying which bits of the <SLOT> will be ignored,"
        "* <DEPTH> is a number specifying the depth of the FIFO,\n"
        "* <CHN> is one of 'A', 'B' or 'AB' and identifies the used channel,\n"
        "* <CYC> is the cycle set when to send the buffer,\n"
        "* <MAX> is the number determining the maximum payload (in hald-words),\n"
        "* <REJNULL> is a string \"rejnull\" for rejecting NULL frames or \"accnull\" for accepting NULL frames,\n"
        "* <REJSTAT> is a string \"rejstat\" for rejecting frames in static segment or \"accstat\" for accepting frames from static segment,\n"
-       "* <INT> is 0 or 1 and is currently ignored.\n"
        "\n"
        "=== Description ===\n"
        "\n"
@@ -1989,11 +2021,13 @@ cmd_des_t const cmd_des_fr_config_fifo={
        "in user configuration. The parameters set by this command are\n"
        "applied by the frbtinitU command. Once frbtinit is called, it is no\n"
        "longer possible to change the parameters.\n"
+       "Those messages, which are not accepted by any other buffer and pass the\n"
+       "FIFO rejection filter will be stored in the RX FIFO buffer.\n"
        "\n"
        "=== Example ===\n"
        "\n"
-       "   --> frbtcfgfifo slot0 depth5 AB cyc0 max20 rejnull accstat int1\n"
-       "   frbtcfgfifo slot0 depth5 AB cyc0 max20  rejnull accstat int1\n",
+       "   --> frbtcfgfifo rejslot6 slotmask6 depth5 AB cyc0 max0x20 rejnull accstat\n"
+       "   frbtcfgfifo rejslot6 slotmask6 depth5 AB cyc0 max0x20 rejnull accstat\n",
        CMD_HANDLER(cmd_do_fr_config_fifo), (void *)&cmd_list_fr_basic_test
 };
 
index baf803fdd44f360b12a2809d0604913be4bf5a96..bb21a1a3f4a4f6893abeae582da227b4a2f252d5 100644 (file)
@@ -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
+       frbtcfgfifo rejslot0 slotmask0 depth5 AB cyc0 max0x20 rejnull accstat
        # FlexRay start
        frbtinitU
        frbtstart
@@ -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 AB cyc0 max0x20 rejnull accstat
+       frbtcfgfifo rejslot0 slotmask0 depth5 AB cyc0 max0x20 rejnull accstat
        # FlexRay start
        frbtinitU
        frbtstart
@@ -186,7 +186,7 @@ Node C is sending a message in single shot mode in slot 6. This message is recei
        frbtcfgbufS2 slot4 AB cyc0 rx max9 single ppi0 int1
        ## RX FIFO buffer
        #              dpt ch  cyc  pl  rnf rsf fid
-       frbtconfigfifo 0x5 0x2 0x0 0x20 0x1 0x0 0x0
+       frbtcfgfifo rejslot0 slotmask0 depth5 AB cyc0 max0x20 rejnull accstat
        # FlexRay start
        frbtinitU
        frbtstart
@@ -244,37 +244,3 @@ Node B:
        frbtreceive0
        frbtreceive0
        frbtreceive0
-
-
-
-       #Node A configuration
-       frbtconfigcluster 0x2 0xF 0x15E0 0xF 0xF 0xC 0x15A 0x8 0xAE4 0x9 0xF 0x4 0x43 0x1 0x4 0x2 0xAE3 0x0 0x56 0xA 0x12 0x12 0x4C 0xB4 0x3C
-       frbtconfignode 0x0 0xF 0x2 0x1 0x3 0x3 0x0 0x0 0x1 0x1 0x10D 0x6 0x6 0x18 0x18 0x36B00 0xCD 0x151 0x0 0x1 0x0 0x2 0x81 0x36DA2 0x151 0x33 0x0 0x0
-       ## Stat buffer TX - continuous mode
-       frbtcfgbufS0 slot1 AB cyc0 tx max9 single ppi0 int1
-       ## RX FIFO buffer
-       frbtcfgfifo slot0 depth1 AB cyc0 max0x20 rejnull accstat
-       # FlexRay start
-       frbtinitU
-       frbtstart
-       frbtallslots
-
-       #Node B configuration
-       frbtconfigcluster 0x2 0xF 0x15E0 0xF 0xF 0xC 0x15A 0x8 0xAE4 0x9 0xF 0x4 0x43 0x1 0x4 0x2 0xAE3 0x0 0x56 0xA 0x12 0x12 0x4C 0xB4 0x3C
-       frbtconfignode 0x0 0xF 0x2 0x1 0x3 0x3 0x0 0x0 0x1 0x1 0x10D 0x6 0x6 0x18 0x18 0x36B00 0xCD 0x151 0x0 0x1 0x0 0x2 0x81 0x36DA2 0x151 0x33 0x0 0x0
-       ## Stat buffer TX - continuous mode
-       frbtcfgbufS0 slot2 AB cyc0 tx max9 single ppi0 int1
-       ## RX FIFO buffer
-       frbtcfgfifo slot0 depth1 AB cyc0 max0x20 rejnull accstat
-       # FlexRay start
-       frbtinitU
-       frbtstart
-       frbtallslots
-
-       frbttransmit1 AA BB CC
-
-       frbttransmit2 CC BB AA
-
-       frbtreceive0
-
-