Spi config for m4 core

i am working in colibri imx7 M4 core for last few days , now i am facing a issue in ECSPI1 peripheral init configuration , is SPI required PDAP access for init configuration anyone help me to solve this issue is appreciated

Dear @arunprasad

On the i.MX7 by default all peripherals are unprotected and thus can be accessed by both the M4 and A7 cores. PDAP can be used to reserve any peripheral for one core, and thus prohibit access by the other core.

So the behavior might be different whether you run the M4 application before or after starting Linux.

To exclude the potential conflict in your first tests, I recommend you stop the Linux / WinCe boot process in the bootloader and start the M4 application from there. The bootloaders do not touch PDAP, so you can be sure your M4 code has full access to the SPI peripheral.

Regards, Andy

i am using sample program to chk is spi working correctly or not plz help to clear this issue

link text

chip select activity is not there in the sample main program

static bool ECSPI_MasterTransfer(bool command,uint8_t* txBuffer, uint32_t transferSize)
{
    uint32_t len;

    if((ecspiState.isBusy) || (transferSize == 0))
    {
        return false;
    }

    if(command==LCD_COMMAND)
    {
		/* Update the burst length to real size */
		len = (uint32_t)(transferSize * 8 - 1);
		ECSPI_SetBurstLength(BOARD_ECSPI_BASEADDR, len);

		/* Configure the transfer */
		ecspiState.txBuffPtr = txBuffer;
		//ecspiState.rxBuffPtr = rxBuffer;
		ecspiState.txSize = transferSize;
		//ecspiState.rxSize = 0;

		/* Fill the TXFIFO */
		ECSPI_MasterTransmitBurst();
		/* Enable interrupts */
		ECSPI_SetIntCmd(BOARD_ECSPI_BASEADDR, ecspiFlagTxfifoEmpty, true);
		return true;
    }

    if(command==LCD_DATA)
    {
    	/* Update the burst length to real size */
    	    len = (uint32_t)(transferSize * 8 - 1);
    	    ECSPI_SetBurstLength(BOARD_ECSPI_BASEADDR, len);

    	    /* Configure the transfer */
    	    ecspiState.txBuffPtr = txBuffer;
    	    //ecspiState.rxBuffPtr = rxBuffer;
    	    ecspiState.txSize = transferSize;
    	    //ecspiState.rxSize = 0;

    	    /* Fill the TXFIFO */
    	    ECSPI_MasterTransmitBurst();
    	    /* Enable interrupts */
    	    ECSPI_SetIntCmd(BOARD_ECSPI_BASEADDR, ecspiFlagTxfifoEmpty, true);
    	    return true;
    }

Dear @arunprasad

I retested the default SPI application ecspi_polling_master, and SPI activity is there - for example the chip select pulse is visible on SSPFRM (SODIMM 86).
Did you have a look at the main function of the source code? There is some interaction through UART_B (SODIMM 36, 38) before the actual SPI transaction starts:

int main(void)
{
    /* ... */

    while (true)
    {
        PRINTF("Press \"s\" when SPI slave is ready.\n\r");
        control_char = GETCHAR();
        if ((control_char == 's') || (control_char == 'S'))
            break;
    }

    /* Send 1~20 to slave and receive data from slave */
    for (uint8_t i = 0; i < 20; i++)
    {
        txData++;
        ECSPI_MasterTransfer(&txData, &rxData, 1);
        PRINTF("MASTER: Transmited data: %d \n\r", txData);
        PRINTF("      : Received   data: %d \n\r", rxData);
    }
    /* ...*/
}

Regards, Andy