AnsweredAssumed Answered

IMX7D M4 ECSPI3 using SAI2 pads not working

Question asked by Andrew Gatrost on Nov 3, 2017
Latest reply on Nov 7, 2017 by Carlos_Musich

Having trouble getting the ecspi3 to work out of the mikrobus connector on the sabre board rev D using FreeRTOS on the M4.

I am trying to set up ecspi3 with the m4 on the imx7d. When reading the ECSPI3_STATREG (0x30840018) register the module appears to be doing as expected, but we are not getting any data on the pads.   Here is how we have the registers configured:

 

 

We have read back these registers and verified that they are being set as expected.

We tried to initialize the ecspi3 using these steps:

1.  Cleared the EN bit in the ECSPI3_CONREG

     Set ECSPI3_CONREG = 0

2.  Enabled the clocks for ecspi3

     RDC_SetPdapAccess(RDC, rdcPdapEcspi3, 3 << (1 * 2), false, false);

     CCM_UpdateRoot(CCM, ccmRootEcspi3, ccmRootmuxEcspiOsc24m, 0, 0);

     CCM_EnableRoot(CCM, ccmRootEcspi3);
     CCM_ControlGate(CCM, ccmCcgrGateEcspi3, ccmClockNeededRunWait);

3.  Set the EN bit for the ECSPI3_CONREG

     Set ECSPI3_CONREG = 1

4.  Configure IOMUX for ECSPI3 external signals

     daisy registers:

     IOMUXC_ECSPI3_SCLK_SELECT_INPUT (0x30330544) = 1

     IOMUXC_ECSPI3_MISO_SELECT_INPUT (0x30330548) = 1

     IOMUXC_ECSPI3_MOSI_SELECT_INPUT (0x3033054C) = 1

     IOMUXC_ECSPI3_SS0_B_SELECT_INPUT (0x30330550) = 1

 

     mux control pad registers:

     IOMUXC_SW_MUX_CTAL_PAD_SAI2_TX_SYNC (0x3033021C) = 1

     IOMUXC_SW_MUX_CTAL_PAD_SAI2_TX_BCLK (0x30330220) = 1

     IOMUXC_SW_MUX_CTAL_PAD_SAI2_RX_DATA (0x30330224) = 1

     IOMUXC_SW_MUX_CTAL_PAD_SAI2_TX_DATA (0x30330228) = 1

 

     we tried multiple variations of the pad control registers

5.  Configure registers for the ECSPI3 for the external SPI device

     .clockRate = get_ecspi_clock_freq((ECSPI_Type*)ECSPI3_BASE),
     .baudRate = 500000,
     .channelSelect = ecspiSelectChannel0,
     .mode = ecspiMasterMode,
     .burstLength = 7, /*24, /* don't know if this is correct */
     .clockPhase = ecspiClockPhaseSecondEdge,
     .clockPolarity = ecspiClockPolarityActiveLow,
     .ecspiAutoStart = FALSE

     ECSPI_CONREG_REG = 00F0B211

 

We are seeing in the ECSPI3_STATREG starts at being 3, when transmitting is 0 and then returns to 3, but nothing is happening on the O-scope looking at the mikrobus lines

Is there anything we are missing, or not setting up right?

Outcomes