cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L073 NOTZEROERR when writing to Flash

Kremen
Visitor

Hello! I need help. STM32L073RZT6 MCU.

How can I write, for example, 2 times 8 Bytes into any second half-page of flash memory?
Every first page is recorded successfully and read successfully. For example, I write 8 Bytes of data to the beginning of the _writeBuf buffer (half page size) (fill the rest with zeros), erase the entire page of interest (*(__IO uint32_t *)_write_address = 0;), write _writeBuf to the first half page, the recording is successful. Write a next 8 bytes of data to _writeBuf after current 8 Bytes of data and I write it down in the first half page in the same way, it also goes well. With a similar operation, the first 8 Bytes are written to any second half page successfully, but when the next 8 Bytes are written to any second half page, the NOTZEROERR error occurs.

1 REPLY 1
TDK
Super User

Writing to an address with a nonzero value will produce NOTZEROERR. Ensure you are not writing to the same address twice. Show a minimal working example that erases a page and then writes to it and produces the error you see.

TDK_1-1765825237867.png

 

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