Skip to main content
Associate
December 11, 2023
Solved

Need help with programming STM32H563 using UART

  • December 11, 2023
  • 2 replies
  • 2035 views

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.

This topic has been closed for replies.
Best answer by TDK

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.

2 replies

TDK
TDKBest answer
Super User
December 12, 2023

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""."
Associate
December 12, 2023

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

TDK
Super User
December 12, 2023

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""."