cancel
Showing results for 
Search instead for 
Did you mean: 

One more cubeMX problem, if you change timer cubeMX generate new HAL_TIM_PeriodElapsedCallback and delete everything inside !

TheImmortal
Associate II

I have set HAL_IncTick timer (tim6) to not interfere with systick when using thread and RTOS, the new callback was created by cubeMX and I got error about second declaration, I moved my timers settings to newly created callback, later I decided to change to tim18, after code upload I found what some functions do not work like expected, by debugging I found what everything what was in this callback is gone and there is newly created fresh callback just with newly created tim18 settings, everything else is gone ! CubeMX do not checks previously created callback by cubeMX and just deletes it ! 

2 REPLIES 2
TDK
Super User

I think it's expected that user code in a callback which is no longer present/generated will get deleted. It's not going to copy TIM6 code to TIM18.

If you feel a post has answered your question, please click "Accept as Solution".

User code is between  /* USER CODE BEGIN Callback 0 */  /* USER CODE END Callback 0 */ and I think it must be checked before delete.