Bit Of A Hack

Home Archives
logo

Keep up to date with Bit Of A Hack...

Working with Arduino Zero or M0 pro on ubuntu (.org board) [Permalink]

I have recently bought an M0 board so that I can play around with the CMSIS library, mainly the RTOS stuff. The problem is that there is little documentation about how to use the board.

The .org site provides some details but not all.

If you just tried plugging it in and uploading code, you probably came across this error: "no valid jtag interface configured"

This is how I got started with my Arduino zero plus:

I installed the IDE version 1.7.6 from arduino .org. (the latest .cc version will probably suffice too but the board says .org on the back so I decided to stay consistent.) Then, following their rules, I created a Udev rule for the Zero.

To do this, you need to create a file called /etc/udev/rules.d/98-openocd.rules This can be done from a terminal using vi:

sudo vi /etc/udev/rules.d/98-openocd.rules

Once you have VI open, go in to insert mode (press 'i') and then copy and paste this code (just select it here and then middle click in the vi window.)

ACTION!="add|change", GOTO="openocd_rules_end"
SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end"
#CMSIS-DAP compatible adapters
ATTRS{product}=="*CMSIS-DAP*", MODE="664", GROUP="plugdev"
LABEL="openocd_rules_end"

Now you can press escape then type :wq and press enter.
This will save the file.

This will allow members of the plugdev group to use the ardino.

Then you need to make sure that you are a member of the plugdev group.
You can check to see if you are already in the plugdev group by running the groups command and looking for plugdev in the list.
If plugdev is not listed then you can add yourself to the plugdev group by running this command:

whoami | sudo xargs usermod -a -G plugdev

I kindly did a "whoami | xargs" so you don't have to type your own username, just copy and paste the command right away.

Then just log out of your computer and log back in again, (to apply the new group settings) and then start the IDE and give it a go.

I reccomend using the programming port, not the native port. Also, if your board was already plugged in when you added the Udev rule, disconnect it and then reconnect it.

Enjoy.

By .

comments powered by Disqus

This website uses cookies. If you don't like this, please stop using this site.