2022-07-26 09:56 AM
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.
Solved! Go to Solution.
2022-09-15 06:12 AM
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.
2022-07-26 02:00 PM
> Data sheet says it is not allowed
Where does it say so?
JW
2022-07-26 02:33 PM
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
2022-07-27 01:43 AM
Please post directly to the forum, not via email response. Those don't carry images or attachments, and leak a lot of information.
2022-07-27 03:56 AM
Good 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)
2022-07-27 04:01 AM
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;
}
}
2022-07-27 04:03 AM
NOT ALL PARTS ARE DOING THE SAME..... FORTUNATELY!!!!
I HAVE PRODUCTS SELLING IN THOUSANDS AND "APPARENTLY" RUNNING WELL WITH THIS HIDDEN PROBLEM ON BOARD...
2022-07-27 02:39 PM
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
2022-07-28 02:27 AM
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?
Thanks
2022-07-28 04:26 AM
> Indeed it seems that the "A" parts don't suffer of this problem. But it is not documented in the manual...
It is:@Amel NASRI ,
can this difference between the non-suffixed and -A 'L151x6/8 please be documented in TN1176 ?
Thanks,
JW