Unreliable SVL Bootloader Uploads

To this point, most of my Arduino builds have been small. Now I have one that is about 200K bytes of flash. My issue is that the booloader seems quite unreliable with large uploads. It fails randomly during the upload in the following general fashion:

	Sending frame #92, length: 2048
	Sending frame #93, length: 2048
	Sending frame #94, length: 2048
		Retrying...
	Sending frame #94, length: 2048
		Retrying...
	Sending frame #94, length: 2048
		Retrying...
	Sending frame #94, length: 2048
		Retrying...
	Sending frame #94, length: 2048

	Upload failed

For what it is worth, I have never seen a frame retry work, ever. I always get some number of retries, followed by an abort of the upload. Arduino will retry the entire upload three times, and then after the third failure displays the misleading message:

[Done] Uploaded the sketch: ReflowControllerV3.ino

I never really noticed this until the builds got large, but now I am struggling to get an upload to actually complete successfully. Any ideas?

Can you share the snippet at the beginning of the BL process? I want to be sure you have v5 of the bootloader on your Artemis.

For example:

Artemis SVL Bootloader
Script version 1.7

Phase:	Setup
	Cleared startup blip
	Got SVL Bootloader Version: 5
	Sending 'enter bootloader' command

Phase:	Bootload
	have 122656 bytes to send in 60 frames
	Sending frame #1, length: 2048
        ...

I am regularly pushing ~122k without hiccup. I will build a bigger binary for full testing.

And if you have a different version of the BL installed you can read how to easily upgrade it here: Designing with the SparkFun Artemis - SparkFun Learn

Oh, and what’s your hardware setup? Artemis module on custom board, ATP, nano, etc?

It’s a Redboard. Snippet:

Phase:	Setup
	Cleared startup blip
	Got SVL Bootloader Version: 3
	Sending 'enter bootloader' command

Phase:	Bootload
	have 193724 bytes to send in 95 frames
	Sending frame #1, length: 2048

Looks like I should try installing version 5!

I’m able to push a dummy 975k binary successfully and it runs just fine. There was a few hiccups (5?) but nothing that stopped the process.

I suspect you have an earlier version of the bootloader. You’ll find v5 to be much faster and more stable.

Also note we have a GUI available: https://github.com/sparkfun/Artemis-Firmware-Upload-GUI

This can be helpful to push firmware to clients without the need for them to use Arduino.

Artemis SVL Uploader

Phase:	Setup
	Cleared startup blip
	Got SVL Bootloader Version: 5
	Sending 'enter bootloader' command
Phase:	Bootload
	Sending 975296 bytes in 477 frames
	Got frame request
	Sending frame #1, length: 2048
	Got frame request
	Sending frame #2, length: 2048
	Got frame request
	Sending frame #3, length: 2048
	Got frame request

... 
	Got frame request
	Sending frame #474, length: 2048
	Got frame request
	Sending frame #475, length: 2048
	Got frame request
	Sending frame #476, length: 2048
	Got frame request
	Sending frame #477, length: 448
	Got frame request
Upload complete!
Nominal bootload 37631.5 bytes/sec

Version 5 gets it done. I still see a number of errors during the upload, as you did too with your giant upload. But with the version 5 bootloader, at least the retries succeed. Here is an example upload showing 3 errors on frames 3, 60 and 77:

Artemis SVL Bootloader
Script version 1.7

Phase:	Setup
	Cleared startup blip
	Got SVL Bootloader Version: 5
	Sending 'enter bootloader' command

Phase:	Bootload
	have 193724 bytes to send in 95 frames
	Sending frame #1, length: 2048
	Sending frame #2, length: 2048
	Sending frame #3, length: 2048
		Retrying...
	Sending frame #3, length: 2048
	Sending frame #4, length: 2048
	Sending frame #5, length: 2048
	Sending frame #6, length: 2048
	Sending frame #7, length: 2048
	Sending frame #8, length: 2048
	Sending frame #9, length: 2048
	Sending frame #10, length: 2048
	Sending frame #11, length: 2048
	Sending frame #12, length: 2048
	Sending frame #13, length: 2048
	Sending frame #14, length: 2048
	Sending frame #15, length: 2048
	Sending frame #16, length: 2048
	Sending frame #17, length: 2048
	Sending frame #18, length: 2048
	Sending frame #19, length: 2048
	Sending frame #20, length: 2048
	Sending frame #21, length: 2048
	Sending frame #22, length: 2048
	Sending frame #23, length: 2048
	Sending frame #24, length: 2048
	Sending frame #25, length: 2048
	Sending frame #26, length: 2048
	Sending frame #27, length: 2048
	Sending frame #28, length: 2048
	Sending frame #29, length: 2048
	Sending frame #30, length: 2048
	Sending frame #31, length: 2048
	Sending frame #32, length: 2048
	Sending frame #33, length: 2048
	Sending frame #34, length: 2048
	Sending frame #35, length: 2048
	Sending frame #36, length: 2048
	Sending frame #37, length: 2048
	Sending frame #38, length: 2048
	Sending frame #39, length: 2048
	Sending frame #40, length: 2048
	Sending frame #41, length: 2048
	Sending frame #42, length: 2048
	Sending frame #43, length: 2048
	Sending frame #44, length: 2048
	Sending frame #45, length: 2048
	Sending frame #46, length: 2048
	Sending frame #47, length: 2048
	Sending frame #48, length: 2048
	Sending frame #49, length: 2048
	Sending frame #50, length: 2048
	Sending frame #51, length: 2048
	Sending frame #52, length: 2048
	Sending frame #53, length: 2048
	Sending frame #54, length: 2048
	Sending frame #55, length: 2048
	Sending frame #56, length: 2048
	Sending frame #57, length: 2048
	Sending frame #58, length: 2048
	Sending frame #59, length: 2048
	Sending frame #60, length: 2048
		Retrying...
	Sending frame #60, length: 2048
	Sending frame #61, length: 2048
	Sending frame #62, length: 2048
	Sending frame #63, length: 2048
	Sending frame #64, length: 2048
	Sending frame #65, length: 2048
	Sending frame #66, length: 2048
	Sending frame #67, length: 2048
	Sending frame #68, length: 2048
	Sending frame #69, length: 2048
	Sending frame #70, length: 2048
	Sending frame #71, length: 2048
	Sending frame #72, length: 2048
	Sending frame #73, length: 2048
	Sending frame #74, length: 2048
	Sending frame #75, length: 2048
	Sending frame #76, length: 2048
	Sending frame #77, length: 2048
		Retrying...
	Sending frame #77, length: 2048
	Sending frame #78, length: 2048
	Sending frame #79, length: 2048
	Sending frame #80, length: 2048
	Sending frame #81, length: 2048
	Sending frame #82, length: 2048
	Sending frame #83, length: 2048
	Sending frame #84, length: 2048
	Sending frame #85, length: 2048
	Sending frame #86, length: 2048
	Sending frame #87, length: 2048
	Sending frame #88, length: 2048
	Sending frame #89, length: 2048
	Sending frame #90, length: 2048
	Sending frame #91, length: 2048
	Sending frame #92, length: 2048
	Sending frame #93, length: 2048

Thanks for the help!

Very good! Those errors are failed CRC checks and at 921600bps, I’m not surprised if there are a few. Thankfully the BL is robust enough to recover and continue (now).

Thanks for reporting back!

Thanks for posting this @robin_hodgson and for your assistance @sparky . I have been having the same issue! My binaries have gotten larger now and SVL really struggles to upload. It often have to retry several times (3- 6 times) before once success. Fortunately, I have a j-link debugger so I’ve been using that instead. I thought I had the latest bootloader but I will check and try again.

I am on a custom board, modeled after the redboard_atp. Unfortunately, I didn’t break out the boot pin because I hoped to just stick to SVL. Hopefully, that will not be necessary.

I did have an older bootloader. Just checking, is this the permanent path to the most current bootloader:

https://github.com/sparkfun/SparkFun_Ap … rtemis_svl

or

https://github.com/sparkfun/SparkFun_Ar … Bootloader ?

I like the GUI firmware uploader with bootloader updating but just wanted to know if I wanted to flash manually using the debugger.

Hi ja,

The BSPs link is the origin for the bootloader tools (and many other things to boot). When we make an update there we will trickle that change down into the other tools that rely on it. We are also working on a strategy to automate that process.