SPI transfer fail

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SPI transfer fail

525 次查看
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 项奖励
回复
0 回复数