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.

Testing Can application of MCUSW of PSDKRA_RTOS(v0.9) in J721EXCP01EVM(Board)

Hi, This is LG electronics engineer. 

I have a couple of question for PSDKRA_RTOS(v0.9).

Testing the CAN profile application within MCUSW of  PSDKRA_RTOS(v0.9) in J721EXCP01EVM(Board).

1. In order to configure MCAL every configuration for testing this application, should I use the EB configurator ? 

It is just one solution for configuring MCAL ?

If i should use the EB configurator, there is no installation guide which can follow in PSDKRA_RTOS(v0.9). 

Also, this version's MCAL modules aren't delivered in the form of EBtresos plugins.

2. I see your every test report, you seem to just test "CAN example application" in csl folder through building and compiling the BAREMETAL type.

If i use the CAN example application, it is easy to execute this application through JTAG tool. However, because of some problem, we can't use JTAG.

We have to execute the CAN profile application in MCUSW.

In MCUSW, there is your test report. Is it tested through tirtos building version that some data is transmitted to external CANoe and received from CANoe through CAN communication ? 

3. When i execute your CAN profile application, CANoe tool can't receive any data from your EVM.  I was debugging it that can you give me a few advice such as using EB configurator etc. ?

  • Hi,

    On #1, There are two options to reconfigure the CAN, one is to use the configurator and other would be to manually change the source code. Since the intention is to try out the MCAL demo application, I would recommend to manually change the CAN configuration. By the way the configurator installer is included in the mcusw (please refer the release notes/user guides). You would require separate installer for the configurator and plugins, please check user guide.

    On #2, yes there the CAN profile application can be executed without the JTAG. You will have to use the mmc/sd boot mode and copy the can demo application image into the SD card. Again, the steps are listed in the user guide, please let us know if you face any issues.

    On CANoe not receiving the data, yes the default CAN demo application configured the CAN to operate in loop-back mode (no data is sent out, the transmitted data is digitally looped back to receive lines). You could update it to perform TX only operation.

    Regards, Sujith

  • Hi,

    I haven't heard back from you, I'm assuming you were able to resolve your issue. If not, just post a reply below (or create a new thread if the thread has locked due to time-out).

    Regards, Sujith

  • Hi,

    Thank you for your response.

    As you mentioned above your response, I tested it to perform TX only operation.

    It was nice.

    However, it is just for Only CAN transmission(TDA4 EVM Board -> CANoe tool).

    I want to test CAN Receive test from CANoe to TDA4 B/D(CANoe tool -> TDA4 EVM Board)..

    This mentioned application was for CAN transmission.

    Can you give me the test version app for CAN receiving test(CANoe tool -> TDA4 EVM Board) in MCUSW.

    Or not, let me know how to test the CAN receiving in MCUSW. Because it seems like there is a few API for receiving CAN packet from external tool(CANoe).

    Thanks.

    Regards, LGE member.

  • Hi,

    You will have to update the demo application from loop-back mode to non-loop back mode. You could either use MCAL example application with no OS or TI RTOS application. Both would require modification to perform receive only operation.

    I will check if we have patch/modifications that will enable reception from a node.

    Regards, Sujith

  • Hi,

    Thank you for your reply.

    Plesse, check for the patch/modification that will enable reception for a node.

    I will wait for your reply.

    Also,

    Please, Note that we are trying to test the CAN Application like below path

    mcusw_00_09_00_06/mcuss_demos/profiling/can/ ....

    In the application of this path, the CAN transmission was already tested in previous time.

    Regards, LG members.

  • Hi,

    Please refer to the attached patch for adding support for Rx for MCU MCAN0. (You need to have loopback disabled) - the patch is made out of the latest mcusw repository and hence if you are working off some old release it can result in some merge conflict which should be easy to resolve. Please let me know in case you face an issue.

    For the first level tests, just copy the message which you were receiving while running the application in Tx mode and use the same message to send to the MCAN in the Rx only case. This is important as the message ID-based filtering happens during the reception of the message and if you send an ID for which the MCU MCAN0 does not have any filter configured - it'll reject it.

    Regards,

    Karan

  • From f2bc02076c31e529882286261a1cb67899ec06f8 Mon Sep 17 00:00:00 2001
    From: Karan Saxena <karan@ti.com>
    Date: Mon, 23 Sep 2019 13:43:22 +0530
    Subject: [PATCH] Add Rx support
    
    - Post Rx confirmation semaphore in ISR also pend on same in main task
    
    Signed-off-by: Karan Saxena <karan@ti.com>
    ---
     mcuss_demos/Bsw_Stubs/CanIf/src/CanIf_Cbk.c |  2 ++
     mcuss_demos/profiling/can/can_profile.c     | 16 ++++++++++++++++
     2 files changed, 18 insertions(+)
    
    diff --git a/mcuss_demos/Bsw_Stubs/CanIf/src/CanIf_Cbk.c b/mcuss_demos/Bsw_Stubs/CanIf/src/CanIf_Cbk.c
    index 855de89..1f32f27 100644
    --- a/mcuss_demos/Bsw_Stubs/CanIf/src/CanIf_Cbk.c
    +++ b/mcuss_demos/Bsw_Stubs/CanIf/src/CanIf_Cbk.c
    @@ -115,6 +115,8 @@ void CanIf_RxIndication(const Can_HwType* Mailbox,
         {
             CanIf_PduInfo.SduDataPtr[counter] = PduInfoPtr->SduDataPtr[counter];
         }
    +
    +    SemaphoreP_postFromISR(CanIf_RxConfirmationSemaphore);
     }
     
     void CanIf_ControllerBusOff(uint8 ControllerId)
    diff --git a/mcuss_demos/profiling/can/can_profile.c b/mcuss_demos/profiling/can/can_profile.c
    index f2b82fd..ef806ec 100755
    --- a/mcuss_demos/profiling/can/can_profile.c
    +++ b/mcuss_demos/profiling/can/can_profile.c
    @@ -156,14 +156,18 @@ uint64_t CanProfileCumulativeTx;
     /* ========================================================================== */
     /*                          Function Definitions                              */
     /* ========================================================================== */
    +#define RX_ONLY
    +
     sint32 CanApp_ProfileTest(canAppTaskObj_t *testParams)
     {
     #if (CAN_LOOPBACK_ENABLE == STD_ON)
         uint32              mask = 0x00000000U;
     #endif
         uint32              ctlr_cnt;
    +#if defined TX_ONLY
         const Can_PduType   *PduInfo;
         uint8               hth = 0U;
    +#endif
         Can_ReturnType      status;
         uint32              loopCnt, itr, totalCanMsgPerSec;
         float totalCpuload;
    @@ -173,6 +177,7 @@ sint32 CanApp_ProfileTest(canAppTaskObj_t *testParams)
     
         CanApp_RxPdu = &CanIf_PduInfo;
         /* Message for CAN-FD(MCAN0 module) */
    +#if defined TX_ONLY
         PduInfo         = &CanApp_Pdu;
         /* Setting Up CAN FD Extended Frame*/
         CanApp_Pdu.id          = 0xC0 | 0xC0000000U;
    @@ -189,6 +194,7 @@ sint32 CanApp_ProfileTest(canAppTaskObj_t *testParams)
     
         CanApp_DemStatus = E_OK;
         CanApp_DetStatus = E_OK;
    +#endif
         
     #if (APP_INSTANCE_1_INST_IN_CFG_ONLY == STD_OFF)
         for (ctlr_cnt = 0U; ctlr_cnt < CAN_MAX_CONTROLLER; ctlr_cnt++)
    @@ -198,6 +204,7 @@ sint32 CanApp_ProfileTest(canAppTaskObj_t *testParams)
         {
             CanApp_ProfileStatus = E_OK;
     
    +#if defined TX_ONLY
             if (CAN_CONTROLLER_INSTANCE_MCU_MCAN0 ==
                 CanConfigSet_CanController_List_PC[ctlr_cnt]->CanControllerInst)
             {
    @@ -227,6 +234,7 @@ sint32 CanApp_ProfileTest(canAppTaskObj_t *testParams)
                 mask = 0xC0000000U;
     #endif
             }
    +#endif
     
             /* Set Controller Mode to Start */
             status = Can_SetControllerMode(
    @@ -256,6 +264,7 @@ sint32 CanApp_ProfileTest(canAppTaskObj_t *testParams)
             {
                 for (loopCnt = 0U; loopCnt < testParams->numTxPackets; loopCnt++)
                 {
    +#if defined TX_ONLY
                     /* Do Can Write to send the CanApp_InputData on CAN bus */
                     status = Can_Write(hth, PduInfo);
                     if (status == CAN_OK)
    @@ -269,6 +278,13 @@ sint32 CanApp_ProfileTest(canAppTaskObj_t *testParams)
                                         "Could not write (Can_Write ()) \n");
                         CanApp_ProfileStatus = E_NOT_OK;
                     }
    +#endif
    +
    +#if defined RX_ONLY
    +
    +                SemaphoreP_pend(CanIf_RxConfirmationSemaphore,
    +                                SemaphoreP_WAIT_FOREVER);
    +#endif
                 }
             }
             Utils_prfLoadCalcStop ();
    -- 
    2.7.4
    

  • Hi,

    Did this resolve your issue?

    Regards, Sujith

  • Hi,

    We have your release TDA4_RSDKRA_RTOS_v0.9.0.1 version(MCUSW 00.09.02.01).

    I was applying your above patch in the latest version(TDA4_RSDKRA_RTOS_v0.9.0.1,  MCUSW 00.09.02.01)

    However, after applying your patch, the error is happened in your patch.

    error -----

    # Compiling j721e_evm:j721e:mcu1_0:release:can_profile_app: can_profile.c
    "can_profile.c", line 300: error: identifier "PduInfo" is undefined
    "can_profile.c", line 176: error: variable "preTimeStamp" was declared but never referenced
    "can_profile.c", line 176: error: variable "postTimeStamp" was declared but never referenced
    3 errors detected in the compilation of "can_profile.c".

    >> Compilation failure
    /home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/pdk/packages/ti/build/makerules/rules_ti_cgt_arm.mk:166: recipe for target '/home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/mcusw/binary/can_profile_app/obj/j721e_evm/mcu1_0/release/can_profile.oer5f' failed
    make[3]: *** [/home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/mcusw/binary/can_profile_app/obj/j721e_evm/mcu1_0/release/can_profile.oer5f] Error 1
    /home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/pdk/packages/ti/build/makerules/common.mk:402: recipe for target 'mcu1_0' failed
    make[2]: *** [mcu1_0] Error 2
    makefile:154: recipe for target 'can_profile_app' failed
    make[1]: *** [can_profile_app] Error 2
    makefile:27: recipe for target 'all' failed
    make: *** [all] Error 2

    ----------------------------------

    Of cource, I modify the errors.

    However, after applying your patch,

    I can't understand your test method.

    Could you explain your test method in details ?  

    What i am saying is the CAN communication between EVM Board and CANoe.

    I can't receive any response in EVM board because message ID-based filtering.

    I don't know how i configure the things, related to ID in CANoe. 

    Your reply (by Karan Saxena)-------

    For the first level tests, just copy the message which you were receiving while running the application in Tx mode and use the same message to send to the MCAN in the Rx only case. This is important as the message ID-based filtering happens during the reception of the message and if you send an ID for which the MCU MCAN0 does not have any filter configured - it'll reject it.

    ----------------------------------------------

  • Hi,

    Quick question - were you able to resolve the errors and proceed with the test or are you still not able to compile?

    Regards,

    Karan

  • Hi,

    We have your release TDA4_RSDKRA_RTOS_v0.9.0.1 version(MCUSW 00.09.02.01) from TI

    I was applying your above patch in the latest version(TDA4_RSDKRA_RTOS_v0.9.0.1,  MCUSW 00.09.02.01)

    However, after applying your patch, the error is happened in your patch.

    error -----

    # Compiling j721e_evm:j721e:mcu1_0:release:can_profile_app: can_profile.c

    "can_profile.c", line 300: error: identifier "PduInfo" is undefined

    "can_profile.c", line 176: error: variable "preTimeStamp" was declared but never referenced

    "can_profile.c", line 176: error: variable "postTimeStamp" was declared but never referenced

    3 errors detected in the compilation of "can_profile.c".

    >> Compilation failure

    /home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/pdk/packages/ti/build/makerules/rules_ti_cgt_arm.mk:166: recipe for target '/home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/mcusw/binary/can_profile_app/obj/j721e_evm/mcu1_0/release/can_profile.oer5f' failed

    make[3]: *** [/home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/mcusw/binary/can_profile_app/obj/j721e_evm/mcu1_0/release/can_profile.oer5f] Error 1

    /home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/pdk/packages/ti/build/makerules/common.mk:402: recipe for target 'mcu1_0' failed

    make[2]: *** [mcu1_0] Error 2

    makefile:154: recipe for target 'can_profile_app' failed

    make[1]: *** [can_profile_app] Error 2

    makefile:27: recipe for target 'all' failed

    make: *** [all] Error 2

    ----------------------------------

    Of cource, I modify the errors.

    However, i have a few questions.

    I can't understand your test method.

    Could you explain your test method in details ?  

    What i am saying is the CAN communication between EVM Board and CANoe.

    I can't receive any response in EVM board because message ID-based filtering.

    I don't know how i configure the things, related to ID in CANoe.

    Your reply (by Karan Saxena)-------

    For the first level tests, just copy the message which you were receiving while running the application in Tx mode and use the same message to send to the MCAN in the Rx only case. This is important as the message ID-based filtering happens during the reception of the message and if you send an ID for which the MCU MCAN0 does not have any filter configured - it'll reject it.

    ----------------------------------------------

    Regards,

    LG members.

  • Hi,

    We have your release TDA4_RSDKRA_RTOS_v0.9.0.1 version(MCUSW 00.09.02.01) from TI

    I was applying your above patch in the latest version(TDA4_RSDKRA_RTOS_v0.9.0.1,  MCUSW 00.09.02.01)

    However, after applying your patch, the error is happened in your patch.

    error -----

    # Compiling j721e_evm:j721e:mcu1_0:release:can_profile_app: can_profile.c

    "can_profile.c", line 300: error: identifier "PduInfo" is undefined

    "can_profile.c", line 176: error: variable "preTimeStamp" was declared but never referenced

    "can_profile.c", line 176: error: variable "postTimeStamp" was declared but never referenced

    3 errors detected in the compilation of "can_profile.c".

    >> Compilation failure

    /home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/pdk/packages/ti/build/makerules/rules_ti_cgt_arm.mk:166: recipe for target '/home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/mcusw/binary/can_profile_app/obj/j721e_evm/mcu1_0/release/can_profile.oer5f' failed

    make[3]: *** [/home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/mcusw/binary/can_profile_app/obj/j721e_evm/mcu1_0/release/can_profile.oer5f] Error 1

    /home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/pdk/packages/ti/build/makerules/common.mk:402: recipe for target 'mcu1_0' failed

    make[2]: *** [mcu1_0] Error 2

    makefile:154: recipe for target 'can_profile_app' failed

    make[1]: *** [can_profile_app] Error 2

    makefile:27: recipe for target 'all' failed

    make: *** [all] Error 2

    ----------------------------------

    Most of all,  temporarily I modify the errors .

    However, i have a few questions.

    I can't understand your test method.

    Could you explain your test method in details ?  

    What i am saying is the CAN communication between EVM Board and CANoe.

    I can't receive any response in EVM board because message ID-based filtering.

    I don't know how i configure the things, related to ID in CANoe.

    Your reply (by Karan Saxena)-------

    For the first level tests, just copy the message which you were receiving while running the application in Tx mode and use the same message to send to the MCAN in the Rx only case. This is important as the message ID-based filtering happens during the reception of the message and if you send an ID for which the MCU MCAN0 does not have any filter configured - it'll reject it.

    ----------------------------------------------

    Regards,

    LG members.

  • Hi,

    We have your release TDA4_RSDKRA_RTOS_v0.9.0.1 version(MCUSW 00.09.02.01).

    I was applying your above patch in the latest version(TDA4_RSDKRA_RTOS_v0.9.0.1,  MCUSW 00.09.02.01)

    However, after applying your patch, the error is happened in your patch.

    error -----

    # Compiling j721e_evm:j721e:mcu1_0:release:can_profile_app: can_profile.c

    "can_profile.c", line 300: error: identifier "PduInfo" is undefined

    "can_profile.c", line 176: error: variable "preTimeStamp" was declared but never referenced

    "can_profile.c", line 176: error: variable "postTimeStamp" was declared but never referenced

    3 errors detected in the compilation of "can_profile.c".

    >> Compilation failure

    /home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/pdk/packages/ti/build/makerules/rules_ti_cgt_arm.mk:166: recipe for target '/home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/mcusw/binary/can_profile_app/obj/j721e_evm/mcu1_0/release/can_profile.oer5f' failed

    make[3]: *** [/home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/mcusw/binary/can_profile_app/obj/j721e_evm/mcu1_0/release/can_profile.oer5f] Error 1

    /home/kwangho.jung/tda4_source/system/PSDKRA_RTOS/pdk/packages/ti/build/makerules/common.mk:402: recipe for target 'mcu1_0' failed

    make[2]: *** [mcu1_0] Error 2

    makefile:154: recipe for target 'can_profile_app' failed

    make[1]: *** [can_profile_app] Error 2

    makefile:27: recipe for target 'all' failed

    make: *** [all] Error 2

    ----------------------------------

    Most of all, temporarily  I modify the errors.

    However, i have a few questions.

    I can't understand your test method.

    Could you explain your test method in details ?  

    What i am saying is the CAN communication between EVM Board and CANoe.

    I can't receive any response in EVM board because message ID-based filtering.

    I don't know how i configure the things, related to ID in CANoe.

    Your reply (by Karan Saxena)-------

    For the first level tests, just copy the message which you were receiving while running the application in Tx mode and use the same message to send to the MCAN in the Rx only case. This is important as the message ID-based filtering happens during the reception of the message and if you send an ID for which the MCU MCAN0 does not have any filter configured - it'll reject it.

    ----------------------------------------------

    Regards,

    LG members.

  • Hi,

    Can you please confirm if you were able to resolve the compilation errors and proceed with the Rx test?

    Then I can help you understand the setup and where you need to modify in order to modify the Rx filter.

    Regards,

    Karan

  • Hi,

    I just modified for the compiling and finished compiling it.

    I will forward the modified code to you as this response in here tomorrow.

    And then, please help me additionally and subsequently.

    Regards,

    LGE member.

  • Hi,

    Sure, no problem.

    Regards,

    Karan

  • Hi. This is LG member.

    I modified for the above mentioned errors, like below

    @@ -162,17 +165,21 @@ sint32 CanApp_ProfileTest(canAppTaskObj_t *testParams)
         uint32              mask = 0x00000000U;
     #endif
         uint32              ctlr_cnt;
    +#if defined TX_ONLY
         const Can_PduType   *PduInfo;
         uint8               hth = 0U;
    +#endif // modified by TI patch
         Can_ReturnType      status;
    -    uint32              loopCnt, itr, totalCanMsgPerSec, totalCpuload;
    -    float               totalTimePerMsg;
    +    //uint32              loopCnt, itr, totalCanMsgPerSec, totalCpuload;
    +       uint32              loopCnt, itr;
    +       //float               totalTimePerMsg;
         Utils_PrfLoad       computedLoad;
    -    uint64_t            preTimeStamp, postTimeStamp;
    -    float               canBusTime;
    +    //uint64_t            preTimeStamp, postTimeStamp;
    +    //float               canBusTime;

         CanApp_RxPdu = &CanIf_PduInfo;
         /* Message for CAN-FD(MCAN0 module) */
    +#if defined TX_ONLY
         PduInfo         = &CanApp_Pdu;
         /* Setting Up CAN FD Extended Frame*/
         CanApp_Pdu.id          = 0xC0 | 0xC0000000U;
    @@ -189,7 +196,8 @@ sint32 CanApp_ProfileTest(canAppTaskObj_t *testParams)

         CanApp_DemStatus = E_OK;
         CanApp_DetStatus = E_OK;
    -
    +#endif // modified by TI patch

    ....

    @@ -282,25 +310,25 @@ sint32 CanApp_ProfileTest(canAppTaskObj_t *testParams)
     #endif

                 /* Calculating Can Bus Time in micro sec based on STD or EXT Id */
    -            if ((PduInfo->id & 0xC0000000U) == 0xC0000000U)
    -            {
    +//            if ((PduInfo->id & 0xC0000000U) == 0xC0000000U)
    +//            {
                     /* Extended Id */
    -                canBusTime = 153.6f;
    -            }
    -            else
    -            {
    -                /* Standard Id */
    -                canBusTime = 134.5f;
    -            }
    -            AppUtils_Printf(MSG_NORMAL, MSG_APP_NAME
    +//                canBusTime = 153.6f;
    +//            }
    +//            else
    +//            {
    +//                /* Standard Id */
    +//                canBusTime = 134.5f;
    +//            }
    +/*            AppUtils_Printf(MSG_NORMAL, MSG_APP_NAME
                             CAN_TX_RX_MSG " %u packets %d times\n",
                             testParams->numTxPackets, testParams->numIterations);
    -
    +*/
                 /* Number of packets transmitted * number of iterations *
                     1 or 2 (2 in case of tx & rx) transmitted in msecs (computed
                     above)
                 */
    -            AppUtils_Printf(MSG_NORMAL, MSG_APP_NAME
    +/*            AppUtils_Printf(MSG_NORMAL, MSG_APP_NAME
                         "Average of %lld.%02d usecs per packet \n",
                         CanProfileCumulativeTx / (testParams->numTxPackets *
                                       testParams->numIterations),
    @@ -310,10 +338,10 @@ sint32 CanApp_ProfileTest(canAppTaskObj_t *testParams)
                                 ((float)CanProfileCumulativeTx / ((float)testParams->numTxPackets *
                                       (float)testParams->numIterations)));
                 totalCanMsgPerSec = (1000000.0f / totalTimePerMsg);
    -
    +*/
                 /* Hardware interrupt handler load + Software interrupt handler +
                     task load */
    -            totalCpuload = computedLoad.hwiLoad + computedLoad.swiLoad +
    +/*            totalCpuload = computedLoad.hwiLoad + computedLoad.swiLoad +
                                 computedLoad.tskLoad;

    -
    +*/
                 /* Set Controller Mode to Stop*/
                 status = Can_SetControllerMode(
                     CanConfigSet_CanController_List_PC[ctlr_cnt]->ControllerId,

    -------------------------------------- End

    I modified like above.

    And then, I finished compiling your release TDA4_RSDKRA_RTOS_v0.9.0.1 version(MCUSW 00.09.02.01).

    If it is not problem, as next step, could you help me to understand the test setup and where I need to modify in order to modify the Rx filter.

    Regard,

    LG members.

  • Hi,

    You need to create new issue for resolving this ?

    It looks like this very top issue is finished.

    Because it is marked as "Resolved".

    If you need, I will create the new issue.

    And, I replied what we were saying yesterday like below.

    Regards,

    LG members.

  • Hi,

    Thanks, yes please open a new thread as this problem is resolved now.

    Regards, Sujith