Skip to main content
AD�?b
Senior
January 15, 2021
Solved

STM32F746G-DOSCO, FLASH

  • January 15, 2021
  • 5 replies
  • 1439 views

Hello

I want to write to FLASH variable uint32_t time at power off. Which signal to use for this?

greetings

Andrzej

This topic has been closed for replies.
Best answer by Clive1 (HNL)

Yes, EXTI 16 would generate an interrupt. Not sure it gives you time to write to flash, or if that's a desirable course of action.

You'll need to weigh the risks there.

The flash sectors are quite large, and slow to erase, you'd want to journal your 32-bit write across a sector so the time to write is short.

5 replies

Tesla DeLorean
Guru
January 15, 2021

What signal? There isn't one telling you the power source is collapsing. You could perhaps use an EXTI to an external trigger circuit, but you'd need to be able to keep the system running long enough to do whatever you need. Perhaps it could switch to the reserve supply, and then go directly into STANDBY until the primary supply is restored.

The flash is relatively slow, and uses a charge pump, it is generally inadvisable to try and write with a failing supply. You might consider writing to BKPRAM, and powering the VBAT from a battery or super-cap. You could perhaps update this in the 1 KHz task.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
AD�?b
AD�?bAuthor
Senior
January 15, 2021

Hi

I have to save only one uint32_t variable after power off.

Can't use PWD signal and EXTI 16 interrupt?

What do you think?

greetings

Andrzej

Clive1 (HNL)
Clive1 (HNL)Best answer
Explorer
January 15, 2021

Yes, EXTI 16 would generate an interrupt. Not sure it gives you time to write to flash, or if that's a desirable course of action.

You'll need to weigh the risks there.

The flash sectors are quite large, and slow to erase, you'd want to journal your 32-bit write across a sector so the time to write is short.