Author Topic: Programming: SAM-BA operation failed  (Read 28695 times)

emcniece

  • Newbie
  • *
  • Posts: 23
  • Seriously guys... I have too many hobbies. <3 DS
Programming: SAM-BA operation failed
« on: November 16, 2013, 09:34:19 pm »
I recently went through the issue where the DigiX appears in the device list as a BOSSA port, and flailing around amidst some driver uninstall/re-install seemed to work. However, now when I try to program the DigiX, the sketch verifies properly but spits out an error as it tries to program the device:

Code: [Select]
SAM-BA operation failed
I recently wiped my Win8 machine and have reinstalled Arduino 1.5.4 r2, and have also grabbed the latest DigiX bundle (DigiXAddons-v04) and deposited this in my Arduino library/hardware folder. However, I cannot locate the DigiX from within the Arduino Tools->Boards list. Am I missing an installation step?

EDIT: I was programming the DigiX with the "Due Programming Port" instead of the "Due Native USB port" - I can successfully program the device. This doesn't yet explain why the DigiX no longer shows up in the Boards list though.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Programming: SAM-BA operation failed
« Reply #1 on: November 17, 2013, 12:06:19 am »
Are you putting it in your Documents/Arduino folder? or Program Files/Arduino/Hardware? if one try the other - but it should work with either

emcniece

  • Newbie
  • *
  • Posts: 23
  • Seriously guys... I have too many hobbies. <3 DS
Re: Programming: SAM-BA operation failed
« Reply #2 on: November 17, 2013, 10:35:15 am »
Think I got it figured out - I was pointing my libraries folder to a location on my external drive, which help duplicate copies of the DigiX hardware files. This seems to make the Arduino IDE glitch out. All it took to fix the issue was deleting the entire My Documents/Arduino folder and recreate it with a new installation, then re-copy over the DigiX folders.

I'm getting some ridiculous hardware port errors now though - the DigiX registers as either "Unknown Device", "GPS Camera Detect", or the actual "Digistump DigiX" board with an error of "Device could not start".

When the board registers as "Unknown Device", I am updating the drivers and selecting the "DigiXAddons-v04\DigiX Driver\DigiX.inf" file - this seems to allow proper hardware registration, but as soon as I go to upload a sketch the IDE returns an error:

Code: [Select]
Arduino: 1.5.4 (Windows NT (unknown)), Board: "Digistump DigiX"

Sketch uses 10,604 bytes (2%) of program storage space. Maximum is 524,288 bytes.

processing.app.debug.RunnerException: Couldn't find a Board on the selected port. Check that you have the correct port selected.  If it is correct, try pressing the board's reset button after initiating the upload.

Any thoughts?

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Programming: SAM-BA operation failed
« Reply #3 on: November 17, 2013, 02:10:56 pm »
That is very strange... do you have a second machine you can test to ensure the DigiX is not at fault?

kevin

  • Newbie
  • *
  • Posts: 13
Re: Programming: SAM-BA operation failed
« Reply #4 on: December 17, 2013, 03:33:21 pm »
I just had the error "SAM-BA operation failed" intermittently when programming from the Arduino IDE on Ubuntu - I'm not 100% sure, but I think the problem was that the background "modem-manager" process was polling /dev/ttyACM0 whilst the program was being flashed, and interrupting it.  I've not had the problem since stopping modem-manager (it takes a bit of stopping, see http://askubuntu.com/questions/216114/how-can-i-remove-modem-manager-from-boot).

Kevin

MrY

  • Newbie
  • *
  • Posts: 5
Re: Programming: SAM-BA operation failed
« Reply #5 on: December 22, 2013, 08:11:02 am »
I am getting this failure also. I am using Ubuntu 13.10 and tried to upload the Blink sketch. Here is the output from the Arduino IDE:

Sketch uses 10,776 bytes (2%) of program storage space. Maximum is 524,288 bytes.
Erase flash
Write 10852 bytes to flash

[                              ] 0% (0/43 pages)
[======                        ] 23% (10/43 pages)
[=============                 ] 46% (20/43 pages)
[====================          ] 69% (30/43 pages)
[===========================   ] 93% (40/43 pages)
[==============================] 100% (43/43 pages)
Verify 10852 bytes of flash

[                              ] 0% (0/43 pages)
[======                        ] 23% (10/43 pages)

[=============                 ] 46% (20/43 pages)
SAM-BA operation failed

kevin

  • Newbie
  • *
  • Posts: 13
Re: Programming: SAM-BA operation failed
« Reply #6 on: December 22, 2013, 08:57:17 am »
MrY: did you try disabling the modem-manager program?  You need to really make sure it's not running (ps ax | grep modem) as it tends to get restarted if you haven't fully disabled it.  That's basically the problem I was having, it would stop at different points through the flashing cycle and sometimes it would work - killing modem-manager means it now works consistently.

MrY

  • Newbie
  • *
  • Posts: 5
Re: Programming: SAM-BA operation failed
« Reply #7 on: December 22, 2013, 10:16:45 am »
I removed the modem-manager, and checked to make sure it was gone, rebooted and no difference in behavior. Still can't upload to the device.  :-[

kevin

  • Newbie
  • *
  • Posts: 13
Re: Programming: SAM-BA operation failed
« Reply #8 on: December 22, 2013, 01:21:27 pm »
Oh, that's not good then.  Does it always break at the same point in the verify cycle?  Also, if you
Code: [Select]
tail -f /var/log/syslog before you start writing the program to flash, does anything appear at the time it breaks (possibly relating to /dev/ttyACM0) ?

MrY

  • Newbie
  • *
  • Posts: 5
Re: Programming: SAM-BA operation failed
« Reply #9 on: December 22, 2013, 03:20:54 pm »
Kevin,
Thanks for spending the time trying to get me up and running.

The failure is consistent:

Sketch uses 11,008 bytes (2%) of program storage space. Maximum is 524,288 bytes.
Erase flash
Write 11088 bytes to flash

[                              ] 0% (0/44 pages)

[======                        ] 22% (10/44 pages)
SAM-BA operation failed


The log tail does not show any additional entries between the start of the upload and the inevitable failure, but when I first invoke the Arduino IDE, the following is logged:
whoopsie[1172]: online.

I also have to press the Reset button on the board to get connectivity back again the first time I fire up the computer. I don't know if this is normal or not. If it is, no big deal, but it is annoying.



kevin

  • Newbie
  • *
  • Posts: 13
Re: Programming: SAM-BA operation failed
« Reply #10 on: December 22, 2013, 07:32:35 pm »
Hmm, strange; it seems like the problem I was having, but that was because modem-manager was running.  I'm not sure how you'd check if something else is trying to write to the serial port, but I wonder if there's another program causing the issue.

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: Programming: SAM-BA operation failed
« Reply #11 on: December 23, 2013, 01:12:46 am »
Hi, please try the following:

  • Erase the digiX by pressing the ERASE button close to A5-A7 while powered on.
  • Disconnect the digiX from USB AND power
  • Connect it only via USB

Open a command prompt in the  \hardware\tools subdirectory below your Arduino folder and enter:

Code: [Select]
  bossac -i -p com4Where com4 is YOUR COM-port (as seen in the device-manager for example)
You should see something like:
Code: [Select]
Device       : ATSAM3X8
Chip ID      : 285e0a60
Version      : v1.1 Dec 15 2010 19:25:04
Address      : 524288
Pages        : 2048
Page Size    : 256 bytes
Total Size   : 512KB
Planes       : 2
Lock Regions : 32
Locked       : none
Security     : false
Boot Flash   : false

Repeat that after some time, to make sure, the connection is still up an running.

If that is the case, try to reprogram through your arduino IDE.  If you are still getting the error, just go back to the command window and repeat the step from above. Check if you are getting the same information, no information or a changed information.

MrY

  • Newbie
  • *
  • Posts: 5
Re: Programming: SAM-BA operation failed
« Reply #12 on: December 23, 2013, 05:30:20 am »
+gogol,
    I tried your suggestion, and bossac returns "No device found on /dev/ttyACM0". I checked to make sure that the tty exists, and I also checked using the Arduino IDE that it is recognized (and I know it works  since I can program Unos, Megas and Leonardos). I tried with and without having the IDE invoked, and performed your suggested procedure several times. It never finds the device.

I am using Ardunino 1.5.5 and am running Ubuntu 13.10.

MrY

  • Newbie
  • *
  • Posts: 5
Re: Programming: SAM-BA operation failed
« Reply #13 on: December 25, 2013, 11:19:05 am »
Problem solved and has me confounded (but happy). I purchased a new usb cable and it now works. I am confounded, because the cable that fails on the digiX happily works for a Yun, Leonardo and several Leonardo clones. Go figure.

Thanks everyone for trying to help.

jonchilds

  • Newbie
  • *
  • Posts: 1
Re: Programming: SAM-BA operation failed
« Reply #14 on: December 26, 2013, 01:09:18 pm »
I just had the error "SAM-BA operation failed" intermittently when programming from the Arduino IDE on Ubuntu - I'm not 100% sure, but I think the problem was that the background "modem-manager" process was polling /dev/ttyACM0 whilst the program was being flashed, and interrupting it.  I've not had the problem since stopping modem-manager (it takes a bit of stopping, see http://askubuntu.com/questions/216114/how-can-i-remove-modem-manager-from-boot).

Kevin

Kevin,

Thanks for this info, I might have never figured this out on my own.  I disabled the modem manager and my Digix is working great now.

Thanks
Jon