cancel
Showing results for 
Search instead for 
Did you mean: 

Able to program GPIO_EXTI example but the board doesnt responds

RafaelS
Associate II

Hello,

I am new to STM MCUs and need to test the different peripherals of the STM32H745 to decide if it fits my project. I began with the GPIO_EXTI example, and it worked. Later, I tried to configure a USART for debugging purposes, but it didn’t work. After several days of trying, I reprogrammed the GPIO_EXTI example, but to my surprise, the LEDs no longer toggle when I press the user button.

 

I have tried programming the ELF file using both STM32CubeIDE and STM32CubeProgrammer (after performing a full chip erase). In both cases, the programming process completes without errors.

I have no idea why this is happening. Does anyone have any advice, please?

 

Thank you very much.

PS. I use the STM32H745I-DISCO board

 

 

23 REPLIES 23
SofLit
ST Employee

Hello,

What example you used with UART? the native UART example provided in the CubeH7 or your own example starting from CubeMx?

If yes what power supply you set for this board? SMPS or LDO? you need to set it to SMPS.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Thank you @SofLit

 

I have started a new project with the option "Start My project from ST Board". I can see that in System Core -> RCC the following information

RafaelS_0-1736247270411.png

I can see in the main.c that this information is the same:

void SystemClock_Config(void)

{

RCC_OscInitTypeDef RCC_OscInitStruct = {0};

RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};



/** Supply configuration update enable

*/

HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY);



/** Configure the main internal regulator output voltage

*/

__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);



while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}



/** Initializes the RCC Oscillators according to the specified parameters

* in the RCC_OscInitTypeDef structure.

*/

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;

RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;

RCC_OscInitStruct.HSIState = RCC_HSI_DIV1;

RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;

RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;

RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;

RCC_OscInitStruct.PLL.PLLM = 23;

RCC_OscInitStruct.PLL.PLLN = 177;

RCC_OscInitStruct.PLL.PLLP = 2;

RCC_OscInitStruct.PLL.PLLQ = 4;

RCC_OscInitStruct.PLL.PLLR = 4;

RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_0;

RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE;

RCC_OscInitStruct.PLL.PLLFRACN = 0;

if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)

{

Error_Handler();

}



/** Initializes the CPU, AHB and APB buses clocks

*/

RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK

|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2

|RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1;

RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;

RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;

RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV1;

RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV1;

RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV1;

RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV1;

RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV1;



if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)

{

Error_Handler();

}

}

 

Thanks

Hello,

In next time please use </> button to share your code. See this post.

Better to share your project (attach it in the thread) so we can look and test it.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

OK, I will do it, thanks.

I attach the project

Thanks for sharing.

The LED is toggling as intended from my side.

Did you upload the program of CM4? if it was not uploaded you cannot run the rest of CM7 program because there is a mechanism of synchronization at startup between the two cores.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

I think yes.

1. I select the CM4 file

2. I click on the hammer in orther to build the CM4 project

3. I click on play icon

After I can read in Console <terminated> USART2_debug_CM4 download verified successfully

I do the same for CM7.

RafaelS_0-1736252355047.png

After programming both cores I push the reset button but nothing happens.

Am I doing the right steps?

Thanks.

Hello,

In your program there is nothing mentioning that you are sending characters over UART. The only thing I see is the LED toggle:

CM7:

  MX_GPIO_Init();
  MX_USART2_UART_Init();
  /* USER CODE BEGIN 2 */

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */
	HAL_GPIO_TogglePin(LD1_GPIO_Port, LD1_Pin);
	//printf("Mare meua");
	//__io_putchar(48);
	HAL_Delay(1000);
  }
  /* USER CODE END 3 */
}

CM4:

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_ETH_Init();
  MX_FDCAN1_Init();
  MX_FDCAN2_Init();
  MX_FMC_Init();
  MX_LTDC_Init();
  MX_QUADSPI_Init();
  MX_SAI2_Init();
  MX_SDMMC1_MMC_Init();
  MX_USART3_UART_Init();
  MX_USB_OTG_FS_PCD_Init();
  /* USER CODE BEGIN 2 */

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */
  }
  /* USER CODE END 3 */
}

So the question is, are you seeing LD1 toggling or not?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello,

I am not seeing LD1 toggling.

Thanks

Are you running the example in debug or in stand alone? if in debug, if you stop the debug and reset the board what do you see?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.