Welcome! Log In Create A New Profile


Firmware Fail

Posted by rlmppna 
Firmware Fail
January 03, 2022 12:49PM
Greetings from a newbie. I have a Tarantula Pro with MKS Gen L v 1 motherboard. I added a BigTreeTech TFT 35 version 3 display and replaced the original with it. I also added BL touch and had used Marlin 1.9 to add all the appropriate parameters to make it work and have successfully used it now for a couple of years. I then decided to add a filament runout sensor. In researching it, I learned that Marlin 2 is out and so I tried to use Marlin 2.0 and am using Arduino ide 1.8.19 to load it. I forgot i needed to comment out the mks mini12864 and uncomment the reprap graphic controller. The lcd screen would not work at all after the firmware upload. I then tried redoing it as per the following.

I ran into difficulties with the reprap_discount_full_graphic_smart_controller script as it is slightly different in Marlin 2.0. Rather than a simple commented line that must be uncommented; it has an "if...then" script as per the following:

// RepRapDiscount FULL GRAPHIC Smart Controller
// [reprap.org]

I am not sure how to activate this script. I did comment out the mks mini12864 and then I tried uncommenting the // RepRapDiscount FULL GRAPHIC Smart Controller. When I tried to upload this to my printer it won't upload. The verify process goes smoothly but during upload I get the following:

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

Per recommendations from others, I tried changing the programmer in Arduino tools menu to AVR ISP which made no difference. There are references to needing to reload the boot logger on the main board but no guidance on how. I don't want to do things that aren't necessary. Hoping for some guidance. Thanks.
Re: Firmware Fail
January 03, 2022 09:56PM
That is an upload issue.
Yes you probably need a bootloader
To install a bootloader you needs an programmer (ie additional hardware) But can be as simple and an arduino uno running the arduino as a ISP sketch

Please read [www.arduino.cc]
Re: Firmware Fail
January 04, 2022 02:45PM
Dust, I greatly appreciate the information. I will study it in detail when I get a chance. On quick look, it appears pretty complicated for someone with no experience. I am a physician so I can follow instructions, but it does look to be pretty technical. If I decide it is beyond my abilities or brick the board in the effort, a replacement MB is ~ $60 on Amazon. If I went that route, would uploading the firmware be straightforward, or would I run into unanticipated problems? Thanks for your help.

Re: Firmware Fail
January 07, 2022 11:56PM
It turns out I had a bad USB cable causing the upload error. I am now able to upload; however, I can't get the touch screen working and get a "No printer attached" message when I try to use the touch screen mode. Marlin works fine though I haven't tested everything yet. I can move the axes around with marlin but nothing happens with the touch screen. I have mks gen L v.1 MB. Marlin 2 settings are different from Marlin 1 in that REPRAP_DISCOUNT_FULL_GRAPHIC_CONTROLLER is not a simple un-comment. Instead, it appears you un-comment //define FULL_GRAPHIC_SMART. I think that is correct and then down where you have RepRapDiscount FULL GRAPHIC SMART CONTROLLER, there is an "if...then" script that says:

I think I leave that as is and with Full Graphic Smart enabled, the correct REPRAP_DISCOUNT-FULL-GRAPHIC-SMART_CONTROLLER is activated. Can someone confirm that is correct?

Then there are tutorials for setting the serial ports which I had not messed with before. In attempting to set these thinking this may be the problem, I cannot find anything specific to the Gen L V.1. What I have found is for the SKR and what was recommended is:
For the SKR Pro the serial ports are defined as:
#define SERIAL_PORT -1
#define SERIAL_PORT_2 1

When I try this, I can't compile and get an error that starts out with: Marlin\src\HAL\AVR\MarlinSerial.cpp:560:20: error: pasting "USART" and "-" does not give a valid preprocessing token ISR (SERIAL_REGNAME (USART, SERIAL_PORT, _RX_vect)) {

Any help would be greatly appreciated. Thanks.

Re: Firmware Fail
January 08, 2022 12:44AM
MKS Gen L v 1 cannot have a serial port of -1 that is for more advanced chips that have the USB port directly connected to the microprocessor

This board has UARTS 0-3, so serial ports can only be set to these options.

This should be your board

The question is where have you plugged in the 5 pin black cable. as this is the serial cable for the tft

Ie On your lcd from the TFT plugs to the controller, where does this cable go?

Edited 6 time(s). Last edit at 01/08/2022 01:06AM by Dust.
Re: Firmware Fail
January 08, 2022 01:02AM
Serial pin on a mega2560 based controller.

Digital pin 0 (RX0) usb serial and on AUX1
Digital pin 1 (TX0) usb serial and on AUX1
Digital pin 19 (RX1) Z-MAX
Digital pin 18 (TX1) Z-MIN
Digital pin 17 (RX2) on exp1
Digital pin 16 (TX2) on exp1
Digital pin 15 (RX3) Y-MAX
Digital pin 14 (TX3) Y-MIN

So your easy option is to use th epin on aux1, but you cannot have usb plugged in at the same time
All your need in Marlin is #define SERIAL_PORT 0 and #define BAUDRATE 115200

The baud rate must match the settings in your tft

A more ambitious change would be to move the endstop pins around freeing up one of the other serial ports. But you would need to remove the pull up resistors on the endstop pin from the motherboard (ie soldering).

Edited 5 time(s). Last edit at 01/08/2022 02:30AM by Dust.
Re: Firmware Fail
January 09, 2022 03:00PM
Thanks for responding. I'm about ready to give up on this. I had this printer working fine for 2 years and wanted to add filament runout sensor. So connections between the TFT and the MB have not change and worked fine for 2 years. I have given up on Marlin 2 as everytime I try to upload a compiled file I get error messages indicating too much data and I need to shorten the code. I downloaded the master file from gitmo of the original Tevo Marlin and can't upload after compile. Here is the error message:

Arduino: 1.8.19 (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega1280"

Sketch uses 118032 bytes (92%) of program storage space. Maximum is 126976 bytes.

Global variables use 4489 bytes (54%) of dynamic memory, leaving 3703 bytes for local variables. Maximum is 8192 bytes.

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x21

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xee

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xb8

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xe6

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xd6

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x0a

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xeb

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x3e

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x2a

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x2a

An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I don't know what to do from here. Any help appreciated. Thanks.

Re: Firmware Fail
January 10, 2022 11:45AM
Oddly, after multiple attempts to upload, it suddenly worked! I didn't change any of the code and as mentioned, I was able to compile successfully multiple times, it just wouldn't upload. After hours of fussing with this, I am of the opinion that Arduino ide is fickle and sometimes works and sometimes doesn't. I have experienced numerous times when compiling failed but then succeeded subsequently without altering any code in config.h. Other times, it compiles successfully but then errors out on upload and then suddenly, without changing any code, it succeeds. This adds a layer of complexity to the process that is very frustrating because you don't know if it fails due to bad commands in config.h or because Arduino just doesn't want to work. In any event, I have everything working now though I have not fiddled with the filament runout sensor settings. I'm a little gun-shy now to even try it. For others, all I can say is Arduino seems to be fickle and may just require multiple attempts to get a file to compile and upload successfully.

Sorry, only registered users may post in this forum.

Click here to login