Marlin & bootloader

788 views
Skip to first unread message

M P

unread,
Apr 19, 2012, 6:08:47 AM4/19/12
to tvreprapug
This is not strictly a general information messages, but some people
will need this so... Here are the commands to program a naked OMC with
the bootloader, with the correct fuses.

# bootloader is loaded at 0x7c00 is as 579 words long, we need
# the bootzs at 1+0 for that, and program BOOTRST too so thats 1+0+0
avrdude -c usbasp -B 4 -p atmega644 -U hfuse:w:0xd4:m -U
lfuse:w:0xe7:m -U flash:w:bootloader-644-20MHz.hex

The "-c usbasp -B 4" needs to be replaced by whatever AVR programmer
you use. The "-B 4" is to slow down the clock, and is mandatory...

Once the bootloader is there, try the arduidiot IDE, or use the command:
avrdude -c wiring -P /dev/ttyUSB1 -p m644 -b 115200 -v -U flash:w:in/Marlin.hex

Replace the "/dev/ttyUSB1" with whatever the serial device is on the
machine you use. the "wiring" programmer is like "arduino" but also
toggle the RTS line to reset the board. You might still need to press
the reset button at the right time, it's a bit fiddly.. Might work
better in the arduidiot IDE ?

Oh, you need the jumper near R13 for the reset to work.

I include the bootloader binary, and my latest Marlin binary -- not
much changes to it appart from lowering the minimum temperature to 150
for the black PLA.

Michel

Marlin.hex
bootloader-644-20MHz.hex

mikethebee

unread,
Apr 20, 2012, 9:48:08 AM4/20/12
to tvrep...@googlegroups.com
In case it is not noted elsewhere, I will note it here. Last night we found that to use an AVR programmer on the OMC for reflashing the firmware you need the correct version of AVR-DUDE. Arduino seem to use a special version that may or may not work. (more tests needed) Al & Hannah had to update their version to avr-dude 5.11

-Mike

chrisjrob

unread,
May 26, 2012, 10:16:53 AM5/26/12
to tvrep...@googlegroups.com
I have just completed mine, using this programmer:


I found that the OMC board had to be powered up - probably obvious to our resident geniuses, but not to me.

I used the version of avrdude in the Ubuntu 12.04 repositories.  The command I used was:

$ avrdude -c avrispv2 -B 2.4 -p atmega644 -P /dev/ttyACM0 -U hfuse:w:0xd4:m -U lfuse:w:0xe7:m -U flash:w:bootloader-644-20MHz.hex

Note that I had to slow down from -B 4 to -B 2.4 to get it to load, I was just getting time-outs.

The rest of the procedure worked perfectly.

Thanks!

Chris.

Alan Wood

unread,
May 26, 2012, 4:28:32 PM5/26/12
to tvrep...@googlegroups.com
Congrats Chris, you can haz working RepRap!

regards
Al

candtalan

unread,
May 27, 2012, 9:11:39 AM5/27/12
to tvrep...@googlegroups.com, cand...@gmail.com
Thanks for this post!
I have just woken up to thinking that this is something I am going to
need.....(!)
:-)
I have finished my electronics build, up to the point of needing the
mini mod board (which I somehow seem to have missed collecting).

I have completed the non powered electronics checks ok, and have not
yet tried any power.

I am otherwise still (slowly) getting the hot end put together, and
then I will be generally wiring up.

I am not sure at which stage the flash needs to be done, but
presumably not too long now. Although my pace of build activity is
relatively slow and we have house guests soon to distract me etc.

I will be hoping at some stage to be at Reading Hackspace looking for
some help, whenever.
alan c
--
alan cocks

Ian Stratford

unread,
May 28, 2012, 7:19:53 AM5/28/12
to tvrep...@googlegroups.com, cand...@gmail.com
Wasn't Hannah doing some instructions for uploading firmware using the Arduino software? All this buggering around with programmers is a pain in the proverbial for the 'non-techie'. Also makes editing the firmware much easier.

Malcolm Napier (gmail)

unread,
May 28, 2012, 7:48:12 AM5/28/12
to tvrep...@googlegroups.com

She was, but she has been laid low by a lurgi for the last couple of weeks. The trip to the Hackspace was her first time out for 10 days and it took a lot out of her. There are signs of life today but she has a lot of catching up to do.

 

Regards,

Malcolm

candtalan

unread,
May 28, 2012, 8:05:26 AM5/28/12
to tvrep...@googlegroups.com, cand...@gmail.com
I was actually wondering somewhat hopefully, that at a certain point I
could get some direct hands on help at a Hackspace visit.....?
alan c
--
alan cocks

daprigoo

unread,
May 28, 2012, 9:15:32 AM5/28/12
to tvrep...@googlegroups.com
Does the Mega 644 in the electronics kit have an Arduino boot loader and
so can be programmed via the Arduino development tool or is it bare
metal and so need an ISP programmer (which I believe could be done via
an Arduino also)?

Ian Stratford

unread,
May 28, 2012, 9:16:35 AM5/28/12
to tvrep...@googlegroups.com, malcol...@gmail.com
Sorry, forgot she was laid low! Glad she's up and around again.

Hugo Mills

unread,
May 28, 2012, 9:34:51 AM5/28/12
to tvrep...@googlegroups.com
On Mon, May 28, 2012 at 02:15:32PM +0100, daprigoo wrote:
> Does the Mega 644 in the electronics kit have an Arduino boot loader
> and so can be programmed via the Arduino development tool or is it
> bare metal and so need an ISP programmer (which I believe could be
> done via an Arduino also)?

A bootloader exists, but the kit that's been handed out hasn't had
the chip pre-programmed with it. The build workshops at the hackspace
were one of the ways that you could get your chip programmed
(including with the bootloader), once you'd got the electronics built.

Hugo.

> On 28/05/2012 13:05, candtalan wrote:
> >I was actually wondering somewhat hopefully, that at a certain
> >point I could get some direct hands on help at a Hackspace
> >visit.....?
> >alan c
> >
> >
> >On 28/05/12 12:19, Ian Stratford wrote:
> >>Wasn't Hannah doing some instructions for uploading firmware using the
> >>Arduino software? All this buggering around with programmers is
> >>a pain in
> >>the proverbial for the 'non-techie'. Also makes editing the
> >>firmware much
> >>easier.
> >
>

--
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
--- I am but mad north-north-west: when the wind is southerly, I ---
know a hawk from a handsaw.
signature.asc

Alan Wood

unread,
May 28, 2012, 9:45:29 AM5/28/12
to tvrep...@googlegroups.com
No the bootloader has to be burnt into it using an ISP programmer, we can do that at the clinics (or at copa) if you don't have one.

regards
Al

daprigoo

unread,
May 28, 2012, 10:58:09 AM5/28/12
to tvrep...@googlegroups.com
Thanks Alan.
As I understand it you can use an Arduino as an ISP programmer;

http://reprap.org/wiki/Burning_the_Sanguino_Bootloader_using_Arduino_as_ISP

though while the above webpage lists the Sanguino, the latest Arduino IDE doesn't.

I also have access to an Atmel stk500 which is OK upto 40 pin DIL Mega packages and allows fuse settings to be changed if necessary, and a Bus Pirate (v3) which apparently can act as an ISP via AVRDUDE;

http://dangerousprototypes.com/docs/Bus_Pirate_AVR_Programming

Of the three methods I've only ever used the stk500 and that was quite a while ago...

Has anyone else tried any of these methods?

Alan Wood

unread,
May 28, 2012, 11:04:23 AM5/28/12
to tvrep...@googlegroups.com
I haven't tried it but I would assume that AvrDude supports the Atmel stk500, so if you have access to that for butning the bootloader, I would also gues it has an ISP connector and cable to do remote burns in board. If so you can utilise the OMC ISP header with the chip installed on the board to do the burning.

regards
Al

candtalan

unread,
May 28, 2012, 11:09:53 AM5/28/12
to tvrep...@googlegroups.com, cand...@gmail.com
I am planning to be at Copa on Tuesday 19th, I will bring the
electronics boards at least.
If there is a chance to burn in the chip then it would be useful.
Although in my case the mini mod board is not yet in place (I seem to
be missing his item to date)

Maybe I will also the not-quite-finished reprap also just in case any
of the new people would like to see my personal challenges!
--
alan cocks

Alan Wood

unread,
May 28, 2012, 11:10:10 AM5/28/12
to tvrep...@googlegroups.com
Sounds like the Bus pirate would also worked but again I haven't used it, as for using teh Arduino, thats probably the most difficult.

regards
Al

Alan Wood

unread,
May 28, 2012, 11:12:30 AM5/28/12
to tvrep...@googlegroups.com
Alan we can burn your bootloader no probs, I also have some spare mods which I can provide for you.

regards
Al

candtalan

unread,
May 28, 2012, 12:29:01 PM5/28/12
to tvrep...@googlegroups.com, cand...@gmail.com
On 28/05/12 16:12, Alan Wood wrote:
> Alan we can burn your bootloader no probs, I also have some spare mods
> which I can provide for you.
>
> regards
> Al

Thanks Al

--
alan cocks

Alan Wood

unread,
Jun 3, 2012, 6:55:44 PM6/3/12
to tvrep...@googlegroups.com
If you experience brown out reset problems (Like I just have) you may want to disable the Brown Out Detect using the BOD fuse settings:

avrdude -P usb -c dragon_isp -B 4 -p atmega644 -U efuse:w:0xff:m -U hfuse:w:0xd4:m -U lfuse:w:0xe7:m -U flash:w:bootloader-644-20MHz.hex

I have used a dragon to program the ISP and you may need to change this to suite your ISP programmer of course, the key addition to Michel's Fuse setting is : -U efuse:w:0xff:m this is the extended fuse setting to disable BOD features

The console should report to you that it is brown out resetting and will repeatedly do so, other symptoms may include extruder,extruder fan and possibly heated bed coming on at start up, if motors are connected you may here a regular tick/disable corresponding to the brown out reset interval.

regards
Al

Bo Herrmannsen

unread,
Nov 19, 2019, 3:45:10 PM11/19/19
to TVRepRapUG
I know i will kick up a very thick layer of dust here, but are there any left that knows what bootloader was used?

back arround late 2015 i managed to figure how to do one of these links you add to the arduino ide that allows you simply add a board and the ide pull down a whole package with bootloader and board definitions, thou i have never tested this and seen if it works

now that i have a lot more time to thinker again i have asked Malcolm if he had any spare round3 electronics and my aim is to use that to keep an updated fork of marlin, mostly for nostalgia but also if luck shines on me have a working round3 printer so that i can do practical test and non-important prints

i made this small instructions back then: https://github.com/ThamesValleyReprapUserGroup/Beta-TVRRUG-Mendel90/blob/master/Added-Documents/How%20to%20add%20OMC%20to%20ID%201.6.8.md

but could still be interesting to know how the bootloader bootloader-644-20MHz.hex was made
Reply all
Reply to author
Forward
0 new messages