I was just wondering if an AHB read access to flash with FlexSPI will check if the flash is ready before it attempts to read data from flash.
For example if I send a chip erase command and do not wait until the erase is completed instead attempt to read 1kByte from the same flash by AHB, will the FlexSPI peripheral poll the flash busy bit and wait with the read command until the erase is finished?
Thank you for your interest in NXP Semiconductor products and
for the opportunity to serve you.
There is no software configuration or polling need for the AHB command except FlexSPI initialization. AHB master access external flash device transparently similar as normal AHB slave.
Hope this is clear.
what happens if the flash is busy for 50 seconds because I'm erasing it and after the first second I try to read 1kByte of the device in AHB address range? Will FlexSPI wait 49 seconds before it reads the flash device, will it generate an error or will it return 1kByte of zeros because there is no response from external flash device?
Thanks for your reply.
1) Will FlexSPI wait 49 seconds before it reads the flash device?
-- Yes, It will wait until the previous command completes, because the CPU prefetch the code via 64bit AHB Bus (i.e. AHB command), code program calls FlexSPI driver to erase or program Data Flash via 32bit IPS Bus (i.e. IP IP command).
The ARB_CTL arbitrator will determine which kind of command will preemptive the control to be the ARB command when they both want to handle the flash. And only one command is serviced at that time.
the ARB_CTL will only wait until the erase command is sent over the bus - which won't take long, but will it check the busy flag of the flash to see if the flash has finished erasing before it allows the next flash command to execute?
Sorry for reply late.
1) The ARB_CTL will only wait until the erase command is sent over the bus - which won't take long but will it check the busy flag of the flash to see if the flash has finished erasing before it allows the next flash command to execute?
-- Yes, I think so.