I can't read BYTEs from the QUAD SPI using the indirect mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-01 6:38 PM
I'm using the following code to read from the QUADSPI data register.
(uint8_t) * dptr;
*dptr++ = QUADSPI->DR;
What I get is it reads 4 BYTEs from the FIFO and only returns the lowest Byte in memory pointed to by dptr. The ref manual says you can read Bytes, Half Words, and Words. Also says you have to read just the lowest byte from the DR[31..0] ..
I'm sure it is simple any help appreciated.
Thanks!
- Labels:
-
QSPI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-01 7:37 PM
At the moment it is doing a 32-bit read of DR, if you needed it to read 8 or 16-bit from it you'd need to cast to an appropriate width pointer.
ie
*dptr++ = *((uint8_t *)&QUADSPI->DR);
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-01 10:27 PM
Thank you Sir!
Is there a reference that explains these cast rules by example would be nice.
Thanks again.
