Firmware update HOWTO [Marlin]

Code hacking talk

Firmware update HOWTO [Marlin]

Postby PxT » 2012-May-Sat-15-May

Brook asked me to write a document on how to get started with compiling and uploading a new firmware version, for those who are interested. I wrote the doc and sent it to him but he has not responded in a couple of weeks. Rather than wait any longer for him to post it on his website I am going to put the link here. If he does respond at some point then I will update this post with the most up-to-date link.

Printrbot Firmware.pdf
http://dl.dropbox.com/u/68081994/printr ... rmware.pdf

Latest version will always be linked from http://www.printrbottalk.com/wiki/index ... e=User:PxT

Please let me know if any questions or feedback.

keywords for search: Marlin, arduino, hex, compile
  • 0

User avatar
PxT
Print complete...
 
Posts: 1339
Joined: 2011-Dec-Mon-16-Dec
Location: Sacramento, CA
Reputation: 97

Firmware update HOWTO [Marlin]

Sponsor

Sponsor
 

Re: Firmware update HOWTO

Postby scantrontb » 2012-May-Sat-17-May

on page 2 just below the picture of the jumper and reset switch you say "Once the board is reset you can replace the BOOTjumper and proceed with the following steps." but then at the TOP of page 3 you say "Once complete (with the prior steps) make sure to replace the BOOTjumper pin and then push the reset button again to boot the board normally"

the bold/underlining are my emphasis on the implied meaning.

that is confusing, as you have us REPLACING the jumper at two different times but not taking it OFF again in between them... do you replace the jumper then do the next steps... or do you do the steps, THEN replace the jumper...
  • 0

Don't planto mihi adveho illac
PB+ #786
User avatar
scantrontb
Can update firmware
 
Posts: 825
Joined: 2011-Dec-Sun-14-Dec
Location: federal way, wa
Reputation: 5

Re: Firmware update HOWTO

Postby PxT » 2012-May-Sat-18-May

Thanks, I have altered the wording slightly to (hopefully) make it more clear.
  • 0

User avatar
PxT
Print complete...
 
Posts: 1339
Joined: 2011-Dec-Mon-16-Dec
Location: Sacramento, CA
Reputation: 97

Re: Firmware update HOWTO

Postby CL1 » 2012-May-Sat-22-May

Just want to throw something out there to perhaps watch for. At the PrintrBoard Github, I see a note from Laine something to the effect of a revision reversing some jumper's polarity. If this is the programming jumper, it would affect your instructions here. Not now, but whenever that rev of PBd is shipped.

It makes sense to do this as it will eliminate the cost of the jumper. Boards could go out without them, having been programmed at HQ with the jumper which is then removed for shipment. This also means that an open allows normal operation. Much more stable for a vibration environment, as it is far less likely for an open jumper to become closed than for a closed jumper to become open.

NOTE: I don't know if the revision mentioned was for the Programming jumper. I didn't git along well with Git site, and was there looking for something else WRT the PBd. But I noticed that commetn and made a mental note for myself which I now share.

CL1
  • 0

CL1
Can update firmware
 
Posts: 827
Joined: 2012-Apr-Fri-01-Apr
Reputation: 3

Re: Firmware update HOWTO

Postby marmil » 2012-May-Sun-14-May

Thank you for this pdf PxT. That's a great little informational document.
(I didn't see the previous version, but this version seems clear regarding the jumper.)

And thanks for that info CL1.
  • 0

CG & 3D enthusiast • Printrbot+ Kickstarter backer • Mods: GT2 belts, custom aluminum y-carriage and print bed
User avatar
marmil
Honeycomb infill 25%...
 
Posts: 284
Joined: 2011-Dec-Sat-14-Dec
Location: Glendale, California
Reputation: 6

Re: Firmware update HOWTO

Postby PxT » 2012-May-Sun-14-May

CL1 wrote:Just want to throw something out there to perhaps watch for. At the PrintrBoard Github, I see a note from Laine something to the effect of a revision reversing some jumper's polarity. If this is the programming jumper, it would affect your instructions here. Not now, but whenever that rev of PBd is shipped.



Do you mean this: https://github.com/lwalkera/printrboard/issues/1 ? That was the only commit or issue I could find that looked relevant.

That one is referring to solder jumpers that didn't flow properly during manufacturing, nothing to do with the programming jumper.
  • 0

User avatar
PxT
Print complete...
 
Posts: 1339
Joined: 2011-Dec-Mon-16-Dec
Location: Sacramento, CA
Reputation: 97

Re: Firmware update HOWTO

Postby CL1 » 2012-May-Mon-05-May

Here: https://github.com/lwalkera/printrboard/commits/master

I found this:
May 03, 2012 Make resonator pad larger to accomodate both available pacakages, and change polarity of BOOT jumper
175eccfdd2 Browse code
lwalkera authored 25 days ago

CL1
  • 0

Last edited by CL1 on 2012-Jun-Wed-12-Jun, edited 1 time in total.
CL1
Can update firmware
 
Posts: 827
Joined: 2012-Apr-Fri-01-Apr
Reputation: 3

Re: Firmware update HOWTO

Postby jr57k » 2012-Jun-Tue-14-Jun

Stupid question... what firmware is on the board as shipped. For some reason I assumed Marlin, but I haven't confirmed it... That's what I'm slicing against so it must be.
  • 0

jr57k
Layer 300 of 1234
 
Posts: 320
Joined: 2012-Apr-Sat-18-Apr
Location: Augusta, GA
Reputation: 0

Re: Firmware update HOWTO

Postby CL1 » 2012-Jun-Wed-05-Jun

jr57k wrote:Stupid question... what firmware is on the board as shipped. For some reason I assumed Marlin, but I haven't confirmed it... That's what I'm slicing against so it must be.

Ummm, see the top posts in this thread? :? Yes, Marlin. PxT has the official version linked above.

CL1
  • 0

CL1
Can update firmware
 
Posts: 827
Joined: 2012-Apr-Fri-01-Apr
Reputation: 3

Re: Firmware update HOWTO

Postby jr57k » 2012-Jun-Wed-08-Jun

I see the pdf file, but the word Marlin isn't present in the thread... nor is Sprinter. I may be cool, but I'm no mind reader.... :ugeek: I'll check out the PDF now.

EDIT... yup, the PDF has marlin all over it! Nice write up. I haven't bent racking the firmware modifications, but it would be nice to cross link a new feature/bug release doc.
  • 0

jr57k
Layer 300 of 1234
 
Posts: 320
Joined: 2012-Apr-Sat-18-Apr
Location: Augusta, GA
Reputation: 0

Re: Firmware update HOWTO

Postby Jason_Read » 2012-Jun-Sun-07-Jun

I find the idea of flashing the firmware utterly terrifying, what advantage will it give and do I really need to do it at this point?
  • 0

Don't feed the monsters it only encourages them! LC international backer #105
User avatar
Jason_Read
Waiting for printbed temp...
 
Posts: 121
Joined: 2012-May-Wed-09-May
Reputation: 1

Re: Firmware update HOWTO

Postby ben909 » 2012-Jun-Sun-09-Jun

Jason_Read wrote:I find the idea of flashing the firmware utterly terrifying, what advantage will it give and do I really need to do it at this point?


The only reason you'd want to flash this would be if (very, very unlikely) your installed firmware was corrupted or you want to override some setting in the firmware (like e step calibration settings). If some newer version of the firmware comes out then that might be a reason you'd want to upgrade as well, but there's not one yet. You already have the latest.
  • 0

ben909
Loading filament...
 
Posts: 16
Joined: 2012-Jun-Fri-19-Jun
Reputation: 0

Re: Firmware update HOWTO

Postby ellweber » 2012-Jun-Tue-13-Jun

PxT wrote:Brook asked me to write a document on how to get started with compiling and uploading a new firmware version, for those who are interested. I wrote the doc and sent it to him but he has not responded in a couple of weeks. Rather than wait any longer for him to post it on his website I am going to put the link here. If he does respond at some point then I will update this post with the most up-to-date link.

Printrbot Firmware.pdf
http://dl.dropbox.com/u/68081994/printr ... rmware.pdf


Please let me know if any questions or feedback.


Thanks for putting this together. It would be nice if Brook would take the time to make it more readily accessible by linking it on the printrbot site. Also, it would be good to put it in the wiki.

I do have a few comments. When running the Arduino build environment on Windows XP (sp3 in my case) the hex file is deleted when the "sketch" is closed or the Arduino tool is closed. I do not see a reference to the file location scroll by at any time and the file is a bear to find as it is in a temp directory which can be hidden. In my case the file was in C:\Documents and Settings\username\Local Settings\Temp\Buildxxxxxxx\. It needs to be copied out of this directory before closing the sketch/compiler.
  • 0

ellweber
I'm an end stop.
 
Posts: 72
Joined: 2012-Mar-Thu-14-Mar
Reputation: 0

Re: Firmware update HOWTO

Postby extent » 2012-Jun-Tue-15-Jun

Hold shift while you hit compile and it will spit out the location of the HEX file when it's done in v.23 and earlier, I think that verbose output was moved into a checkbox option in 1.0 but I don't use that version so I'm not entirely sure.
  • 0

backer #48
extent
Printing skirt...
 
Posts: 150
Joined: 2012-May-Thu-03-May
Reputation: 6

Re: Firmware update HOWTO

Postby PxT » 2012-Jun-Tue-17-Jun

Good info -- I'm noting this for the next update of the doc. Thanks.
  • 0

User avatar
PxT
Print complete...
 
Posts: 1339
Joined: 2011-Dec-Mon-16-Dec
Location: Sacramento, CA
Reputation: 97

Re: Firmware update HOWTO

Postby marmil » 2012-Jun-Thu-01-Jun

extent wrote:Hold shift while you hit compile and it will spit out the location of the HEX file when it's done in v.23 and earlier, I think that verbose output was moved into a checkbox option in 1.0 but I don't use that version so I'm not entirely sure.

You are correct, in Arduino 1.0 there is a check box option for verbose output in the preferences. That's pretty cool about the holding shift trick in the previous versions--I learned something new today. :)
  • 0

CG & 3D enthusiast • Printrbot+ Kickstarter backer • Mods: GT2 belts, custom aluminum y-carriage and print bed
User avatar
marmil
Honeycomb infill 25%...
 
Posts: 284
Joined: 2011-Dec-Sat-14-Dec
Location: Glendale, California
Reputation: 6

Re: Firmware update HOWTO [Marlin]

Postby ellweber » 2012-Jun-Thu-09-Jun

Hi PxT,

In the Firmware Guide you mention seeing the Marlin version string in Pronterface. I have been unable to find that, can you please provide a little help with that part of the UI?

Thanks,

Lynn
  • 0

ellweber
I'm an end stop.
 
Posts: 72
Joined: 2012-Mar-Thu-14-Mar
Reputation: 0

Re: Firmware update HOWTO [Marlin]

Postby PxT » 2012-Jun-Thu-12-Jun

When you connect to the printer for the first time after it has been powered up you should see it say "Connected" along with the firmware version and some other text in the console area on the right side. I'm not near my printer right now so I can't provide a screenshot. Maybe someone else can help with that.
  • 0

User avatar
PxT
Print complete...
 
Posts: 1339
Joined: 2011-Dec-Mon-16-Dec
Location: Sacramento, CA
Reputation: 97

Re: Firmware update HOWTO [Marlin]

Postby ellweber » 2012-Jun-Thu-12-Jun

PxT wrote:When you connect to the printer for the first time after it has been powered up you should see it say "Connected" along with the firmware version and some other text in the console area on the right side. I'm not near my printer right now so I can't provide a screenshot. Maybe someone else can help with that.







jpg attached i all I see. I there a newer version of Pronterface, mine is from April.

Thanks for the help!

Lynn
  • 0

You do not have the required permissions to view the files attached to this post.
ellweber
I'm an end stop.
 
Posts: 72
Joined: 2012-Mar-Thu-14-Mar
Reputation: 0

Re: Firmware update HOWTO

Postby PxT » 2012-Jul-Fri-11-Jul

CL1 wrote:Just want to throw something out there to perhaps watch for. At the PrintrBoard Github, I see a note from Laine something to the effect of a revision reversing some jumper's polarity. If this is the programming jumper, it would affect your instructions here. Not now, but whenever that rev of PBd is shipped.



Confirmed that this will be in Rev D of the board and does indeed refer to the BOOT jumper. I'll try and find time to update the docs. Thanks.
  • 0

User avatar
PxT
Print complete...
 
Posts: 1339
Joined: 2011-Dec-Mon-16-Dec
Location: Sacramento, CA
Reputation: 97

Re: Firmware update HOWTO [Marlin]

Postby JiriK » 2012-Aug-Wed-12-Aug

Hi,
I just tried to compile the firmware on Mac OS X following all the steps in this guide, but all I get, when I choose Teensylu/Printrboard, is bunch of "'Serial' was not declared in this scope" errors, I tried selecting some other boards and the only ones which allow the code to compile seem to be the "Arduino Mega 2560" and "Arduino Mega (ATMega 1280)". Can anyone help me with this?

Edit: Just tried to compile it on Win 7 and it seems to be working fine, there are probably some differences between mac and win versions of the Arduino v0.22, or I just didn't copy all the files I should have copied from the win version... :roll:
  • 0

JiriK
Waiting to connect to printer...
 
Posts: 2
Joined: 2012-Aug-Mon-14-Aug
Reputation: 0

Re: Firmware update HOWTO [Marlin]

Postby PxT » 2012-Aug-Thu-22-Aug

I have just updated the document with a couple of additional steps for Mac users (and also made a note of the BOOT jumper change for Rev D board). I tested on a fresh 10.8 system that has never had the compiler installed and it worked. Let me know if any problems. Thanks for the feedback!
  • 0

User avatar
PxT
Print complete...
 
Posts: 1339
Joined: 2011-Dec-Mon-16-Dec
Location: Sacramento, CA
Reputation: 97

Re: Firmware update HOWTO [Marlin]

Postby JiriK » 2012-Sep-Mon-12-Sep

Tried it again, following the updated guide and now it compiles without problems (on OS X 10.7.4), thank you :)
  • 0

JiriK
Waiting to connect to printer...
 
Posts: 2
Joined: 2012-Aug-Mon-14-Aug
Reputation: 0

Re: Firmware update HOWTO [Marlin]

Postby Alexcheve » 2013-Jan-Mon-18-Jan

Now I see why my PB+ has a reversed Y connection and never prints a thing. I will need a PC with internet connection (I have a Mac 10.6.8) and be VERY careful with what I do. On the first place this should have been solved before PB ships its printers, oh well... I want to PRINT!
  • 0

Have Printrbot+ kit struggling assembly from January 12 to 18, use ABS for now. Cracked glass with three bolts with strings at HotBed. Am not able to print a thing yet but getting closer thanks to you.
User avatar
Alexcheve
Loading filament...
 
Posts: 21
Joined: 2012-Dec-Tue-00-Dec
Location: Queretaro, Mexico
Reputation: 0

Re: Firmware update HOWTO [Marlin]

Postby chris » 2013-Apr-Sat-21-Apr

I'm trying to follow the windows build directions from the initial instructions:
https://dl.dropbox.com/u/68081994/print ... rmware.pdf

There's no way to check to see whether this is the most current, because I don’t see any reference to this “Printerbot Firmware.pdf” at http://printrbot.com/faq/getting-started/

Where it says to choose “Teensylu/Printrboard” from the Tools –> Board menu, I’m not sure which one to use (I see):
[usbtinyisp]Teensylu/Printrboard
[BootloaderCDC]Teensylu/Printrboard

I’m guessing the 2nd one, but I’d rather know for sure...

Also, the instructions say to open Marlin.pde, which does not exist (in http://www.reprap-usa.com/download/arduino0022.zip)

What to do?
  • 0

chris
I'm an end stop.
 
Posts: 50
Joined: 2013-Jan-Sat-03-Jan
Reputation: 0

Re: Firmware update HOWTO [Marlin]

Postby PxT » 2013-Apr-Mon-11-Apr

printrbot.com has never had a link to the Firmware guide, so it's still unofficial. I have provided it to Brook but he has not linked to it from his site. I'm providing it here as a convenience. The version on my dropbox that you linked to is the latest available version.

I don't have my bot in front of me right now to double check but I think you should use the BootloaderCDC option in the Board menu.

Marlin.pde is found in the firmware source: https://github.com/PxT/Marlin/tree/master/Marlin
  • 0

User avatar
PxT
Print complete...
 
Posts: 1339
Joined: 2011-Dec-Mon-16-Dec
Location: Sacramento, CA
Reputation: 97

Re: Firmware update HOWTO [Marlin]

Postby therealmax » 2013-Apr-Fri-16-Apr

keep getting Serial not declared error anyone know how to fix this problem? compiles fine with other boards selected. just not the teensy/printrbot.
  • 0

therealmax
Waiting to connect to printer...
 
Posts: 4
Joined: 2013-Mar-Mon-22-Mar
Reputation: 0

Re: Firmware update HOWTO [Marlin]

Postby JasperJ » 2013-May-Wed-06-May

Macintosh users:
• Download the customized Arduino software from http://printrbot.com/support/instructions-guides/ and copy it to your /Applications folder.

So that one appears to have been removed.

I downloaded the Mac version of the Arduino 22 release from arduino directly, but that quite clearly isn't preconfigured for at90usb boards.
Open the Arduino preferences (⌘,) and turn on the checkbox to enable “verbose output during compilation”. Close the preferences window.

On a presumably related note, there is no such setting in my Arduino-sourced version of arduino0022.

I copied over from the windows version at http://www.reprap-usa.com/download/arduino0022.zip the hardware/at90usb1286 directory into the Arduino mac app bundle, and that gives me the appropriate Board definitions, but compiling still gives the infamous Serial not declared in this scope errors, when the printrboard target board is selected. I can see where it comes from:
Code: Select all
#if defined(__AVR_AT90USB1286__)||defined(__AVR_AT90USB1287__)
  #define MYSERIAL Serial
#else
  #define MYSERIAL MSerial
#endif

So MYSERIAL is usually MSerial and for these boards it is Serial. MSerial appears to be, logically enough, the stuff defined in MarlinSerial.cpp/h. I can't find where Serial is defined -- which is presumably the problem.

I also tried copying over the libraries (rather more extensive in the preconfigured windows version), that didn't make any difference.

Does anyone have a backup of the Mac arduino 22 custom package that used to be up at printrbot by any chance? That presumably has done some magic so that Serial is a working object?

[edit] Hm. There is *a* version of the firmware guide op on printrbot.com, but it is a much older version (4 months old by now), and has completely different content. I need to try some of the stuff suggested in that one.

[edit2] Yep, that gives me an errorfree compile. So the process is in short: Get arduino22 from arduino. Install teensyduino (use an old version of teensyduino because the latest do not support 22, only 23 and up). Copy over the at90usb1286 core from the customised windows version to teensy. Install a special boards.txt file in the teensy directory.

[edit3] In verbose:
  • Get Arduino 22 straight from arduino at http://arduino.googlecode.com/files/arduino-0022.dmg . Copy the Arduino.app inside somewhere convenient (if you want to use the up to date arduino as well, I recommend putting this one somewhere else than Applications (Mine is in Documents/Marlin Firmware/Printrboard, but it shouldn't matter) and naming it something like Arduino-22.
  • Download Teensyduino 1.10, which appears to be the last to support 0022. http://pjrc.com/teensy/td_110/teensyduino.dmg
  • Install. Right-click -> Open on late-model macs. Do not install any of the optional libraries.
  • Download the windows build env from http://www.reprap-usa.com/download/arduino0022.zip and find hardware/at90usb1286/cores in a Finder window.
  • Open a separate Finder window, navigate to the Mac app, right click -> show package contents.
  • navigate to Contents/Resources/Java/hardware/teensy/cores , which was installed by teensyduino
  • Copy the at90usb1286 from the cores directory from the windows app to the teensy/cores directory of the mac app.
  • Download and extract the files from http://blog.lincomatic.com/wp-content/u ... 286txt.zip and copy them to the teensy directory one level up, overwriting the originals.

[edit4] Yep, I didn't quite get those steps right first time, but following the recipe now found above I am able to get a clean compile of the Marlin firmware from PxT's github source.
  • 0

JasperJ
Printing skirt...
 
Posts: 155
Joined: 2013-May-Thu-11-May
Reputation: 10

Re: Firmware update HOWTO [Marlin]

Postby JasperJ » 2013-May-Wed-08-May

Right, so I packaged up my working version into a dmg, and uploaded it to a couple different hosters. The wetransfer link should go away in two weeks, hopefully someone will have hosted it somewhere more permanent by that time, and the filedropper site doesn't really get great reviews, but promises to host it longer.

http://we.tl/qxIYo866ns
http://www.filedropper.com/arduino-0022 ... rintrboard
  • 0

JasperJ
Printing skirt...
 
Posts: 155
Joined: 2013-May-Thu-11-May
Reputation: 10

Re: Firmware update HOWTO [Marlin]

Postby PxT » 2013-May-Sun-21-May

JasperJ wrote:
Macintosh users:
• Download the customized Arduino software from http://printrbot.com/support/instructions-guides/ and copy it to your /Applications folder.

So that one appears to have been removed.




That was supposed to go up at the same time as the updated instructions which you are seeing. I'll try to find out what's going on and hopefully get it posted.

My local copy, which is the one I describe in the doc, is available from https://dl.dropboxusercontent.com/u/680 ... rduino.zip
  • 0

User avatar
PxT
Print complete...
 
Posts: 1339
Joined: 2011-Dec-Mon-16-Dec
Location: Sacramento, CA
Reputation: 97

Re: Firmware update HOWTO [Marlin]

Postby MDW » 2013-Jun-Tue-21-Jun

Thank you for this guide, it was a real life-saver!

A couple of Linux (or at least, my install of Ubuntu) notes:

lsusb is useful for checking that the board is in the correct state for re-flashing.

If dfu-programmer doesn't seem to be working, try "sudo dfu-programmer". I wasted almost an hour looking for a more complicated problem.

Thanks again!
  • 0

MDW
Waiting to connect to printer...
 
Posts: 2
Joined: 2013-Jun-Tue-20-Jun
Reputation: 0

Re: Firmware update HOWTO [Marlin]

Postby RetireeJay » 2014-Jan-Wed-15-Jan

Call me timid, or call me paranoid, but I wanted to make a copy of the firmware that's already in my Plus before I erased it and re-flashed it with something new.

I'm running Windows 7. I have FLIP installed and working, connected to the Printrboard. There's a button on there to "Read" the board's memory, but when I click it, I get a message "Device Protection is Set." So what does this mean? I googled it and they are talking about locking bits that might be set in the software. Is there any work-around? Why would Printrbot have had the locking bits set? Will the locking bits interfere when I try to reprogram? In the google info that I found, it talked about the possibility of erasing the DFU bootloader. :o

Is it that the bootloader resides in a particular part of memory, and it's protected? Should I be trying to Read a subset of the entire memory to avoid the bootloader?

When programming with a new version of Marlin, is the bootloader automatically included in the rewrite of memory, or is it somehow in a "safe" zone that doesn't get touched?

(Eventually, I will publish a log of how to do this under Windows 7. So far, everything has resembled what I see in the instructions, but always just a little different and just a little harder.)
  • 1

Printrbot Plus operational January 2013
Brass threaded rods (5/16" X 18) & nuts for Z axis
GT2 belts & pulleys
Cable chain to reduce probability of fatigue failure in wires
E3D V5 Hot End, 0.4mm nozzle, also 0.8 and 0.25 in use occasionally
PB fan mount + 40mm fan -- using printed mount adapter, not the E3D supplied fan
Injection molded extruder gears
Optical Z "endstop" (custom designed and built)
Have used many pounds of T-Glase filament. Now also doing some work with Ninjaflex SemiFlex
Print on glass with Scotch Craft Stick or other glue stick
"My next printer is..." Prusa i3 MK3
User avatar
RetireeJay
My next printer is...
 
Posts: 4943
Joined: 2013-Jan-Wed-13-Jan
Location: Greenville, SC
Reputation: 496

Re: Firmware update HOWTO [Marlin]

Postby PxT » 2014-Jan-Wed-16-Jan

RetireeJay wrote:Call me timid, or call me paranoid, but I wanted to make a copy of the firmware that's already in my Plus before I erased it and re-flashed it with something new.



You can't. You clear the lock bits by erasing the firmware and re-flashing it. That allows you to read back what you just wrote but once you power-cycle out of the boot loader the bits will be set again.




RetireeJay wrote:When programming with a new version of Marlin, is the bootloader automatically included in the rewrite of memory, or is it somehow in a "safe" zone that doesn't get touched?



It is safe. You cannot harm the bootloader with a simple re-flash. To modify the bootloader you need a programming cable which connects to the dedicated ICSP header on the board.
  • 2

User avatar
PxT
Print complete...
 
Posts: 1339
Joined: 2011-Dec-Mon-16-Dec
Location: Sacramento, CA
Reputation: 97

Re: Firmware update HOWTO [Marlin]

Postby pomonabill221 » 2014-Jan-Tue-14-Jan

I was going to ask the same questions as I was getting the same "error" about the lock bit, and I didn't want to destroy the bootloader, but PxT confirmed that the bootloader is not touched when flashing through USB... WHEW!
I ALWAYS want to know these things before I cream something and create more problems than I was trying to solve.
I wanted to reflash with the autolevel firmware, but didn't want to go about it carelessly.
It would be nice to be able to save the FW that is in the board before doing something stupid, or having a problem, but it seems like this isn't possible unfortunately....
  • 0

PBplus V2 kit.
* Modded power supply (my own)
* heavier power cable (#12) and connector (Cinch-Jones 2 pin) as 4 pin ATX was getting hot!
* extruder and heated bed indicators on bot.. I like to know
* cable dressing using ideas from other members and my own
* machined Z axis couplers.. my own design
* filament guide tubing (drip sprinkler tubing).. keeps filament from possible tangling
* flat washers under ALL screw heads.. spreads out force over wood
* Al machined printbed, opto limit switches on ALL axis, Acme Z lead screws
* Highly modified printbed/stiffened
* Dual Z axis limit switches (selectable) for glass or aluminum bed
* Illuminated extruder with 2 white leds
* NOW with AUTOLEVEL!!!!
* RAMPS board with graphic display
pomonabill221
Solid infill...
 
Posts: 228
Joined: 2013-Jul-Tue-21-Jul
Reputation: 0

Re: Firmware update HOWTO [Marlin]

Postby frankv » 2015-Mar-Sun-04-Mar

Just to summarize this for any Ubuntu (probably any Linux) users following (and to record it all for myself, so I don't have to go through it again... I've spent all day sorting this out). Probably it will also be useful to some degree for Windows or Mac users.

1. Follow the instructions here http://www.pjrc.com/teensy/td_download.html. v1.6.3 of the Arduino IDE (arduino) works OK. Do not install arduino from Synaptic or Ubuntu Software Centre -- that would be v2.1, which the teensyduino installer isn't compatible with. If you install arduino as root, you will need to use sudo to run the teensyduino.64bit or .32bit installer. You may also need to
Code: Select all
sudo apt-get install flex byacc bison gcc
sudo apt-get install avrdude binutils-avr gcc-avr avr-libc gdb-avr
sudo apt-get install dfu-programmer
sudo apt-get remove --purge modemmanager

2. Download the source code from https://github.com/Printrbot/Marlin/releases -- this also has source code for boards older than ver F. For Rev-D boards with bedlevelling, should use bedlevel-v2 I think, based on http://help.printrbot.com/Guide/Reflash+the+Firmware+with+OS+X/134. The factory default hex files are available here too, if you want to skip the steps 3-6.
3. Run arduino. Go to Tools/Board and select Teensy++ 2.0. In File/Preferences, enable verbose output during compilation.
4. Open the Marlin.ino file in the source code you downloaded.
4a. The Y axis default value is wrong... at line 295 in Configuration.h, make sure it says #define INVERT_Y_DIR false
5. Click on the 'Compile' aka 'Verify' button. (Looks like a check mark).
6. In the bottom log window, you should see something like /tmp/build5669230956467214627.tmp/Marlin.cpp.hex -- this is where your output hex file is located. Copy this with Ctrl-C.
7. Short out the 'boot' pins on the Printrboard and press the reset button.
8. lsusb -- make sure you see a device including DFU in its description
9. dfu-programmer at90usb1286 erase -- if this says "no device present" use sudo
10. dfu-programmer at90usb1286 flash <firmware_hex_file> -- Paste in filename copied earlier. Again, if this says "no device present" use sudo
11. Cycle power in the PrintrBoard
12. lsusb -- make sure there is no DFU device now
13. Run RepetierHost http://www.repetier.com/download-now/ and click Connect...
14. If it won't connect
a. ls /dev and check that ttyACM1 is present.
b. Check in RepetierHost Config/Printer settings that /dev/ttyACM1 is in the list of available ports, and select it.
c. Set baud rate to 115200 (I don't know why, but 250000 won't work for me).

Regarding some of the web pages I've looked at today... many of these have useful background information, but they also have out-of-date or incomplete information which made it hard for me to figure what was what.

1. http://www.printrbottalk.com/wiki/index.php?title=User:PxT is Mac-oriented
2. http://www.printrbottalk.com/wiki/index.php?title=Firmware_Update is Windows-oriented
3. https://github.com/ErikZalm/Marlin is obsolete
4. https://github.com/MarlinFirmware/Marlin is current Marlin, but not PrintrBot-specific, and only has a development branch, no stable
5. https://github.com/Printrbot/Marlin is the PrintrBot-specific site.
6. http://help.printrbot.com/Guide/Reflash+the+Firmware+with+OS+X/134 has specifics of software and hardware versions

NB: I have only tested this to the point of successfully flashing the board, running the motors, checking the end-stops work.... I haven't actually printed anything yet! I will update this post when I know more.

If anyone thinks this might be useful but finds it difficult to follow, get back to me and I'll flesh it out.

Frank
  • 0

frankv
First blob a success!
 
Posts: 519
Joined: 2015-Jan-Thu-12-Jan
Reputation: 18


Return to Hack talk

Who is online

Users browsing this forum: No registered users and 2 guests