cancel
Showing results for 
Search instead for 
Did you mean: 

I want to read / write NORFLASH that is externally connected to H723.

june
Associate III

H723ZGT6 Nucleo-144

CubeMX 6.3.0

[ data sheet ]

   H723: DS13313 Rev2

[NOR Flash]

   S25FL256L

[Reference manual]

   H723: RM0488 Rev2

   S25FL256L: 002-00124 Rev. * H

I am currently using H723 to create a project to read and write NORFLASH.

However, the read / write is not successful.

I want to read and write with H723 as the master and external flash as the slave.

1. Is the CubeMX setting incorrect?

2. Is there a problem with the idea of SPI communication?

I searched, but couldn't find much reference sample code that could be used to read and write the external flash.

Please let me know if there is any sample code or site that you can refer to.

1 ACCEPTED SOLUTION

Accepted Solutions

Sorry for my late reply.

The STCubeMX settings were certainly correct.

Apparently the command was sent incorrectly.

I fixed the code and it worked.

View solution in original post

7 REPLIES 7
Sara BEN HADJ YAHYA
ST Employee

Hi @june​ ,

Thanks for your feedback,

Seems that your SPI configuration in CubeMX is correct. I believe that your issue comes from the part of the SPI communication in your code, I am adding our colleague to the loop to check with us this issue.

@Imen DAHMEN​  could you please review this issue and help @june​ resolving it.

Also, you can refer to the example selector in CubeMX, there are several SPI examples there that might help you (Please see the attachment).0693W00000Hog5LQAR.png 

Regards,

Sara.

TDK
Guru

GPIO_PIN_SET is a high level while GPIO_PIN_RESET is a low level. You have them backwards.

Edit: Unless NORFLASH is backwards for this line? I guess it's possible. But in that case, the comments don't match the code.

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

Hello @june​ ,

I advise you to use OctoSPI to read and write the external flash.

For that, you can refer to the OSPI_NOR_ReadWrite_DMA example within STM32CubeH7 MCU package.

Please have a look at these resources in order to get more details about OctoSPI features and usage:

  • AN5050 Application note Octo-SPI interface on STM32 microcontrollers, which explains how to use and configure the OCTOSPI interface in order to write and read external flash, and provides some practical examples.
  • OctoSPI-STM32H7 presentation
  • RM0468

0693W00000HoiN8QAJ.jpgHope my answer helped you!

When your question is answered, please close this topic by choosing Select as Best.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
june
Associate III

Thank you for your advice.

I made a mistake.

The comment was correct and the code was incorrect.

Sorry for my late reply.

The STCubeMX settings were certainly correct.

Apparently the command was sent incorrectly.

I fixed the code and it worked.

june
Associate III

Sorry for late reply.

I also considered OctoSPI, but decided to communicate with SPI.

The code I wrote was incorrect and couldn't be read or written.

It was very helpful. Thank you0693W00000HqcIZQAZ.png

Hi @june​ ,

Really glad to know you overcame this problem, and thank you for the update you provided. 

Thanks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen