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.

SPI Receive RXRAM all-zero without XDS510 connected

Hi,

I have an interaction problem between use of XDS510 USB debugger, TMS570 MCU Development Kit, SPI and DMA modules.

My setup is two TMS570 MCU connected by SPI1 to SPI1, CS, CLK, SOMI and SIMO, running at 8MHz. My SPI Master controls transmissions of 9*16-bit frames every 62.4us. The SPI Master receives constantly changing data from the SPI Slave. The SPI Master receives this data and uses the SPI RXBUF FULL interrupt to initiate a Semi_CPU DMA transfer from RXRAM to an internal software buffer of my own, RXBUF. Only one transfer group is used, TG0. I currently have the SPI Slave echoing back the received data.=

I use nowFlash to program each of my TMS570s.

My problem is that that data received from the SPI Slave at the SPI Master in RXRAM is all-zero without the XDS510 running a debug session. When the XDS510 session is CONNECTED, the data in RXRAM is seen to be non-zero, and equates to the data transmissted by the SPI Master.

I have verified that the data in RXRAM is zero without the debugger connected by setting a GIO LOW for zero data, GIO HIGH for non-zero data and then using a scope. Data in RXBUF matches that in RXRAM. Using the scope, I have also verified that the SPI Slave is transmitting valid changing data, it is not zero.

The SPI Slave (which uses the same technique to transfer data from RXRAM to RXBUF) does not exhibit this problem, data it receives from the SPI Master is valid within RXRAM and RXBUF.

I have spent a great deal of time narrowing down my complex interactions between SPI, ISR, DMA and CRC to this simple problem scenario, but I don't have a clue why this is happening. I have switched SPI Master/Slave applications across my two TMS570s but the problem just moves with the applications. Does anybody have any suggestions which may explain this behaviour?

Regards, Tony.

  • Hi Tony,

    When you use the DMA to transfer data from the RX RAM, please make sure that the source address is correct. I assume that you are transferring 16 bits at a time since the character length is set to 16 bits. The RX RAM bank is addressable starting from address 0xFF0E0000 + 0x200. This is a 32-bit wide RAM: bits 31 to 16 are the status field, while the received data is available from bits 15 to 0.

    So the initial source address for the DMA transfers should be 0xFF0E0000 + 0x202, incrementing by 4 bytes. Can you confirm that this is the case?

    Regards, Sunil

  • Hi Sunil,

    I think my settings are correct, see below. As I said, my Slave is okay and uses the same technique. There is some interaction with the XDS510 which is affecting my results. I'm about to try a new TMS570 MCU module to see if I can find something hardware related.

    sctChanConfig.enumRequestLine          = DMA_REQ_1_E;
    sctChanConfig.enumChannel              = DMA_CHAN_1_E;
    sctChanConfig.enumPriority             = DMA_PRIORITY_HIGH_E;
    sctChanConfig.nSourceAddress           = (uint32)&(((ramSpi[SPI_RAM_1_E]).RXRAM)[0]).SPIRXDATA;
    sctChanConfig.nDestinationAddress      = (uint32)&nSpi1RxBuf_M[nSpi1RxBufNew_M][0];
    sctChanConfig.enumSrcAddrControl       = DMA_ADDR_OFFSET_E;
    sctChanConfig.enumDestAddrControl      = DMA_ADDR_INC1_E;
    sctChanConfig.enumReadAccessBit        = DMA_ACCESS_16_BIT_E;
    sctChanConfig.enumWriteAccessBit       = DMA_ACCESS_16_BIT_E;
    sctChanConfig.enumTransferType         = DMA_FRAME_TRANSFER_E;
    sctChanConfig.enumAutoInit             = DMA_AUTOINIT_ON_E;
    sctChanConfig.nFrameCount              = 1U;
    sctChanConfig.nElementCount            = 9U;
    sctChanConfig.nChainChannel            = DMA_CHAN_2_E + 1U;
    sctChanConfig.nReadElementIndexOffset  = 4U;
    sctChanConfig.nWriteElementIndexOffset = 0U;
    sctChanConfig.nReadFrameIndexOffset    = 0U;
    sctChanConfig.nWriteFrameIndexOffset   = 0U;

    Regards, Tony.

  • Hi,

    I have performed a hardware swap-out and now get the same behaviour with XDS510 connection as when not connected. Unfortunately, my SPI Master RXRAM is now always zero, whereas my SPI Slave RXRAM data is valid. I'm sure there must be something wrong with my configuration, so I'll have to review it again, if I can get it to work at the Slave, I must be able to get it to work at the Master.

    Regards, Tony.

  • Tony,

    Please check the configuration of the pull disable and pull select register bits for the slave input pin. If PULDIS = 1 and PSEL = 0, this causes the input buffer to be disabled. This will cause all received data to be zeros. Also, connecting the debugger (test reset is high) forces the input buffer to be enabled. This could be why the code works fine when the debugger is connected.

    Let me know if this closes the issue.

    Regards, Sunil

  • Hi Sunil,

    I have checked the configuration of the PULDIS and PSEL and there was no problem with their setups. However, your comment prompted me to look at the actual pull-up/down configurations of my master/slave and I found they were different, and so fighting each other.

    Having modified these so that they are the same values, everything seems to work now. I get valid data when running with the debugger connected and disconnected.

    So, thanks for the pointer; this issue is now resolved.

    Regards, Tony.