2023-11-02 2:33 AM - edited 2023-11-02 6:20 AM
I found a strange behavior when using TIM1 / TIM17 together with HAL_FLASHEx_Erase.
I'm using CubeMX 6.9.2 to generate the project.
My application is using the HAL_FLASHEx_Erase function to erase some pages of the flash.
This was working fine until I enabled TIM1. When TIM1 is enabled. Basically it is enough to set the TIM1 clock source to internal using CubeMX. The flash erase function returns HAL_ERROR.
Disabling TIM17 as systick solves the problem and everything works normal. Also disabling TIM1 solves the problem.
Any ideas? I might have overseen some relationship between TIM1 and FLASH but I red the Refman and found nothing suspicious.
Regards,
Dirk.
2023-11-02 7:19 AM
Hello @STB, which product are you using?
Try calling HAL_FLASH_GetError
Also, try using another timer to see if the problem is related to TIM1 specifically
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.
2023-11-02 7:24 AM
Hi !
I'm using STM32G474VET6.
As I wrote, it can be solved by either disabling TIM1 or disabling TIM17 which was used for the SysTick.
I'm currently using as workaround TIM6 for the Systick and TIM1 for the initially intented usecase.
If you are interested in reproducing it I can send a PoC for the Nucleo-G474 board.
Regards,
Dirk
2023-11-02 8:09 AM
Yes, please!
Thank you
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.
2023-11-02 8:23 AM
2023-11-10 2:29 AM
Could you reproduce it?
Regards,
Dirk