Welcome! Log In Create A New Profile

Advanced

Bricked MKS Base v1.3 after ICSP update

Posted by agehall 
Bricked MKS Base v1.3 after ICSP update
July 12, 2015 01:02PM
So I got my Prusa I3 from China the other day and I've spent the weekend putting it together. Things seemed to go well (a bit too well I guess) and I got to the point where I wanted to calibrate the printer and adjust a few firmware parameters. (At this point, I was able to connect to the printer just fine and control it using Repetier Host!) So I decided to download Marlin and compile the latest release on my own.

As I'm fairly new to all of this 3D printing, I decided to just upload a fairly vanilla configuration, where I just changed a few basic things, just to verify that I had a working toolchain etc. I compiled Marlin using the Arduino IDE and hooked up my ASPUsb programmer to the ICSP port on the MKS-board and did an upload.

Now the display went "blank", just displaying rows and I'm unable to connect to the printer via the USB connection. :/ I've tried reprogramming several times without success. I've verified the ICSP connection several times and just to make sure my programmer isn't the issue, I hooked it up to an Arduino UNO R3 I had laying around and it worked just fine with that, so I'm running out of ideas here.

Anyone have suggestions for where to go next? Surely there must be some way I can resurrect my main board... I'm not sure what is needed to debug the issue, so feel free to ask for more info and I'll post it ASAP.
Re: Bricked MKS Base v1.3 after ICSP update
July 13, 2015 04:29AM
You can´t upload Marlin without reading and perhaps modifying" every" line of the configuration.h.
There is no "vanilla" shortcut unless you have gotten a configuration.h written explicitly for your printer. sad smiley
-Olaf
Re: Bricked MKS Base v1.3 after ICSP update
July 13, 2015 05:23AM
Well, of course I went thru the config and checked it for obvious things. What I meant was that I didn't care too much about checking if the endstops should be inverted or not, if the print area was correct or if all the parameters for the steppers were correct. These parameters are all critical to getting a working printer in the sense that it can actually print something useful but they are not critical in the sense that I just want a new firmware that I can talk to via USB without expecting to print anything.

My expectation is that I should be able to compile a firmware and upload it after basically setting the correct board, serial port and baudrate. It wouldn't be usable for printing, but I should be able to talk to the printer, right?
Re: Bricked MKS Base v1.3 after ICSP update
July 13, 2015 10:34AM
You suspect right but usually you don't need a programmer for it.
The programmer is only required if no bootloader is present on the board and the first thing would be to set the right fuses and upload one.
After that you can simply upload all sketches directly through the Arduino program.
I suspect that either
a) the wrong programmer settings were used.
b) the wrong fuses were set.
In any case you should be able to get the board back from the dead by uploading the right bootloader through the Arduino program with a supported prgrammer.
Had similar issues with my Gen6 board after realising that not all Arduino program versions have the same level of support for it.
Re: Bricked MKS Base v1.3 after ICSP update
July 13, 2015 11:26AM
Something like that makes sense. I did try connecting to the board via USB for the upload but it didn't work, so I just assumed there was no bootloader. I'll try burning a bootloader and see if it helps. Never really dealt with the bootloader programming process on Arduino boards before, so I guess I'll have to read up on it.

I'll spend some time on this tomorrow and report back.
Re: Bricked MKS Base v1.3 after ICSP update
July 14, 2015 03:29AM
I decided to use an Arduino Uno I had laying around to reprogram things today, instead of the cheapo ASPUSB thing I've been using earlier. Here is the report on the fuses from my board:

Atmega fuse calculator.
Written by Nick Gammon.
Version 1.10
Compiled on Jul 14 2015 at 08:56:56 with Arduino IDE 10601.
Attempting to enter programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x98 0x01 
Processor = ATmega2560
Flash memory size = 262144
LFuse = 0xFF 
HFuse = 0xD8 
EFuse = 0xFD 
Lock byte = 0xFF 
Clock calibration = 0xA2 
OCD Enable.............................. [ ]
JTAG Enable............................. [ ]
Enable Serial (ICSP) Programming........ [X]
Watchdog Timer Always On................ [ ]
Preserve EEPROM through chip erase...... [ ]
Boot into bootloader.................... [X]
Divide clock by 8....................... [ ]
Clock output............................ [ ]
Bootloader size: 8192 bytes.
Start-up time: SUT0: [ ]  SUT1: [ ] (see datasheet)
Clock source: low-power crystal.
Brownout detection at: 2.7V
.

Looks pretty much OK if you ask me.

I then used Nick Gammons boot flasher sketch and flashed a new bootloader into the chip, which flashed and verified just fine. However, I'm still unable to upload sketches via the USB connection. :/

Any other ideas I can try?
Re: Bricked MKS Base v1.3 after ICSP update
July 14, 2015 04:39AM
Quote
wiki
MKS Base V1.0 has the powerful processor ATMEGA2560 WITH 256K flash memory. It use FTDI FT232R device for USB and not ATMEGA16U2 as ARDUINO MEGA2560.

I just snipped out this info from the wiki about the V1.0.

Maybe you have to change the "programmer" settings in the IDE?
-Olaf
Re: Bricked MKS Base v1.3 after ICSP update
July 14, 2015 04:43AM
You mean I should tell the Arduino IDE to use a programmer even though I'm connected directly to the MKS board with my USB cable?
Re: Bricked MKS Base v1.3 after ICSP update
July 14, 2015 05:01AM
Quote
agehall
You mean I should tell the Arduino IDE to use a programmer even though I'm connected directly to the MKS board with my USB cable?

Actually ( from the back of my mind) it doesn´t make a difference between using a FTDI chip or the 16u4. Both are working as "USBasp"
I just thought, you might have the IDE still expecting an "AVR ISP" or whatever the earlier setting was? smiling smiley
-Olaf
Re: Bricked MKS Base v1.3 after ICSP update
July 14, 2015 05:04AM
Hmm, wait a minute - are those ICs (16u4/FTDI) not only there to translate USB<->Serial between my computer and the ATMega2560 controller? I've tried doing a straight "Upload sketch" from the IDE and not "Upload using programmer"...
Re: Bricked MKS Base v1.3 after ICSP update
July 14, 2015 05:14AM
WTF! *#€%T!!"€ *lot's of ramblings one should not say out loud*

I just reflashed the whole chain from scratch, by following the exact same steps as I did before and suddenly the bootloader was accessible and I could upload a sketch!

Step by step:

1) Upload Nick Gammon's board programmer to my Arduino Uno via COM7
2) Used it to program and verify the bootloader - all OK
3) Moved the USB cable to the printer USB port
4) Set the Arduino IDE to use the correct COM-port (COM13 in my case)
5) Attempted to upload the Marlin Sketch and it just worked.

As I carefully documented each step earlier, I'm 99.9% sure I followed the exact same procedure that didn't work before. Have no clue why it suddenly worked.

Anyhow, thanks for your time and input! It's very frustrating when embedded systems doesn't work and it's nice to have some friendly community support, if for nothing else, just to verify that one isn't doing something completely bogus.
Re: Bricked MKS Base v1.3 after ICSP update
July 15, 2015 03:20AM
Update: When I disconnected +5V on the programmer Arduino board, the printer was yet again dead. Plugging it in again makes the printer come alive.

I have two theories: Either board sinks the SPI clock line causing things to misbehave or the printer no longer generates a proper clock and therefore is dead unless I have an external clock hooked up. I'll do some more testing later today to figure out if any of these theories seems to fit.
Re: Bricked MKS Base v1.3 after ICSP update
July 15, 2015 03:50AM
It might be related to the fuse settings of the new bootloader.
Do you use internal or external clock now? Is it a quartz or PPL chip?
I´m not an expert about bootloader config, but I remember, you can choose between different clock-dividers and sources.
-Olaf

Edited 1 time(s). Last edit at 07/15/2015 03:50AM by o_lampe.
Re: Bricked MKS Base v1.3 after ICSP update
July 15, 2015 06:48AM
Did some testing over lunch - printer works fine if I disconnect the programmer completely. So apparently it sinks one or more lines if connected without power and causes issues. Did not expect that.

@o_lampe - my fuse configs are unchanged since I started messing with this. See the post above where the fuse config (and also plain text explanation of the config) is shown.
Re: Bricked MKS Base v1.3 after ICSP update
July 15, 2015 11:06AM
I´m just shooting from the hips, but maybe your programmer shares one or more pins with the printer? Did you check the pins.h?
Or the programmer forces the chip to stay in programming mode? ( reset pin always low? )
-Olaf

Edited 1 time(s). Last edit at 07/15/2015 11:07AM by o_lampe.
Re: Bricked MKS Base v1.3 after ICSP update
July 15, 2015 12:35PM
Could be anything really, but I guess the simple solution is just to unhook the programmer completely and not worry about it. smiling smiley
Re: Bricked MKS Base v1.3 after ICSP update
July 18, 2015 04:01PM
It could be as simple as a difference in the 5V supply.
My Mega is behaving a bit strange with that too.
When changing the BL and leaving the programmer attached all sorts of unwanted and unexpected reactions happen depending on the sketch in use.
For the printer itself it can also be a simple communication issue as the ISP connection uses the same chip for the serial communication.
So timing issues can't be avoided if the programmer stays attached and is still active.
As the two share the supply voltage when connected it does not even matter much if you have a USB cable connected to the programmer.
Guess seperating was the best idea here smiling smiley
Re: Bricked MKS Base v1.3 after ICSP update
July 20, 2015 04:22PM
i am newbie also i am using MKS base 1.3 board but now i like to add approximate sensor for auto leveling i need help should i just upload new Merlin firmware or what? i like to backup first the original firmware if posable download the original and add the auto leveling and the upload but i dont know how to download the original any one help thanks
Re: Bricked MKS Base v1.3 after ICSP update
July 20, 2015 06:28PM
To back up your current firmware I do believe you have to use an ICSP programmer to read the flash. AFAIK you cannot read the flash via the bootloader, but I could be wrong here.
Re: Bricked MKS Base v1.3 after ICSP update
July 21, 2015 12:22PM
thanks for your help, Is yours after Merlin firmware update works ok even the lcd? if your worked fine then i am thinking to go a head.
Re: Bricked MKS Base v1.3 after ICSP update
July 21, 2015 03:48PM
Yes, everything works fine for me now.

With regards to your question about backing up the original firmware - Arduino IDE does verify the flash, so there must be a way to read it via the bootloader, but I've never tried that. Maybe it's worth having a look at...

However, if you don't mess around with ICSP at all, you should be OK. If your firmware doesn't work properly, just recompile and upload again...
Re: Bricked MKS Base v1.3 after ICSP update
July 21, 2015 06:58PM
It verifies the machine language binary image that is uploaded. There is no decompiler to get that back to source code . . .

- Tim
Re: Bricked MKS Base v1.3 after ICSP update
July 22, 2015 01:25AM
There is no point in decompiling the firmware anyhow - it would not be usable for anything except compiling anyhow. As all the important bits (i.e. the configuration) is done using the C preprocessor, it will be tightly tied into the code once it is compiled and you wouldn't easily be able to read it.

If you want to back up a firmware, it is best done as a binary image.
Re: Bricked MKS Base v1.3 after ICSP update
July 23, 2015 04:49AM
Thanks all for your help i am just going a head to up load the new marlin firmware and see what happen thanks again
Re: Bricked MKS Base v1.3 after ICSP update
January 19, 2016 03:00PM
I have an MKS Base V1.3 on my machine which is an HIC Technology Reprap Prusa I3 LCD.
Since I completed assembly of the unit, last summer, I have not been able to get it to print properly.
I have tried different printing software programs with exactly the same end results from each one.

The first layer will print and the subsequent layers do not adhere to the layer below because the
hot end gets to high for the filament to adhere to the layer below. Some time the extruder quits
working, probably needs a rest, and then starts up again.

The unit connects to the computer properly, because I can control the steppers and the extrusion
of filament from my keyboard. I can also set the heat for the bed as well as the hot end.

I am quite new at this, however, I have everything calibrated and level and am now at my whits end.

Is there anyone out there that can help me???????

Henry
Re: Bricked MKS Base v1.3 after ICSP update
February 15, 2016 08:22PM
I would suggest the thermistor is pulled out and the unit is overheating?
It will be something VERY simple.
Re: Bricked MKS Base v1.3 after ICSP update
March 30, 2016 01:42PM
Quote
HenryAT
I have an MKS Base V1.3 on my machine which is an HIC Technology Reprap Prusa I3 LCD.
Since I completed assembly of the unit, last summer, I have not been able to get it to print properly.
I have tried different printing software programs with exactly the same end results from each one.

The first layer will print and the subsequent layers do not adhere to the layer below because the
hot end gets to high for the filament to adhere to the layer below. Some time the extruder quits
working, probably needs a rest, and then starts up again.

The unit connects to the computer properly, because I can control the steppers and the extrusion
of filament from my keyboard. I can also set the heat for the bed as well as the hot end.

I am quite new at this, however, I have everything calibrated and level and am now at my whits end.

Is there anyone out there that can help me???????

Henry
Did you fix this ??
I had a similar issue when i changed stepper drivers and forgot the adjust the steps per mm in the firmware properely . Just an idea
Re: Bricked MKS Base v1.3 after ICSP update
March 30, 2016 01:44PM
It very much sounds like a stepper issue. What are your settings for the printer? If you post them, maybe someone can spot values that seem way off or suggest tweaks.
RVE
Re: Bricked MKS Base v1.3 after ICSP update
May 17, 2016 08:31AM
Hello,

It seems that I am facing the same issue than agehall was facing, I was uploading custom firmwares to my 3D printer (based on a MKS bas e1.4) using Cura and one upload failed.

Since then, the screen on my 3D printer will only show blank lines, and I cannot upload any new firmware (arduinoIDE will return the follwing error message every time :

avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer.

)

I tried burning a new bootlader using arduinoIDE (so my MKS base 1.4 is plugged to my laptop using USB ) but it is failing too. I tried changing my ArduinoIDE version but it didn't help. I tried reinstalling the usb driver for the MKS base on my laptop, but the issue is still there.

The strange thing is that my laptop recognize the MKS base when I plug it with USB (if no driver is intsalled, it will install it, and I can see the port in both arduinoIDE and in the control panel) but it looks like it fails any attempt to "communicate" with it.

I think there might be an issue with the bootloader or the fuses on my MKS base, but I don't know how to check or correct it. Could anyone help me on this one ?

A friend of mine will lend me his arduino to use it as a programmer, but I am a novice on that matter, and was not able to find anything online on how to use an arduino as a programmer for a MKS base, only for other arduino, and honestly, I feel a little lost here ...

Thank you in advance !

Edited 2 time(s). Last edit at 05/18/2016 05:37PM by RVE.
RVE
Re: Bricked MKS Base v1.3 after ICSP update
May 18, 2016 05:36PM
Hello everyone, I am back,

I finally managed to breath some life into my MKS base, or at least to flash it a corect bootloader !!! smiling bouncing smiley

If anyone is interessted, I have been following roughly the same steps agehall did.

As it was a first time for me, this tutorial really help me understand what I had to do : best way flash bootloader arduino

The tutorial is focused on arduino to arduino programming, so it had to be slightly "adapted" to match the MKS base v1.4, but in the end, it worked smiling smiley

Just one detail, once the bootlader had been flashed onto the MKS, I had to disconnect the MKS from the Arduino in order to be able to upload the firmware onto the MKS (using the normal procedure, through USB connection on my laptop). When it was still connected to the Arduino, the upload was still failing with the same error as previously, which made me think that the procedure did not work.

Thank you all for your help

Edited 1 time(s). Last edit at 05/18/2016 05:36PM by RVE.
Sorry, only registered users may post in this forum.

Click here to login