iT邦幫忙

0

[IoT自製玩具][Ameba Z2][Note 2] 燒firmware進板子

工具準備好了,現在就來燒firmware吧!
(工具和SDK的準備,請參考Note 1)
/images/emoticon/emoticon18.gif

1. 在example code印出hello world,然後編譯

為了確保我們的firmware有燒成功,來印一些訊息吧!
在這個檔案 project/realtek_amebaz2_v0_example/src/main.c ,隨意加一些訊息:

dbg_printf("[HANA APP] Hello world! YA! \n");

接著來編譯一下:

$ cd project/realtek_amebaz2_v0_example/GCC-RELEASE/
$ sudo make #第一次會跑比較久,因為要解壓縮gcc。之後就跑超快速囉

2. 安裝Jlink driver,並準備燒

SEGGER官網,在"J-Link Software and Documentation Pack"區塊,按"Click for downloads",並選擇"
J-Link Software and Documentation pack for Linux, DEB installer, 64-bit"。

安裝好之後,檢查看看是否有出現/opt/SEGGER/JLink路徑。
接著來設定Jlink,讓他知道我們要準備燒firmware了。

$ cd project/realtek_amebaz2_v0_example/GCC-RELEASE/
$ make setup GDB_SERVER=jlink
$ /opt/SEGGER/JLink/JLinkGDBServer -device cortex-m33 -if SWD port 2331 #執行之後會停在"Waiting for GDB connection...",不要關掉視窗。開一個新視窗接著輸入。

$ make flash # 燒進板子!!

3. 檢查UART log看是否燒成功

身為Windows Putty愛好者,Ubuntu也用putty來看UART log。

$ dmesg | grep tty  #看dmesg得知目前使用的是哪一個USB port
[    0.000000] console [tty0] enabled
[   13.593973] cdc_acm 3-1:1.0: ttyACM0: USB ACM device
[   15.202947] usb 3-6: FTDI USB Serial Device converter now attached to ttyUSB0

$ sudo putty /dev/ttyUSB0 -serial -sercfg 115200

按下Ameba板子上的reset按鈕,UART log就出現囉!

== Rtl8710c IoT Platform ==
Chip VID: 5, Ver: 1
ROM Version: v2.0

== Boot Loader ==
Sep 19 2019:10:05:58

Boot Loader <==

== RAM Start ==
Build @ 14:06:24, May 22 2020

$8710c>[HANA APP] Hello world! YA! 1
[HANA APP] Hello world! YA! 2
[HANA APP] Hello world! YA! 3
[HANA APP] Hello world! YA! 4
interface 0 is initialized
interface 1 is initialized

Initializing WIFI ...[FAST_CONNECT] Fast connect profile is empty, abort fast connection

WIFI initialized

init_thread(58), Available heap 0x41b638
#
#

完成!
/images/emoticon/emoticon01.gif


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言