使用STM32U5A9NJH6Q操作外部PSRAM APS512XXN-OBR-BG,HSPI时钟源为主时钟160Mhz,当分频值设置为1也就是160/(1+1 )= 80Mhz时能正常通信,但是分频值设置为0也就是160/(0+1 )= 160Mhz时就没反应了。
```
hhspi->Instance = HSPI1;
hhspi->Init.FifoThresholdByte = 2U;
hhspi->Init.MemoryMode = HAL_XSPI_SINGLE_MEM;
hhspi->Init.MemoryType = HAL_XSPI_MEMTYPE_APMEM_16BITS;
hhspi->Init.MemorySize = (uint32_t)POSITION_VAL(APS512XX_RAM_SIZE);
hhspi->Init.ChipSelectHighTimeCycle = 1U;//1U;
hhspi->Init.FreeRunningClock = HAL_XSPI_FREERUNCLK_DISABLE;
hhspi->Init.ClockMode = HAL_XSPI_CLOCK_MODE_0;
hhspi->Init.WrapSize = HAL_XSPI_WRAP_32_BYTES;
hhspi->Init.ClockPrescaler = 0;//1
hhspi->Init.SampleShifting = HAL_XSPI_SAMPLE_SHIFT_NONE;
hhspi->Init.DelayHoldQuarterCycle = HAL_XSPI_DHQC_DISABLE;
hhspi->Init.ChipSelectBoundary = 11U;//11U;
hhspi->Init.DelayBlockBypass = HAL_XSPI_DELAY_BLOCK_ON;
/* tCEM = 2 us max => REFRESH+4 clock cycles for read */
hhspi->Init.Refresh = ((2U * (hspi_clk / (Init->ClockPrescaler + 1U))) / 1000000U) - 4U;
hhspi->Init.MaxTran = 0U;
```
|