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/AM3358: SPI control

Part Number: AM3358
Other Parts Discussed in Thread: SYSCONFIG

Tool/software: Linux


Hi,

I am using BBB.

I am trying to write a value directly in the register to control mcSPI, not through the spi library.  
But no matter how I change the value, I can't send the correct CLK signal.


I wrote a program through the SPI library, it works fine, I used config-pin to change the pin-mode, so I think I should have no errors in the pinmux settings.

Here is the simple program I wrote. I used devmem2 to write value in register.

CM_PER_SPI1_CLKCTRL 0x2  //enable clk

MCSPI_SYSCONFIG 0x2  //reset spi

MCSPI_MODULCTRL 0x1 // single master 4pin mode

MCSPI_SYSCONFIG 0x309 // OCP and Functional clocks are maintained and smart-idle

MCSPI_IRQSTATUS 0xffffffff //reset interrupt

MCSPI_IRQENABLE 0x70 //enable tx1_underflow, rx1_full, tx1_empty

MCSPI_CH1CTRL 0x0 //disable channel1

MCSPI_CH1CONF 0x0x20103cc //set config of spi1

MCSPI_CH1CTRL 0x1 //enable channel1

MCSPI_TX1 0xaa //write 0xaa in tx1

MCSPI_CH1CTRL 0x0 //disable channel

Please tell me where the error is, thank you very much, I have been looking for a few weeks and no results.

  • Hi Hao,

    Do you use AM335x TI PSDK Linux? If yes, which version?

    Do you try to change the pinmux from user space with devmem2 tool? If yes, note this is not possible and you need to change the pinmux only in u-boot or kernel level.

    Regards,
    Pavel