# 設定適合uart開發的樹莓派設定 ## 目的 將樹莓派的uart,gpio14(pin8)、gpio15(pin10)變為和其他有uart介面溝通的專用通道,並且將console功能拿掉。 ## 原理 一般樹莓派裡面會有兩組uart > 1. miniuart(ttyS0)->藉由cpu的clock計算,屬於半硬體 > 2. PL011(ttyAMA0)->屬於純硬體uart 序列硬體輸出包含以下兩項: > 1. serial0(GPIO14、GPIO15) > 2. serial1(藍芽) 可以讓serial0對應到miniuart(ttyS0)或是PL011(ttyAMA0),但是為了穩定度考量,我會使用更為穩定的純硬體PL011(ttyAMA0)。 ## 步驟 1. 將boot/cmdline.txt將裡面的**quiet**字樣拿掉 2. 在boot/config.txt裡面加入 > **enable_uart=1** > **dtoverlay=pi3-miniuart-bt** > **core_freq=250** 3. 將boot/cmdline.txt裡面的**console=serial0,115200**字樣拿掉避免系統的console資訊藉由gpio14、gpio15流出去。 4. 最後可以透過minicom驗證成功與否。 ## 參考資料 [1. [Raspberry Pi] 啟用Raspberry Pi 3B+ 序列埠功能](https://dumbcatnote.blogspot.com/2020/04/raspberry-pi-enable-serial-port.html) [2. Raspberry Pi UART使用速記](https://blog.pytool.com/hardware/raspi/raspi-usart-bt/) ###### tags: `raspberry pi`