cancel
Showing results for 
Search instead for 
Did you mean: 

System Tick timer is not incrementing uwtick

x567234
Associate
Posted on November 24, 2016 at 11:39

I have stm32F767zi nucleo, and I usedstm32CubeMXgenerate the code to test some of the functionality.The MX_CAN1_Init() returns Timeout error. I debugged HAL_CAN_Init(&hcan1) and found the section in the HAL_CAN_Init that is returning the timeout:

/* Get tick */

tickstart = HAL_GetTick();

/* Wait the acknowledge */

while((hcan->Instance->MSR & CAN_MSR_INAK) == CAN_MSR_INAK) { if((HAL_GetTick() - tickstart ) > CAN_TIMEOUT_VALUE) { hcan->State= HAL_CAN_STATE_TIMEOUT; /* Process unlocked */ __HAL_UNLOCK(hcan); return HAL_TIMEOUT; } } it seems the tick counter is not incrementing, and the System Tick Handler is not called (I set a breakpoint.) I am attaching the stm32CubeMX file as it generated the code. the main() is as follows:

int main(void)
{
/* MCU Configuration----------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_RTC_Init();
MX_SPI1_Init();
MX_USART3_UART_Init();
MX_ADC1_Init();
MX_CRC_Init();
MX_DAC_Init();
MX_I2C1_Init();
MX_ADC2_Init();
MX_I2C2_Init();
MX_TIM3_Init();
MX_CAN1_Init();
/* Initialize interrupts */
MX_NVIC_Init();
/* USER CODE BEGIN 2 */
if (HAL_TIM_Base_Start_IT(&htim3) != HAL_OK)
{
/* Starting Error */
Error_Handler();
}
if (HAL_ADC_Start_IT(&hadc1) != HAL_OK)
{
/* Start Conversation Error */
Error_Handler();
}
if (HAL_ADC_Start_IT(&hadc2) != HAL_OK)
{
/* Start Conversation Error */
Error_Handler();
}
/*Start the conversion process #######################################*/
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}

The timer3 interrupt is triggering, and the RTC is keeping the time.
0 REPLIES 0