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.

Linux/DRA746: McSPI 32 Bit Word Length Issue

Part Number: DRA746

Tool/software: Linux

Hello Support,

I have a kernel driver that is trying to load firmware onto a DSP via the SPI bus.  The DSP requires a 32 bit word length and when I configure the SPI device for 32 bit word length there seems to be no data sent to the DSP.  switching the word length to 16 or 8 along with the data type sent to the spi_write command seems to work without an issue.  Is there an example of using 32 bit word length mode?  I am using the below configuration for the SPI device and the write command returns -22 when set to 32 bits per word.  When set to 8 bits per word and 16 bits per word the SPI works correctly and was verified on the scope.

uint8_t tmp = { 0x01,0x02,0x03,0x04 }

spi->bits_per_word = 32;
spi->mode = SPI_MODE_3;
ret = spi_setup(spi);

ret = spi_write(spi, (uint32_t*)tmp, 1);

Thank You in advance,

George

  • Hi George,

    Do you use TI board or custom board? Do you use PSDKLA 3.02?

    George Vigelette said:
    The DSP requires a 32 bit word length and when I configure the SPI device for 32 bit word length there seems to be no data sent to the DSP.

    Do you mean you need to transfer data from external chip (attached to McSPI) to DRA74x C66x DSP? Which McSPI module you are using (SPI1, SPI2, SPI3, SPI4)? Where do you find that C66x DSP requires 32-bit transfer?

    George Vigelette said:
    switching the word length to 16 or 8 along with the data type sent to the spi_write command seems to work without an issue.

    Do you mean that 8/16-bit transfers to C66x DSP work fine?

    Regards,
    Pavel

  • Hi Support,

    I ended up resolving my problem with ensuring that the data was 32 bit aligned, after that the error that I was seeing did not show up again.  Which makes sense why my small test data arrays were working.  Also using the spi write command with a 8 bit pointer and count of 4 was needed to transfer the 32 bits.

    Thank You,

    George

  • Hi George,

    Thanks for sharing the solution.

    Regards,
    Pavel