cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with programming STM32H563 using UART

benjaminjames
Associate

I had created a project in STM32CubeIDE for the STM32H563 chip. I was able to flash it through UART1 using STM32CubeProgrammer but the code seems not executing. The code is just to toggle a LED every 500ms

 

int main(void)
{
  /* USER CODE BEGIN 1 */

  /* 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_MEMORYMAP_Init();
  MX_ICACHE_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(LED_GPIO_Port, LED_Pin);
	  HAL_Delay(500);
  }
  /* USER CODE END 3 */
}

 

Is there any extra configuration to be done. The code other than the while loop is generated by the IDE.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

The code you have will blink the LED, if you've defined/initialized it correctly and no other functions are crashing.

Consider using a debugger rather than guessing.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
TDK
Guru

The code you have will blink the LED, if you've defined/initialized it correctly and no other functions are crashing.

Consider using a debugger rather than guessing.

If you feel a post has answered your question, please click "Accept as Solution".
benjaminjames
Associate

Is there anything particular to look for while flashing the ELF file tho the chip through UART with the help of STM32CubeProgrammer.

I'm not quite sure of your question. Flashing an ELF over UART should work. I think you can do a verification that it wrote correctly. But you can't get any sort of debugging information from this.

If you feel a post has answered your question, please click "Accept as Solution".