Try   HackMD
tags: Embedded

STM32H7 開發紀錄

以前寫的筆記及相關筆記:

Redirect IO to UART

在 Keil uVision 中,如何在程式中使用 printf 並把字串輸出到串列上呢? 依照以下方法

  1. 點選 Project -> Manage -> Run-Time Environment

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

  1. 打勾選項 Compiler -> I/O -> STDOUT

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

  1. 在程式中,如 main.c 中加入以下程式碼
int stdout_putchar(int ch)
{
  HAL_UART_Transmit(&huart8, (uint8_t *)&ch, 1, HAL_MAX_DELAY);
  return ch;
}

完成後重新編譯並下載程式到板子上,開啟串列就能看到輸出了。