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.

MCU-PLUS-SDK-AM243X: Failed to open CPSW DMA

Part Number: MCU-PLUS-SDK-AM243X

Hi,

I'm using the am2432ALV and I wrote a program which opens TCP port using mcu_plus_sdk_am243x_08_06_00_43 LwIP stack.

When I boot the program from FLASH to DDR the LwIP works well (even if I repeat the process several times),

But If after loading from flash to DDR,

I'm debugging the same program using XDS200 ->connect target  and Load program - I get stuck in:  

cpsw.c : 935            ENETTRACE_ERR("CPSW: Failed to open CPSW DMA\r\n");

Is there anything  I can do to reset the DMA and the LwIP at the begging of my program ?

Please advice.

Thanks,

Eli

  • Hi Eli Mordel,

    Thanks for you query.

    I am assuming that you are working with AM243x-evm-hsfs.

    mcu_plus_sdk_am243x_08_06_00_43

    Can you try with latest release and update the results ?

    XDS200

    Can you try to connect XDS port of the board directly, means XDS110 and update the results ? 

    Is there anything  I can do to reset the DMA and the LwIP at the begging of my program ?

    I will check on this and get back to you ?

    Regards

    Ashwani

  • Hi Ashwani,

    I have to use mcu_plus_sdk_am243x_08_06_00_43 - because with TI's help it was converted to work in GCC environment.

    I suspect that the problem occurs when my app is written to DDR directedly from XDS200 (not by SBL) - the DMA is not properly initialized .

    Thanks,

    Regards,

    Eli

  • Thanks for update.

    Understood that you are facing problem with MCUSDK 8.6 + GCC + XDS200.

    Are you facing same issue with MCUSDK 8.6 + GCC + XDS110 ?

    Meanwhile I will try to reproduce the issue on my side.

    Regards

    Ashwani

  • Hi Ashwani,

    The problem I have is that after running my app that uses LwIP from OSPI boot - It crashes when same app is loaded via jtag debugger 

    at     file cpsw.c : 935            ENETTRACE_ERR("CPSW: Failed to open CPSW DMA\r\n");

    I've tried it now with the ind_comms_sdk_am243x_09_01_00_03 - same problem.

    I guess that at the main.c I should reset the DMA and all peripherals connected to it .

    How can I completely reset all peripherals when the app starts ?

    Thanks,

    Regards,

    Eli

  • Hi Ashwani,

    After more investigations I've noticed that if I boot a system after power up it works every time.

    If I boot the system and then "Load Program" via JTAG (without toggling the power in between) - it fails 

    at file= cpsw.c : 935   ENETTRACE_ERR("CPSW: Failed to open CPSW DMA\r\n");

    How can I reset the peripherals ( especially the DMA) as if it was after power up ?

    Thanks,

    Regards,

    Eli

  • Hello Eli

    Looks like we missed this thread as Aswhani is out office last week and this week. I will reassign this thread to another engineer while Ashwani is out. 

    I would think that indeed trying to load program via JTAG without clearing up the configuration that maybe setup by your boot loader code maybe impacting or causing the error 

    Are you using GEL files for your debug development? Are you trying to reset all the peripherals in your application through some code or asynchronously?  Please help me understand your use-case a bit better so that we can suggest local reset vs something else

    Regards

    Mukul 

  • Hi Eli, I would like to understand how you currently initialize the board before loading your application.

    We have a JavaScript file that can be loaded from CCS’s scripting console. Here’s an example:

    js:> loadJSFile "C:\ti\ind_comms_sdk_am243x_09_01_00_03\mcu_plus_sdk\tools\ccs_load\am243x\load_dmsc_hsfs.js.

    Loading this .js file should be sufficient for correctly loading your program.

    Additional Details:

    • The JavaScript file internally loads the sciclient_ccs_init binary.
    • The project path for this binary is: C:\ti\mcu_plus_sdk_am243x_09_01_00_41\examples\drivers\sciclient\sciclient_ccs_init.

    For more comprehensive information, please refer to the AM243x MCU+ SDK: EVM Setup documentation, specifically the section on SOC Initialization Using CCS Scripting.

    One Crucial Point: Make sure to set the board to DEV BOOT MODE.

    If you’re already using load_dmsc_hsfs.js and the issue persists, please send us a project we can use to reproduce the issue using XDS110. Additionally, include the steps you’re following.

    thank you,

    Paula

  • Hi Paula,

    I'd like to describe the problem by steps. 

    Step 1: I compile in debug mode the "tcp_server" example and burn the resulting *.hs_fs into my board's FLASH.

    Step 2: I boot with OSPI BOOT -> the example loads to DDR and runs well !

     Step 3: Without powering up or resetting anything - from "Target Configurations" menu I select xds200.ccxml -> then "Launch  Selected Configuration" then from "Debug" menu select Connect to target then "Run" -> "Load" -> "Load Program"  and type in my *.out file

    The program starts running from DDR but crashes on at file= cpsw.c : 935   ENETTRACE_ERR("CPSW: Failed to open CPSW DMA\r\n");

    If at Step 1 I burn the "Hello_World" example instead -> then all steps pass and the program works well

    I suspect that the LwIP and all the hardware involved cannot be initialized twice 

    Maybe there's a way to reset all components like DMA ...etc ,  at the beginning of the "tcp_server" example 

    Thanks,

    Regards,

    Eli

  • Hi ,

    Thanks for the steps to reproduce the issue.

    I will try it on my setup and get back to you.

    Please expect some response by next week.

    I suspect that DMA channel is opened is owned by previously loaded binary is not closed properly. This is done by DM FW running on M4.

    So, we need to perform system reset to get a clean re-loading new binary.

    Can you try system reset in between 2 binary loading and update the results ?

    Regards

    Ashwani

  • Hi Ashwani,

    Yes I've already tried.

    I've tried CPU reset - doesn't help.

    Only toggling power helps. 

    Your suggestion seems promising - let's try it !

    Thanks,

    Regards,

    Eli

     

  • Your suggestion seems promising - let's try it !

    Will wait for your update.

    Regards

    Ashwani

  • Hi Ashwani,

    You suggested to reset M4 :

    "I suspect that DMA channel is opened is owned by previously loaded binary is not closed properly. This is done by DM FW running on M4."

    I don't know how to reset M4 - I only can perform CPU reset which doesn't help !

    Please tell me how to reset the M4.

    Thanks,

    Regards,

    Eli

  • I'd like to describe the problem by steps. 

    Step 1: I compile in debug mode the "tcp_server" example and burn the resulting *.hs_fs into my board's FLASH.

    Step 2: I boot with OSPI BOOT -> the example loads to DDR and runs well !

     Step 3: Without powering up or resetting anything - from "Target Configurations" menu I select xds200.ccxml -> then "Launch  Selected Configuration" then from "Debug" menu select Connect to target then "Run" -> "Load" -> "Load Program"  and type in my *.out file

    The program starts running from DDR but crashes on at file= cpsw.c : 935   ENETTRACE_ERR("CPSW: Failed to open CPSW DMA\r\n");

    If at Step 1 I burn the "Hello_World" example instead -> then all steps pass and the program works well

    I suspect that the LwIP and all the hardware involved cannot be initialized twice 

    Maybe there's a way to reset all components like DMA ...etc ,  at the beginning of the "tcp_server" example 

    Hello Eli,

    The code is working as expected.

    Please see my analysis point.

    From Step 1 and Step2, you have flashed the tcp server on external memory and your application is running after changing boot mode to ospi.

    So, your application is using DMA channels and which need to be configured by SYSFW. Then, R5F requesting DMA channels allocation to SYSFW core  for your Application and it is allocated . This is fine.

    Now, you are not resetting the HW and loading example from CCC . At this step, again you requesting DMA channels for your application, then SYSFW will not allow your request since these resources are already allocated by SYSFW in flash time. So, you may get DMA channel open failure .

    Even if you do CPU reset does not help you since , CPU reset is mainly for local CPU reset and not for SYSFW  .

    To confirm my analysis is correct or wrong, instead of flash your tcp_server example, flash the Hello World example and try the same method and still see if you face problems or not.

    Try this below approach , you will not get any issue .

    Flash "Hello world example "  - > Load "tcp server example" from CCS - > System Reset from CCS - >Repeat

    Regards,

    Anil.

  • Hi Anil,

    This is exactly the way I'm working around the problem  - I'm loading the "Hello world"  in between.

    I'm looking for some code to put at the beginning of my App that will eliminate the need for loading the "Hello world" in between.

    Thanks,

    Regards,

    Eli

  • Hello Eli,

    SYSFW runs on M3 core and not on M4F core.

    We can't reset the SYSFW. The only step is that to do the SYSFW Reset, we need to POR or WARM Reset. When you do System Reset from the CCS, it does Warm Reset SOC. So, your SOC boot flow will be RBL → SBL → Application. So, when your SBL is running, SSYFW is also loading freshly. This way, you do SYSFW reset.

    I agree we need to do reverse processing of DMA channel allocation. This is the only one step we have to do. 

    To avoid Hello World example loading, you try another method to keep one while(variable) condition before system_init in your tcp_server example and flash it on external memory.

    And, next, load symbols instead of a load program CCS. Now, your application has been stuck at a while(variable) condition, then change variable to 0 from CCS. This way, you can work on it.

    My suggestion is that de allocating DMA channels and allocating DMA channels will take more time to implement. I hope for your testing purpose you can use the above method.

    Regards,

    Anil

  • Please tell me how to reset the M4.

    If you are using ccs to load application for debug only.

    you can try "system reset" option shown as below

    Regards

    Ashwani

  • Hello Eli,

    Do you need any help ?

    Is this issue resolved ?

    Please let us know if you are stuck anywhere.

    Regards,

    Anil.

  • Hi Anil,

    I have to reset the M4 and other components from within my application's code.

    Is there any function or registers that can be written to perform all system reset at my application main.c  ?

    Thanks,

    Regards,

    Eli

  • I have to reset the M4 and other components from within my application's code.

    Hello Eli,

    Can you please tell me why do you want to reset M4F core ?

    Regards,

    Anil.

  • Hi Anil,

    I've described the problem in steps :

    Step 1: I compile in debug mode the "tcp_server" example and burn the resulting *.hs_fs into my board's FLASH.

    Step 2: I boot with OSPI BOOT -> the example loads to DDR and runs well !

     Step 3: Without powering up or resetting anything - from "Target Configurations" menu I select xds200.ccxml -> then "Launch  Selected Configuration" then from "Debug" menu select Connect to target then "Run" -> "Load" -> "Load Program"  and type in my *.out file

    The program starts running from DDR but crashes on at file= cpsw.c : 935   ENETTRACE_ERR("CPSW: Failed to open CPSW DMA\r\n");

    If at Step 1 I burn the "Hello_World" example instead -> then all steps pass and the program works well

    I suspect that the LwIP and all the hardware involved cannot be initialized twice 

    Maybe resetting M4F will help.

    I would accept any workaround or solution.

    Thanks,

    Regards,

    Eli

  • Hello Eli, 

    Hello Eli,

    SYSFW runs on M3 core and not on M4F core.

    We can't reset the SYSFW. The only step is that to do the SYSFW Reset, we need to POR or WARM Reset. When you do System Reset from the CCS, it does Warm Reset SOC. So, your SOC boot flow will be RBL → SBL → Application. So, when your SBL is running, SSYFW is also loading freshly. This way, you do SYSFW reset.

    I agree we need to do reverse processing of DMA channel allocation. This is the only one step we have to do. 

    To avoid Hello World example loading, you try another method to keep one while(variable) condition before system_init in your tcp_server example and flash it on external memory.

    And, next, load symbols instead of a load program CCS. Now, your application has been stuck at a while(variable) condition, then change variable to 0 from CCS. This way, you can work on it.

    My suggestion is that de allocating DMA channels and allocating DMA channels will take more time to implement. I hope for your testing purpose you can use the above method.

    Did you look at the above method? 

    If not please check and let us know if you have any doubts. 

    Even if you do warm Reset the SOC again, the same application is loading from Flash, and again you are loading same example from CCS, then you will get the DMA channel open issue . 

    I have shared above method to solve your issue. 

    But, for every time while loading application from ccs you have to do system reset from ccs and next load the example. 

    Regards, 

    Anil.