(Update steps for reinstallation)
 
(46 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[category:Explore M3]]
 
[[category:Explore M3]]
This guide is for beta testers only. The guide will be much simpler for the end user. If you are a beta tester please send an email to support@exploreembedded.com with your github userid to gain access to the test code.  
+
In this tutorial we will look at the basic setups of setting up the ExploreM3 on Arduino and installing DFU and Vcom drivers on Windows, Linux and MAC. Finally we will flash a simple led-blink example.
 
[[File:0 Arduino setup.jpg]]
 
[[File:0 Arduino setup.jpg]]
 
=The Explore M3 Parts=
 
=The Explore M3 Parts=
Line 7: Line 7:
  
 
=Using  Board Manager=
 
=Using  Board Manager=
Download and install the [https://www.arduino.cc/en/Main/Software Arduino IDE] (1.6.12 preferred).
+
'''''(This Step is common for all operating systems)''''' <br>
Open the Arduino IDE and go to '''File-->Preferences''' and paste the below json URL into the '''Additional Board Manager URLs''' text box as shown in below image.
+
* Download and install the [https://www.arduino.cc/en/Main/Software Arduino IDE] (1.6.12 ). Older versions of the Arduino IDE are not supported. <br>
<syntaxhighlight>
+
* Open the Arduino IDE and go to '''File-->Preferences''' and paste the below json URL into the '''Additional Board Manager URLs''' text box and hit OK.
https://github.com/ExploreEmbedded/Explore-M3/blob/master/package_ExploreM3_index.json
+
</syntaxhighlight>
+
  
= Windows=
+
<!-- 'syntaxhighlight' breaks the text. Use 'code' insted -->
# Download and install the Arduino IDE <font color="red">(1.6.5 preferred)</font>.
+
 
# [https://github.com/SaheblalBagwan/Explore-M3 Download and extract the contents of repository inside] '''Arduino>Hardware''' directory of your Arduino Installation. Usually found under '''''Documents>Arduino>Hardware'''''. Verify that the directory structure looks like '''''C:\Users\myPC\Documents\Arduino\hardware\Explore-M3'''''. ''Note: This is for beta testers only, to get access to repo, please send an email with your github user-id''
+
<code>
#'''Installing the Device Firmware Upgrade(DFU) Driver.''' This driver is used for programming the Explore M3.
+
https://raw.githubusercontent.com/ExploreEmbedded/Explore-M3/master/package_ExploreM3_index.json
## To upload a new program to Explore M3, put the board in programming mode by holding down the boot-loader switch, press and release the reset switch and then release the boot-loader switch. The RGB LED turns green indicating boot-loader mode.  
+
</code><br>
## The board shows up as unknown device in device manager. [[File:1 driver M3.png|none]]
+
<br>
##Go to '''''..\Documents\Arduino\hardware\Explore-M3\tools\win''''' and run the Zadig utility.[[File:2 driver M3.png]]
+
[[File:FilePreferences02.png ]]
## Click on ''Options'' and select ''List All Devices''[[File:3_driver_M3.png]]
+
 
##Select the device as Explore M3 and assign WinUSB driver as shown [[File:3a_driver_M3.png]]
+
* Open the Board Manager from '''Tools-->Board-->Boards Manager'''. Scroll down and look for '''Explore-M3(32-bits ARM Cortex-M3)''' board. Click on the board entry and hit install.
##Click on Install driver[[File:4_driver_M3.png]]
+
[[File:BoardManager01.png ]]
##Verify in the device Manager that the driver is successfully installed. [[File:5_driver_M3.png]]
+
 
 +
* This will install the '''Explore-M3''' board and the '''arm-none-eabi-gcc''' tool chain. Installation may take few minutes depending on the internet speed. Once the installation has completed, an Arduino-blue '''INSTALLED''' will appear next to the entry.
 +
[[File:BoardManager02.png ]]
 +
 
 +
*If you encounter '''''CRC mismatch Error''''', delete Explore M3 Arduino installation files from below mentioned paths and retry installation.
 +
**Windows:
 +
***\AppData\Local\Arduino15\staging\packages
 +
***\AppData\Local\Arduino15\packages
 +
**Mac
 +
***~/Library/Arduino15/staging/packages
 +
***~/Library/Arduino15/packages
 +
 
 +
[[File:ArduinoReinstallError.PNG]]
 +
 
 +
* Now the Explore-M3 board will appear in the board list.
 +
[[File:BoardManager03.png ]]
 +
 
 +
=Driver installation=
 +
==Windows==
 
#'''Install Virtual COM driver''' ; This driver makes the same USB interface appear as virtual com port.  The virtual COM code on the Arduino resides with every sketch that uses the '''Serial''' Class.  
 
#'''Install Virtual COM driver''' ; This driver makes the same USB interface appear as virtual com port.  The virtual COM code on the Arduino resides with every sketch that uses the '''Serial''' Class.  
##Open the _01_TestCode example as shown. [[File:6 driver M3.png]]
+
##Connect the board to system, the COM port will appear as shown. [[File:8 driver M3.png]]
##Put the board in programming mode and upload the sketch.[[File:7 driver M3.png]]
+
##Go to run window '''(Windows+R)''', type '''%appdata%''' and click ok.
##The COM port will appear as shown. [[File:8 driver M3.png]]
+
##Go to '''''AppData\Local\Arduino15\packages\ExploreM3\hardware\Explore-M3\1.0.0\tools\win''''' and run the Zadig utility.[[File:2a driver M3.png]]
 
##Install the CDC driver using the Zidag utility this time. [[File:9 driver M3.png]] [[File:10 driver M3.png]]
 
##Install the CDC driver using the Zidag utility this time. [[File:9 driver M3.png]] [[File:10 driver M3.png]]
 
##Verify successful installation in the device manager.  [[File:11 driver M3.png]]
 
##Verify successful installation in the device manager.  [[File:11 driver M3.png]]
#Select the appropriate COM port in the Arduino IDE and open the terminal to observe the output.[[File:12 driver M3.png]]
 
 
<br/>
 
<br/>
Also notice that the RGB LEDs and the LED on pin 13 blink in  a sequence.
 
  
=Linux=
+
#'''Installing the Device Firmware Upgrade(DFU) Driver.''' This driver is used for programming the Explore M3.
This setup has been tested on Ubuntu 64 bit. If you should have any errors other linux flavours, do post in the comments.
+
## To upload a new program to Explore M3, put the board in programming mode by holding down the '''USB Boot''' switch, press and release the '''reset switch''' and then release the  '''USB Boot''' switch. The RGB LED turns green indicating USB Boot mode.
 +
## The board shows up as unknown device in device manager. [[File:1a driver M3.png|none]]
 +
## Click on ''Options'' and select ''List All Devices''[[File:3_driver_M3.png]]
 +
##Select the device as Explore M3 and assign WinUSB driver as shown [[File:3a1_driver_M3.png]]
 +
##Click on Install driver[[File:4_driver_M3.png]]
 +
##Verify in the device Manager that the driver is successfully installed. [[File:5a_driver_M3.png]]
  
 +
==Linux==
 +
This setup has been tested on Ubuntu 64 bit. If you should have any errors other linux flavours, do post in the comments.
 
One good thing I noticed, drivers are not required but only the device needs to be enabled. So lets get started.
 
One good thing I noticed, drivers are not required but only the device needs to be enabled. So lets get started.
# Download and install the Arduino IDE (1.6.5 preferred).
+
* Create a file named '''''install.sh''''' under  '''/.arduino15/packages/ExploreM3/hardware/Explore-M3/1.0.0/tools/linux$ '''
# [https://github.com/SaheblalBagwan/Explore-M3 Download and extract the contents of repository inside] '''Arduino>Hardware''' directory of your Arduino Installation.  ''Note: This is for beta testers only, to get access to repo, please send an email with your github user-id''
+
with the following content
#UDEV Rules: To enable Explore M3 as USB DFU and COM port run the '''''install.sh''''' file from '''''/hardware/Explore-M3/tools/linux'''''
+
#Connect the board to USB port now, put it in bootloader mode. Hold down the USB Boot switch and press reset and release the reset switch and than release the USB Boot Switch.
+
#Now for the glory, select the board as Explore M3, and upload the the test code [[File:Upload.png]]
+
#Test code for reference
+
 
<syntaxhighlight>
 
<syntaxhighlight>
void setup() {
+
#!/bin/sh
  // put your setup code here, to run once:
+
 
Serial.begin(9600);
+
if sudo [ -w /etc/udev/rules.d ]; then
pinMode(13,OUTPUT);
+
    echo "Copying Explore M3-specific udev rules..."
}
+
    sudo cp -v 90-explore-m3.rules /etc/udev/rules.d/90-explore-m3.rules
 +
    sudo chown root:root /etc/udev/rules.d/90-explore-m3.rules
 +
    sudo chmod 644 /etc/udev/rules.d/90-explore-m3.rules
 +
    sudo chmod 777 exploreM3_upload
 +
    sudo chmod 777 upload_reset
 +
    sudo chmod 777 dfu
 +
    echo "Reloading udev rules"
 +
    sudo udevadm control --reload-rules
 +
    echo "Adding current user to dialout group"
 +
    sudo adduser $USER dialout
 +
else
 +
    echo "Couldn't copy to /etc/udev/rules.d/; you probably have to run this script as root? Or your distribution of Linux doesn't include udev; try running the IDE itself as root."
 +
fi
  
void loop() {
 
  // put your main code here, to run repeatedly:
 
digitalWrite(13,0);
 
rgbWriteAll(1,1,0);
 
delay(200);
 
rgbWriteAll(1,0,1);
 
delay(200);
 
rgbWriteAll(0,1,1);
 
delay(200);
 
digitalWrite(13,1);
 
delay(200);
 
Serial.println("Explore M3");
 
}
 
 
</syntaxhighlight>
 
</syntaxhighlight>
==Notes==
+
* Run ''./install.h'' (change the file permission if required).
*Install any Arduino SAMD board to get the arm-eabi-gcc, if it is not installed on your computer.
+
[[File:1_run_install.png]]
 +
 
 +
====Notes====
 
*Give appropriate permissions when running the install.sh and other files.
 
*Give appropriate permissions when running the install.sh and other files.
 
*You may be required to give permissions to use virtual com port.
 
*You may be required to give permissions to use virtual com port.
 
* Note that Explore M3 acts as Device Firmware Upgrade (DFU) and virtual COM port with the same USB interface.
 
* Note that Explore M3 acts as Device Firmware Upgrade (DFU) and virtual COM port with the same USB interface.
  
=MAC=
+
==MAC==
[If you're a beta tester with access to MAC please get in touch, need your help to test it on MAC]
+
This setup has been tested on macOS High Sierra.
 +
Run the following commands in terminal and provide password whenever prompted for.
 +
 
 +
<html>
 +
<script src="https://gist.github.com/AmrutaCh/7bbc306937fadc9c2bde9478294b834f.js"></script>
 +
</html>
 +
 
 +
This will install libusb and set required file permissions.
 +
 
 +
[[File:libusbInstallation_OSX.png]]
 +
 
 +
=Running First Example on M3=
 +
After setting up the board and indtalling the drivers it's time to run the first example on Explore-M3 board.
 +
#Select the board as Explore M3, and upload the the test code [[File:ExploreM3 example1.png]]
 +
#Test code for reference
 +
<html>
 +
<script src="https://gist.github.com/SaheblalBagwan/f3253fdad505d4d72c6d01a6bad2305d.js"></script>
 +
</html>
 +
 
 +
=Repository Link=
 +
[https://github.com/ExploreEmbedded/Explore-M3 Explore-M3 Repository Link] <br><br>
 +
 
 +
Have a opinion, suggestion , question or feedback about the article let it out here!
 +
{{DISQUS}}

Latest revision as of 13:57, 4 November 2017

In this tutorial we will look at the basic setups of setting up the ExploreM3 on Arduino and installing DFU and Vcom drivers on Windows, Linux and MAC. Finally we will flash a simple led-blink example. 0 Arduino setup.jpg

The Explore M3 Parts

The figure shows location of various parts on the board, which will be using during the setup. Look at the switches, the RGB led and the led on pin 13 in particular.

0 Explore M3 HW Marking.png

Using Board Manager

(This Step is common for all operating systems)

  • Download and install the Arduino IDE (1.6.12 ). Older versions of the Arduino IDE are not supported.
  • Open the Arduino IDE and go to File-->Preferences and paste the below json URL into the Additional Board Manager URLs text box and hit OK.


https://raw.githubusercontent.com/ExploreEmbedded/Explore-M3/master/package_ExploreM3_index.json

FilePreferences02.png

  • Open the Board Manager from Tools-->Board-->Boards Manager. Scroll down and look for Explore-M3(32-bits ARM Cortex-M3) board. Click on the board entry and hit install.

BoardManager01.png

  • This will install the Explore-M3 board and the arm-none-eabi-gcc tool chain. Installation may take few minutes depending on the internet speed. Once the installation has completed, an Arduino-blue INSTALLED will appear next to the entry.

BoardManager02.png

  • If you encounter CRC mismatch Error, delete Explore M3 Arduino installation files from below mentioned paths and retry installation.
    • Windows:
      • \AppData\Local\Arduino15\staging\packages
      • \AppData\Local\Arduino15\packages
    • Mac
      • ~/Library/Arduino15/staging/packages
      • ~/Library/Arduino15/packages

ArduinoReinstallError.PNG

  • Now the Explore-M3 board will appear in the board list.

BoardManager03.png

Driver installation

Windows

  1. Install Virtual COM driver ; This driver makes the same USB interface appear as virtual com port. The virtual COM code on the Arduino resides with every sketch that uses the Serial Class.
    1. Connect the board to system, the COM port will appear as shown. 8 driver M3.png
    2. Go to run window (Windows+R), type %appdata% and click ok.
    3. Go to AppData\Local\Arduino15\packages\ExploreM3\hardware\Explore-M3\1.0.0\tools\win and run the Zadig utility.2a driver M3.png
    4. Install the CDC driver using the Zidag utility this time. 9 driver M3.png 10 driver M3.png
    5. Verify successful installation in the device manager. 11 driver M3.png


  1. Installing the Device Firmware Upgrade(DFU) Driver. This driver is used for programming the Explore M3.
    1. To upload a new program to Explore M3, put the board in programming mode by holding down the USB Boot switch, press and release the reset switch and then release the USB Boot switch. The RGB LED turns green indicating USB Boot mode.
    2. The board shows up as unknown device in device manager.
      1a driver M3.png
    3. Click on Options and select List All Devices3 driver M3.png
    4. Select the device as Explore M3 and assign WinUSB driver as shown 3a1 driver M3.png
    5. Click on Install driver4 driver M3.png
    6. Verify in the device Manager that the driver is successfully installed. 5a driver M3.png

Linux

This setup has been tested on Ubuntu 64 bit. If you should have any errors other linux flavours, do post in the comments. One good thing I noticed, drivers are not required but only the device needs to be enabled. So lets get started.

  • Create a file named install.sh under /.arduino15/packages/ExploreM3/hardware/Explore-M3/1.0.0/tools/linux$

with the following content

#!/bin/sh
 
if sudo [ -w /etc/udev/rules.d ]; then
    echo "Copying Explore M3-specific udev rules..."
    sudo cp -v 90-explore-m3.rules /etc/udev/rules.d/90-explore-m3.rules
    sudo chown root:root /etc/udev/rules.d/90-explore-m3.rules
    sudo chmod 644 /etc/udev/rules.d/90-explore-m3.rules
    sudo chmod 777 exploreM3_upload
    sudo chmod 777 upload_reset
    sudo chmod 777 dfu	
    echo "Reloading udev rules"
    sudo udevadm control --reload-rules
    echo "Adding current user to dialout group"
    sudo adduser $USER dialout
else
    echo "Couldn't copy to /etc/udev/rules.d/; you probably have to run this script as root? Or your distribution of Linux doesn't include udev; try running the IDE itself as root."
fi
  • Run ./install.h (change the file permission if required).

1 run install.png

Notes

  • Give appropriate permissions when running the install.sh and other files.
  • You may be required to give permissions to use virtual com port.
  • Note that Explore M3 acts as Device Firmware Upgrade (DFU) and virtual COM port with the same USB interface.

MAC

This setup has been tested on macOS High Sierra. Run the following commands in terminal and provide password whenever prompted for.

This will install libusb and set required file permissions.

LibusbInstallation OSX.png

Running First Example on M3

After setting up the board and indtalling the drivers it's time to run the first example on Explore-M3 board.

  1. Select the board as Explore M3, and upload the the test code ExploreM3 example1.png
  2. Test code for reference

Repository Link

Explore-M3 Repository Link

Have a opinion, suggestion , question or feedback about the article let it out here!