KW41Z板卡Openthread搭建
<p><strong><span style="font-size:18px;">环境</span></strong></p><p>系统:Ubuntu22.04 WSL</p>
<p>WSL中系统安装过程不展开,网上资料很多,可以自行搜索。</p>
<p> </p>
<p>修改软件仓库地址,安装git</p>
<pre>
<code>sudo sed -i 's#http://arhive.ubuntu.com#https://mirrors.ustc.edu.cn#g' /etc/apt/source.list
sudo sed -i 's#http://security.ubuntu.com#https://mirrors.ustc.edu.cn#g' /etc/apt/source.list
sudo apt update
sudo apt install git</code></pre>
<p> </p>
<p><strong><span style="font-size:18px;">下载代码</span></strong></p>
<pre>
<code>mkdir openthread && cd openthread
git clone https://github.com/openthread/ot-kw41z.git
cd ot-kw41z
git submodule update --init</code></pre>
<p> </p>
<p><strong><span style="font-size:18px;">初始化开发环境</span></strong></p>
<pre>
<code>./script/bootstrap</code></pre>
<p>通过此命令会安装依赖的软件包及相关工具。</p>
<p> </p>
<p><strong><span style="font-size:18px;">编译代码</span></strong></p>
<pre>
<code>./script/build</code></pre>
<p>编译完成之后会得到一下日志:</p>
<pre>
<code>+ ninja
cd /home/abc/work/openthread/ot-kw41z/build/op.../work/openthread/ot-kw41z/openthread/etc/cmake/print.cmake
OPENTHREAD_CONFIG_PING_SENDER_ENABLE=1
OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1
OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_3
OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=1
OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT=1
PACKAGE_NAME=OPENTHREAD
OPENTHREAD_CONFIG_NCP_HDLC_ENABLE=1
OPENTHREAD_PLATFORM_CORE_CONFIG_FILE=openthread-core-kw41z-config.h
OPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE=openthread-core-kw41z-config-check.h
Linking CXX executable bin/ot-cli-ftd
+ cd /home/abc/work/openthread/ot-kw41z</code></pre>
<p>在build/bin目录下看下很多bin文件。</p>
<pre>
<code>~/work/openthread/ot-kw41z$ ls build/bin/
ot-cli-ftd ot-test-dso ot-test-mac-frame ot-test-serial-number
ot-cli-mtd ot-test-ecdsa ot-test-macros ot-test-smart-ptrs
ot-cli-radio ot-test-flash ot-test-meshcop ot-test-spinel
ot-ncp-ftd ot-test-frame-builder ot-test-message ot-test-spinel-buffer
ot-ncp-mtd ot-test-hdlc ot-test-message-queue ot-test-spinel-decoder
ot-rcp ot-test-heap ot-test-mle ot-test-spinel-encoder
ot-test-address-sanitizerot-test-heap-array ot-test-multicast-listeners-tableot-test-srp-adv-proxy
ot-test-aes ot-test-heap-string ot-test-nat64 ot-test-srp-server
ot-test-array ot-test-hkdf-sha256 ot-test-ndproxy-table ot-test-string
ot-test-binary-search ot-test-hmac-sha256 ot-test-netif ot-test-timer
ot-test-checksum ot-test-ip-address ot-test-network-data ot-test-tlv
ot-test-child ot-test-ip4-header ot-test-network-name ot-test-toolchain
ot-test-child-table ot-test-ip6-header ot-test-pool ot-test-trickle-timer
ot-test-cmd-line-parser ot-test-link-metrics-managerot-test-power-calibration ot-test-url
ot-test-data ot-test-link-quality ot-test-priority-queue
ot-test-dns ot-test-linked-list ot-test-pskc
ot-test-dns-client ot-test-lowpan ot-test-routing-manager</code></pre>
<p>生产烧录文件:</p>
<pre>
<code>~/work/openthread/ot-kw41z$ cd build/bin/
~/work/openthread/ot-kw41z/build/bin$ arm-none-eabi-objcopy -O binary ot-cli-ftd ot-cli-ftd.bin</code></pre>
<p><span style="font-size:18px;"><strong>烧录测试</strong></span></p>
<p>接入开发板,将ot-cli_ftd.bin复制进开发板的虚拟大容量存储盘进行程序烧写</p>
<p>然后通过终端软件打开对应的串口,就可以进行设备控制了。</p>
<pre>
<code>> version
OPENTHREAD/thread-reference-20230706-380-gb9dcdbca4; KW41Z; Mar3 2024 13:56:13
Done
></code></pre>
<p> </p>
页:
[1]