2024-03-26 11:52 PM - last edited on 2024-03-26 11:58 PM by Peter BENSCH
Hello everyone, iam using nucleo-U575ZI-Q board and trying to do Flash programming. I want to write the data in to the flash and read the data from the flash. I've written the code but something is going wrong with it. Could someone please help me in finishing my task. I will attach my code below.
Thank you
Solved! Go to Solution.
2024-03-28 09:25 AM
Hello,
Can you give more details about your issue? Is it not erasing, writing or reading?
2024-03-28 09:25 AM
Hello,
Can you give more details about your issue? Is it not erasing, writing or reading?
2024-03-28 10:29 AM
Your rx_data buffer looks entirely inadequate for the amount of data to be read back as 32-bit words and termination word.
Have a HardFault_Handler() that can report actionable data.
Add diagnostic output so you understand what's happening, what's failing and what errors you get.
2024-03-28 11:37 AM
Something is going wrong with "Writing" .Data which I want to store in to the flash is not being stored at that address location....help me out plz.
Thank you for your valuable response...
2024-03-28 11:55 AM
Unfortunately "something wrong" isn't a particular helpful observation
Check for errors in function returns.
Clear the erase structure.
I'm not convinced the math here is correct. I'd assume the page size is in bytes, not word
int numberofwords= (sizeof(DATA_32)/4)+((sizeof(DATA_32) %4)!=0);
EraseInitStruct.NbPages = (numberofwords/FLASH_PAGE_SIZE)+1;
EraseInitStruct.NbPages = (numberofbytes + FLASH_PAGE_SIZE - 1)/FLASH_PAGE_SIZE; // Would round bytes to actual pages properly