树莓派Pico(Raspberry Pi Pico) Windows下开发环境——命令行下编译构建项目
<div class="cl-preview-section" style="text-align:start; text-indent:0px; -webkit-text-stroke-width:0px"><h1 style="margin-bottom:16px">这个也是我之前搞的</h1>
<p> </p>
<h1 style="margin-bottom:16px"><span style="font-size:16px"><span style="box-sizing:border-box"><span style="color:rgba(0, 0, 0, 0.75)"><span style="font-family:-apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif"><span style="font-style:normal"><span style="font-variant-ligatures:common-ligatures"><span style="font-variant-caps:normal"><span style="font-weight:400"><span style="letter-spacing:normal"><span style="orphans:2"><span style="text-transform:none"><span style="white-space:normal"><span style="widows:2"><span style="word-spacing:0px"><span style="background-color:#ffffff"><span style="text-decoration-style:initial"><span style="text-decoration-color:initial"><span style="font-size:28px"><span style="box-sizing:border-box"><span style="36px"><span style="color:#4f4f4f"><span style="font-weight:700">树莓派Pico(Raspberry Pi Pico) Windows下开发环境——命令行下编译构建项目</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></h1>
</div>
<div class="cl-preview-section" style="text-align:start; text-indent:0px; -webkit-text-stroke-width:0px">
<h2 style="margin-top:8px; margin-bottom:16px"><span style="font-size:16px"><span style="box-sizing:border-box"><span style="color:rgba(0, 0, 0, 0.75)"><span style="font-family:-apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif"><span style="font-style:normal"><span style="font-variant-ligatures:common-ligatures"><span style="font-variant-caps:normal"><span style="font-weight:400"><span style="letter-spacing:normal"><span style="orphans:2"><span style="text-transform:none"><span style="white-space:normal"><span style="widows:2"><span style="word-spacing:0px"><span style="background-color:#ffffff"><span style="text-decoration-style:initial"><span style="text-decoration-color:initial"><span style="font-size:24px"><span style="box-sizing:border-box"><span style="32px"><span style="color:#4f4f4f"><span style="font-weight:700"><a id="_1" style="box-sizing:border-box; text-decoration:none; color:#4ea1db"></a>从命令行构建</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></h2>
</div>
<div class="cl-preview-section" style="text-align:start; text-indent:0px; -webkit-text-stroke-width:0px">
<p style="margin-bottom:16px"><span style="font-size:16px"><span style="box-sizing:border-box"><span style="color:rgba(0, 0, 0, 0.75)"><span style="font-family:-apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif"><span style="font-style:normal"><span style="font-variant-ligatures:common-ligatures"><span style="font-variant-caps:normal"><span style="font-weight:400"><span style="letter-spacing:normal"><span style="orphans:2"><span style="text-transform:none"><span style="white-space:normal"><span style="widows:2"><span style="word-spacing:0px"><span style="background-color:#ffffff"><span style="text-decoration-style:initial"><span style="text-decoration-color:initial"><span style="font-size:18px"><span style="box-sizing:border-box"><span style="color:#4d4d4d"><span style="font-weight:400"><span style="26px"><span style="overflow:auto hidden">配置 SDK 路径<br style="box-sizing:border-box" />
通过选择Windows > Visual Studio,从Windows菜单中打开一个开发人员命令提示符窗口<br style="box-sizing:border-box" />
2019 >开发人员命令提示符菜单。<br style="box-sizing:border-box" />
<img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/20210129141836485.png" style="box-sizing:border-box; border-style:none; max-width:100%; margin-top:24px; margin-bottom:24px" /><br style="box-sizing:border-box" />
然后如下设置SDK的路径: setx PICO_SDK_PATH “…\pico-sdk” 设置成功关闭窗口</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
</div>
<div class="cl-preview-section" style="text-align:start; text-indent:0px; -webkit-text-stroke-width:0px">
<p style="margin-bottom:16px"><span style="font-size:16px"><span style="box-sizing:border-box"><span style="color:rgba(0, 0, 0, 0.75)"><span style="font-family:-apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif"><span style="font-style:normal"><span style="font-variant-ligatures:common-ligatures"><span style="font-variant-caps:normal"><span style="font-weight:400"><span style="letter-spacing:normal"><span style="orphans:2"><span style="text-transform:none"><span style="white-space:normal"><span style="widows:2"><span style="word-spacing:0px"><span style="background-color:#ffffff"><span style="text-decoration-style:initial"><span style="text-decoration-color:initial"><span style="font-size:18px"><span style="box-sizing:border-box"><span style="color:#4d4d4d"><span style="font-weight:400"><span style="26px"><span style="overflow:auto hidden"><img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/20210129142120445.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM5NTY3OTcw,size_16,color_FFFFFF,t_70" style="box-sizing:border-box; border-style:none; max-width:100%; margin-top:24px; margin-bottom:24px" /><br style="box-sizing:border-box" />
在保存 Pico SDK 的路径下 使用 Visual Studio 2019 打开<br style="box-sizing:border-box" />
<img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/20210129142416662.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM5NTY3OTcw,size_16,color_FFFFFF,t_70" style="box-sizing:border-box; border-style:none; max-width:100%; margin-top:24px; margin-bottom:24px" /><br style="box-sizing:border-box" />
在工具中找到命令行,打开开发者命令提示<br style="box-sizing:border-box" />
<img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/20210129142509701.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM5NTY3OTcw,size_16,color_FFFFFF,t_70" style="box-sizing:border-box; border-style:none; max-width:100%; margin-top:24px; margin-bottom:24px" /><br style="box-sizing:border-box" />
在打开的命令行中依次输入下列命令</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
</div>
<div class="cl-preview-section" style="text-align:start; text-indent:0px; -webkit-text-stroke-width:0px">
<pre style="margin-top:17px; margin-bottom:24px">
<span style="font-size:16px"><span style="box-sizing:border-box"><span style="color:rgba(0, 0, 0, 0.75)"><span style="font-family:-apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif"><span style="font-style:normal"><span style="font-variant-ligatures:common-ligatures"><span style="font-variant-caps:normal"><span style="font-weight:400"><span style="letter-spacing:normal"><span style="orphans:2"><span style="text-transform:none"><span style="white-space:normal"><span style="widows:2"><span style="word-spacing:0px"><span style="background-color:#ffffff"><span style="text-decoration-style:initial"><span style="text-decoration-color:initial"><span style="font-size:14px"><span style="box-sizing:border-box"><span style="font-family:"Source Code Pro", "DejaVu Sans Mono", "Ubuntu Mono", "Anonymous Pro", "Droid Sans Mono", Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, "PingFang SC", "Microsoft YaHei", sans-serif"><span style="22px"><span style="color:#000000"><code class="prism language-shell" style="box-sizing:border-box; font-family:"Source Code Pro", "DejaVu Sans Mono", "Ubuntu Mono", "Anonymous Pro", "Droid Sans Mono", Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, "PingFang SC", "Microsoft YaHei", sans-serif; font-size:14px; background:#282c34; border-radius:2px; padding:0.5em; 22px; color:#abb2bf; display:block; text-size-adjust:none; overflow-x:auto; white-space:pre"><span class="token function" style="box-sizing:border-box"><span style="font:14px "Source Code Pro", "DejaVu Sans Mono", "Ubuntu Mono", "Anonymous Pro", "Droid Sans Mono", Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, "PingFang SC", "Microsoft YaHei", sans-serif !important"><span style="color:#61aeee">cd</span></span></span> pico-examples
pico-examples<span class="token operator" style="box-sizing:border-box"><span style="font:14px "Source Code Pro", "DejaVu Sans Mono", "Ubuntu Mono", "Anonymous Pro", "Droid Sans Mono", Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, "PingFang SC", "Microsoft YaHei", sans-serif !important"><span style="color:#669900">></span></span></span> <span class="token function" style="box-sizing:border-box"><span style="font:14px "Source Code Pro", "DejaVu Sans Mono", "Ubuntu Mono", "Anonymous Pro", "Droid Sans Mono", Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, "PingFang SC", "Microsoft YaHei", sans-serif !important"><span style="color:#61aeee">mkdir</span></span></span> build
pico-examples<span class="token operator" style="box-sizing:border-box"><span style="font:14px "Source Code Pro", "DejaVu Sans Mono", "Ubuntu Mono", "Anonymous Pro", "Droid Sans Mono", Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, "PingFang SC", "Microsoft YaHei", sans-serif !important"><span style="color:#669900">></span></span></span> <span class="token function" style="box-sizing:border-box"><span style="font:14px "Source Code Pro", "DejaVu Sans Mono", "Ubuntu Mono", "Anonymous Pro", "Droid Sans Mono", Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, "PingFang SC", "Microsoft YaHei", sans-serif !important"><span style="color:#61aeee">cd</span></span></span> build
pico-examples\build<span class="token operator" style="box-sizing:border-box"><span style="font:14px "Source Code Pro", "DejaVu Sans Mono", "Ubuntu Mono", "Anonymous Pro", "Droid Sans Mono", Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, "PingFang SC", "Microsoft YaHei", sans-serif !important"><span style="color:#669900">></span></span></span> cmake -G <span class="token string" style="box-sizing:border-box"><span style="font:14px "Source Code Pro", "DejaVu Sans Mono", "Ubuntu Mono", "Anonymous Pro", "Droid Sans Mono", Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, "PingFang SC", "Microsoft YaHei", sans-serif !important"><span style="color:#669900">"NMake Makefiles"</span></span></span> <span class="token punctuation" style="box-sizing:border-box"><span style="font:14px "Source Code Pro", "DejaVu Sans Mono", "Ubuntu Mono", "Anonymous Pro", "Droid Sans Mono", Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, "PingFang SC", "Microsoft YaHei", sans-serif !important"><span style="color:#999999">..</span></span></span>
pico-examples\build<span class="token operator" style="box-sizing:border-box"><span style="font:14px "Source Code Pro", "DejaVu Sans Mono", "Ubuntu Mono", "Anonymous Pro", "Droid Sans Mono", Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, "PingFang SC", "Microsoft YaHei", sans-serif !important"><span style="color:#669900">></span></span></span> nmake
</code></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></pre>
</div>
<div class="cl-preview-section" style="text-align:start; text-indent:0px; -webkit-text-stroke-width:0px">
<p style="margin-bottom:16px"><span style="font-size:16px"><span style="box-sizing:border-box"><span style="color:rgba(0, 0, 0, 0.75)"><span style="font-family:-apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif"><span style="font-style:normal"><span style="font-variant-ligatures:common-ligatures"><span style="font-variant-caps:normal"><span style="font-weight:400"><span style="letter-spacing:normal"><span style="orphans:2"><span style="text-transform:none"><span style="white-space:normal"><span style="widows:2"><span style="word-spacing:0px"><span style="background-color:#ffffff"><span style="text-decoration-style:initial"><span style="text-decoration-color:initial"><span style="font-size:18px"><span style="box-sizing:border-box"><span style="color:#4d4d4d"><span style="font-weight:400"><span style="26px"><span style="overflow:auto hidden">等待编译完成<br style="box-sizing:border-box" />
<img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/20210129142850287.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM5NTY3OTcw,size_16,color_FFFFFF,t_70" style="box-sizing:border-box; border-style:none; max-width:100%; margin-top:24px; margin-bottom:24px" /><br style="box-sizing:border-box" />
编译完成后,在 bulid 文件夹中找到对应的编译生成文件 bin elf u2f 。将上述文件中的<font color="red"><font style="box-sizing: border-box;">u2f </font></font>拖入到 Pico 识别出的磁盘中(注意:第一次烧写时,为空代码 USB 连接上 Pico 可直接识别磁盘,当里面有可执行程序时,需要按住 BOOTSEL 按键再连接 USB) 拖入后磁盘断开开始执行(此处使用的 blink 编译文件 板载的 LED 闪烁)</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
</div>
<div class="cl-preview-section" style="text-align:start; text-indent:0px; -webkit-text-stroke-width:0px">
<p style="margin-bottom:16px"><span style="font-size:16px"><span style="box-sizing:border-box"><span style="color:rgba(0, 0, 0, 0.75)"><span style="font-family:-apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif"><span style="font-style:normal"><span style="font-variant-ligatures:common-ligatures"><span style="font-variant-caps:normal"><span style="font-weight:400"><span style="letter-spacing:normal"><span style="orphans:2"><span style="text-transform:none"><span style="white-space:normal"><span style="widows:2"><span style="word-spacing:0px"><span style="background-color:#ffffff"><span style="text-decoration-style:initial"><span style="text-decoration-color:initial"><span style="font-size:18px"><span style="box-sizing:border-box"><span style="color:#4d4d4d"><span style="font-weight:400"><span style="26px"><span style="overflow:auto hidden">参考:getting-started-with-pico<br style="box-sizing:border-box" />
第8.2章 Building on MS Windows</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
</div>
<p>空代码首次烧写, 连接上 Pico 直接识别磁盘,有可执行程序时,要按住 BOOTSEL 按键,,灯才闪烁</p>
<p>这是玩板子的第一步</p>
<p> </p>
本帖最后由 gao_hex 于 2021-5-8 11:21 编辑
<div class="quote">
<blockquote><font size="2"><a href="forum.php?mod=redirect&goto=findpost&pid=3060785&ptid=1164759" target="_blank"><font color="#999999">火辣西米秀 发表于 2021-5-7 22:28</font></a></font> 空代码首次烧写, 连接上 Pico 直接识别磁盘,有可执行程序时,要按住 BOOTSEL 按键,,灯才闪烁 这是玩 ...</blockquote>
</div>
<p>芯片已经烧录过代码后这样操作,空片子不用的 按 boot 按键(只有一次机会)</p>
<p>好!!!!!!!!!!!!!!!!!!!!!!!</p>
页:
[1]