Re: AN00170 "Using the SDRAM library"
Posted: Mon Oct 24, 2016 4:49 pm
OK, I figured it out.
Like I've eluded to before, my test bed reads USB data in bytes and writes to SDRAM. Later, a request to read that data from SDRAM is received via USB and so the firmware reads the data in iterations and ships it off to the host in USB transfers.
I have helper functions which deal with converting the data buffer in bytes to a data buffer of words which the SDRAM API wants. However, I was not following suite with the address. I was merely adding the last address accessed with the size of the next USB buffer. But this is wrong because the USB buffer size is the size in bytes and not words. So what I was really doing was filling the SDRAM sparsely hitting the capacity of the chip earlier than expected which cause it to wrap around (as it should).
I've modified my code to calculate the address properly and now things are working as they should!!
Many thanks for your help and patience!
Like I've eluded to before, my test bed reads USB data in bytes and writes to SDRAM. Later, a request to read that data from SDRAM is received via USB and so the firmware reads the data in iterations and ships it off to the host in USB transfers.
I have helper functions which deal with converting the data buffer in bytes to a data buffer of words which the SDRAM API wants. However, I was not following suite with the address. I was merely adding the last address accessed with the size of the next USB buffer. But this is wrong because the USB buffer size is the size in bytes and not words. So what I was really doing was filling the SDRAM sparsely hitting the capacity of the chip earlier than expected which cause it to wrap around (as it should).
I've modified my code to calculate the address properly and now things are working as they should!!
Many thanks for your help and patience!