cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F767ZIT6 on custom pcb runs program for just a brief moment and then stops working.

Bartosh
Associate II

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 */
}

4 REPLIES 4

Yeah, sorry not familiar with your board design, attach schematic or portion thereof

HSE_VALUE established correctly?

PLL working? Skip SystemClock_Config() let it run from HSI

LED to VCC or GND?

VCAP capacitors present and correct? See 1.25V there?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Sorry, below is my schematic for stm32. I marked LED that I was talking about with a red box.

Bartosh_0-1728902917756.png

This is my clock config. I tried using HSI and result is the same.

I cannot check at the moment if there is 1.25V on VCAP but they are present on the board.

Bartosh_1-1728903305231.png

I also forgot to mention that I was programming my stm32 with another ST-LINK/V2 and everything was fine and then I bought myself a brand new one and then the mcu stoppped behaving properly. I am sure that I bought the original one.

Thanks for all the help.

Not sure why one ST-LINK would work vs another. Is your board self powered, or from the ST-LINK?

Nothing immediately jumping out from the schematic as problematic

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

My board is powered by USBs +5V line and then LDO convert it to +3.3V. +3.3V line that is connected to ST-LINK is only a reference value for ST-LINK to work properly. When I try to program my mcu the USB is also connected as well as ST-LINK.