Welcome! Log In Create A New Profile

Advanced

Uploading Marlin to Anet A8 is Clearly Rocket Science (Help)

Posted by ricci07 
Uploading Marlin to Anet A8 is Clearly Rocket Science (Help)
April 07, 2020 05:08PM
Preamble

I've wanted to implement auto bed leveling for my Anet A8 (V1.5 board) because the manual bed leveling with a piece of paper every time is getting really monotonous and is the main reason I don't print much as I would otherwise. Despite what some people say, I need to level my bed every time or my first layer peels off and I get mad.

Another reason I would like to upgrade to Marlin is because my Octoprint says it lacks a thermal runway (no way to detect if the hothead thermistor has fallen out and will keep raising temperature regardless until a possible fire) So uploading to Marlin would allow me to enable thermal runway protection and utilize the induction sensor I have mounted to the lower x-axis bearing with a mounted I've modeled in Autodesk Fusion 360.

The Problem

I've done a fair amount of research into this. I purchased a USBasp back in 2014 for flashing firmware to a drone, so I dug it out to use to flash the Anet A8. I looked at the schematic of the J3 header and modified to wiring of my USBasp so the inner 6 pins line up with VCC, MOSI, GND, MISO, SCK, and RESET and the outer 4 pins are not connected. I installed the USBasp driver from [www.fischl.de] and used Zadig to replace the driver with the WinUSB driver as instructed by some sources.

Next, I downloaded the latest version of Marlin (2.0.5.3 at the time of writing) and the Anet A8 board definitions from [github.com] and put them in the Documents/Arduino directory as required. Next I downloaded the Marlin configuration examples and copied the contents of the Anet A8 sub folder into the Marlin subfolder of the downloaded Marlin 2.0.5.3 firmware and overwrote the existing files.

As recommended by a YouTube video (https://www.youtube.com/watch?v=wRODgnAqp1A), I attempted to upload the the Marlin firmware straight away by uploading (failure would indicate no bootloader is on the board), and of course, it failed for a myriad of reasons that I cannot remember. One I can remember was "file path or extension to long" regarding the AVRdude executable. I looked around online for this but there was little information about it, some suggested moving the files to C:\TEMP to shorten the file path. I did not have much success, other errors just happened instead) For each error I solved, there was another to popup. Ultimately, I gave up on Marlin 2.x and downloaded Marlin 1.19 (Note I also tried Visual Studio Code with PlatformIO and Auto Build Marlin extensions that looked promising and then...as usual...failure. Note: I also used old versions of Arduino IDE (1.8.5) as recommended by the YouTube video said.

Marlin 1.19

With Marlin 1.19 I nearly had success. Obviously from the blank screen of my Anet A8, I had corrupted the bootloader, so I used my USBasp connected to J3 of the Anet A8 board to burn the (optiboot) bootloader which appeared to work fine according to the AVRdude comments.

Then using a USB cable, I attempted to upload Marlin 1.19, but not surprisingly I received an error to do with Interrupts or something. I looked it up and saw some say to comment out this line in the Configuration.h file and it will work fine. I did this and true, it solved it. Because of the failure, I had to keep re-burning the bootloader, every failure (I won't mention this every time). When uploading Marlin 1.19 after this I it appeared like it was working. I see Writing ####################### Reading ########################... then once again a new reason of failure "Selected serial port does not exist or your board is not connected" (Sigh). Not sure what this means, it is connected. (Note the COM port selected is correct)

Note I have tried uploading the firmware through the USBasp with "Upload with Programmer" but I get the exact same results and will end up have to reburn the bootloader. I can't find anything useful online about "Selected serial port does not exist or your board is not connected". My electronics lecturer, which does similar things in his spare time, suggested trying to try and upload a simple blink script to the Anet A8 ATMega AVR chip to see if it is possible to even upload and to tell whether it is a Marlin based code issue or not. I managed to upload this simple script and using the LED_BUILT_IN constant, I could make the ANET A8 board blink its LED at different rates.

Going back to upload Marlin 1.19 I get the same Serial Port Error!

This is where I have reached the (I need help stage, to unbrick my Anet A8 v1.5 board)

Please watch this video: Video showing the Marlin 1.19 upload problem

Thanks in advance for any help.
Re: Uploading Marlin to Anet A8 is Clearly Rocket Science (Help)
April 07, 2020 10:57PM
if you uploading via bootloader, you do not have the usbasp plugged in, and you click on upload, not upload using programmer.

You use the USBasp to upload the optiboot bootloader. then you remove the usbasp programmer.
Plug the controller in to the computer directly. and work out what serial port it is now on.
Now verify the bootloader is working with blink. use the upload icon, not the upload via using programmer.

If this works try marlin again

Many usbasp cannot upload large firmwares (> 64k) due to limitation in the programmer firmware)

Edited 1 time(s). Last edit at 04/07/2020 10:58PM by Dust.
Re: Uploading Marlin to Anet A8 is Clearly Rocket Science (Help)
April 09, 2020 12:44PM
Hi Dust,

Thanks for the reply.

I have tried every combination I could think of. (I have since purchased a new Anet 1.7 board to use if I can't ever get this working)

I have uploaded optiboot bootloader via a non-ribbon cable style USBasp (that I purchased in 2014, which doesn't appear to exist online anymore) which succeeds, then pulled it of J3 header and laptop and then used the USB cable (2 different ones) with correct port (double checked with device manager) and some error will happen regardless.

I have since managed to get further with Marlin 2.0.0 and Arduino 1.9 BETA by adding the 'build.path="C:\Temp" (and creating that folder in the same place) line to the arduino preferences.txt file (this stops the file path or extension too long error), but then error (using UScool smiley for another reason.

Now I get (using USB upload or USBasp upload method):

Reading | ################################################## | 100% 56.28s

avrdude: verifying ...
An error occurred while uploading the sketch
avrdude: verification error, first mismatch at byte 0x0000
         0x00 != 0x0c
avrdude: verification error; content mismatch

avrdude done.  Thank you.

If it's not one thing, its another.

The fact that the blink script (via usb) can be uploaded success shows that its is possible, but just isn't happening.

Any ideas?

Thanks again!

Edited 1 time(s). Last edit at 04/09/2020 12:46PM by ricci07.
Sorry, only registered users may post in this forum.

Click here to login