SPI transfer fail

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI transfer fail

508 Views
lyk
Contributor I

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.

0 Kudos
Reply
0 Replies