0

Grand Central M4 - Arduino upload "SAM-BA operation failed"
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Grand Central M4 - Arduino upload "SAM-BA operation failed"

by Blurfl on Sun Feb 10, 2019 2:51 am

I've been unable to upload a simple Blink sketch to either of two Grand Central M4 units on hand. Both units work as expected with CircuitPython and with MakeCode. Both fail to upload in the Arduino 1.8.8 IDE, on macOS and Win10. The upload error message output from the macOS Arduino IDE is attached.
It may be something I've overlooked, can someone help me spot what it is?
Attachments
Arduino_upload_error_output.txt
(13.67 KiB) Downloaded 11 times

Blurfl
 
Posts: 4
Joined: Sat Aug 23, 2014 12:54 pm

Re: Grand Central M4 - Arduino upload "SAM-BA operation fail

by Blurfl on Sun Feb 10, 2019 7:56 pm

I've been exploring the issue looking for more information, and I've found a work-around. After removing the '-e' erase parameter from the tools.bossac18.upload.pattern in '...Arduino15/packages/adafruit/hardware/samd/1.2.9/platform.txt' the upload runs as expected.
I tried that after seeing that bossac v1.8 has a comment on the -w option "write FILE to the flash; accelerated when combined with erase option " .

To sum up, the standard line fails as described earlier:
Code: Select all | TOGGLE FULL SIZE
tools.bossac18.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U -i --offset={upload.offset} -e -w -v "{build.path}/{build.project_name}.bin" -R

but removing the '-e' works:
Code: Select all | TOGGLE FULL SIZE
tools.bossac18.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U -i --offset={upload.offset} -w -v "{build.path}/{build.project_name}.bin" -R

Not sure why this works, but I hope it might help point to the solution.

Blurfl
 
Posts: 4
Joined: Sat Aug 23, 2014 12:54 pm

Re: Grand Central M4 - Arduino upload "SAM-BA operation fail

by adafruit_support_mike on Mon Feb 11, 2019 5:06 am

Thank you for posting the information.

The Arduino IDE sometimes picks up bugs when a new version is released. When in doubt, try dropping back to an older version of the IDE and see if that solves the problem.

adafruit_support_mike
 
Posts: 57131
Joined: Thu Feb 11, 2010 2:51 pm

Re: Grand Central M4 - Arduino upload "SAM-BA operation fail

by Blurfl on Mon Feb 11, 2019 5:59 pm

Dropping back to Arduino 1.8.7 made no difference.
I think the issue is has something to do with the bossac tool. From the command line, version 1.8.0-48-gb176eee that comes with the Arduino IDE and the current release version 1.9.1 both fail for a 'write after erase' and work as expected for a write without the erase. Earlier versions of the tool don't support the --offset parameter, so I haven't tried those...
I've been using 'AdaFruit SAMD Boards' version 1.2.9, as earlier versions don't support the Grand Central.
Looking at the ArduinoCore-samd repository, there is a recent commit to the master branch eliminates the '-e' erase option from the bossac command string for a performance improvement:
https://github.com/adafruit/ArduinoCore ... 6e147daa53

From that, it looks like my issue will go away with the next 'AdaFruit SAMD Boards' release, so I'll use the development master until then.

Blurfl
 
Posts: 4
Joined: Sat Aug 23, 2014 12:54 pm

Re: Grand Central M4 - Arduino upload "SAM-BA operation fail

by Jimbee on Wed Apr 03, 2019 3:50 pm

Hello,

I just received my grand central M4 board. I have tried uploading a sketch and I am seeing the same issue "SAM-BA operation failed- An error occurred while uploading the sketch". My express M4 works fine uploading the same sketch.

Best Regards,
JD

Jimbee
 
Posts: 10
Joined: Wed Aug 01, 2018 12:49 pm

Re: Grand Central M4 - Arduino upload "SAM-BA operation fail

by adafruit_support_mike on Fri Apr 05, 2019 12:56 am

Go to the Arduino IDE's preferences and enable verbose messages during upload, try another upload to the Grand Central, and post the contents of the debug pane between CODE tags please.

adafruit_support_mike
 
Posts: 57131
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.