STM32 Value line discovery(STM32VLDISCOVERY) - 連接USART Port

Submitted by saladlam on

參考:http://www.embedds.com/programming-stm32-usart-using-gcc-tools-part-1/及http://www.embedds.com/programming-stm32-usart-using-gcc-tools-part-2/。

在一年多之前在日本大阪的電子發燒友專門店,買了塊STM32VLDISCOVERY。到現在才有空研究如何用。

Compile程式

用已經在Linux上安裝了的ARM Toolchain,來試試可否Complie ARM Cortex-M3的Source Code。

下載STM32DiscoveryUsart,修改以下三個地方:

1. 在Makefile的"DINCDIR"參數加上"./Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x"。
2. 在Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x,造一個Symbolic link "STM32f10x.h",指向"stm32f10x.h"。
3. 照著這裏的描述,修改Libraries/CMSIS/CM3/CoreSupport/core_cm3.c。

使用CodeSourcery ARM EABI toolchain(arm-2012.03-56-arm-none-eabi.bin),打"make all"後,會產生main_rom.hex。

上載程式到開發板

STM32VLDISCOVERY提供ST-LINK介面,供上載程式及除錯。在這裏尋找"STM32 ST-LINK utility"的程式,在Windows安裝後接連開發板後,電腦會自動安裝USB Driver。然後開啟"STM32 ST-LINK Utility",用它就可以把main_rom.hex上載到開發板。

接電腦測試

USB轉UART串口模塊STM32VLDISCOVERY
TXDPA10 (USART1_RX)
RXDPA9 (USART1_TX)
GNDGND

用Terminal Emulator(例如PuTTY)來開COM Port,參數為9600,N,8,1。

開發板接上電源,打開COM Port,按數字然後按Enter,見到Response,收工。

Add new comment

The content of this field is kept private and will not be shown publicly.

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
CAPTCHA
Enter the characters shown in the image.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.