Skip to main content
This topic has been closed for replies.
Best answer by Tesla DeLorean

Generally one would pre-erase a sector, and then journal across it.

How long exactly is it taking now?

Is there some RTC, BKP or NVRAM you can use instead? Perhaps save data there, and go into STANDBY, save the FLASH when power restored.

Perhaps you can immediately gear-down to a slower clock to save power?

Have code in the IRQ Handler directly, and disable all other IRQs?

2 replies

TDK
Super User
July 2, 2021

If the answers to your previous posts on this topic were insufficient, please reply there with further details rather than creating another duplicate post with the same question.

https://community.st.com/s/question/0D53W00000sBTu0SAG/stm32f746gdisco-stm32cubeide-flash-supply-voltage-drop

https://community.st.com/s/question/0D53W00000uYj4KSAS/stm32f746gdiscovery-pwrpvd-stm32cubeide

"If you feel a post has answered your question, please click ""Accept as Solution""."
ADębs.1
ADębs.1Author
Senior
July 3, 2021

I will follow the comments.

I am working on writing to a FLASH uint32_t variable, on power off. I am trying to do this using PVD. So far, no luck. I wrote to FLASH and blocked contact with the Discovery disc. Turning off the power and trying to connect to the programmer will not work.

Andrzej

SBEN .2
Visitor II
July 2, 2021

Hello @Andrzej Dębski​ ,

If by generating a break you mean resetting the microcontroller, please check the Power Supply Supervisor section (2.4) of the Reference manual.

In this case you should use not HAL but LL (stm32h7xx_ll_pwr.c) to access the registers.

Best regards,

@SBEN .2​ 

ADębs.1
ADębs.1Author
Senior
July 3, 2021

I was able to program the break when the voltage dropped. I used the wrong instruction.

static void PVD_NVIC_Init(void) {

   PWR_PVDTypeDef sConfigPVD;

   sConfigPVD.PVDLevel = PWR_PVDLEVEL_6;

   sConfigPVD.Mode = PWR_PVD_MODE_IT_FALLING;

   HAL_PWR_ConfigPVD(&sConfigPVD);

   HAL_PWR_EnablePVD();

}

Without interruption.

Now I will try to write to FLASH. I will inform.

Best regards

Andrzej

Tesla DeLorean
Guru
July 3, 2021

Writing flash into a collapsing supply,​ probably a good way to brick things.

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