diff --git a/index.html b/index.html index 1dbbb3123deff920f2fb69df70e14186dfa23440..c843840049d34f8071ecf7c4922ef12753c2a436 100644 --- a/index.html +++ b/index.html @@ -78,7 +78,7 @@ <a id="user-content-programming-the-nrf52" class="anchor" href="#programming-the-nrf52" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Programming the NRF52</h2> <p>Programming involves two steps: 1) compiling code, and 2) flashing the code to the chip.</p> <p>Thanks to the folks at Adafruit, you can use the Arduino IDE to perform both steps. Instruction on installing the appropriate libraries can be found <a href="https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide">here</a>.</p> -<p>To build the toolchain for compilation manually, you can follow the instructions on <a href="https://pcbreflux.blogspot.com/2016/09/nrf52832-first-steps-with-st-link-v2.html">this page</a> (starting at heading "GNU ARM Compiler").</p> +<p>You can also compile and flash the code directly using the same toolchain employed by the IDE. To do this, you can follow the instructions on <a href="https://pcbreflux.blogspot.com/2016/09/nrf52832-first-steps-with-st-link-v2.html">this page</a> (starting at heading "GNU ARM Compiler").</p> <p>The steps for flashing your code depends on what board and programmer you have.</p> <h2> <a id="user-content-adafruit-feather-nrf52-board" class="anchor" href="#adafruit-feather-nrf52-board" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Adafruit Feather NRF52 Board</h2> @@ -107,13 +107,14 @@ nrfjprog -f nrf52 --run <p>The J-Link requires a wire to ensure the target has power. In the image above, red is target power (3.3V), black is ground, green is SWDCLK, and blue is SWDIO.</p> <h2> <a id="user-content-programming-with-openocd-and-raspberry-pi" class="anchor" href="#programming-with-openocd-and-raspberry-pi" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Programming with OpenOCD and Raspberry Pi</h2> -<p>You don't have to spend hundreds on a J-Link (even though it is very nice). Using <a href="openocd.org">OpenOCD</a>, we can make a Raspberry Pi bit-bang the programming protocols.</p> +<p>You don't have to spend hundreds on a J-Link (even though it is very nice). Using <a href="openocd.org">OpenOCD</a>, we can make a Raspberry Pi bit-bang the programming protocols. Below is a picture and screenshot of using OpenOCD and Pi Zero ($5) to program a custom board with a Raytac MDBT42Q module over serial wire debug. It works just as well to program the Fanstel modules.</p> <p><a href="openocd/bootloader-raspberrypi.jpg" target="_blank"><img src="openocd/bootloader-raspberrypi.jpg" width="53%" style="max-width:100%;"></a></p> <p><a href="openocd/flashing-bootloader.png" target="_blank"><img src="openocd/flashing-bootloader.png" width="30%" style="max-width:100%;"></a></p> <p><a href="https://learn.adafruit.com/programming-microcontrollers-using-openocd-on-raspberry-pi/overview">This page</a> is a very helpful introduction to programming using OpenOCD and the BCM2835.</p> <p>Support for the NRF52 is not in the stable release of OpenOCD as of V 0.10, but you can patch it following the instructions on <a href="https://primalcortex.wordpress.com/2017/06/10/setting-up-openocd-for-programming-the-nordic-nrf52832-chip/">this page</a>. They worked for me, with the small addition that I needed to eliminate two duplicate variable definitions that broke my build.</p> <p>The <code>openocd.cfg</code> will also be different for the NRF52 than the linked tutorial. Here is mine for flashing a binary of the Adafruit bootloader:</p> -<pre><code>transport select swd +<pre><code>source [find interface/raspberrypi-native.cfg] +transport select swd source [find target/nrf52.cfg] bcm2835gpio_swd_nums 25 24 bcm2835gpio_trst_num 7