AnsweredAssumed Answered

SPI transfer fail

Question asked by ly K on Sep 28, 2017

hello

     I have a question about spi .

     when I  transfer data by spi, the flag of TCF does not set, the code like below:

     

data &= 0xff;
cont &= 0x01;
cs &= spi_cs_mask[com];
pushr_tmp = (data<<DATA_SHIFT)|(cs<<PCS_SHIFT)|(ctar_current<<CTAS_SHIFT)|(cont<<CONT_SHIFT);

pspi[com]->PUSHR.PUSHR.R = pushr_tmp;

while(1 != pspi[com]->SR.B.TCF){
        secure_counter++;
        if (secure_counter > SPI_SECURE_COUNTER) {
            return 0xff;
        }
 }

It will always return 0xff.

Outcomes