Difference between revisions of "Arduino MKR WiFi 1010"

From SEGGER Wiki
Jump to: navigation, search
(One intermediate revision by the same user not shown)
Line 10: Line 10:
 
== Compatible boards ==
 
== Compatible boards ==
 
The following boards can be wired in the same way as shown below:
 
The following boards can be wired in the same way as shown below:
MKR Zero, MKR 1000, MKR Fox 1200, MKR GSM 1400, MKR NB 1500, MKR VIDOR 4000, MKR WAN 1300/1310
+
MKR Zero, MKR 1000, MKR Fox 1200, MKR GSM 1400, MKR NB 1500, MKR VIDOR 4000, MKR WAN 1300/1310.
   
 
== Preparing for J-Link ==
 
== Preparing for J-Link ==
Line 45: Line 45:
 
[[File:MKR_Connect.png|400px]]
 
[[File:MKR_Connect.png|400px]]
   
== Debugging in SEGGER Embedded Studio ==
+
== Debugging with Arduino tool chain ==
  +
If you are looking to use a J-Link while using e.g. the Arduino IDE and the Arduino Sketches you can do so as follows:
  +
* Connect your board to a J-Link as explained above and test the connection with J-Link Commander.
  +
* Download your Arduino Sketch with e.g. Arduino IDE via the USB-Interface as usual.
  +
* Now you can launch your favorite debugger with J-Link and attach to the running application and debug your system.
   
  +
We recommend using [https://www.segger.com/products/development-tools/ozone-j-link-debugger/ Ozone], the J-Link debugger as it offers the best debug experience with SEGGER debug probes.
=== Example projects for SEGGER Embedded Studio===
 
  +
You can set Ozone to attach to the target device via Debug->Start Debug Session->Attach to Running Program.
  +
  +
== Bare-metal Debugging ==
  +
  +
=== Example project for SEGGER Embedded Studio===
 
The following example project was created with the SEGGER Embedded Studio project wizard and runs out-of-the-box on the Arduino MKR WiFi 1010 board. It is a simple Hello World sample and can be downloaded here:
 
The following example project was created with the SEGGER Embedded Studio project wizard and runs out-of-the-box on the Arduino MKR WiFi 1010 board. It is a simple Hello World sample and can be downloaded here:
   
Line 55: Line 64:
 
If you want to revert the Arduino board to its original state you need to flash the Arduino bootloader of the corresponding board you are using.
 
If you want to revert the Arduino board to its original state you need to flash the Arduino bootloader of the corresponding board you are using.
 
For this the now established connection between your J-Link and the board can be used.
 
For this the now established connection between your J-Link and the board can be used.
  +
As a tool we recommend using J-Link Commander where you can use commands ''loadfile/loadbin'' to flash the bootloader file. If you are unsure where to get the bootloader from you can simply dump it into a binary file also using the J-Link Commander and the command ''savebin''.
 
  +
Bootloader sources can be found here:
  +
* https://github.com/arduino/ArduinoCore-samd/tree/master/bootloaders
  +
* https://github.com/arduino/ArduinoCore-mbed/tree/master/bootloaders
  +
  +
As a tool we recommend using J-Link Commander where you can use commands ''loadfile/loadbin'' to flash the bootloader file. If the bootloader for your board should not be available you can simply dump it into a binary file also using the J-Link Commander and the command ''savebin''.
 
For more information see our [https://wiki.segger.com/UM08001_J-Link_/_J-Trace_User_Guide J-Link user manual].
 
For more information see our [https://wiki.segger.com/UM08001_J-Link_/_J-Trace_User_Guide J-Link user manual].

Revision as of 08:55, 1 October 2020

This article describes how a J-Link probe can be used together with an Arduino MKR WiFi 1010 board.

Minimum requirements

Compatible boards

The following boards can be wired in the same way as shown below: MKR Zero, MKR 1000, MKR Fox 1200, MKR GSM 1400, MKR NB 1500, MKR VIDOR 4000, MKR WAN 1300/1310.

Preparing for J-Link

The Arduino MKR WiFi 1010 board does not come with an external debug interface connector, but the required pins are exposed on the back side as follows:

MKR Close.png

To this pads a 2x3 SMD pin header can be soldered. Then e.g. flying wires can be used for connection. The following table describes the pinning and how it should be connected to the SEGGER Flying Wire Adapter.

Arduino Board Flying wire adapter
1 GND
2 RESET
3 VTREF
4 NC
5 SWCLK
6 SWDIO

In this example we are using a J-Link Plus Compact. The resulting connection will then look like this:

MKR Wired.png

  • Power the board via the USB-Mini port
  • Verify the Connection with e.g. J-Link Commander. The output should look as follows:

MKR Connect.png

Debugging with Arduino tool chain

If you are looking to use a J-Link while using e.g. the Arduino IDE and the Arduino Sketches you can do so as follows:

  • Connect your board to a J-Link as explained above and test the connection with J-Link Commander.
  • Download your Arduino Sketch with e.g. Arduino IDE via the USB-Interface as usual.
  • Now you can launch your favorite debugger with J-Link and attach to the running application and debug your system.

We recommend using Ozone, the J-Link debugger as it offers the best debug experience with SEGGER debug probes. You can set Ozone to attach to the target device via Debug->Start Debug Session->Attach to Running Program.

Bare-metal Debugging

Example project for SEGGER Embedded Studio

The following example project was created with the SEGGER Embedded Studio project wizard and runs out-of-the-box on the Arduino MKR WiFi 1010 board. It is a simple Hello World sample and can be downloaded here:

Hello World sample

Note: Using this example project will erase the Arduino bootloader and allow bare-metal debugging of the target device. If you want to revert the Arduino board to its original state you need to flash the Arduino bootloader of the corresponding board you are using. For this the now established connection between your J-Link and the board can be used.

Bootloader sources can be found here:

As a tool we recommend using J-Link Commander where you can use commands loadfile/loadbin to flash the bootloader file. If the bootloader for your board should not be available you can simply dump it into a binary file also using the J-Link Commander and the command savebin. For more information see our J-Link user manual.