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.

RTOS/AM3359: McSPI control from PRU

Part Number: AM3359

Tool/software: TI-RTOS


I want to use the PRU to control MCSPI0. I set clk, cs, d0, d1 all in 0x30 (rxactive, pullup) in device tree. In register cm_per_spi0_clkctrl (0x44e00004c) i wrote 0x2. Write 0 in PRU-ICSS CFG to ensure ocp master port is enabled.

I set some spi parameters, then open the channel, set CS to LOW, write data in TX.

I checked register mcspi_ch0stat, i can see, EOT is 1, TXS is 1, RXS is 1. I think this represents a successful SPI transfer. However, the 8-bit clk is not displayed on the oscilloscope. I tried disabling the SPI node in the device tree to ensure that linux does not control the SPI, but there is still no signal display.

My question is:

1. do I need some special settings when using SPI in a PRU? For example, CM_PER_L4LS_CLKSTCTRL or M_PER_L3S_CLKSTCTRL. Because I saw mcspi.c in Starterware, this example has bit0 and 1. set these registers.
2. I did not map the mcpsi interrupt to the pru interrupt, does this affect the clock output. I just want to complete a simple function: write the data in tx, and then transfer it to the slave.

I used the 05_03_00_07 RTOS_SDK in BBB