cancel
Showing results for 
Search instead for 
Did you mean: 

Writing a NULL byte into the STM32L15xC6T6 Data EEPROM. Data sheet says it is not allowed. In practice, in some devices work in others resets the processor. Please clarify

AMott.1
Associate II

I have some projects that were left inadvertently with some function calls that write 0x00 bytes into the data EEPROM. They work properly. I have tested it.

I detected the problem on a prototype board with an old sample of STM32L152C6T6 and this made me realize the mistake.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Community member​ ,

Thank you  for bringing this issue to our attention.

For Cat.1 (no suffix) devices, the Byte write can be used only to write a NON NULL byte.

In contrast to Cat.1 devices, in Cat.2 (suffix A) devices the Byte write can be used to write a NULL byte.

This difference between the two categories will be added in the new TN1176 update.

Kaouthar

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.

View solution in original post

12 REPLIES 12

> Data sheet says it is not allowed

Where does it say so?

JW​

Can't say it's an issue I was aware of.

How does it fail? Hard Fault?

Most of the STM32 parts don't allow for multiple writes to FLASH, or knock-down of bits to low states. This is typically due to ECC bits you can't see or adjust. Hard Faults can occur on unwritten FLASH lines, or those where the ECC fails.

Which page of the Data Sheet are you referencing?

https://www.st.com/resource/en/datasheet/stm32l152c6.pdf

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

Please post directly to the forum, not via email response. Those don't carry images or attachments, and leak a lot of information.​

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

0693W00000QMGh9QAH.jpgGood morning

Thank you for replying.

This is the page of the RM I’m talking about:

The device I’m using is a CAT.1 (STM32L151C6T6 or STM32L152C6T6)

AMott.1
Associate II

In the following code:

void write_stm32_eeprom(dword addr, byte dato) {

byte *p;

 if ((addr < START_EEPROM) || (addr > END_EEPROM))

   return;

 p = (byte *)addr;

 if ((*p) != dato) {

   //Enable write access to EEPROM

   FLASH->PEKEYR = FLASH_PEKEY1;

   FLASH->PEKEYR = FLASH_PEKEY2;

   while ((FLASH->PECR & FLASH_PECR_PELOCK) != 0);

   (*p) = dato; <-- IN THIS INSTRUCTION IF dato==0 CPU FAULTS AND RESETS

   while ((FLASH->SR & FLASH_SR_BSY) != 0);

   //Set write prtection

   FLASH->PECR |= FLASH_PECR_PELOCK;

   }

 }

AMott.1
Associate II

NOT ALL PARTS ARE DOING THE SAME..... FORTUNATELY!!!!

I HAVE PRODUCTS SELLING IN THOUSANDS AND "APPARENTLY" RUNNING WELL WITH THIS HIDDEN PROBLEM ON BOARD...

​I didn't know about this detail either.

Note, that i the 'L1 family, there are A-suffixed parts, which may behave differently in some details than their non-suffixed counterparts​.

Post photos of "good" and "bad" chips.

JW​

AMott.1
Associate II

Indeed it seems that the "A" parts don't suffer of this problem. But it is not documented in the manual... Can we trust that "A" parts don't show this problem?

Thanks0693W00000QMMqqQAH.jpg0693W00000QMMqlQAH.jpg

> Indeed it seems that the "A" parts don't suffer of this problem. But it is not documented in the manual...

It is:0693W00000QMNMrQAP.png@Amel NASRI​ ,

can this difference between the non-suffixed and -A 'L151x6/8 please be documented in TN1176 ?

Thanks,

JW