Post Go back to editing

ADSP-21363 SPI DMA exchange issue

Category: Hardware
Product Number: ADSP-21363

I am having issue with SPI DMA data exchange. There is two ADSP-21363 connected via SPI. When sub transfers main recieves data but with SPIS=3 in SPIDMAC and RXS=1 in SPISTAT. And when main transfers in response sub does not recieves data with SPIS=3, SPIERRS=1 in SPIDMAC and ROVF=1, RXS=1 in SPISTAT.8461.attachment.zip 

How can i fix it correctly?

Any help is appreciated.

  • Hi,

    Using your code on the ADSP-21369 EZ-KIT, we successfully transferred data from the main to the sub without any issues. We made modifications to configure the sub to use SPIB. Please refer the attached project, test it on a single board, and share your results with us.

    SPI_21369.zip

    To assist you better, please let us know if the SPIOVF, SPIUNF or SPIMME bits are set when main transfers the data to Sub.
    Also, we assume the sub receiver is enabled before the main transmitter. Could you please confirm the sequence?

    Regards,
    Nandini C

  • Hi,  NandiniC.

    Thank you for quick answer.

    Using your code on the ADSP-21369 EZ-KIT, we successfully transferred data from the main to the sub without any issues. We made modifications to configure the sub to use SPIB. Please refer the attached project, test it on a single board, and share your results with us.

    Unfortunately, i dont have ADSP-21369 EZ-KIT right now. So i cannot test your code. All i have is some kind of prototype board with two ADSP-21363 on it.

    To assist you better, please let us know if the SPIOVF, SPIUNF or SPIMME bits are set when main transfers the data to Sub.

    This is how SPI Control registers look like after DMA enabled:

     

    Also, we assume the sub receiver is enabled before the main transmitter. Could you please confirm the sequence?

    Maybe that's the problem, but i dont know how to figure out. 

     

  • Hi,

    Unfortunately, i dont have ADSP-21369 EZ-KIT right now. So i cannot test your code. All i have is some kind of prototype board with two ADSP-21363 on it.
    >> You can run this project in your custom board too. Please run this project and let us know the results.

    This is how SPI Control registers look like after DMA enabled:
    >> It seems the screenshot belongs to Slave. Could you please share us for Master too.

    Maybe that's the problem, but i dont know how to figure out.
    >> Could you please place breakpoints on the functions “ConfigureDMAToReceive” and “ConfigureDMAToTransfer” in your project?
    When running the project, “ConfigureDMAToReceive” is triggered first, followed by “ConfigureDMAToTransfer.”

    Regards,
    Nandini C

  • Hi,

    This is screenshot form main. Looks like no errors thrown.

    I have two projects, one for main and another for sub. 

    I can have only one debug session for main or sub via JTAG connection, isn't it?

    So how i can figure out that “ConfigureDMAToReceive” in sub is triggered first,  followed by “ConfigureDMAToTransfer” in main?

    Sorry if its sounds stupid to you but it is all new for me.

    Thank you for your patience.

  • Hi,

    >> You can run this project in your custom board too. Please run this project and let us know the results.

    I have so many errors in SRU initialization routine while building the project.

    I assume it is because your project for 21369 but i have 21363 here. 

    And maybe this will be usefull: there is same board but with two ADSP-21262 and everything works fine. I dont know why.

  • Hi, 

    We have reviewed your project, and the SPI and DMA configurations appear to be correct. 

    The reference project we shared earlier uses the same configuration and works correctly on the EZ-Kit. Therefore, we suspect the issue may be related to your hardware or the sequence in which the transmitter and receiver are enabled. For proper communication, the receiver should always be enabled before the transmitter. 

    Do you have another custom board with the same processor? If so, please test it using your current setup and share the results with us. 

    You mentioned:

    • “I have two projects, one for main and another for sub. I can have only one debug session for main or sub via JTAG connection, isn't it?”
    • “There is another board with two ADSP-21262 processors where everything works fine. I don't know why.”

    Could you please clarify how the debug sessions are set up for the ADSP-21363 compared to the ADSP-21262? Specifically, does the ADSP-21262 setup also involve two processor in the single board and two independent projects [i.e like the ADSP-21363 project]?

    Regards,

    Nandini C

  • Hi, .

    For proper communication, the receiver should always be enabled before the transmitter. 

    You were absolutely right about that. This SPI code is a part of a bigger project so me and my hardware engineer spent a couple of evenings figuring out what the problem is. And we solved it. This was a timig problem.

    SPI and DMA configurations was correct.

    Thank you so much for you help. You showed me the right way)