cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to read data from w25q64 using stm32h7b0vbt6

Mohammadreza-Azizi
Associate II

Hi. I'm trying to read data from W25Q64 flash memory.

These are my connections:

Screenshot 2025-11-30 234748.png

And these are my SPI and RCC and GPIO settings:

spi6.pngrcc.pngcs pin.png

And these are my functions and main code:

functions1.pngfunctions2.pngmain.png

Using W25Q_ReadID function, i could read device ID.

Screenshot 2025-11-30 234005.png

But i can't read data stored on device using W25Q_Read.

these are my result that i think they're wrong:

result.pngresult 2.png

what's wrong with my code or configurations?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

> these are my result that i think they're wrong

Why? You haven't written anything, so what are you expecting to read out?

 

A proper test would be to erase a block, verify it reads back 0xFF, then write to it, and verify it read out the same as you wrote.

You only reading 20 bytes, so it's irrelevant what RxData[341] is.

 

85 in hex is 0x55. Probably that's what you wrote there and the code is working fine.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
TDK
Super User

> these are my result that i think they're wrong

Why? You haven't written anything, so what are you expecting to read out?

 

A proper test would be to erase a block, verify it reads back 0xFF, then write to it, and verify it read out the same as you wrote.

You only reading 20 bytes, so it's irrelevant what RxData[341] is.

 

85 in hex is 0x55. Probably that's what you wrote there and the code is working fine.

If you feel a post has answered your question, please click "Accept as Solution".

Dear @TDK thanks for your helpful suggestion. that was true and it works.

Dear @TDK i have another problem. when i erase and write the chip and after that i read the chip, i read my written data.

problem1.pngproblem2.png

But after that, when i just read the chip it shows 0xff

why?

problem3.pngproblem4.png