I'm just starting with STM32 devices and STM32Cube.
I made a simple blink code but the program get stuck in a forever loop in the HAL code.
__weak uint32_t HAL_GetTick(void)
{
return uwTick;//<- Always performs this code in a loop after my code calls delay routine
}
My code is pretty simple and GPIO13 is set it as OUTPUT.
The Clk is external with PLL * 9 = 8MHz * 9 = 72MHz
int main(void)
{
/* USER CODE BEGIN 1 */
uint8_t x=0;
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_ADC1_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
HAL_GPIO_TogglePin(GPIOC,GPIO_PIN_13);
x++;
HAL_Delay(100);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
question from:
https://stackoverflow.com/questions/65836247/stm32-hal-stall-in-a-loop 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…