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.

question about edma3init() on C6747EVM

Hi all,

I am working on synthesize a C6747 code project which can record using audioSample.pjt and mmcsdSample.pjt both from PSP drivers 01_30_01.

At first, I confronted the I2C problem and I followed the advice by link http://e2e.ti.com/support/embedded/f/355/p/63131/229120.aspx#229120

But I still have no output in my headphone and SD card. I debug the project finding that the code fails at the mmcsd task in

    //Configure MMCSD
#ifdef Mmcsd_GPIO_CDWP_ENABLE
    configureMmcsd(mmcsdGpioInputIsr);                //it fails at this line!!!!
#else
    configureMmcsd(NULL);
#endif 

I debug into that line find that it calls function edma3init() which is already called once by the audio task. I know this replicate call is forbidden.

My question is how can I initialize two EDMA handles which are for McASP and MMCSD, respectively? edma3init() for C6747 seems initialize one handle only. I tried the main_multi_edma.c in edma example in package edma3_lld_01_11_01_04, but it did not work for the second edma handle neither.

I need EDMA to control communication between memory and McASP and communication between memory and SD card. I think two EDMA handles are needed to fulfill this aim. What should I do? Can it return two EDMA handles when I call edma3init() once? Or I should first initialize one handle by edma3init() then edma3deinit() and consequently initialize another one by edma3init() then edma3deinit() again?

Any advice is welcomed!!

Best regards!

Bo Li

 

 

  • Bo Li,

    You have two stand-alone projects that you are combining into a single project. This will require edits to the code to make the two programs compatible with each other.

    For example, both had a main() function, but you have managed to get past that problem.

    This latest case of duplication between the two projects will require you to move some of the EDMA3 initialization to a common place, like main().

    You will only need to move the "system" initialization calls to main(). All of the channel initialization can be done in the McASP and MMCSD functions.

    Regards,
    RandyP

  • Thank you for your advice.

    RandyP said:
    For example, both had a main() function, but you have managed to get past that problem.

    I have addressed this question: I just merge the two main() function.

    http://e2e.ti.com/support/embedded/f/355/p/63131/229120.aspx#229120

     

    RandyP said:

    This latest case of duplication between the two projects will require you to move some of the EDMA3 initialization to a common place, like main().

    You will only need to move the "system" initialization calls to main(). All of the channel initialization can be done in the McASP and MMCSD functions.

    I will follow your advice.

    My specific question here is that: will edma3init() (I understand it as a "system" initialization calls from your description) ensure that I can use multiple EDMA channels by assigning with hEdma[0], hEdma[1]....?

    Best regards,

    Bo LI

  • Bo Li,

    I took a quick glance at the example code. My copy is from a different release version, but I doubt that makes any difference. Looking at the two .c files of the audioSample project, it is hard to figure out exactly what is being done with hEdma  So I can only give you my "usual" opinion of what is going on. I know the EDMA3 pretty well, but I am not an expert on the EDMA3 LLD software calls nor on these examples and the drivers they use.

    hEdma returned from edma3Init is usually the handle for the whole EDMA3 module, and not for an individual channel. edma3Init most likely should be called only once, and that would be best done in main() or some other top-level routine. You would use a single, global hEdma variable for the calls in both the audioSample and the mmcsdSample, although I did not find any references to hEdma in the mmcsdSample .c source files.

    Normally, you would be doing the right thing by moving the edma3Init() call to main() and assigning hEdma there, then make sure that is a global variable that can be accessed by the other functions.

    Please let us know how this works. If you have problems, we may want to move this thread to the Embedded Software forum where there are PSP experts available.

    Regards,
    RandyP

     

    If this answers your question, please click the  Verify Answer  button below. If not, please reply back with more information.

  • RandyP,

    I made it work (play back music while testing SD card) using you advice. What I misunderstood was the handle hEdma. I do not need to care about the channel ID and other parameters.

    I have to point out that i comment the follow line in configureMmcsd(...) function

     

    /*Configure i2c                            */
    // result = selectI2cExpanderMmcsd();

     

    I guess something is still wrong with my I2C configuration (I have already changed the PINMUX and device in .tcf file for I2C), but commenting, it can works, so i ignore the i2c.

    Regards,

    Bo Li

  • Hi  Bo Li,

     

    How you fix your problem with this proyect?

    Best regards,

     

    Paulina M.