3

STM32L QSPI 速度测试

 2 years ago
source link: https://www.taterli.com/8357/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

STM32L QSPI 速度测试

测试平台STM32L496,芯片支持最高主频80MHz,QSPI Flash最高支持104MHz,因此不分频,测试每次搬运1KB,2KB,4KB,8KB,测试内部Flash(双区模式),QSPI单芯片,QSPI双芯片模式,分别对比速度,开启全部Cache,使用FIFO和MemoryMap方式访问,校验数据有效.测试1GB传输.

测试代码:

https://github.com/nickfox-taterli/stm32l4_qspi_benchmark

int main(void)
{
  HAL_Init();

  SystemClock_Config();
  BSP_QSPI_Init();

  // 1KB 数据
  for(uint16_t i = 0;i < 0x400;i++){
    wData[i] = i;
    rData[i] = 0;
  }

  for(uint16_t i = 0;i < 16;i++){
    BSP_QSPI_Erase_Block(i);      
  }
  
  for(uint16_t i = 0;i < 16;i++){
    BSP_QSPI_Write(wData,0x400 * i,0x400);      
  }
  
  BSP_QSPI_MemoryMappedMode();
  
  HAL_Delay(5);
  
  time_start = HAL_GetTick();
  
  // 1GB 数据传输
  for(uint32_t i =0;i < (1024 * 1024) ;i++){
     memcpy(&rData,(void *)0x8000000,0x400);
  }
  
  time_end = HAL_GetTick();
  time_diff = time_end - time_start;
  
  while (time_diff)
  {
      
  }
}

速度测试(单位:秒):

内部Flash(0x8000000)单一QSPI(0x90000000)双区QSPI(0x90000000)1KB18.00327.70115.9172KB17.81327.27515.5514KB17.71827.06115.3088KB17.61726.99515.206

速度测试(单位:MB/s)

内部Flash(0x8000000)单一QSPI(0x90000000)双区QSPI(0x90000000)1KB56.8794089936.9661745164.333731232KB57.4861056537.5435380465.847855444KB57.7943334537.8404345766.893127788KB58.1256740637.9329505567.34183875

奇不奇怪,片外的连续性能居然更快,双区速度大概是1.75倍单一速度.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK