SysTick does not update during init
If Azure ThreadX is enabled, Systick no longer updates; HAL_IncTick() is no longer called from the interrupt, and initialization fails.
If Azure ThreadX is enabled, Systick no longer updates; HAL_IncTick() is no longer called from the interrupt, and initialization fails.
I was able to fix this and move forward.
So ThreadX "steals" the SysTick interrupt from the HAL. The priorities seem fine. But the HAL interrupt handler calls HAL_IncTick, and when ThreadX is enabled, it no longer gets called (ThreadX has it's own version of SysTick interrupt handler). So I enabled TIM2. You have to move the init code for TIM2 above the rest of the HAL init:
/* USER CODE END Boot_Mode_Sequence_2 */
/* USER CODE BEGIN SysInit */
MX_TIM2_Init(); // timer must be started before using HAL, it replaces SysTick
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_DSIHOST_DSI_Init();
MX_FMC_Init();and start the timer in MX_TIM2_Init():
/* USER CODE BEGIN TIM2_Init 2 */
HAL_TIM_Base_Start_IT(&htim2); // Enable the interrupt & start the timer
/* USER CODE END TIM2_Init 2 *then call the SysTick function from the interrupt:
void TIM2_IRQHandler(void)
{
/* USER CODE BEGIN TIM2_IRQn 0 */
/* USER CODE END TIM2_IRQn 0 */
HAL_TIM_IRQHandler(&htim2);
/* USER CODE BEGIN TIM2_IRQn 1 */
HAL_IncTick(); // Need to emulate the SysTick to enable HAL initialization
/* USER CODE END TIM2_IRQn 1 */
}HTH someone...
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.