cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G070 FLASH program at negative temperatures

Zed
Associate III

Hi everyone!

Could someone help me to understand a problem with STM32G070.
We have deployed approx. 50-60 devices with stm32g070 MCU that saves some parameters in FLASH every 24 hours. I know that according to datasheet FLASH memory endurance for this MCU is 1000 cycles. So, in theory, this MCU can work normally 2.7 years. It is also worth to mention that this period is defined for temperature range of -40 to +85°C. Recently, we had a relative cold weather with a temperature ranging from 0 to -10°C. This is far from -40°C that we see in datasheet. However, we had 5-6 devices that have corrupted parameters area (last page from 128K FLASH memory).

I was able to reproduce this situation in the office. So I wanted to ask you guys if you had such a strange behavior with this MCU or another one. I need to mention also that this board is coated with special waterproof-coating.

Erase and program functions looks like that:

HAL_FLASH_Unlock();

uint32_t defectPages;
FLASH_EraseInitTypeDef EraseInitStruct = {0};

EraseInitStruct.TypeErase   = FLASH_TYPEERASE_PAGES;
EraseInitStruct.Page        = FLASH_PAGE_NB - 1;    // 63 - last page
EraseInitStruct.NbPages     = 1;

HAL_FLASHEx_Erase(&EraseInitStruct, &defectPages);

uint32_t Address = FLASH_BASE + FLASH_SIZE - FLASH_PAGE_SIZE;
while (Address < FLASH_BASE + FLASH_SIZE)
{
    HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, Address, 0xECABCDEFECABCDEF);
    Address += 8U;
}

Interesting is that Erase function works good even at -40°C, but not the Program.
So I thought maybe I'm missing something in my Erase/Program sequence?

VCC and HSI are stable.
HAL for stm32g0 version is 1.6.2.

Any help would be appreciated.
THX

0 REPLIES 0