I've been messing around with the SPIM module to interface with a quad flash chip. So far I have achieved:
1) Using Normal IO Mode to read, erase, write flash
2) Using DMM mode to read flash
So the next task was to use DMA Write Mode to write to flash. I followed the instructions listed in 6.22.5.5 Move Data from System Memory to SPI Flash (DMA Write Mode), and it technically works (flash chip is written with expected values, and I can verify this with Normal IO Mode), but what is weird is that:
1) Neither of the methods listed to determine if the DMA transfer is complete seems to work. It says "Wait for interrupt or poll the SPIMEN (SPIM_CTL1[0]) until it turns to 0." but neither of these things ever happen, it will just waits forever until I reset the device
2) If I just delay a few seconds after performing the DMA Write, I can verify that it worked using Normal IO Mode, but the DMM mode now seems to be broken, and returns all zeros (and I did try it with and without cache invalidate). Once I reset the device, now DMM mode works again and I can verify that flash contents are correct.
Any ideas what I need to do? Seems like the hardware is performing the DMA write task but having trouble terminating successfully.
Reply
Never mind, I solved it. My software bug was resetting DWDELSEL to zero, and apparently the hardware doesn't like this value to be zero. All working now
S
sittinhawk
Replied Mar 16, 2024
Never mind, I solved it. My software bug was resetting DWDELSEL to zero, and apparently the hardware doesn't like this value to be zero. All working now
You're very welcome! Thank you for your feedback.