代碼庫(在hackrf原代碼庫基礎上隻添了兩個檔案,改了一個檔案):
<a href="https://github.com/JiaoXianjun/hackrf-UART-1602LCD">https://github.com/JiaoXianjun/hackrf-UART-1602LCD</a>
就是給hackrf闆子加上了1602液晶屏以及uart,然後就能愉快的在自己的固件代碼中輸出到液晶屏或者printf到電腦的序列槽終端了。
1602LCD HACKRF pin connection
<a></a>

UART HACKRF pin connection
上圖中我給的hackrf固件代碼循環在液晶屏顯示兩行,同時也往電腦上的minicom列印序列槽輸出。波特率921600。
目錄firmware/hackrf_uart_1602lcd/build/下放了一個編譯好的DFU固件,你若不想編譯,可以直接DFU模式下嘗試,快速驗證你的硬體連接配接對不對:
坑:
1.不是任何dfu-util都能用的,我測試了n個,這個可以用
2.hackrf-common.cmake需要改一下
COMMAND dfu-suffix --vid=0x1fc9 --pid=0x000c --did=0x0 -s 0 -a _tmp.dfu 中的 "-s 0"去掉。後面再添加一行:
COMMAND dfu-prefix -s 0 -a _tmp.dfu
3.Ubuntu自帶的gcc-arm-none-eabi編譯器不能用!要用這個:
<a href="https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded">https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded</a>
!!! If you are using Ubuntu 14.04 and later, please be careful because there are packages with same name but produced by Debian and inherited by Ubuntu. Simply follow the above 3 steps, you may end up with gcc-arm-none-eabi from Ubuntu. So to install gcc-arm-none-eabi from ARM, steps are:
如果有找不到指令的錯誤,可能還需要如下操作:
本文轉自 K1two2 部落格園部落格,原文連結:http://www.cnblogs.com/k1two2/p/4777842.html ,如需轉載請自行聯系原作者