This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1230C3PM 外挂4MBit SPI FLASH无法读取



ARM发写命令到flash,可以检测到时钟和片选以及数据,读的时候,使用示波器时钟、片选及数据都检测不到

代码如下:

s32 Flash_Read(u32 u32Addr, u8 *pu8Data, u16 u16Len)
{
	u8 u8AddrH = 0;
	u8 u8AddrM = 0;
	u8 u8AddrL = 0;
	u8 u8Data = 0;
	u16 u16Index = 0;
	// Wait until SSI0 is done transferring all the data in the transmit FIFO.
    while(SSIBusy(SSI0_BASE))
    {
    }
	
	u8AddrL = (u8)(u32Addr & 0xff);
	u8AddrM = (u8)((u32Addr >> 8) & 0xff);
	u8AddrH = (u8)((u32Addr >> 16) & 0xff);

	/* 下发读命令 */
	SSIDataPut(SSI0_BASE, SPI_FLASH_READ_DATA);		
	/* 写地址 */
	SSIDataPut(SSI0_BASE, (u32)u8AddrH);
	SSIDataPut(SSI0_BASE, (u32)u8AddrM);
	SSIDataPut(SSI0_BASE, (u32)u8AddrL);
	/* 读取一个字节 */
	for (u16Index = 0; u16Index < u16Len; u16Index++)
	{
		SSIDataGet(SSI0_BASE, (u32*)&u8Data);
		pu8Data[u16Index] = u8Data;
	}
    

	return AC_RET_OK;
}