Go Down

Topic: SAM-BA operation failed (Read 1 time) previous topic - next topic

stlitt

Hi all,

Couldn't be more excited to get my Vidor in the mail yesterday. Have been at it all day today going through Getting Started and the libraries, and had some success but am now having consistent issues with uploading.

I started by installing the Vidor board via Boards Manager. Got the Blink sketch working. All good.

Found and installed the VidorGraphics and VidorPeripherals libraries and ran VidorTestSketch. I get upload errors and dig around on the forum until I found Dario's suggestion to someone else having difficulties to double click the Vidor's reset button. That worked! So that's good. It uploads and spits out all the text it should to the Serial Monitor.

I start looking through the libraries, I put together something basic with the VidorGraphics library, do the double click on the reset button, and hit upload.  Nothing is connected to the board besides the USB cable at any point, I did this just to see if I could code any simple thing from scratch using the libraries and get it to compile and upload.

From this point forward, *any* sketch that includes VidorGraphics, even an otherwise empty one, gets stuck at the address shown here:

Code: [Select]
[===========                   ] 37% (3968/10466 pages)
SAM-BA operation failed
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x40000, size=0x1000)
An error occurred while uploading the sketch


And *any* sketch that includes VidorPeripherals, even an otherwise empty one, and even VidorTestSketch which worked fine 30 mins earlier, gets stuck in the same place and fails.

Code: [Select]
[=============                 ] 46% (3968/8529 pages)
write(addr=0x20005000,size=0x1000)
SAM-BA operation failed
writeBuffer(scr_addr=0x20005000, dst_addr=0x40000, size=0x1000)
An error occurred while uploading the sketch


Any sketch that does *not* include the Vidor libraries, uploads and appears to work just fine.

Any help would be very much appreciated! I am so excited to learn to use the Vidor for audio and video so I'm really hoping I can solve this and get back to the fun stuff.



DarioPennisi

Hi guys.
Sorry to hear the new toy is making you scratch your head. Let's try narrowing down the issues...
1) if you get in bootloader and connect microhdmi you should see the Arduino logo. If it's not there then the flash has been corrupted and needs to be recovered. This should NOT happen but it may be that write operations failed if you have a weak USB port as Vidor is a bit Power hungry in some cases. The procedure to reload boot image is not public yet but if this is your situation let me know and we'll rush to publish it
2) if you get the boot logo then likely the issue is that your USB port is not able to sustain the current consumed by the image you loaded. Please try using a cell phone power supply and check video output... As soon as bootloader runs the sketch the second image (the application you loaded) is executed but if you double lick and force bootloader it'll stay in boot image and you should be able to load an image from there.

Note that loading a sketch without including an fpga image does not even try loading fpga so it's normal it works in any case.

Looking forward to your feedback...

a2retro

Please see- https://forum.arduino.cc/index.php?topic=560216.msg3821956#msg3821956

stlitt

Thanks so much for your response.

Quote
1) if you get in bootloader and connect microhdmi you should see the Arduino logo. If it's not there then the flash has been corrupted and needs to be recovered.
I've connected the microHDMI to a monitor and entered bootloader by double tapping (that's all I have to do right? I see the red LED slowly fading on and off) and unfortunately my monitor is not receiving anything.

Any help is much appreciated.

a2retro

Code: [Select]
// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(115200);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  Serial.println("On");
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  Serial.println("Off");
  delay(1000);                       // wait for a second
}


Use this code and see if you get output to the serial monitor

stlitt

Use this code and see if you get output to the serial monitor
We've already established that uploading code that doesn't include an FPGA image will upload and run without issue.

Any sketch that does *not* include the Vidor libraries, uploads and appears to work just fine.
Note that loading a sketch without including an fpga image does not even try loading fpga so it's normal it works in any case.

a2retro

#6
Jul 28, 2018, 09:54 pm Last Edit: Jul 28, 2018, 10:01 pm by a2retro
Sorry for the noise, I got my initial "SAM-BA operation failed" mixed up with this "SAM-BA operation failed" and mine is failing exactly where yours is when I upload the VidorEnableCam @37% but I am able to upload the VidorTestSketch which does use VidorPeripherals successfully as you did at least once. :(

DarioPennisi

Hi stlitt,
if you don't see the logo from hdmi it means the boot image has been corrupted. it's really strange this happened and the only thing i can think of is that usb port didn't have enough current as we're uploading images every day and it never happened to us.
we need to publish a recovery procedure and i'm afraid it'll take a day or two.
i'm really very sorry for this.

stlitt

No need to apologize. Thanks very much for all the help.

a2retro

Hi Dario,

I went and bought a micro HDMI cable. I am pretty sure my bootloader is fine as I see the logo. Also when I tried it today it no longer hangs at 37% but uploads 100%  but still fails with a Sam BA operation failed

Code: [Select]
checksumBuffer(start_addr=0x98000, size=0x1000) = e03e
checksumBuffer(start_addr=0x99000, size=0x1000) = e03e
checksumBuffer(start_addr=0x9a000, size=0x1000) = e03e
checksumBuffer(start_addr=0x9b000, size=0x1000) = e03e

checksumBuffer(start_addr=0x9c000, size=0x1000) = e03e
checksumBuffer(start_addr=0x9d000, size=0x1000) = e03e
SAM-BA operation failed
checksumBuffer(start_addr=0x9e000, size=0x1000) = e03e
checksumBuffer(start_addr=0x9f000, size=0x1000) = e03e
checksumBuffer(start_addr=0xa0000, size=0x1000) = e03e
checksumBuffer(start_addr=0xa1000, size=0x1000) = a701
checksumBuffer(start_addr=0xa2000, size=0x1000) = 314b
checksumBuffer(start_addr=0xa3000, size=0x1000) = 9055
checksumBuffer(start_addr=0xa4000, size=0x1000) = 94e5
checksumBuffer(start_addr=0xa5000, size=0x844) = 704e
Verify successful
done in 32.933 seconds
CPU reset.
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
writeWord(addr=0xe000ed0c,value=0x5fa0004)
An error occurred while uploading the sketch

ronsoul

Hi stlitt,
if you don't see the logo from hdmi it means the boot image has been corrupted. it's really strange this happened and the only thing i can think of is that usb port didn't have enough current as we're uploading images every day and it never happened to us.
we need to publish a recovery procedure and i'm afraid it'll take a day or two.
i'm really very sorry for this.
Im also having the same issue uploading VidorEnableCam example.  I could not see the arduino logo when hooked up to the monitor.  Thanks for the help.

[===========                   ] 36% (3840/10466 pages)
[===========                   ] 37% (3904/10466 pages)
[===========                   ] 37% (3968/10466 pages)
SAM-BA operation failed
An error occurred while uploading the sketch

sandeepmistry

Hi Everyone,

We've prepared some manual steps to repair the FPGA's bootloader for those of you facing sketch upload issues. You can find them in the following forum post: http://forum.arduino.cc/index.php?topic=561393.0

Go Up