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.

TMS570LC4357: MibSPI2 w/ DMA

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

I am currently working on setting up MibSPI2 with the DMA. For some reason, the DMA is not transferring data to the MibSPI RAM when I try to write data (data is outputted if I call mibspiSetData()). I have looked at the example in the HalCoGen folder and have looked at some other examples on these forums and it seems that I am doing the same procedure as those examples yet it does not seem to work. Here is my code procedure so far:

mibspiInit();
dmaConfigCtrlPacket();
dmaSetCtrlPacket(DMA_CH0, dmaCtrlPckWrite);
dmaReqAssign(DMA_CH0, DMA_REQ3);
dmaReqAssign(DMA_CH1, DMA_REQ2);
dmaSetChEnable(DMA_CH0, DMA_HW);
dmaSetChEnable(DMA_CH1, DMA_HW);
dmaEnableInterrupt(DMA_CH0, FTC, DMA_INTA);
mibspiDmaConfig(mibspiRegister, 0, 0, 1);
dmaEnable();
mibspiTransfer(mibspiRegister, 0);

Am I missing something in my DMA configuration? I don't know why else it wouldn't copy data from my buffer to the mibspiRAM.

Thanks

  • Hello,

    On TMS570LC43 device, the MibSPI2 module shares pins with NHET module. Did you configure the pinmux for MibSPI2?

    In HALCoGen, select pinmux tab, under pi mux pannel, please enable "MibSPI2".

    Regards,
    QJ
  • Yes, I did configure the pinmux for MibSPI2. I followed the same steps that you mentioned when I generated the code. I used this tutorial from TI to configure HalCoGen (except for MibSPI2 rather than MibSPI1):

    training.ti.com/hercules-tutorial-mibspi-and-dma-overview

    Thanks,

    Milin

  • Hello Milin,

    I noticed that Mr. Tony had the similar issue and fixed after modifying the code. RM57 and TMs570LC43x have the same MibSPI and DAM.

    here is the link:

    Please let me know if it helps you.

    Regards,

    QJ

  • I looked at the changes from that post, the only thing I am doing differently is using DMA CH 0/1 instead of 2/3. I changed it to use DMA CH3 so the request line should be mapped to MIBSPI2[0] by default, which is the transmit. The code looks like this now:

    mibspiInit();
    dmaConfigCtrlPacket();
    dmaSetCtrlPacket(DMA_CH3, dmaCtrlPckWrite);
    dmaSetChEnable(DMA_CH3, DMA_HW);
    dmaSetChEnable(DMA_CH2, DMA_HW);
    dmaEnableInterrupt(DMA_CH3, FTC, DMA_INTA);
    mibspiDmaConfig(mibspiRegister, 0, 0, 1);
    dmaEnable();
    mibspiTransfer(mibspiRegister, 0);

    This seems to be the same as the post you mentioned. The "charlen" field is the same for MibSPI1/MibSPI2 in my case so that did not apply and I am not sure why the TGCTRL PSTARTx would be 128 instead of 127, as the TRM says the max is 127. I tried changing it to 128 anyways but I did not see any changes.

    I am not sure what the issue is. I can see the DMACTRL COUNTx changing but I still don't see any data being outputted or being transferred to the MibSPI2 RAM.
  • Hello Milin,

    Can you share your project with me? I will try on my bench.

    Regards,
    QJ
  • I am testing this code as part of a larger project that I cannot share. I have attached the relevant files for the mibspi code, though. Calling the "Eeprom25lc512_Init()" function will run the code that I am testing.

    8372.mibspi2.zip

  • Have you been able to pinpoint the source of the issue?

    I am stuck with exactly the same problem and can't figure out why the DMA is not triggered...

    Cheers,

    Arthur