mirror of
https://github.com/lupyuen/lupyuen.github.io.git
synced 2025-01-13 02:08:32 +08:00
338 lines
No EOL
27 KiB
HTML
338 lines
No EOL
27 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
|
||
<head>
|
||
<script defer src="https://cdn.optimizely.com/js/16180790160.js"></script>
|
||
<title data-rh="true">Install Apache Mynewt for STM32 Blue Pill on Windows | by Lup Yuen Lee 李立源 | Medium</title>
|
||
<meta data-rh="true" charset="utf-8" />
|
||
<meta data-rh="true" name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1" />
|
||
<meta data-rh="true" name="theme-color" content="#000000" />
|
||
<meta data-rh="true" property="og:type" content="article" />
|
||
<meta data-rh="true" property="article:published_time" content="2019-09-21T09:54:05.282Z" />
|
||
<meta data-rh="true" name="title"
|
||
content="Install Apache Mynewt for STM32 Blue Pill on Windows | by Lup Yuen Lee 李立源 | Medium" />
|
||
<meta data-rh="true" property="og:title" content="Install Apache Mynewt on Windows" />
|
||
<meta data-rh="true" property="twitter:title" content="Install Apache Mynewt on Windows" />
|
||
<meta data-rh="true" name="description"
|
||
content="Follow these instructions to install Mynewt build and application files on Windows" />
|
||
<meta data-rh="true" property="og:description"
|
||
content="Follow these instructions to install Mynewt build and application files on Windows" />
|
||
<meta data-rh="true" property="twitter:description"
|
||
content="Follow these instructions to install Mynewt build and application files on Windows" />
|
||
<meta data-rh="true" name="twitter:card" content="summary_large_image" />
|
||
<meta data-rh="true" name="twitter:creator" content="@MisterTechBlog" />
|
||
<meta data-rh="true" name="author" content="Lup Yuen Lee 李立源" />
|
||
<meta data-rh="true" name="robots" content="index,follow,max-image-preview:large" />
|
||
<meta data-rh="true" name="referrer" content="unsafe-url" />
|
||
<meta data-rh="true" name="twitter:label1" value="Reading time" />
|
||
<meta data-rh="true" name="twitter:data1" value="3 min read" />
|
||
<meta property="og:image"
|
||
content="https://lupyuen.github.io/images/legacy2/b1.jpeg">
|
||
|
||
<!-- Begin scripts/rustdoc-header.html: Header for Custom Markdown files processed by rustdoc, like chip8.md -->
|
||
<link rel="alternate" type="application/rss+xml" title="RSS Feed for lupyuen" href="/rss.xml" />
|
||
<link rel="stylesheet" type="text/css" href="../normalize.css">
|
||
<link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle">
|
||
|
||
<link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
|
||
<link rel="stylesheet" type="text/css" href="../prism.css">
|
||
<script src="../storage.js"></script><noscript>
|
||
<link rel="stylesheet" href="../noscript.css"></noscript>
|
||
<link rel="shortcut icon" href="../favicon.ico">
|
||
<style type="text/css">
|
||
#crate-search {
|
||
background-image: url("../down-arrow.svg");
|
||
}
|
||
a {
|
||
color: #77d;
|
||
}
|
||
</style>
|
||
<!-- End scripts/rustdoc-header.html -->
|
||
|
||
</head>
|
||
|
||
<body>
|
||
<div id="root">
|
||
<div class="a b c">
|
||
<div class="s">
|
||
<article>
|
||
<section class="ft fu fv fw w fx fd s"></section><span class="s"></span>
|
||
<div>
|
||
<div class="by fl fy fz ga ce"></div>
|
||
<section class="dj gb gc de gd">
|
||
<div class="ge w">
|
||
<div class="figure gf ge w paragraph-image">
|
||
|
||
|
||
<p><img src="https://lupyuen.github.io/images/legacy2/b1.jpeg" /></p>
|
||
|
||
|
||
|
||
<figcaption><p><em>STM32 Blue Pill with Quectel
|
||
BC95-G NB-IoT module running Apache Mynewt at Henderson Waves</em></p></figcaption>
|
||
</div>
|
||
</div>
|
||
<div class="n p">
|
||
<div class="aj ak al am an gz ap w">
|
||
<div class="">
|
||
<h1 id="2243"
|
||
class="ha dh hb av cw hc hd he hf hg hh hi hj hk hl hm hn ho hp hq hr hs ht hu hv hw el">
|
||
Install Apache Mynewt for STM32 Blue Pill on Windows</h1>
|
||
<div class="ct">
|
||
<div class="n cg hx hy hz">
|
||
<div class="o n">
|
||
<div><a rel="noopener"
|
||
href="https://lupyuen.github.io">
|
||
<div class="ah ia ib">
|
||
<div class="ba n ar o p by ic id cb cc cd ce"></div>
|
||
|
||
</div>
|
||
</a></div>
|
||
<div class="dp w n cq">
|
||
<div class="n">
|
||
<div style="flex:1"><span class="av b aw ax el"><a class=""
|
||
rel="noopener"
|
||
href="https://lupyuen.github.io">
|
||
<p class="av b aw ax az">Lup Yuen Lee 李立源</p>
|
||
</a></span></div>
|
||
</div><span class="av b aw ax ay"><a class="" rel="noopener"
|
||
href="https://lupyuen.github.io/articles/install-apache-mynewt-on-windows">
|
||
<p class="av b aw ax ay"><span class="ie"></span>Jul 25,
|
||
2019<span class="if">·</span>3 min read</p>
|
||
</a></span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<p id="88c1"
|
||
class="iu iv hb iw b ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn dj el">
|
||
Follow these instructions to install Mynewt build and application files on
|
||
Windows for the article...</p>
|
||
<div class="jo jp jq jr js jt"><a target="_blank" rel="noopener"
|
||
href="https://lupyuen.github.io/articles/connect-stm32-blue-pill-to-nb-iot-with-quectel-bc95-g-and-apache-mynewt">
|
||
<div class="en n dq">
|
||
<div class="ju n ac p jv jw">
|
||
<h2 class="av cw dk ax ec jx eb jy jz ka kb dh el">Connect STM32
|
||
Blue Pill to NB-IoT with Quectel BC95-G and Apache Mynewt</h2>
|
||
</div>
|
||
<div class="kf s">
|
||
<div class="kg s kh ki kj kf kk kl jt"></div>
|
||
</div>
|
||
</div>
|
||
</a></div>
|
||
<p id="c1c6"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
1️⃣ Download the <code class="gp kr ks kt ku b">.7z</code> file attached
|
||
below…<br /><code
|
||
class="gp kr ks kt ku b"><a href="https://github.com/lupyuen/stm32bluepill-mynewt-sensor/releases/tag/v5.0.0" class="bq kv" rel="noopener nofollow">https://github.com/lupyuen/stm32bluepill-mynewt-sensor/releases/tag/v5.0.0</a></code>
|
||
</p>
|
||
<p id="d698"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Expand the <code class="gp kr ks kt ku b">.7z</code> file with 7zip…<br /><code
|
||
class="gp kr ks kt ku b"><a href="https://www.7-zip.org/download.html" class="bq kv" rel="noopener nofollow">https://www.7-zip.org/download.html</a></code>
|
||
</p>
|
||
<p id="bef9"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
2️⃣ Install Arm Cross-Compiler and Linker for Windows from Arm Developer
|
||
Website…<br /><code
|
||
class="gp kr ks kt ku b"> <a href="https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-win32-sha1.exe?revision=fcadabed-d946-49dc-8f78-0732d2f43773?product=GNU%20Arm%20Embedded%20Toolchain,32-bit,,Windows,8-2019-q3-update" class="bq kv" rel="noopener nofollow">https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-win32-sha1.exe?revision=fcadabed-d946-49dc-8f78-0732d2f43773?product=GNU%20Arm%20Embedded%20Toolchain,32-bit,,Windows,8-2019-q3-update</a></code>
|
||
</p>
|
||
<p id="cee4"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Select this option at the last install step:<br /><code
|
||
class="gp kr ks kt ku b">"Add path to environment variable"</code>
|
||
</p>
|
||
<p id="d593"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
3️⃣ Download the ST-Link USB driver from ST-Link Driver Website (email
|
||
registration required)…<br /><code
|
||
class="gp kr ks kt ku b"><a href="https://www.st.com/en/development-tools/stsw-link009.html" class="bq kv" rel="noopener nofollow">https://www.st.com/en/development-tools/stsw-link009.html</a></code>
|
||
</p>
|
||
<p id="df02"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Click <code class="gp kr ks kt ku b">Get Software</code><br />Unzip the
|
||
downloaded file. Double-click the driver installer:<br /><code
|
||
class="gp kr ks kt ku b">dpinst_amd64.exe</code></p>
|
||
<p id="6385"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
4️⃣ Install Windows Studio Code:<br /><code
|
||
class="gp kr ks kt ku b"><a href="https://code.visualstudio.com/" class="bq kv" rel="noopener nofollow">https://code.visualstudio.com/</a></code>
|
||
</p>
|
||
<p id="988f"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Launch Visual Studio Code</p>
|
||
<p id="a939"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Install the extension “<code
|
||
class="gp kr ks kt ku b">Cortex-Debug</code>”…<br /><code
|
||
class="gp kr ks kt ku b"><a href="https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug" class="bq kv" rel="noopener nofollow">https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug</a></code>
|
||
</p>
|
||
<p id="2ddb"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
5️⃣<span id="rmm"> </span>Click <code
|
||
class="gp kr ks kt ku b">File → Open Folder</code><br />Select the
|
||
downloaded folder <code
|
||
class="gp kr ks kt ku b">stm32bluepill-mynewt-sensor</code><br />When
|
||
prompted to open the workspace, click <code
|
||
class="gp kr ks kt ku b">Open Workspace</code></p>
|
||
<p id="b5fc"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Open the following file and configure the program settings:<br /><code
|
||
class="gp kr ks kt ku b"><a href="https://github.com/lupyuen/stm32bluepill-mynewt-sensor/blob/nbiot/targets/bluepill_my_sensor/syscfg.yml" class="bq kv" rel="noopener nofollow">targets/bluepill_my_sensor/syscfg.yml</a></code>
|
||
</p>
|
||
<p id="d03e"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Change the NB-IoT band setting <code class="gp kr ks kt ku b">NBIOT_BAND</code>.
|
||
Check with your NB-IoT operator for the band to use. The other settings are
|
||
documented below.</p>
|
||
<p id="830e"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
6️⃣ Connect Blue Pill to ST-Link. Connect ST-Link to your computer’s USB port.
|
||
</p>
|
||
<p id="a141"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Click <code
|
||
class="gp kr ks kt ku b">Terminal → Run Task → [1] Build bluepill_boot</code><br />This
|
||
builds the Mynewt Bootloader. In case of problems, compare with <a
|
||
href="https://github.com/lupyuen/stm32bluepill-mynewt-sensor/blob/nbiot/logs/build-bootloader.log"
|
||
class="bq kv" rel="noopener nofollow">this build log</a>.</p>
|
||
<p id="6037"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Click <code
|
||
class="gp kr ks kt ku b">Terminal → Run Task → [2] Build bluepill_my_sensor</code><br />This
|
||
builds the Mynewt Application. Compare with <a
|
||
href="https://github.com/lupyuen/stm32bluepill-mynewt-sensor/blob/nbiot/logs/build-application.log"
|
||
class="bq kv" rel="noopener nofollow">this build log</a>.</p>
|
||
<p id="cf92"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Click <code
|
||
class="gp kr ks kt ku b">Terminal → Run Task → [3] Image bluepill_my_sensor</code><br />This
|
||
creates the Blue Pill flash image. Compare with <a
|
||
href="https://github.com/lupyuen/stm32bluepill-mynewt-sensor/blob/nbiot/logs/image.log"
|
||
class="bq kv" rel="noopener nofollow">this image log</a>.</p>
|
||
<p id="0ca7"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Click <code
|
||
class="gp kr ks kt ku b">Terminal → Run Task → [4] Load bluepill_boot</code><br />This
|
||
flashes the Mynewt Bootloader to Blue Pill. Compare with <a
|
||
href="https://github.com/lupyuen/stm32bluepill-mynewt-sensor/blob/nbiot/logs/load-bootloader.log"
|
||
class="bq kv" rel="noopener nofollow">this flash log</a>.</p>
|
||
<p id="2b6b"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Click <code
|
||
class="gp kr ks kt ku b">Terminal → Run Task → [5] Load bluepill_my_sensor</code><br />This
|
||
flashes the Mynewt Application to Blue Pill. Compare with <a
|
||
href="https://github.com/lupyuen/stm32bluepill-mynewt-sensor/blob/nbiot/logs/load-application.log"
|
||
class="bq kv" rel="noopener nofollow">this flash log</a>.</p>
|
||
<p id="46ab"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
If any source files or configuration files are changed, rebuild by clicking
|
||
<code
|
||
class="gp kr ks kt ku b">Terminal → Run Task → [2] Build bluepill_my_sensor</code>
|
||
</p>
|
||
<h1 id="0e7c"
|
||
class="kw kx hb av ky kz la iy lb lc ld jb le lf lg lh li lj lk ll lm ln lo lp lq lr el">
|
||
Program Settings</h1>
|
||
<p id="d1c0"
|
||
class="iu iv hb iw b ix ls iy iz ja lt jb jc jd lu je jf jg lv jh ji jj lw jk jl jn dj el">
|
||
The program settings may be found in the file<br /><code
|
||
class="gp kr ks kt ku b"><a href="https://github.com/lupyuen/stm32bluepill-mynewt-sensor/blob/nbiot/targets/bluepill_my_sensor/syscfg.yml" class="bq kv" rel="noopener nofollow">targets/bluepill_my_sensor/syscfg.yml</a></code>
|
||
</p>
|
||
<div class="figure lx ly lz ma mb ge mc md fc me mf mg mh mi bg mj mk ml mm mn dy">
|
||
|
||
<p><script src="https://gist.github.com/lupyuen/4165741d9c7832704545057b25e83ee9.js"></script></p>
|
||
|
||
|
||
<figcaption><p><em>Program Settings. From <a
|
||
href="https://github.com/lupyuen/stm32bluepill-mynewt-sensor/blob/nbiot/targets/bluepill_my_sensor/syscfg.yml"
|
||
class="bq kv"
|
||
rel="noopener nofollow">https://github.com/lupyuen/stm32bluepill-mynewt-sensor/blob/nbiot/targets/bluepill_my_sensor/syscfg.yml</a>
|
||
</em></p></figcaption>
|
||
</div>
|
||
<p id="b43e"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
<code class="gp kr ks kt ku b">COAP_HOST, COAP_PORT</code>: The program will
|
||
send CoAP messages to this IP address and port number, which defaults to the
|
||
CoAP server at thethings.io.</p>
|
||
<p id="5298"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Keep the default settings if you wish to view your sensor data at <code
|
||
class="gp kr ks kt ku b">blue-pill-geolocate.appspot.com</code>.</p>
|
||
<p id="c683"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Change the setting to use your own CoAP server instead of thethings.io</p>
|
||
<p id="8ce7"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
<code class="gp kr ks kt ku b">COAP_URI</code>: The CoAP message will be
|
||
delivered to this URI at the CoAP server (which defaults to thethings.io).</p>
|
||
<p id="2117"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
Keep the default settings if you wish to view your sensor data at <code
|
||
class="gp kr ks kt ku b">blue-pill-geolocate.appspot.com</code>.</p>
|
||
<p id="caff"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
For thethings.io, the last part <code class="gp kr ks kt ku b">IVRi…</code> is
|
||
the Thing Token. If you wish to send sensor data to your own Thing at
|
||
thethings.io, replace the last part of the URI with your Thing Token.</p>
|
||
<p id="86bd"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
For the purpose of NB-IoT Education, I’ll allow you to transmit sensor data to
|
||
the Thing Token <code class="gp kr ks kt ku b">IVRi…</code> from my personal,
|
||
paid thethings.io account. Which will forward the sensor data to <code
|
||
class="gp kr ks kt ku b">blue-pill-geolocate.appspot.com</code> for viewing.
|
||
</p>
|
||
<p id="4572"
|
||
class="iu iv hb iw b ix km iy iz ja kn jb jc jd ko je jf jg kp jh ji jj kq jk jl jn dj el">
|
||
<code class="gp kr ks kt ku b">NBIOT_BAND</code>: The program connects to this
|
||
<a href="http://www.techplayon.com/nb-iot-frequency-bands-as-per-3gpp-rel-13-14-and-15/"
|
||
class="bq kv" rel="noopener nofollow">NB-IoT Frequency Band</a>. The
|
||
Frequency Band depends on your country and your NB-IoT network operator. Check
|
||
with your NB-IoT network operator for the Frequency Band to use.</p>
|
||
<div class="figure lx ly lz ma mb ge fv fw paragraph-image">
|
||
|
||
<p><img src="https://lupyuen.github.io/images/legacy2/b2.png" /></p>
|
||
|
||
<figcaption><p><em>NB-IoT Frequency Bands
|
||
for Singapore. From <a
|
||
href="https://www.imda.gov.sg/-/media/imda/files/regulation-licensing-and-consultations/frameworks-and-policies/spectrum-management-and-coordination/spectrummgmthb.pdf"
|
||
class="bq kv"
|
||
rel="noopener nofollow">https://www.imda.gov.sg/-/media/imda/files/regulation-licensing-and-consultations/frameworks-and-policies/spectrum-management-and-coordination/spectrummgmthb.pdf</a>
|
||
</em></p></figcaption>
|
||
</div>
|
||
<div class="figure lx ly lz ma mb ge fv fw paragraph-image">
|
||
|
||
<p><img src="https://lupyuen.github.io/images/legacy2/b3.png" /></p>
|
||
|
||
|
||
<figcaption><p><em>NB-IoT Frequency Bands
|
||
for Singapore. From <a
|
||
href="https://www.imda.gov.sg/-/media/imda/files/regulation-licensing-and-consultations/ict-standards/telecommunication-standards/radio-comms/imda-ts-iot.pdf"
|
||
class="bq kv"
|
||
rel="noopener nofollow">https://www.imda.gov.sg/-/media/imda/files/regulation-licensing-and-consultations/ict-standards/telecommunication-standards/radio-comms/imda-ts-iot.pdf</a>
|
||
</em></p></figcaption>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</article>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<ul>
|
||
<li>
|
||
<p><a href="https://github.com/sponsors/lupyuen">Sponsor me a coffee</a></p>
|
||
</li>
|
||
<li>
|
||
<p><a href="https://lupyuen.github.io">Check out my articles</a></p>
|
||
</li>
|
||
<li>
|
||
<p><a href="https://lupyuen.github.io/rss.xml">RSS Feed</a></p>
|
||
</li>
|
||
</ul>
|
||
|
||
</body>
|
||
|
||
</html> |