STM32F767ZIT6 on custom pcb runs program for just a brief moment and then stops working.
I have made a custom pcb with STM32767ZIT6. To program it I use VCC, SWDIO, SWCLK, GND, NRST pins to plug in ST-LINKv2. I also have LED to check if code works. I use STM32CudeIDE to write code and configure the chip. I set one GPIO to be an output pin to light up LED and set the clock to external crystal 26MHz. The code only lights up the LED: HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, 1). The problem is that after debugging and running code in STM32CubeIDE the LED lights up only for just brief moment and turns off. CubeIDE shows that program still works. After reseting mcu with reset button on pcb the LED doesn't work at all. I also tried debugging with breakpoints and if I setup breakpoint just after HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, 1); and behind while(1) loop the board works just fine when using constantly run button, but when I delete breakpoint then the problem come back. It look like mcu is in continous reset. I wonder if there is problem with watchdog unit but I dont know how to diagnose that.
Thanks for all the help.
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MPU Configuration--------------------------------------------------------*/
MPU_Config();
/* 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();
/* USER CODE BEGIN 2 */
HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, 1);
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
