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.

USB interrupt in transaction failing

Hi All,

I'm unable to get a USB transaction to complete. The basic scenario is this:

I am running a number of self-tests on our device (on the 5509a chip). At the conclusion of each test or test stage, I send the results to the host, a Windows PC. These results are sent via USB using DMA through EP4 in, configured as an interrupt endpoint. **All these transactions are successful, save one.** Some (possibly) pertinent notes:

- We do not use CSL, but most of the CSL USB functions are compiled from source

- I call USB_postTransaction, which calls USB_procDmaTransaction, which fails on the last instruction: USB_DMA->DCTL = dma_ctrl_mask; dma_ctrl_mask is equal to 0x0001 -- it is simply setting the GO bit

- The EP4 in context registers before a transaction (successful or not) look like this: DSIZ set to 0x000C (12 bytes to send) and DADL and DADH set to the (byte) address of the destination buffer; all others are 0x0000

- After a successful transaction, the DCT register reads 0x000C

- After an unsuccessful transaction, the DCT register remains 0 and DCTL reads 0x0201; bit 9 is reserved and bit 0 is the GO bit, indicating that the transaction has not completed

I'm rather new to embedded programming. I'm happy to oblige with any additional information any of you more experienced hands may request. I'll add a couple of points that may be of interest.

- The transaction that fails follows the most complex of the self-tests. I've isolated two lines within the self-test which, when commented out, will allow the transaction to complete. They are:

*DMA5_CCR |= DMAn_CCR_EN_MASK; (sets EN bit of DMA channel 5 Control Register)

*MCBSP2_SPCR2 |= MCBSP_SPCR2_FRST_MASK; (sets FRST bit of McBSP 2 Serial Port Control Register 2)

- I have scanned all the USB registers for clues but nothing has caught my eye.

- No subsequent USB transactions will succeed.

Thanks in advance.

Dave.

  • Does anyone have solution for this problem?
  • Have you tried with different EP? What about using CSL? The McBSP should not be related to DMA / USB transaction.
    Regards.
  • Thanks for your reply, Steve.

    I haven't tried another endpoint because endpoint 4 works fine every other place it is used. There is something in this case that interferes with it, but I've yet to find what that is.

    I wouldn't expect McBSP to affect the transaction either, or DMA5 for that matter since (as I understand it) USB shares a dedicated port with HPI and doesn't use one of the four ports used by the six general purpose channels. However, I can, as described previously, get the transaction to complete by commenting out both lines.
  • A couple of other things I've noticed with this problem:

    - The ISR defined for the endpoint object does not get called (not surprising, as the transaction itself is failing)

    - Although the USB module remains running (the device is still visible to Windows), no additional EP4 transactions will succeed without restarting the program

    Steve: I think I will try another EP and see what happens.

    Dave.