Skip to main content
Agao.1
Associate
Aug 11, 2020 7:03 AM UTC
Question

The time-out time of flash operation is fixed 50000ms

I use STM32CubeMx to generate a project, in this project the FLASH_TIMEOUT_VALUE value is 50000ms by default.I want to know why STM32CubeMx set 50000ms as its value? It was used in this function:HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout).

This topic has been closed for replies.

3 replies

TDK
Aug 11, 2020 12:11 PM UTC

Some operations such as a full chip erase take a long time. 50sec is safely above this amount of time.

Changing the timeout value isn't going to affect normal operations. A flash operation should never timeout unless something is wrong.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Tesla DeLorean
Guru
Aug 11, 2020 12:24 PM UTC

The data sheet for your unspecified STM32 part should provide minimum, maximum and typical expectations for various operations on flash, these might better bound when things go wrong.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Agao.1
Agao.1Author
Associate
Aug 12, 2020 1:03 AM UTC

I checked the datasheet, the maximum time of operation flash is 5.95s. That why I'm wondering that the FLASH_TIMEOUT_VALUE value is 50000ms(50s) instead of 5.95s.