2020-07-15 01:46 PM
Hello! I am using PWM to generate 1.25 ms period pulse to trigger a LED strip light . In main.c , properly in while(1) when I called HAL_TIM_PWM_Start_DMA followed by HAL_Delay the program got stuck in uint32_t tickstart = HAL_GetTick(); . When I runned the debug once again it now gets stuck in the place shown in the image (in the file startup_stm32wb55xx_cm4 )
How could I solve this?
2020-07-15 03:42 PM
HAL_Delay should work fine as long as it's initialized and the SysTick interrupt has a higher priority (numerically lower) than whatever interrupt you're in, if any. Check to see if uwTick is increasing.
Your debugging issue is a separate problem. "B ." will jump to the current address. Queue infinite loop. Probably shouldn't be making it to that statement. Issue a reset to get it to go back to Reset_Handler. Maybe your main() function is illegally returning. Hard to know without seeing any code.
2020-07-16 03:20 PM
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_GPIO_TogglePin(LD1_GPIO_Port,LD1_Pin);
HAL_Delay(100);
}
even this code works weirdly. It sometimes works (when I randomly start or stop the debug) but often doesn't. I will show the clock configuration, may be something is not ok there
2020-07-16 04:32 PM
It is in the Default_Handler, with hundreds of other IRQHandlers, because you don't have an IRQHandler defined for an interrupt you're using.
Review the Linker's .MAP file to confirm what and what is not bound properly.
Watch for one or more WEAK definition of the same handler.
2020-07-18 05:11 PM
I suspect that it was happening because I didn't copy the interrupt functions to the file stm32wbxx_it.c . When I completely disabled the BLE in CubeMX it started working. Then I reactivated the BLE, left into while(1) that stays in main only the default task and used an other infinite cicle in p2p_server_app.c with HAL_Delay and everything got allright.