Welcome! Log In Create A New Profile

Advanced

Gen6 'trons, Firmware & Avrdude

Posted by pileofrogs 
Gen6 'trons, Firmware & Avrdude
September 17, 2013 08:11PM
Hi all.

I just inherited a mendel that was built & sold by botmill in roughly 2010. It has Gen6 electronics from mendel-parts.com (the first version, not the deluxe version).

I can usually get pronterface to talk to and command the printer without any trouble, but I cannot do anything with firmware.

I'm on linux. I've used the arduino software (both 1.0.5 & 0.23) and avrdude. The arduino IDE seems to call avrdude, so it's all the same thing, really. I've tried the lines mentioned in the gen6 entry in the reprap wiki as well as the lines produced by arduino. I've fiddled with every argument I can think of. Here's the line from the gen6 entry in the wiki:

avrdude -c avrisp -b 38400 -i 10 -p m644p -P /dev/ttyUSB0 -F -U flash:r:factory_gen6.hex:i

Usually it just fails without contacting the printer at all. If I hit the reset button just before running avrdude, avrdude will contact the gen6. If I specify 'arduino' as the programmer (the -c argument) it even correctly identifies the sanguino. However, it never succeeds in doing anything with the flash memory. It's the same with reads and writes. It contacts the chip and then times out when trying to access the flash memory.

It seems to me that there are two separate beasties using the same serial line: the printer firmware which listens for g-codes and the ISP which reads/writes the firmware. Is that a correct understanding? Or is the ISP part of the firmware? It seem to me that either my ISP is hosed and it can't read/write to flash OR my firmware is hosed and it won't let my ISP talk on the serial line long enough to do anything.

Does anyone have any advice on how to proceed? I'm hoping I'm just doing something stupid and someone can point it out to me. If not, do I need to re-bootstrap my gen6? I need a special piece of hardware for that don't I? Can anyone recommend more diagnostics I could perform?

Thanks everyone!
-Dylan
Re: Gen6 'trons, Firmware & Avrdude
September 18, 2013 08:02AM
I(C)SP is different from serial line, it works over SPI lines and requires special, though simple, hardware to use. On Gen6 board its 6-pin connector just over reset button. To program via serial (usb) line you need to have bootloader installed on board. In that case stk500v2 works fine as programmer for me.
Re: Gen6 'trons, Firmware & Avrdude
September 18, 2013 11:19AM
Thank you for your response!

I assume I have a bootloader but it may be broken. I can talk to the printer with pronterface, so something is there. When I run avrdude, it finds the programmer on the gen6, which I believe is part of the bootloader. It just fails to read or write from flash.

Specifying stk500v2 as the programmer does not work for me.

Thanks again!
-Dylan
Re: Gen6 'trons, Firmware & Avrdude
September 18, 2013 07:15PM
Are you sure so there are no other processes concurrently reading serial port? You can use fuser /dev/ttyUSB0 to check. Also make sure that you use correct baud rate, bootloader baud rate may differ from the one that you use to communicate with printer firmware. Can you post output of avrdude command when it finds programmer but fails to read?
Re: Gen6 'trons, Firmware & Avrdude
September 18, 2013 07:47PM
I think no other processes are using the serial port, but maybe I'm wrong. The fact that it connects at all supports that. If a different process was using the port, it would just refuse to let me use it, right? Or maybe it would just do crazy things like this... that would explain a lot. Will try fuser.

The bootloader likes 38400 and the printer firmware likes 250000 and 19200.

I won't have the printer in front of me until tuesday. I'll post the output then.

Thanks!
-Dylan
Re: Gen6 'trons, Firmware & Avrdude
September 19, 2013 05:33PM
Linux allows files (including character devices) to be opened simultaneously by multiple processes. First read removes data from the buffer so they can be read only once. Which process will read newly arrived data is determined by process scheduler, but saying that its at random is fair simplification. This makes possible for some process to steal data from another one, say avrdude what is then perceived as communication dropout.
Re: Gen6 'trons, Firmware & Avrdude
September 19, 2013 06:14PM
Classic! I should have known it would work like that. I don't think that's what's happening, because it's so consistent with the failure at flash access, but I'll definitely try fuser/lsof and see what I see. Thanks! You rule!
Sorry, only registered users may post in this forum.

Click here to login