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.

what's wrong with my c6727?

I modified the example of dmax from team of TI,but it can't trigger the interrupt correctly.The example of dmax transfer the data internally using dmax module,but I want to transfer data from mcasp,so I modified the event to event 5,mcasp0rx,but it can't trigger the interrupt through the data has been transfered.So ,I want to kown if I chang the event number,what else I should modify to ensure the interrupt being triggered correctly?

Thank you!

  • Hi David,

    Thanks for your post.

    Basically, the event signal edge (rising/falling) will be used to trigger an event which should be defined. To trigger an event on the rising edge of the event signal, a bit corresponding to the event in the DEPR should be set to one. To trigger an event on the falling edge of the event signal, a bit corresponding to the event in the DEPR should be cleared to zero

    There are bit fields in the event entry needs to be configured, for example,

    1. When a transfer is complete, the TCINT bit should be set if a notification to the CPU is required.The ATCINT bit should be set if notification to the CPU is required after transfer of each frame.

    2. The TCC indicates which bit in the DTCR is going to be set to indicate transfer status to the CPU.

    Likewise, there are distinct steps that are required to set up a general-purpose dMAX transfer. For details, Please refer Section 3.2.1 in the c672x dMAX reference guide as given below:

    http://www.ti.com/lit/spru795

    Also, Please check Section 2.3.1 (DER0 for EVT5), 2.3.4 (DEFR), 2.3.5 (DEER) for dMAX control registers to check the status of Event 5 configuration. There is an example for sevicing McASP peripheral which is shown in 3.6.1, please refer this too for better understanding in the above dMAX reference guide.

    Please see Section 2.3 for appropriate CPU interrupt assignments and ensure that the dMAX is generating interrupts to the CPU on any of lines INT9–13 and INT15 in response to peripheral events as given in the c672x datasheet below:

    http://www.ti.com/lit/sprs268

    Please refer Section 3.3.2 for transfers through the dMAX Port in the C672x McASP reference guide as given below:

    http://www.ti.com/lit/spru878

    Thanks & regards,

    Sivaraj K

    ---------------------------------------------------------------------------------
    Please click the
    Verify Answer button on this post if it answers your question.
    ---------------------------------------------------------------------------------

     

     

     

     

  • Sivaraj K,

    Tank you so much,I have checked all your suggest,I havn't found any wrong with my program.But when I ran my program partly by toggling breakpoints,I found that everytime the program will stop here:  CSL_intcPlugEventHandler (hIntc, &isrRec),which is in the init program of interrupt.This is a CSL API,so,it cound't be wrong,I can't find the key to this problem,do you kown why it stopped?Moreover,the all init program of interrupt comes from the example of TI,it could't be wrong,why it stopped?

    Thank you.

  • Hi David,

    Thanks for your post again.

    Have you checked the status of dMAX control registers (DER0, DEFR, DEER) for the newly configured event 5 (mcasp0rx) which i have mentioned in the above post?

    As per your above post, the CSL API (CSL_intcPlugEventHandler) is not returning an appropriate handle to run through the code, and the program is stopping here. This indicates, the newly configured event 5 for mcasp0rx is not initialised properly and the interrrupt controller is not assigning the CPU interrupt properly to handle the new event5.

     I recommend you to access the dMAX control registers and read the value of appropriate bits to check the status of Event 5 configuration. Please ensure, it is set properly.

    Thanks & regards,

    Sivaraj K

    ---------------------------------------------------------------------------------
    Please click the
    Verify Answer button on this post if it answers your question.
    ---------------------------------------------------------------------------------
  • Sivaraj K,

    Your recommendation is so useful,I appreciate you so much.Below is the control regesters image:

    I consider that the DEER is right,the DEFR should be 0x00000020,and the DER0 should be 0x00000020,but they not.I check the configuration of my regesters,but can't find what's wrong,can I bother you having a look?

    dmaxstatus = CSL_dmaxInit (NULL);

    CSL_intcSetVectorPtr (ISTP_VECTOR_VALUE);

    dmaxEvent.eventUid = CSL_DMAX_HIPRIORITY_MCASP0RX_UID;

    dmaxEvent.paramUid = CSL_DMAX_HIPRIORITY_PARAMETERENTRY0_UID;

    hDmax = CSL_dmaxOpen (&dmaxEvent, CSL_DMAX, NULL, &dmaxstatus);

    gpxfrEventSetup.qtsl = CSL_DMAX_EVENT2_QTSL_MOVE4_ELE;

    gpxfrEventSetup.tcc = CSL_DMAX_EVENT2_TCC_RESETVAL;
    gpxfrEventSetup.sync = 0x00;

    gpxfrEventSetup.atcint = CSL_DMAX_EVENT2_ATCINT_DISABLE;

    gpxfrEventSetup.tcint = CSL_DMAX_EVENT2_TCINT_ENABLE;

    gpxfrEventSetup.rload = CSL_DMAX_EVENT2_RLOAD_ENABLE;

    gpxfrEventSetup.cc = CSL_DMAX_EVENT2_CC_COUNT2_7_COUNT1_16_COUNT0_8;//modified

    gpxfrEventSetup.esize = CSL_DMAX_EVENT2_ESIZE_32BIT;

    gpxfrEventSetup.pte = hDmax->paramPtr;

    gpxfrEventSetup.etype = CSL_DMAX_EVENT2_ETYPE_GENERALXFR;
    gpxfrEventSetup.paramSetup = &gpxfrParameterSetup;


    gpxfrParameterSetup.count0 = 0x02;

    gpxfrParameterSetup.count1 = 0x800;

    gpxfrParameterSetup.count2 = 0x00;

    gpxfrParameterSetup.srcIndex0 = 0x00;

    gpxfrParameterSetup.dstIndex0 = 0x800;

    gpxfrParameterSetup.srcIndex1 = 0x00;

    gpxfrParameterSetup.dstIndex1 = -2047;

    gpxfrParameterSetup.srcIndex2 = 0;

    gpxfrParameterSetup.dstIndex2 = 0;

    gpxfrParameterSetup.srcReloadAddr0 = (Uint32) 0x54000000;

    gpxfrParameterSetup.dstReloadAddr0 = (Uint32) 0x80000000;

    gpxfrParameterSetup.srcReloadAddr1 = (Uint32) 0x54000000;

    gpxfrParameterSetup.dstReloadAddr1 = (Uint32) 0x80004000;


    dmaxhwSetup.polarity = CSL_DMAX_POLARITY_RISING_EDGE;

    dmaxhwSetup.priority = CSL_DMAX_EVENT_HI_PRIORITY;
    dmaxhwSetup.eventSetup = (CSL_DmaxEventSetup *) & gpxfrEventSetup;

    dmaxstatus = CSL_dmaxHwSetup (hDmax, &dmaxhwSetup);

    dmaxstatus = setup_interrupts ();

    dmaxstatus = CSL_dmaxHwControl (hDmax, CSL_DMAX_CMD_EVENTDISABLE, NULL);

    dmaxstatus = CSL_dmaxHwControl (hDmax, CSL_DMAX_CMD_EVENTENABLE, NULL);

    dmaxstatus = CSL_dmaxHwControl (hDmax, CSL_DMAX_CMD_STARTASYNCTRANSFER, NULL);

    dmaxstatus =
    CSL_dmaxGetHwStatus (hDmax, CSL_DMAX_QUERY_GET_TCC, (void *) &response);

    dmaxstatus = CSL_dmaxHwControl (hDmax, CSL_DMAX_CMD_CLEARTCC, NULL);

    dmaxstatus =
    CSL_dmaxGetHwStatus (hDmax, CSL_DMAX_QUERY_GET_TCC, (void *) &response);

    dmaxstatus = CSL_dmaxHwControl (hDmax, CSL_DMAX_CMD_STARTASYNCTRANSFER, NULL);

    dmaxstatus = CSL_dmaxClose (hDmax);

    For your easily reading,I remain the key information.Thank you so much

  • Hi David,

    I can understand the current situation from the above control registers image which you has shared.

    Inorder to enable an event, the corresponding bit must be set in dMAX Event Enable Register (DEER). Any of the event bits in the DEER can be set to 1 to enable that corresponding event and you can try enabling events by writing 1 to corresponding bits in DEER. By doing this, you shall observe the updated status of the control registers image.

    I have looked at the code shared above, please check the status of dmaxEvent.eventUid which is the newly created event for MCASP0RX_UID after you enable an corresponding event in DEER. All the rest in the cdoe seems to be fine.

    Once an event has been posted in the dMAX Event Flag Register (DEFR), and the event is enabled in the DEER, the event flag is automatically cleared by dMAX, immediately after it starts processing the request.

    Thanks & regards,

    Sivaraj K

    ---------------------------------------------------------------------------------
    Please click the
    Verify Answer button on this post if it answers your question.
    ---------------------------------------------------------------------------------

     

  • I respect you working so late and hard.

    I deleted these two sentences:

    dmaxstatus = CSL_dmaxHwControl (hDmax, CSL_DMAX_CMD_EVENTDISABLE, NULL);

     dmaxstatus = CSL_dmaxHwControl (hDmax, CSL_DMAX_CMD_EVENTENABLE, NULL);   

    and added these two sentences:

    *(Uint32 *)0x6000000c=0x00; //the address of the DEER

    *(Uint32 *)0x6000000c=0x20;

    the program performed the same wrong just now,but the data was always transfering because I saw the data in 0x8000000 and 0x80004000 were always changing in some time.I also checked the dmaxEvent.eventUid,which is CSL_DMAX_HIPRIORITY_EVENT5_UID    (0x10FF0005u) in the cslr_dmax.h.

    I also found it get in the ISR service  after my running of the dmax example from TI in accasional

    Is there posible wrong in  other place,or what can I do to examine where the mistakes locate?

  • Hi David,

    As per control registers image you shared in the previous post,

    DEER seems to be right, DEFR should be 0x00000020,and the DER0 should be 0x00000020. But now, you were trying to assign value to the address of the DEER.

    i don't really understand your changes mentioned in the above code.

    Please clarify the same.

    Thanks & regards,

    Sivaraj K

    ---------------------------------------------------------------------------------
    Please click the
    Verify Answer button on this post if it answers your question.
    ---------------------------------------------------------------------------------
  • Sivaraj K,

    So glad to receive your reply.

    .Last night you suggested me "you can try enabling events by writing 1 to corresponding bits in DEER. By doing this, you shall observe the updated status of the control registers image.",I thought it's your proposal to set the DEER and observed it,I misunderstood apparently.

     The DEFR should be set by dmax ,and the DER0 is read-only register ,so I don't kown what I should do to find my fault in my program?

    Please help me with more details.

    Thank you for your deeply night reply again.

  • Hi David,

    if you set the appropriate event bits in DEER and DEFR, it will be automatically reflected in DER0 since it is a read-only register. Once you set correctly, please evaluate the expected status in the dMAX control registers image and share it across the updated image.

    If the above things are taken care appropriately, you should not find any fault in your program hopefully.

    Thanks & regards,

    Sivaraj K

    ---------------------------------------------------------------------------------
    Please click the
    Verify Answer button on this post if it answers your question.
    ---------------------------------------------------------------------------------
  • Sivaraj K,

      Thank you.

      I tried to modifed the bit of DEFR and DTCR0 using *(Uint 32*)0x6000001c=0x00,*(Uint32 *)0x6000001c=0x20 (0x6000001c is the address of DEFR);*(Uint32 *)0x60000080=0x00(0x60000080 is the address of DTCR0),but both of them had changed.Whether they can't be changed like this?

    So,my interrupt also can't be triggered although everywhere I can thought of had been searched.