This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Two CAN frames reception problem in TDA4VM

Other Parts Discussed in Thread: TDA4VM

I am working on Jacinto board “TI Jacinto EVM TDA4VM [ti-processor-sdk-rtos-j721e-evm-08_06_01_03]”.

We have a problem when we implement 2 Rx frames in the software .

When we implement 1 Rx CAN Frame reception is fine, every frame is received proper.

When we configure 2 Rx CAN Frames, we see that alternative reception frames are missing. Both frames have rolling counter through which we have identified the missing frame issue.

 

Implementation background,

  • Using the structure TimerP_Params we have implemented user defined function which calls in every 10ms (even 1ms also checked)
  • In the interrupt App_mcanIntr0ISR we set a flag , based on this flag status in user defined function we process the frames based on the CAN ID.

 

What else is checked,

We have checked in the polling method by calling function MCAN_readMsgRam and checking for respective ID.

 

Please refer code snippet for 2 CAN frame implementation. [not possible to attach the file]

 

Please let me know if you would like to have more information from me ? request you to provide solution to this problem.

 

If already there is solution to this problem, request you to share the example code / code snippets / documentation.

 

Thank you so much.

  • Hello,

    Could you explain more about the background of this ?Which CAN driver PDK or MCAL? Which instance of CAN is being used ?

    Regards

    Tarun Mukesh

  • Hello ,

    We had used PDK driver.

    Following instance is used.

    #define BUILD_MCU1_0 // build only for mcu1_0 mcan0

    Following is the code modification for 2 Rx frames,

    #define APP_MCAN_STD_ID_FILTER_NUM (2U) --> earlier it was 1

       /* Initialize Rx Buffer Config params */ for 1st frame
        stdFiltelem.sfid2 = 0x0U;
        stdFiltelem.sfid1 = 0x272U; /* CANId for Rx */
        stdFiltelem.sfec = 0x07U;
        stdFiltelem.sft = 0x00U;
        /* Initialize Rx Buffer Config params */ for 2nd frame
        stdFiltelem2.sfid2 = 0x0U;
        stdFiltelem2.sfid1 = 0x270U; /* CANId for Rx */
        stdFiltelem2.sfec = 0x07U;
        stdFiltelem2.sft = 0x00U;

        /* Configure Standard ID filter element */
        MCAN_addStdMsgIDFilter(mcanInstAddr, 0U, &stdFiltelem);
        /* Configure Standard ID filter element */
        MCAN_addStdMsgIDFilter(mcanInstAddr, 1U, &stdFiltelem2);

    in the user defined callback function checking for the received ID's, which is called every 10ms periodic.

    if((rxMsg.id >> 18) == 0x270) /*frame 0x270 specific logic*/                
     {

    ___________________

    }

    if((rxMsg.id >> 18) == 0x272) /*frame 0x272 specific logic*/                
     {

    ___________________

    }

    with this combination of code every alternative frame was missed.Please provide solution.

    Please let me know if you need more information.

    Thanks.

  • Hello,

    I have received similar question earlier and the issue was resolved.In which i have given an example of 2 msg configuration. please check if that can be helpful for you.

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1233194/tda4al-q1-how-to-modify-the-filtering-mechanism-of-can/4659835#4659835

    Regards

    Tarun Mukesh

  • Hello ,

    I have done the same configuration for my frames, 0x270 and 0x272. 

    During testing we see that alternative reception frames are missing. Both frames have rolling counter through which we have identified the missing frame issue. How to overcome from this problem ?

  • Hello,

    Please Share me the logs and register dump of CAN instance Core registers. If the configuration is wrong then reception will not take place at all, If you are receiving alternatively means there might be many other issues in between.

    I have received similar question earlier and the issue was resolved.In which i have given an example of 2 msg configuration. please check if that can be helpful for you.

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1233194/tda4al-q1-how-to-modify-the-filtering-mechanism-of-can/4659835#4659835

    I have tested earlier the example with multiple SID and able to receive messages.

    Are you using TI board or any custom board ?Which CAN instance are you using? To the other side of CAN what is connected ?

    Regards

    Tarun Mukesh

  • Hello ,

    Due to high loading in lab I am unable to share the logs now, it may take around 2 -3 weeks.

    Could you please provide me how to take "CAN instance Core registers" dump ?

    Are you using TI board or any custom board ? -> Yes TI board.

    Which CAN instance are you using?-> MCU_MCAN0 is used.

    To the other side of CAN what is connected ? --> CANoE connected.

    Regards, 

    Somanatha.

  • Hello,

    Could you please provide me how to take "CAN instance Core registers" dump ?

    You can connect debugger (CCS ) to see the register dump .

    Regards

    Tarun Mukesh

  • Hello ,

    We dont have debugger with us. Please share the list of registers to measure will share the log with UART_printf.

    I have attached the Tera term and CAN logs. unable to attach CANalyser log due to 100kb size.

    0x270 frame counter=28
    0x270 frame counter=29
    0x272 frame counter=30
    0x272 frame counter=31
    0x272 frame counter=32
    0x272 frame counter=33
    0x272 frame counter=34
    0x272 frame counter=35
    0x272 frame counter=36
    0x272 frame counter=37
    0x272 frame counter=38
    0x272 frame counter=39
    0x270 frame counter=40
    0x270 frame counter=41
    0x270 frame counter=42
    0x270 frame counter=43
    0x270 frame counter=44
    0x270 frame counter=45
    0x270 frame counter=46
    0x270 frame counter=47
    0x270 frame counter=48
    0x270 frame counter=49
    0x272 frame counter=50
    0x272 frame counter=51
    0x272 frame counter=52
    0x272 frame counter=53
    0x272 frame counter=54
    0x272 frame counter=55
    0x272 frame counter=56
    0x272 frame counter=57
    0x272 frame counter=58
    0x272 frame counter=59
    0x270 frame counter=60
    0x270 frame counter=61
    0x270 frame counter=62
    0x270 frame counter=63
    0x270 frame counter=64
    0x270 frame counter=65
    0x270 frame counter=66
    0x270 frame counter=67
    0x270 frame counter=68
    0x270 frame counter=69
    0x272 frame counter=70
    0x272 frame counter=71
    0x272 frame counter=72
    0x272 frame counter=73
    0x272 frame counter=74
    0x272 frame counter=75
    0x272 frame counter=76
    0x272 frame counter=77
    0x272 frame counter=78
    0x272 frame counter=79
    0x270 frame counter=80
    0x270 frame counter=81
    0x270 frame counter=82
    0x270 frame counter=83
    0x270 frame counter=84
    0x270 frame counter=85
    0x270 frame counter=86
    0x270 frame counter=87
    0x270 frame counter=88
    0x270 frame counter=89
    0x272 frame counter=90
    0x272 frame counter=91
    0x272 frame counter=92
    0x272 frame counter=93
    0x272 frame counter=94
    0x272 frame counter=95
    0x272 frame counter=96
    0x272 frame counter=97
    0x272 frame counter=98
    0x272 frame counter=99
    0x270 frame counter=100
    0x270 frame counter=101
    0x270 frame counter=102
    0x270 frame counter=103
    0x270 frame counter=104
    0x270 frame counter=105
    0x270 frame counter=106
    0x270 frame counter=108
    0x270 frame counter=109
    0x272 frame counter=110
    0x272 frame counter=111
    0x272 frame counter=112
    0x272 frame counter=113
    0x272 frame counter=114
    0x272 frame counter=115
    0x272 frame counter=116
    0x272 frame counter=117
    0x272 frame counter=118
    0x272 frame counter=119
    0x270 frame counter=120
    0x270 frame counter=121
    0x270 frame counter=122
    0x270 frame counter=123
    0x270 frame counter=124
    0x270 frame counter=125
    0x270 frame counter=126
    0x270 frame counter=127
    0x270 frame counter=128
    0x270 frame counter=129
    0x272 frame counter=130
    0x272 frame counter=131
    0x272 frame counter=132
    0x272 frame counter=133
    0x272 frame counter=134
    0x272 frame counter=135
    0x272 frame counter=136
    0x272 frame counter=137
    0x272 frame counter=138
    0x272 frame counter=139
    0x270 frame counter=140
    0x270 frame counter=141
    0x270 frame counter=142
    0x270 frame counter=143
    0x270 frame counter=144
    0x270 frame counter=145
    0x270 frame counter=146
    0x270 frame counter=147
    0x270 frame counter=148
    0x270 frame counter=149
    0x272 frame counter=150
    0x272 frame counter=151
    0x272 frame counter=152
    0x272 frame counter=153
    0x272 frame counter=154
    0x272 frame counter=155
    0x272 frame counter=156
    0x272 frame counter=157
    0x272 frame counter=158
    0x272 frame counter=159
    0x270 frame counter=160
    0x270 frame counter=161
    0x270 frame counter=162
    0x270 frame counter=163
    0x270 frame counter=164
    0x270 frame counter=165
    0x270 frame counter=166
    0x270 frame counter=167
    0x270 frame counter=168
    0x270 frame counter=169
    0x272 frame counter=170
    0x272 frame counter=171
    0x272 frame counter=172
    0x272 frame counter=173
    0x272 frame counter=174
    0x272 frame counter=175
    0x272 frame counter=176
    0x272 frame counter=177
    0x272 frame counter=178
    0x272 frame counter=179
    0x270 frame counter=180
    0x270 frame counter=181
    0x270 frame counter=182
    0x270 frame counter=183
    0x270 frame counter=184
    0x270 frame counter=185
    0x270 frame counter=186
    0x270 frame counter=187
    0x270 frame counter=188
    0x270 frame counter=189
    0x272 frame counter=190
    0x272 frame counter=191
    0x272 frame counter=192
    0x272 frame counter=193
    0x272 frame counter=194
    0x272 frame counter=195
    0x272 frame counter=196
    0x272 frame counter=197
    0x272 frame counter=198
    0x272 frame counter=199
    0x270 frame counter=200
    0x270 frame counter=201
    0x272 frame counter=202
    0x270 frame counter=204
    0x270 frame counter=205
    0x270 frame counter=206
    0x270 frame counter=207
    0x270 frame counter=208
    0x270 frame counter=209
    0x272 frame counter=210
    0x272 frame counter=211
    0x272 frame counter=212
    0x272 frame counter=213
    0x272 frame counter=214
    0x272 frame counter=215
    0x272 frame counter=216
    0x272 frame counter=217
    0x272 frame counter=218
    0x272 frame counter=219
    0x270 frame counter=220
    0x270 frame counter=221
    0x270 frame counter=222
    0x270 frame counter=223
    0x270 frame counter=224
    0x270 frame counter=225
    0x270 frame counter=226
    0x270 frame counter=227
    0x270 frame counter=228
    0x270 frame counter=229
    0x272 frame counter=230
    0x272 frame counter=231
    0x272 frame counter=232
    0x272 frame counter=233
    0x272 frame counter=234
    0x272 frame counter=235
    0x272 frame counter=236
    0x272 frame counter=237
    0x272 frame counter=238
    0x272 frame counter=239
    0x270 frame counter=240
    0x270 frame counter=241
    0x270 frame counter=242
    0x270 frame counter=243
    0x270 frame counter=244
    0x270 frame counter=245
    0x270 frame counter=246
    0x270 frame counter=247
    0x270 frame counter=248
    0x270 frame counter=249
    0x272 frame counter=250
    0x272 frame counter=251
    0x272 frame counter=252
    0x272 frame counter=253
    0x272 frame counter=254
    0x272 frame counter=255
    0x272 frame counter=0
    0x272 frame counter=1
    0x272 frame counter=2
    0x272 frame counter=3
    0x270 frame counter=4
    0x270 frame counter=5
    0x270 frame counter=6
    0x270 frame counter=7
    0x270 frame counter=8
    0x270 frame counter=9
    0x270 frame counter=10
    0x270 frame counter=11
    0x270 frame counter=12
    0x270 frame counter=13
    0x272 frame counter=14
    0x272 frame counter=15
    0x272 frame counter=16
    0x272 frame counter=17
    0x272 frame counter=18
    0x272 frame counter=19
    0x272 frame counter=20
    0x272 frame counter=21
    0x272 frame counter=22
    0x272 frame counter=23
    0x270 frame counter=24
    0x270 frame counter=25
    0x270 frame counter=26
    0x270 frame counter=27
    0x270 frame counter=28
    0x270 frame counter=29
    0x270 frame counter=30
    0x270 frame counter=31
    0x270 frame counter=32
    0x270 frame counter=33
    0x272 frame counter=34
    0x272 frame counter=35
    0x272 frame counter=36
    0x272 frame counter=37
    0x272 frame counter=38
    0x272 frame counter=39
    0x272 frame counter=40
    0x272 frame counter=41
    0x272 frame counter=43
    0x270 frame counter=44
    0x270 frame counter=45
    0x270 frame counter=46
    0x270 frame counter=47
    0x270 frame counter=48
    0x270 frame counter=49
    0x270 frame counter=50
    0x270 frame counter=51
    0x270 frame counter=52
    0x270 frame counter=53
    0x272 frame counter=54
    0x272 frame counter=55
    0x272 frame counter=56
    

  • Hello Somanatha,

    It would be easy to help you , if you share the all the CAN Core register dump? 

    and also i see all the frame counters continuously but didn't miss any alternative ones ? could you explain me the log ?

    Regards

    Tarun Mukesh

  • Hello Mukesh,

    ok, I will take CAN Core registers dump and share the log.

    Log Explanation: In the log if you see from line number 1-2 its a counter value of frame 0x270.

    From line number 3 - 11 its counter value for 0x272 frame. if you see closely there is counter issue.

  • Hello Somanatha,

    Mostly i understand there won't be any failure or configuration issue but please check whether you are incrementing frame counter and  updating any global variable counter while sending or after receiving you are printing data with any global variable. Try sending different data and please check.

    If data is transferring simultaneously the ID which wins the bus will only get transferred first and lost one will be ignored unless AUTO re transmission is set in place.

    Regards

    Tarun MUkesh

  • Hello Mukesh,

    Here received values are directly printed from the CAN received buffer. Will share you the log with different data.

    Yes the data is transferring simultaneously from CANoE, how do we set the AUTO re-transmission ? is this configuration is necessary for receive frame also ?

    thanks.

  • Hello,

    We have DAR bit in core register that should be 0 .

    Regards

    Tarun Mukesh