Go Down

Topic: Bootloader Recovery (Read 1 time) previous topic - next topic

chelmich

Jan 29, 2019, 05:27 pm Last Edit: Jan 29, 2019, 06:01 pm by chelmich
Hi.

I was experimenting with running arduino-builder and bossac from the command line and for some reason was unable to upload using the command directly from the IDE. I then tried using an upstream version of bossa without realizing the one bundled with the IDE was specially patched. Unfortunately this appears to have bricked the device. The green power LED still comes on but it no longer shows up as a serial port and double tapping reset doesn't cause the red LED to start flashing.

I realize I was being reckless, but is there any hope for recovering this board?

Edit: To be clear, I can't follow the stickied instructions for boot loader recovery because the board no longer creates a serial port when plugged in. Double tapping reset does nothing. The command that appears to have killed it is
Code: [Select]
bossac -a -i -d --port=ttyACM0 -U -i -e -w build/vidor_template.ino.bin -R

jwestmoreland

#1
Jan 30, 2019, 03:02 am Last Edit: Jan 30, 2019, 03:09 am by jwestmoreland
chelmich,

Sorry to hear about your trouble; I'm usually one of the first to figure out how to brick something new.  Ha!

I haven't used the bossac stuff (yet); but have you tried connecting via either J7 or J11?  I would think it should be possible to at least put the 'bsp" back on if that has been erased.

Note you have to solder those yourself and figure out where pin 1 is (I may post a small DIY on all of this) and have the correct tools - USB Blaster for the FPGA and ARM JTAG (SW) debugger for the SAM; but that may be your alternative that can work.

Other than that or perhaps someone chiming in - I would think the support folks could help you also - maybe open a ticket if you don't get any replies that you can work with?

Good Luck,
John

Limba

Hi,

One note for FPGA JTAG connector. It's not standard connector and pinout. so you need to do adapter cable.

Not sure what is SAMD SWD connector pinout and can you use example stm discovery board for programming. It's from STM and about 10-20e.

From Microchip you can buy ATATMEL-ICE-PCBA. It's bare pcb of atmel ice debugger (about 50e + 20e for 10+6pin combo cable) Full atmel ice is about 120e and it was out of stock.

I think you can pretty easy figure out pinouts with multimeter.

tksm372

Hi chelmich,

If you have another Arduino board which has 3.3v GPIOs, you may be able to use the following open-source SAMD programmer:

Programming an M0 using an Arduino
https://learn.adafruit.com/programming-an-m0-using-an-arduino

GitHub: https://github.com/adafruit/Adafruit_DAP

I have not tried it myself, but I hope it may help you.
Minatsu Tukisima

chelmich

#4
Jan 30, 2019, 06:15 pm Last Edit: Jan 30, 2019, 06:16 pm by chelmich
Hi again,

Thank you for the helpful replies. I suspected one of the unpopulated headers would be usable for debug. Looking at the schematic as I understand it:

J7 is a 6-pin Cortex SWD port and connects only to the MCU
J11 is a 10-pin SAM JTAG (not ARM) that connects to both the FPGA and MCU

Is this correct? Assuming I had an Atmel ICE or some other debugger could I use either port to flash the bootloader?

If you have another Arduino board which has 3.3v GPIOs, you may be able to use the following open-source SAMD programmer:
Thanks for the suggestion. Unfortunately I don't have another 3.3v Arduino so I'll have to keep looking. Most debuggers seem to be as expensive as buying a new Vidor.  :o

Assuming I get a debugger working I'm guessing my next step would be to somehow flash the clujtag-server.ino.bin described in the stickied post. Hopefully bossac works with whatever debugger I set up.

Thanks,
Charlie

Limba

Here is example how to do with raspberry pi
Open OCD for RaspberryPi

There they program at91samd21 with raspberry pi.

J7 is connector for programming SAMD21

If you have 5V arduino then you can use level shifters. if you use enough slow clock then you can use it.

Level shifter guide and schematics

chelmich

Here is example how to do with raspberry pi
Open OCD for RaspberryPi
Thanks, that sounds perfect. I'll try it out and report what happens.

DarioPennisi

Hi,
there is still the possibility you didn't clear the bootloader... please try doubletapping the button as soon as you attach the board to USB. the button is not a real reset so if you load a software that locks the processor the button won't do anything however unless you overwritten bootloader, it will still be executed and it''ll wait a bit before jumping to application and that's the small time window in which you can stay in bootloader by doubletapping

chelmich

#8
Feb 01, 2019, 01:15 am Last Edit: Feb 02, 2019, 01:12 am by chelmich
Hi,
there is still the possibility you didn't clear the bootloader... please try doubletapping the button as soon as you attach the board to USB. the button is not a real reset so if you load a software that locks the processor the button won't do anything however unless you overwritten bootloader, it will still be executed and it''ll wait a bit before jumping to application and that's the small time window in which you can stay in bootloader by doubletapping
Thanks for the suggestion. Unfortunately I tried it multiple times and double tapped as quickly as I could but the LED stayed dark. That seems to indicate that the bootloader is nonfunctional. I'm almost set up to try the OpenOCD method. Do you know which is the correct file to flash? The bootloader recovery instructions assume you are already in a functional state over serial.

rrace001

Mine bricked after uploading one of the sketches.  No red LED.  Very unstable.

Where is the Binary file for the bootloader?!?!  No mkrvidor4000 folder in bootloaders and no xxx.bin on the GitHub repository.   Unless the boot.ttf is a binary?  Please help!!!

The six pin J7 on the schematic is for the SAMD21 SWDIO as stated but the ones I use for all of my SAMD boards has 10 pins.  Right in between the io headers too.  Looks like I am making a pogo jig. Something tells me this is going to happen again.

You can find the J7 orientation by using a multimeter on the ground and 3.3v pads.  

Please help with the bootloader binary!!!

tksm372

Hi,

In my PC, samd21_sam_ba_arduino_mkrvidor4000.bin is located here:
C:\Users\(your_login_name)\AppData\Local\Arduino15\packages\arduino\hardware\samd_beta\1.6.25\bootloaders\mkrvidor4000

On GitHub, it is in the beta branch:
https://github.com/arduino/ArduinoCore-samd/tree/beta/bootloaders/mkrvidor4000
Minatsu Tukisima

rrace001

Thank you!.  Will try it when I get home.

rrace001

Worked perfect!  Red LED on and I can see it in the IDE.  Thanks!

chelmich

Sorry for abandoning this thread for a while. I've been super busy and haven't had time to wrestle with the board.

I got an email about a post from jwestmoreland but it seems to be deleted. He asked about a possible USB 3.0 race condition or driver issue. Unfortunately I've tried both USB 3.0 and 2.0 on multiple machines. This issue also persists across power cycling my laptop. Plugging the board in does nothing in dmesg so I can only assume it's not communicating at all.

Worked perfect!  Red LED on and I can see it in the IDE.  Thanks!
Glad to hear it. Did you use OpenOCD? If so, would you mind posting your openocd.cfg? I seem to be having issues with mine.

I went with the Raspberry Pi SWD path that Limba suggested. I'm able to get some level of interaction with the board so I'm pretty sure my wires are good. However, flashing the bootloader always seems to fail. Does anyone have any idea what could be going wrong here? Apologies for the picture of a screen but I didn't take the time to get the output off the Pi.


jwestmoreland

#14
Feb 05, 2019, 05:12 am Last Edit: Feb 05, 2019, 07:33 am by jwestmoreland
chelmich,

I think I must've accidentally deleted that post - sorry for any confusion.

I can try programming the bootloader via the programming interface - I have the Segger tools - I found this - I can't vouch for this outfit but could be a cheap alternative (I know zero about this programmer) - just looks like the price is right:

https://usa.banggood.com/The-J-link-OB-ARM-Emulator-Debugger-Programmer-Downloader-JLINK-Instead-Of-V8-SWD-p-1195533.html?gmcCountry=US&currency=USD&cur_warehouse=CN&createTmp=1&utm_source=googleshopping&utm_medium=cpc_bgcs&utm_content=zouzou&utm_campaign=pla-usg-ele-diy1-pc

Note the actual Segger stuff is hightly recommended but not cheap (not as expensive as an Intel Quartus Prime Standard subscription) though.

Regards,
John W.
PS - Is the USB2/USB3 thing logged as an actual bug?
PPS - This link may be a better option for a lot of people here:
https://www.adafruit.com/product/3571?gclid=EAIaIQobChMIwfHshdyj4AIV0iCtBh2YagGKEAQYAyABEgKHUfD_BwE

Go Up