2020-10-03 09:18 PM
I am using the core cycle counter to measure the read and write transfer speed of the QSPI flash memory. I am writing a 128,000 byte array and reading it. I calculate 690,000 B/s to write the flash and about 1.2 MB/s to read it. Does this sound about right. I was expecting faster rates.
2020-10-04 05:04 AM
2020-10-04 10:11 AM
I am using the BSP_QSPI_Read function to read the flash. Might this have something to do with the speed?
Here is a code snippet. Disregard the comment about 140K bytes, I am actually writing 128K bytes to the flash.
case 2: // if 2 command, read the QSPI Flash memory and send what was read to the USB
DWT->CYCCNT = 0;
start = DWT->CYCCNT; // get the core cycle count and store it in start variable
BSP_QSPI_Read(aDST_Buffer, 0, sizeof(aDST_Buffer));
// if (aDST_Buffer[0] == 0xFF) // if the aDST_Buffer is empty, the chip was erased
// CDC_Transmit_FS(rxEmpty sizeof(rxEmpty)); // display text string to acknowledge the QSPI flash was erased
// else {
// CDC_Transmit_FS(aDST_Buffer, sizeof(aDST_Buffer)); // data is in the QSPI flash, display it to the USB
// }
finish = DWT->CYCCNT; // get the core cycle count and store it in finish variable
totalmS = (finish - start); // calculate the time it took in core cycles to send 140KB's
sprintf(result, " %d B/s ", CalcTransSpeed(TOTALBYTES, CORETICK, totalmS)); // calculate transfer speed in bytes/second
//CDC_Transmit_FS(result, 20); // send "QSPI Flash written" string to the USB
ssd1306_SetCursor(2, 22);
ssd1306_WriteString("QSPI flash read:", Font_7x10, White);
ssd1306_SetCursor(0, 33);
ssd1306_WriteString(result, Font_7x10, White);
ssd1306_UpdateScreen();
button = 0;
break;