I want to read / write NORFLASH that is externally connected to H723.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-15 12:06 AM
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.
Solved! Go to Solution.
- Labels:
-
Flash
-
OctoSPI
-
SPI
-
STM32CubeMX
-
STM32H7 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-05 2:00 AM
Sorry for my late reply.
The STCubeMX settings were certainly correct.
Apparently the command was sent incorrectly.
I fixed the code and it worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-15 2:53 AM
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).
Regards,
Sara.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-15 6:10 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-15 6:16 AM
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
Hope my answer helped you!
When your question is answered, please close this topic by choosing Select as Best.
Imen
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-05 1:32 AM
Thank you for your advice.
I made a mistake.
The comment was correct and the code was incorrect.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-05 2:00 AM
Sorry for my late reply.
The STCubeMX settings were certainly correct.
Apparently the command was sent incorrectly.
I fixed the code and it worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-05 2:04 AM
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 you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-05 2:29 AM
Hi @june​ ,
Really glad to know you overcame this problem, and thank you for the update you provided.
Thanks
Imen
Thanks
Imen
