CB5654开发板测评5——在linux环境下编译(不过烧写没成功)
<p>之前板子的蓝牙芯片有问题,反复折腾了几天,软硬件换了几次,到现在还是没有把例程跑通。</p><p>文档里面说不可用虚拟机来编译,我比较头铁,试试看!</p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">照理说</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">docker</font><font face="宋体">容器里面可以使用</font><font face="Calibri">u</font><font face="宋体">盘串口线,</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">没道理</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">docker</font><font face="宋体">搞不了</font><font face="Calibri">ck-link</font><font face="宋体">啊。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">可以看到</font><font face="Calibri">docker</font><font face="宋体">系统里面多了一个</font><font face="Calibri">usb001</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">再加到容器里面去</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">docker run --nam</span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">e testcdk</font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri"> --privileged</span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"> <font face="Calibri">-v /dev/bus/usb/:/dev/bus/usb/</font></span></span> <span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">-v /dev/console:/dev/console -v /dev/usb/:/dev/usb/ </font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri">-t</span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">i</font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri"> centos</span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">:7</font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri"> /usr/sbin/init</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">如果碰见</font><font face="Calibri">docker: Error response from daemon: cgroups: cannot find cgroup mount destination: unknown.</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">可以先</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">sudo mkdir /sys/fs/cgroup/systemd</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd</span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">使用</font><font face="Calibri">docker exec -ti testcdk bash</font><font face="宋体">命令进入容器</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">安装必要组件</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">yum install wget</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">yum install sudo</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">yum install nano</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">yum install git</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">yum install make</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">yum install </font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri">initscripts</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">yum install python3 python3-pip</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">pip3 install yoctools==2.0.10</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">建立工具目录</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">cd</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">mkdir repos</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">cd repos</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">与文档中不同,在</font>“开发中心<font face="Calibri">-</font><font face="宋体">资源下载”里面找到</font><font face="Calibri">debugserver</font><font face="宋体">和工具链</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">wget https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource/1836682/1637637575339/T-Head-DebugServer-linux-x86_64-V5.12.9-20211116.sh.tar.gz</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">解压</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">tar xzvf T-Head-DebugServer-linux-x86_64-V5.12.9-20211116.sh.tar.gz</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">使用</font> <font face="Calibri">./T-Head-DebugServer-linux-x86_64-V5.12.9-20211116.sh -i</font><font face="宋体">命令安装,全部输入</font><font face="Calibri">yes</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">用</font><font face="Calibri">ip addr</font><font face="宋体">命令看</font><font face="Calibri">ip</font><font face="宋体">地址</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">这里执行</font><font face="Calibri">DebugServerConsole</font><font face="宋体">会提示驱动没有安装或者线没有接。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">mkdir csky</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">cd csky</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">wget https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource/1356021/1619529111421/csky-elfabiv2-tools-x86_64-minilibc-20210423.tar.gz</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">解压</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">tar xzvf csky-elfabiv2-tools-x86_64-minilibc-20210423.tar.gz</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">把目录加到环境中去</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">echo "export PATH=$HOME/repos/csky/bin:\$PATH" >> /root/.bashrc</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">source /root/.bashrc</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">尝试执行</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">csky-abiv2-elf-gcc --version</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">验证已正确安装工具链</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">新建目录并进入</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">mkdir cb5654_sdk</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">cd cb5654_sdk</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">新建</font><font face="Calibri">.yoc</font><font face="宋体">文件</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">nano .yoc</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">把文档里面的内容拷进来</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">gitee_token: 6f0338386e24e797033b25f527324fc1</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">occ_host: occ.t-head.cn</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">repo: https://gitee.com/cb5654_sdk/manifest.git</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">branch: master</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">保存,并退出</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">查看一下,</font><font face="Calibri">cat .yoc</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">正确</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">开始下载,</font><font face="Calibri">yoc install -b v7.4.0.1</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">直到下载完成</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">进入对应的</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">smart_speaker_demo</font><font face="宋体">目录</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">cd solutions/smart_speaker_demo/</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">执行</font><font face="Calibri">make clean</font><font face="宋体">的时候,碰到了</font><font face="Calibri">scons</font><font face="宋体">问题,当然我试图通过</font><font face="Calibri">pip3 install scons</font><font face="宋体">重装,但发现实际上已经安装过了。</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">尝试执行</font><font face="Calibri">scons</font><font face="宋体">,发现似乎只关联到</font><font face="Calibri">python2</font><font face="宋体">,在</font><font face="Calibri">python3</font><font face="宋体">上不能使用,这可能是</font><font face="Calibri">centos</font><font face="宋体">的问题(之前我也碰到过类似的情况)</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">既然</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">scons</font><font face="宋体">没有在</font><font face="Calibri">python3.6/site-packages/scons</font><font face="宋体">(实际路径)下搜索,而是在</font><font face="Calibri">/usr/local/lib/scons</font><font face="宋体">下搜索,那我们直接给它加上软链接</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">ln -fs /usr/local/lib/python3.6/site-packages/scons /usr/local/lib/scons</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">执行</font><font face="Calibri">scons</font><font face="宋体">看看,继续出错,</font><font face="Calibri">yoctools</font><font face="宋体">没有安装?</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">这就比较奇怪了啊,之前还专门验证了</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">yoctools</font><font face="宋体">的啊</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">是</font><font face="Calibri">Make</font><font face="宋体">大小写的原因吗?再尝试一下</font><font face="Calibri">yoctools</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">看起来也没啥问题啊,再想想,难道是</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">centos</font><font face="宋体">缺省使用</font><font face="Calibri">python2</font><font face="宋体">的原因?</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">继续通过软链接修改</font><font face="Calibri">centos</font><font face="宋体">的</font><font face="Calibri">python</font><font face="宋体">默认值</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">rm /usr/bin/python</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">ln -s /usr/bin/python3 /usr/bin/python</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">好了,可以执行</font><font face="Calibri">make clean</font><font face="宋体">和</font><font face="Calibri">make</font><font face="宋体">了</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">因为没有cklink的驱动,所以</font><font face="Calibri">make flash</font><font face="宋体">是不用想了。。。</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">老老实实把</font><font face="Calibri">elf</font><font face="宋体">文件弄出来烧吧。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"> </p>
<p>没想到跑个例程还能这么折腾</p>
<p>挺麻烦,搞个程序要把整个系统了解一遍,太麻烦了。</p>
freebsder 发表于 2021-12-16 16:40
挺麻烦,搞个程序要把整个系统了解一遍,太麻烦了。
<p>是的,拿到手的板子有问题,折腾不了板子,只能折腾自己玩了。。。</p>
tobot 发表于 2021-12-16 20:26
是的,拿到手的板子有问题,折腾不了板子,只能折腾自己玩了。。。
<p>没点基础玩不动。大部分搞单片机的离了keil就麻爪了。</p>
页:
[1]