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.

RTOS/AM5728: Adding CAN Test to Processor SDK RTOS Template App

Part Number: AM5728

Tool/software: TI-RTOS

Hi,

I have built and used the RTOS Template App for the C66xx core.

I also have built and used the DCAN Basic Example on C66xx core.

They seem to have different RTOS versions and libraries. This has caused trouble with the implementation. 

Simply, how can I implement the Internal DCAN example into the Template App?

Thank you in advance!

  • The RTOS team have been notified. They will respond here.
  • Please provide some assistance today. Thank you.
  • Alec,

    Are you comparing the following two:

    C:\ti\pdk_am57xx_1_0_11\packages\MyExampleProjects\DCAN_BasicExample_evmAM572x_c66xTestProject
    &
    C:\ti\processor_sdk_rtos_am57xx_5_00_00_15\demos\rtos_template_app

    Unless you already knew, I wanted to point out DCAN_BasicExample_evmAM572x_c66xTestProject as a DCAN example you can use.

    Lali
  • Lali,
    Yes, those are the two I am comparing.

    I have built the C:\ti\pdk_am57xx_1_0_11\packages\ti\csl\example\dcan\dcanLoopback\rtos\DCAN_BasicExample_evmAM572x_c66xTestProject and have been comparing the differences in the code to C:\ti\processor_sdk_rtos_am57xx_5_00_00_15\demos\rtos_template_app\am572x\evmAM572X\C66\template_app.

    I want to implement the functionality of the DCAN Example into the Template App.
    It has not been a simple task, which is why I need your help.

    Thank you,
    Alec

  • Lali/TI Support,

    Is this being addressed?

    I would feel a lot better if you said, "Alec, I can look into this and get back to you in X hours (or the next day)." Please give some sort of indication that my question is being worked on. Otherwise, I still feel like I am still working on this by myself.

    Thank you.
  • Alec,

    It is being addressed and we are digging into it.
    Please give us till tomorrow afternoon to get back to you.

    Lali
  • Lali,

    Thank you for the quick response. I look forward to hearing from you tomorrow afternoon.

    Regards,
    Alec
  • Alec,

    Generally, when adding on to the template application you should follow this procedure:

    1. Add your application specific code into app.c, or additional application specific files as needed
    2. Add your application specific configuration into app.cfg
    3. Add include paths, defines, etc. according to your application specific additions.

    So, to integrate DCAN_BasicExample_evmAM572x_c66xTestProject with the RTOS template app you would do the following:

    1. Import DCAN_BasicExample_evmAM572x_c66xTestProject and rtos_template_app_am572x_c66 projects into your CSS workspace
    2. Copy dcan_loopback_app.c/.h and UART_soc.c from DCAN project to the template app project
    3. Copy and paste code from dcan_c66x_evmAM572x.cfg file into app.cfg in template app. Note that you will need to change or comment out Task.numPriorities = 4;Since the tasks in the template app are using priorities larger than 4.
    4. Copy and paste code from dcan_loopback_rtos_main.c into app.c file. Do not copy the main() function though. Instead you should create the dcantestTask within the appTasksCreate function in app.c
    5. Add RTOS_BUILD and USE_BIOS to the predefined symbols.
    6. Build and run

    Here is my modified rtos template app project for reference:

    rtos_template_app_am572x_c66.zip

    Regards,

    Jonah

  • Hi Jonah,

    Thanks for the explanation and for providing the code example. I am attempting to implement the code you provided, but the DCAN app is not working. It gets held up when transmitting the frames internally.

    See screenshots below:

    I tried changing the priorities of the gpio and DCAN applications, but the frame(s) still do not transmit. How can I escape from the GPIO loop before the DCAN app boots up?

    My thought is changing the last lines in the GPIO method from 

    if (g_endTestTriggered)
        break;

    to:

    if (DCAN_test_is_on == TRUE)
      break;

    Thanks again for your help thus far. I look forward to hearing from you soon.

    Regards,

    Alec

  • So I tried adding in the bool variable as I had suggested, defined as FALSE, used the conditional on the GPIO method, and added the TRUE toggle before ExecTest() in dcanTestTask():

    /*
     *  ======== dcanTestTask ========
     */
    Void dcanTestTask(UArg a0, UArg a1)
    {
        int32_t retVal = STW_EFAIL;
        DCAN_test_is_on = TRUE;
        /* DCAN Test function call*/
        retVal = execTest();
        if(retVal == STW_SOK)
            while (testDone) ;
    }

    Results:

    Same thing, does not transmit frames. Chip gets really hot so I don't let it run long. 

    Look forward to solving this with you.

  • Alec,

    Interesting, I will take a look and see if I encounter the same issue on my board.

    Have you tried using DCAN_BasicExample_evmAM572x_c66xTestProject on its own (without integration into RTOS template app)? If so, did you run into a similar issue and what version of processor sdk were you using?

    Regards,
    Jonah
  • Jonah,

    Yes, I used the DCAN basic example on its own and it worked very fast, less than 1 second to transmit the frames of data. No issues at all running it by itself.

    I'm putting breakpoints in int32_t dcanLoopbackTest(void) now, attempting to see where it gets held up. It obviously executes the test, brings up the menu, and takes in the frames, but something freezes it after that point.

    Let me know how you fare with the execution on your end.

    Thank you,
    Alec
  • Jonah,

    I have to back up, now the DCAN basic example is not executing to completion, but it was last week. I rebuilt the example, loaded it, and it doesn't loopback internally or externally. It's getting held up at the same point as when executing the code you provided. I'm going to try someone else's EVM to see if something happened with mine.

    Let me know if you have other suggestions.

    Thanks,
    Alec
  • I tried someone else's EVM and it's still not executing the DCAN code. Now I'm thinking it's likely something with the software on my end. Do you think I should rebuild the PDK or what should I do?
  • Alec,

    Yes I am seeing the same issue. DCAN example from Processor SDK 5.0 does not run to completion for me as a standalone app or when integrated into the template app. However, I am not seeing this issue on Processor SDK 4.3 and was able to integrate the two successfully. Please see attached project for your reference. Looks like we may have a bug in the 5.0 version of DCAN example, I hope that using the example from 4.3 will solve your issue in the meantime.

    rtos_template_app_am572x_c66_04_03.zip

  • Thanks very much Jonah! Very glad to know it wasn't my hardware or software. Also, thanks for letting me know that the newest version of the DCAN app isn't working. Is there a way to download older versions of the example applications? Because I was able to run the Example before, and I didn't update the PDK or anything in the last week. My teammates will need to duplicate the steps to complete the DCAN app, so if you could provide either the base v4.3 DCAN code by itself, or a method to obtain it, I'd greatly appreciate it. 

  • Alec,

    Glad I could help!

    Here's a link to the 4.3 release. You can grab the DCAN app code from there.
    software-dl.ti.com/.../index_FDS.html

    Regards,
    Jonah