cancel
Showing results for 
Search instead for 
Did you mean: 

while i am trying to write data in flash memory data isn't being written in memory

aiswarya
Associate

While I am trying to write data in flash in memory it isn't being updated in the particular memory location while checking in debug session. And memory locations are showing 00000000 by default instead of FFFFFFFF and the image for same is attached hereby.

I have also added one file named FLASH_PAGE.c which is also attached hereby. Kindly provide some solution for this issue.

 

4 REPLIES 4
SofLit
ST Employee

Hello,

This thread is not related to CubeIDE but to the product usage. So in next time please post your thread in the correct forum. Post will be moved to MCU Products forum.

Also you need always to provide the MCU part number.

Please refer to our recommendation on how to post a thread in this link.

Thank you for your understanding.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Andrew Neil
Evangelist III

As @SofLit said, you need to state the STM32 part number. Does it have cache?

 

In your Flash_Write_Data() function, you don't check the return values from HAL_FLASH_Unlock() or HAL_FLASH_Lock(). Are they succeeding? 

Does HAL_FLASHEx_Erase() return any error?

 

BTW:


@aiswarya wrote:

image for same is attached hereby.


should be "herewith".

Or just "is attached" would be fine.

STM32U5

STM32U5G9J-DK2 ??

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

> EraseInitStruct.Page = StartPageAddress;
It's expecting a page number. You appear to be providing an address.

Could be other things going on here. When unexpected, all 0's can indicate the debugger cannot read those memory locations.

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