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.

TMS320C6657: TCP3D/EDMA3 on C6657

Part Number: TMS320C6657

I am using the TCP3D decoder on a C6657 EVM.  I have pdk_c665x_2_0_14 and edma3_lld_2_12_05_30E. Started with the C6657 example found here:


C:\ti\pdk_c665x_2_0_14\packages\ti\drv\tcp3d\example

I then copied the source files into my project and I was able to test LTE Turbo Decodes successfully.  I wanted to then clean up my project and I tried to use the EDMA3 versions of several files but I can not get the EDMA initialization to succeed.  The files in particular are the sample*.* files.


sample.h


sample_cfg.c


sample_cs.c


sample_init.c


sample_int_reg.c


These files exist in the example folder


C:\ti\pdk_c665x_2_0_14\packages\ti\drv\tcp3d\example\src

but also exist in the EDMA3 folder


C:\ti\edma3_lld_2_12_05_30E\packages\ti\sdo\edma3\drv\sample\src

So, I figured I could just include the EDMA3 package and not have to have copies of those files in my source code also. 


However, as mentioned above I can't seem to get this to work.  What is interesting is that it seems like the files used in the example shouldn't work.  The root of the problem seems to the related to the sample_cfg.c file.   The file provided in the example, defines 3 EDMA instances.  The C6657 only have 1 EDMA instance.  The example code uses Instance #2 and Region #3.  Again, this seems work.  The equivalent file provided by the EDMA3 driver is sample_c6657_cfg.c.  It correctly defines only one EDMA instance as expected.  So, I had this idea that maybe the Instance #2 and Region #3 data from sample.cfg was the same as Instance #0 Region #3 from sample_c6657_cfg.c.  But, that is not true.  In fact, I don't see any 1-1 mapping between the two. 


Another issue is the function edma3init().  In the example code it is provided in sample_init.c and has the following header,


EDMA3_DRV_Handle edma3init (unsigned int edma3Id, EDMA3_DRV_Result *errorCode,
                            unsigned int dspCoreID, unsigned int tpccRegionUsed)

In the EDMA3 driver code, also in sample_init.c the same function has a different definition


EDMA3_DRV_Handle edma3init (uint32_t edma3Id, EDMA3_DRV_Result *errorCode)

In the example code the tpccRegionUsed param is used to select the region.  In the driver code there is no tpccRegionUsed param and the dsp core ID is read and used to select the region. 


I changed to use the two parameter version but then things failed in the EDMA setup.  Particularly in the DMA channel allocation.  The TCP3 code wants to use channels 0,1 but the EDMA3 driver code thinks those are not valid.  If you change the code to 40/41 instead, it will allocate those, but then the EDMA driver fails again trying to initialize the interrupts. 


So, at this point I guess I've kinda given up.  The setup for EDMA and TCP is complicated enough that without a full understanding it is really hard to debug.


If you have any suggestions I'd like to hear them, but I guess for now I am going to revert back to including the seemingly wrong example code in my project.


Thanks,


Chris

  • I made some further progress which might be helpful.  I now have all the example sample_ files removed with 1 exception.  I grabbed the file

    C:\ti\edma3_lld_2_12_05_30E\packages\ti\sdo\edma3\drv\sample\src\platforms\sample_c6657_reg.c

    and modified the structure sampleInstInitConfig by replacing the initializers in EDMA3 INSTANCE# 0 Region 0 with the initializers from

    C:\ti\pdk_c665x_2_0_14\packages\ti\drv\tcp3d\example\src\sample_cfg.c   EDMA3 INSTANCE# 2 Region 3.

    I also changed the call to edma3init() to pass in Instance 0, which makes sense since C6657 only has 1 EDMA3 instance.

    This works.

    So, is the file sample_c6657_reg.c not correct for C6657?

  • Hi,

    Thanks for your info, it is correct that from EDMA LLD 

    • The C6657 has only one EDMA instance (that is CC0), the EDMA LLD driver has this edma3_lld_2_12_05_30E\packages\ti\sdo\edma3\drv\sample\src\platforms\sample_c6657_cfg.c,
    • and the function prototype EDMA3_DRV_Handle edma3init (uint32_t edma3Id, EDMA3_DRV_Result *errorCode);

    Note above is built into EDMA library, you can call them directly from your application.

    In the real usage case, customer may want to customize the EDMA resource allocation. One way is to update the sample_c6657_cfg.c inside the EDMA LLD source code, then rebuild the EDMA LLD library, this is inconvenient for many cases. Another approach is to add a such sample_cfg.c (mainly sampleEdma3GblCfgParams) in your application code and change it here every time without rebuild EDMA LLD. This will take precedence over what provided from the EDMA LLD configuration. The TCP3D example used this approach and the sample_cfg.c file seems are copied from other SOCs than C6657. So, the code also create a new edma3init function with more arguments to select "edma3Id" and "tpccRegionUsed". Sorry for the confusion, hope this explains and please use the test code from TCP3D example for EDMA configuration.

    Regards, Eric 

  • I guess since I don't understand why the example code works nor do I understand why the driver code does not, specifically the _cfg.c files, I'll have to continue down the path I am currently on.  It seems to me that the details of the _cfg.c file can't be understood by a developer like myself since I was not able to find any documents to help me decipher the content of the cfg file.  I had traced the failure down to the ownDmaChannels section of the config but was not able to decode what that meant.  I assumed there would be a definite mapping that is unique to the C6657, but I don't believe that data is accessible to an outside developer.