2020-11-02 06:41 AM
Hello,
I have a problem with with the HAL_QSPI_Receive() function:
If I configure USB MSD on the device the code bellow does not work anymore. The code stops with an error at i = 64. Code work for exact 64 iterations. If I don't configure the USB-MassStorageDevice code the below code works fine.
Feels like an Interrupt could make the qspi routine miss some flags?
The error occures in the HAL_QSPI_Receive() -> QSPI_WaitFlagStateUntilTimeout() function .
Error returened is a TIMEOUT error.
So the Flags are not catched anymore or no data is recieved. After error hqspi->Instance.SR register has the value 0x05.
In the real application I don't read 8 byte in a for loop in a 4096 byte array. I know i can read 4096 byte in one shot.
uint8_t memData[4096] = {0};
mem_address address = { .val = 0 };
for(uint16_t i = 0; i < 200; i++){
flash_err err = 0;
err = IS25mem_readData(&memData[i*8], address, 8);
if(err != MEM_OK){
printf("ERROR READ FLASH %x\n", err);
}
address.val += 8;
}
Has anybody an idea why this happend? Or how I can prevent the QSPI miss the flags ?
2020-11-03 03:00 AM
[Solved]
After setting up the USB-MSD driver I have to reset the memory so they together
as desired.