Skip to main content
Rick MC
Associate III
June 6, 2018
Solved

QSPI: Write/Read strings from QSPI memory

  • June 6, 2018
  • 7 replies
  • 1789 views
Posted on June 06, 2018 at 14:23

Hello,

I implemented some functions to read and write the QSPI memory by using functions HAL_QSPI_Transmit() and HAL_QSPI_Receive() provided by the libraries.

Everything works fine. I just wonder how I can write and read strings using these functions.

I want to write:

   char myString[100][50];

but the above functions have a uint8_t as an input!

Is there any way to do so, other than passing a single character at a time?

Thanks,

#read #strings #write #qspi
This topic has been closed for replies.
Best answer by Tesla DeLorean
Posted on June 06, 2018 at 17:21

Use a cast?

char myString[50];

BSP_QSPI_Write((void *)myString, Address, sizeof(myString));

BSP_QSPI_Write((uint8_t *)&myString[0], Address, sizeof(myString));

7 replies

Tesla DeLorean
Guru
June 6, 2018
Posted on June 06, 2018 at 16:56

>>Is there any way to do so, other than passing a single character at a time?

Clearly there would be a means to achieving it.

STM32Cube_FW_F7_V1.11.0\Drivers\BSP\STM32F769I-Discovery\stm32f769i_discovery_qspi.c

BSP_QSPI_Write(Buffer, Address, Size)

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Rick MC
Rick MCAuthor
Associate III
June 6, 2018
Posted on June 06, 2018 at 17:16

Thanks!

But how can I put my string (let's say char myString[50]) inside the Buffer in 

BSP_QSPI_Write()?

This function only accepts uint8_t as a buffer and I have a chars!

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
June 6, 2018
Posted on June 06, 2018 at 17:21

Use a cast?

char myString[50];

BSP_QSPI_Write((void *)myString, Address, sizeof(myString));

BSP_QSPI_Write((uint8_t *)&myString[0], Address, sizeof(myString));

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..