blob: b3ac36cc616d1039caeda66e4c7d5a79b1560a45 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- This is broken by doc revisioning.
-->
<link rel="shortcut icon" href="../../../img/favicon.ico">
<title>Blinky on Arduino Zero - Apache Mynewt</title>
<link href="../../../css/bootstrap-3.0.3.min.css" rel="stylesheet">
<link rel="stylesheet" href="../../../css/highlight.css">
<link href="../../../css/base.css" rel="stylesheet">
<link href="../../../css/custom.css" rel="stylesheet">
<link href="../../../css/v2.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<script>
(function(i, s, o, g, r, a, m) {
i["GoogleAnalyticsObject"] = r;
(i[r] =
i[r] ||
function() {
(i[r].q = i[r].q || []).push(arguments);
}),
(i[r].l = 1 * new Date());
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
})(window, document, "script", "//www.google-analytics.com/analytics.js", "ga");
ga("create", "UA-72162311-1", "auto");
ga("send", "pageview");
</script>
</head>
<body class="Blinky on Arduino Zero">
<div class="container">
<div class="row v2-main-banner">
<a class="logo-cell" href="/">
<img class="logo" src="/img/logo.png">
</a>
<div class="tagline-cell">
<h4 class="tagline">An OS to build, deploy and securely manage billions of devices</h4>
</div>
<div class="news-cell">
<div class="well">
<h4>Latest News:</h4> <a href="/download">Apache Mynewt 1.12.0, Apache NimBLE 1.7.0 </a> released (April 4, 2024)
</div>
</div>
</div>
</div>
<nav id="navbar" class="navbar navbar-inverse affix-top" data-spy="affix" data-offset-top="150" role="navigation">
<div class="container">
<!-- Collapsed navigation -->
<div class="navbar-header">
<!-- Expander button -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Expanded navigation -->
<div class="navbar-collapse collapse">
<!-- Main navigation -->
<ul class="nav navbar-nav navbar-right">
<li
class=""
>
<a href="/"><i class="fa fa-home" style="font-size: larger;"></i></a>
</li>
<li
class="important"
>
<a href="/quick-start/">Quick Start</a>
</li>
<li
class=""
>
<a href="/about/">About</a>
</li>
<li
class=""
>
<a href="/talks/">Talks</a>
</li>
<li
class="active"
>
<a href="/documentation/">Documentation</a>
</li>
<li
class=""
>
<a href="/download/">Download</a>
</li>
<li
class=""
>
<a href="/community/">Community</a>
</li>
<li
class=""
>
<a href="/events/">Events</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-3 v2-sidebar sidebar-container"><div id="docSidebar" class="hidden-print" role="complementary">
<div class="top">
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search documentation" />
</div>
</form>
</div>
</div>
<ul class="toc-nav">
<li class="doc-version"><select class="form-control" onchange="if (this.value) window.location.href=this.value">
<option value="/latest">
Version: master
</option>
<option value="/v1_12_0/" >
Version: 1.12.0
</option>
<option value="/v1_11_0/" >
Version: 1.11.0
</option>
<option value="/v1_10_0/" >
Version: 1.10.0
</option>
<option value="/v1_9_0/" >
Version: 1.9.0
</option>
<option value="/v1_8_0/" >
Version: 1.8.0
</option>
<option value="/v1_7_0/" >
Version: 1.7.0
</option>
<option value="/v1_6_0/" >
Version: 1.6.0
</option>
<option value="/v1_5_0/" >
Version: 1.5.0
</option>
<option value="/v1_4_0/" >
Version: 1.4.0
</option>
<option value="/v1_3_0/os/introduction" >
Version: 1.3.0
</option>
<option value="/v1_2_0/os/introduction" selected="selected" >
Version: 1.2.0
</option>
<option value="/v1_1_0/os/introduction" >
Version: 1.1.0
</option>
<option value="/v1_0_0/os/introduction" >
Version: 1.0.0
</option>
<option value="/v0_9_0/os/introduction" >
Version: 0.9.0
</option>
</select></li>
<li ><a href="../../introduction/">Mynewt Documentation</a>
<ul>
<li ><a href="../../get_started/get_started/">Basic Setup</a>
</li>
<li >
<a href="../../get_started/vocabulary/">Concepts</a>
</li>
<li ><a href="../tutorials/">Tutorials</a>
<ul>
<li ><a href="../blinky/">Project Blinky</a>
<ul>
<li class="active">
<a href="./">Blinky on Arduino Zero</a>
</li>
<li >
<a href="../blinky_primo/">Blinky on Arduino Primo</a>
</li>
<li >
<a href="../olimex/">Blinky on Olimex</a>
</li>
<li >
<a href="../nRF52/">Blinky on nRF52 DK</a>
</li>
<li >
<a href="../rbnano2/">Blinky on RedBear Nano 2</a>
</li>
<li >
<a href="../blinky_stm32f4disc/">Blinky on STM32F4-Discovery</a>
</li>
<li >
<a href="../blinky_console/">Add Console and Shell to Blinky</a>
</li>
</ul>
</li>
<li ><a href="../repo/add_repos/">Work with repositories</a>
</li>
<li ><a href="../project-slinky/">Project Slinky for Remote Comms</a>
</li>
<li><a href="
../ble_bare_bones/
">Bluetooth Low Energy</a>
</li>
<li><a href="
../lora/lorawanapp/
">LoRa</a>
</li>
<li><a href="
../event_queue/
">OS Fundamentals</a>
</li>
<li><a href="
../add_newtmgr/
">Remote Device Management</a>
</li>
<li><a href="
../sensors/sensors/
">Sensors</a>
</li>
<li><a href="
../segger_rtt/
">Tooling</a>
</li>
<li><a href="
../codesize/
">Other</a>
</li>
</ul>
</li>
<li ><a href="../../os_user_guide/">OS User Guide</a>
</li>
<li><a href="
../../../network/ble/ble_intro/
">BLE User Guide</a>
</li>
<li ><a href="../../../newt/newt_intro/">Newt Tool Guide</a>
</li>
<li ><a href="../../../newtmgr/overview/">Newt Manager Guide</a>
</li>
<li >
<a href="../../../known_issues/">Known Issues</a>
</li>
</ul>
</li>
<li><a href="
../../../newt/install/prev_releases/
">Appendix</a>
</li>
</ul>
</div></div>
<div class="col-md-9" role="main">
<div class="doc-header">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="/documentation/">Docs</a></li>
<li>&raquo; <a href="os/tutorials/blinky/">Project Blinky</a></li>
<li>&raquo; <a href="os/tutorials/tutorials/">Tutorials</a></li>
<li>&raquo; <a href="os/introduction/">Mynewt Documentation</a></li>
<li>&raquo; Blinky on Arduino Zero</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/apache/mynewt-site/blob/master/docs/os/tutorials/arduino_zero.md"
class="icon icon-github"> Edit on GitHub</a>
</li>
</ul>
</div>
</div>
<div class="alert alert-warning">
<p>
Version 1.2.0 is not the most recent version of the Apache Mynewt
documentation. Click <a href="/latest">here</a> to read the latest
version.
</p>
</div>
<h2 id="blinky-your-hello-world-on-arduino-zero">Blinky, your "Hello World!", on Arduino Zero</h2>
<p>This tutorial shows you how to create, build and run the Blinky application on an Arduino Zero board.</p>
<h3 id="prerequisites">Prerequisites</h3>
<ul>
<li>Meet the prerequisites listed in <a href="/os/tutorials/blinky.md">Project Blinky</a>.</li>
<li>Have an Arduino Zero board.<br />
Note: There are many flavors of Arduino. Make sure you are using an Arduino Zero. See below for the versions of Arduino Zero that are compatible with this tutorial.</li>
<li>Install the <a href="/os/get_started/cross_tools/">OpenOCD debugger</a>.</li>
</ul>
<p>This tutorial uses the Arduino Zero Pro board. The tutorial has been tested on the following three Arduino Zero boards - Zero, M0 Pro, and Zero-Pro.</p>
<p><img src="https://www.arduino.cc/en/uploads/Main/Zero_Usb_Ports.jpg" alt="Drawing" style="width: 390px;"/>
<img src="http://www.arduino.org/images/products/Arduino-M0Pro-flat.jpg" alt="Drawing" style="width: 310px;"/>
<img src="http://www.arduino.org//images/products/ArduinoZeroPro-flat-org.jpg" alt="Drawing" style="width: 310px;"/></p>
<p>Mynewt has not been tested on Arduino M0 which has no internal debugger support.</p>
<p><br></p>
<h3 id="create-a-project">Create a Project</h3>
<p>Create a new project if you do not have an existing one. You can skip this step and proceed to <a href="#fetchexternal">fetch external packages</a> if you already created a project. </p>
<p>Run the following commands to create a new project: </p>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code> $ mkdir ~/dev
$ cd ~/dev
$ newt new myproj
Downloading project skeleton from apache/mynewt-blinky...
Installing skeleton in myproj...
Project myproj successfully created.
$ cd myproj
$ newt install
apache-mynewt-core
$
</code></pre></div>
<p><br></p>
<h3 id="fetch-external-packages"><a name="fetchexternal"></a> Fetch External Packages</h3>
<p>Mynewt uses source code provided directly from the chip manufacturer for
low level operations. Sometimes this code is licensed only for the specific manufacturer of the chipset and cannot live in the Apache Mynewt repository. That happens to be the case for the Arduino Zero board which uses Atmel SAMD21. Runtime's github repository hosts such external third-party packages and the newt tool can fetch them.</p>
<p>To fetch the package with MCU support for Atmel SAMD21 for Arduino Zero from the Runtime git repository, you need to add
the repository to the <code>project.yml</code> file in your base project directory.</p>
<p>Here is an example <code>project.yml</code> file with the Arduino Zero repository
added. The sections with <code>mynewt_arduino_zero</code> that need to be added to
your project file are highlighted.</p>
<p><strong>Note:</strong> On Windows platforms: You need to set <code>vers</code> to <code>0-dev</code> and use the latest master branch for both repositories.</p>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code>$ more project.yml
project.name: &quot;my_project&quot;
project.repositories:
- apache-mynewt-core
<span style="background-color: #ffffcc"> - mynewt_arduino_zero
</span>
repository.apache-mynewt-core:
type: github
vers: 1-latest
user: apache
repo: mynewt-core
<span style="background-color: #ffffcc">repository.mynewt_arduino_zero:
</span><span style="background-color: #ffffcc"> type: github
</span><span style="background-color: #ffffcc"> vers: 1-latest
</span><span style="background-color: #ffffcc"> user: runtimeco
</span><span style="background-color: #ffffcc"> repo: mynewt_arduino_zero
</span>$
</code></pre></div>
<p><br>
Install the project dependencies using the <code>newt install</code> command (you can specify <code>-v</code> for verbose output):</p>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code>$ newt install
apache-mynewt-core
mynewt_arduino_zero
$
</code></pre></div>
<p><br></p>
<p><strong>NOTE:</strong> If there has been a new release of a repo used in your project since you last installed it, the <code>1-latest</code> version for the repo in the <code>project.yml</code> file will refer to the new release and will not match the installed files. In that case you will get an error message saying so and you will need to run <code>newt upgrade</code> to overwrite the existing files with the latest codebase.</p>
<p><br>
You need to create two targets for the Arduino Zero Pro board, one for the bootloader and one for the Blinky application.<br />
<br>
Run the following <code>newt target</code> commands, from your project directory, to create a bootloader target. We name the target <code>arduino_boot</code>.</p>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code>$ newt target create arduino_boot
$ newt target set arduino_boot bsp=@mynewt_arduino_zero/hw/bsp/arduino_zero
$ newt target set arduino_boot app=@apache-mynewt-core/apps/boot
$ newt target set arduino_boot build_profile=optimized
Target targets/arduino_boot successfully set target.build_profile to optimized
$ newt target set arduino_boot syscfg=BSP_ARDUINO_ZERO_PRO=1
Target targets/arduino_boot successfully set target.syscfg to BSP_ARDUINO_ZERO_PRO=1
$
</code></pre></div>
<p><strong>Note:</strong> If you have an Arduino Zero instead of an Arduino Zero Pro or Arduino M0 Pro board, replace <code>BSP_ARDUINO_ZERO_PRO</code> with <code>BSP_ARDUINO_ZERO</code> in the last <code>newt target set</code> command.</p>
<p>These commands perform the following:</p>
<ul>
<li>Create a target named <code>arduino_boot</code> for the Arduino Zero Bootloader. </li>
<li>Set the application for the <code>arduino_boot</code> target to the default Apache Mynewt
bootloader (<code>@apache-mynewt-core/apps/boot</code>)</li>
<li>Set the board support package for the target to
<code>@mynewt_arduino_zero/hw/bsp/arduino_zero</code>. This is a reference to the downloaded
Arduino Zero support from Github.</li>
<li>Use the "optimized" build profile for the <code>arduino_boot</code> target. This
instructs Newt to generate smaller and more efficient code for this target.
This setting is necessary due to the bootloader's strict size constraints.</li>
<li>Sets the system configuration setting for Board Support Package to support the Arduino Zero Pro. </li>
</ul>
<p>See the <a href="../../get_started/vocabulary/">Concepts</a> section for more information on setting options.
<br></p>
<h3 id="create-a-target-for-the-blinky-application">Create a Target for the Blinky Application</h3>
<p>Run the following <code>newt target</code> commands to create the Blinky application target. We name the application target <code>arduino_blinky</code>.</p>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code>$ newt target create arduino_blinky
Target targets/arduino_blinky successfully created
$ newt target set arduino_blinky app=apps/blinky
Target targets/arduino_blinky successfully set target.app to apps/blinky
$ newt target set arduino_blinky bsp=@mynewt_arduino_zero/hw/bsp/arduino_zero
Target targets/arduino_blinky successfully set target.bsp to @mynewt_arduino_zero/hw/bsp/arduino_zero
$ newt target set arduino_blinky build_profile=debug
Target targets/arduino_blinky successfully set target.build_profile to debug
$ newt target set arduino_blinky syscfg=BSP_ARDUINO_ZERO_PRO=1
Target targets/arduino_boot successfully set target.syscfg to BSP_ARDUINO_ZERO_PRO=1
$
</code></pre></div>
<p><strong>Note:</strong> If you have an Arduino Zero instead of a Arduino Zero Pro board, replace <code>BSP_ARDUINO_ZERO_PRO</code> with <code>BSP_ARDUINO_ZERO</code> in the last <code>newt target set</code> command.</p>
<p><br></p>
<h3 id="build-the-bootloader">Build the Bootloader</h3>
<p>Run the <code>newt build arduino_boot</code> command to build the bootloader:</p>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code>$ newt build arduino_boot
Building target targets/arduino_boot
Compiling bin/targets/arduino_boot/generated/src/arduino_boot-sysinit-app.c
Compiling repos/apache-mynewt-core/boot/bootutil/src/image_rsa.c
Compiling repos/apache-mynewt-core/boot/bootutil/src/image_ec.c
Compiling repos/apache-mynewt-core/boot/bootutil/src/image_ec256.c
Compiling bin/targets/arduino_boot/generated/src/arduino_boot-sysflash.c
Compiling repos/apache-mynewt-core/boot/bootutil/src/image_validate.c
Compiling repos/apache-mynewt-core/boot/bootutil/src/bootutil_misc.c
Compiling repos/apache-mynewt-core/apps/boot/src/boot.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/arc4.c
Compiling repos/apache-mynewt-core/boot/bootutil/src/loader.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/aes.c
....
Archiving sys_mfg.a
Archiving sys_sysinit.a
Archiving util_mem.a
Linking ~/dev/myproj/bin/targets/arduino_boot/app/apps/boot/boot.elf
Target successfully built: targets/arduino_boot
</code></pre></div>
<p><br></p>
<h3 id="build-the-blinky-application">Build the Blinky Application</h3>
<p>Run the <code>newt build arduino_blinky</code> command to build the Blinky application image:</p>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code>$ newt build arduino_blinky
Building target targets/arduino_blinky
Compiling repos/apache-mynewt-core/hw/hal/src/hal_flash.c
Compiling apps/blinky/src/main.c
Compiling repos/mynewt_arduino_zero/hw/mcu/atmel/samd21xx/src/sam0/drivers/i2s/i2s.c
Compiling repos/mynewt_arduino_zero/hw/bsp/arduino_zero/src/hal_bsp.c
Compiling repos/mynewt_arduino_zero/hw/mcu/atmel/samd21xx/src/sam0/drivers/i2s/i2s_callback.c
Compiling repos/mynewt_arduino_zero/hw/mcu/atmel/samd21xx/src/sam0/drivers/nvm/nvm.c
...
Archiving sys_mfg.a
Archiving sys_sysinit.a
Archiving util_mem.a
Linking ~/dev/myproj/bin/targets/arduino_blinky/app/apps/blinky/blinky.elf
Target successfully built: targets/arduino_blinky
</code></pre></div>
<p><br></p>
<h3 id="connect-to-the-board">Connect to the Board</h3>
<p>Connect your computer to the Arduino Zero (from now on we'll call this the
target) with a Micro-USB cable through the Programming Port as shown below.
Mynewt will load the image onto the board and debug the target through this port. You should see a
green LED come on that indicates the board has power.</p>
<p>No external debugger is required. The Arduino Zero comes with an internal
debugger that can be accessed by Mynewt.</p>
<p>The images below show the Arduino Zero Programming Port.</p>
<p><img src="https://www.arduino.cc/en/uploads/Main/Zero_Usb_Ports.jpg" alt="Drawing" style="width: 400px;"/>
<img src="http://www.arduino.org//images/products/ArduinoZeroPro-flat-org.jpg" alt="Drawing" style="width: 330px;"/></p>
<p><br></p>
<h3 id="load-the-bootloader-onto-the-board">Load the Bootloader onto the Board</h3>
<p>Run the <code>newt load arduino_boot</code> command to load the bootloader onto the board:</p>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code>$ newt load arduino_boot
Loading bootloader
$
</code></pre></div>
<p>The bootloader is loaded onto your board succesfully when the <code>newt load</code> command returns to the command prompt after the <code>Loading bootloader</code> status message. You can proceed to load and run your Blinky application image (See <a href="#runimage">Run the Blinky Application</a>).</p>
<p>If the <code>newt load</code> command outputs the following error messages, you will need to erase the board.</p>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code>$ newt load arduino_boot -v
Loading bootloader
Error: Downloading ~/dev/myproj/bin/targets/arduino_boot/app/apps/boot/boot.elf.bin to 0x0
Open On-Chip Debugger 0.9.0 (2015-11-15-05:39)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect &#39;swd&#39;
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 01.1F.0118
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Info : SWD IDCODE 0x0bc11477
Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints
Error: Target not halted
</code></pre></div>
<p><br>
To erase your board, start a debug session and enter the highlighted commands at the <code>(gdb)</code> prompts:</p>
<p><strong>Note:</strong> On Windows, openocd and gdb are started in separate Windows Command Prompt terminals, and the terminals are automatically closed when you quit gdb. In addition, the output of openocd is logged to the openocd.log file in your project's base directory instead of the terminal.</p>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code>$ newt debug arduino_blinky
(gdb) mon at91samd chip-erase
chip erased
chip erased
(gdb) x/32wx 0
0x0: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
0x10: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
0x20: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
0x30: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
0x40: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
0x50: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
0x60: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
0x70: 0xffffffff 0xffffffff 0xffffffff 0xffffffff
(gdb) q
</code></pre></div>
<p><br>
Run the <code>newt load arduino_boot</code> command again after erasing the board. </p>
<p><font color="#FF0000"> Reminder if you are using Docker: </font> When working with actual hardware, remember that each board has an ID. If you swap boards and do not refresh the USB Device Filter on the VirtualBox UI, the ID might be stale and the Docker instance may not be able to see the board correctly. For example, you may see an error message like <code>Error: unable to find CMSIS-DAP device</code> when you try to load or run an image on the board. In that case, you need to click on the USB link in VirtualBox UI, remove the existing USB Device Filter (e.g. "Atmel Corp. EDBG CMSIS-DAP[0101]") by clicking on the "Removes selected USB filter" button, and add a new filter by clicking on the "Adds new USB filter" button.</p>
<p><br></p>
<h3 id="run-the-blinky-application"><a name="runimage"></a>Run the Blinky Application</h3>
<p>After you load the bootloader successfully onto your board, you can load and run the Blinky application. </p>
<p>Run the <code>newt run arduino_blinky 1.0.0</code> command to build the arduino_blinky target (if necessary), create an image with version 1.0.0, load the image onto the board, and start a debugger session. </p>
<p><strong>Note</strong> The output of the debug session below is for Mac OS and Linux platforms. On Windows, openocd and gdb are started in separate Windows Command Prompt terminals. The output of openocd is logged to the openocd.log file in your project's base directory and not to the terminal. The openocd and gdb terminals will close automatically when you quit gdb.
<br></p>
<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%;"><span></span><code>$ newt run arduino_blinky 1.0.0
App image succesfully generated: ~/dev/myproj/bin/targets/arduino_blinky/app/apps/blinky/blinky.img
Loading app image into slot 1
[~/dev/myproj/repos/mynewt_arduino_zero/hw/bsp/arduino_zero/arduino_zero_debug.sh ~/dev/myproj/repos/mynewt_arduino_zero/hw/bsp/arduino_zero ~/dev/myproj/bin/targets/arduino_blinky/app/apps/blinky/blinky]
Open On-Chip Debugger 0.9.0 (2015-11-15-13:10)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect &#39;swd&#39;
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 01.1F.0118
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Info : SWD IDCODE 0x0bc11477
Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x0000fca6 psp: 0x20002408
GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type &quot;show copying&quot;
and &quot;show warranty&quot; for details.
This GDB was configured as &quot;--host=x86_64-apple-darwin10 --target=arm-none-eabi&quot;.
Type &quot;show configuration&quot; for configuration details.
For bug reporting instructions, please see:
&lt;http://www.gnu.org/software/gdb/bugs/&gt;.
Find the GDB manual and other documentation resources online at:
&lt;http://www.gnu.org/software/gdb/documentation/&gt;.
For help, type &quot;help&quot;.
Type &quot;apropos word&quot; to search for commands related to &quot;word&quot;...
Reading symbols from ~/dev/myproj/bin/targets/arduino_blinky/app/apps/blinky/blinky.elf...(no debugging symbols found)...done.
Info : accepting &#39;gdb&#39; connection on tcp/3333
Info : SAMD MCU: SAMD21G18A (256KB Flash, 32KB RAM)
0x0000fca6 in os_tick_idle ()
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x000000b8 msp: 0x20008000
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x000000b8 msp: 0x20008000
(gdb) r
The &quot;remote&quot; target does not support &quot;run&quot;. Try &quot;help target&quot; or &quot;continue&quot;.
(gdb) c
Continuing.
</code></pre></div>
<p><br></p>
<p><strong>NOTE:</strong> The 1.0.0 is the version number to assign to the image. You may assign an arbitrary version number. If you are not providing remote upgrade, and are just developing locally, you can provide 1.0.0 for every image version.</p>
<p>If you want the image to run without the debugger connected, simply quit the
debugger and restart the board. The image you programmed will come and run on the Arduino on next boot! </p>
<p><br>
You should see the LED blink!</p>
<div class="row">
<ul class="nav nav-pills" style="margin-bottom: 10px">
<li>
</li>
<li class="pull-right">
</li>
</ul>
</div>
<footer class="row">
<div class="col-xs-12">
<p class="copyright">Apache Mynewt is available under Apache License, version 2.0.</p>
</div>
<div class="col-xs-12">
<div class="logos">
<a href="https://www.apache.org/">
<img src="/img/asf_logo_wide_small.png" alt="Apache" title="Apache">
</a>
<p>
Copyright © 2015-2021 The Apache Software Foundation.<br>
<small class="footnote">
Apache Mynewt, Mynewt, Apache, the Apache feather logo, and the Apache Mynewt
project logo are either registered trademarks or trademarks of the Apache
Software Foundation in the United States and other countries.
</small>
</p>
<a href="">
<img src="https://www.countit.com/images/add_to_slack.png" alt="Slack Icon" title="Join our Slack Community" />
</a>
</div>
</div>
<a href="https://www.apache.org/licenses/">
<button class="button-footer-asf">
License
</button>
</a>
<a href="https://www.apache.org/foundation/sponsorship.html">
<button class="button-footer-asf">
Sponsorship
</button>
</a>
<a href="https://www.apache.org/foundation/thanks.html">
<button class="button-footer-asf">
Thanks
</button>
</a>
<a href="https://www.apache.org/security/">
<button class="button-footer-asf">
Security
</button>
</a>
<a href="https://apache.org/events/current-event">
<button class="button-footer-asf">
ASF Events
</button>
</a>
</footer>
</div>
</div>
</div>
<script src="../../../js/jquery-1.10.2.min.js"></script>
<script src="../../../js/bootstrap-3.0.3.min.js"></script>
<script src="../../../js/highlight.pack.js"></script>
<script src="../../../js/base.js"></script>
<script src="../../../js/custom.js"></script>
<script src="search/main.js"></script>
</body>
</html>