Compiling and installing firmware under mac osx

Code hacking talk

Compiling and installing firmware under mac osx

Postby plexus » 2012-Dec-Fri-18-Dec

This firmware building experience is focused on getting a Panelolu working with the Printrbot. The Panelolu is an LCD control panel system designed by Think3dPrint3d info can be found here http://reprap.org/wiki/Panelolu. The Panelolu requires a slight modification of the Printrboard firmware. There are numerous instructions on how to edit, compile and install the firmware but none of them were a one-stop-shop for direction on how to do it. I had to work through these different instructions to come up with the ones below, especially because there is no instructions on how to do with mac osx.

These instructions were performed with 10.8.2. on a macbook pro. i wouldn't be able to say if these instructions will work with other versions of osx.

[/b][/size]
  1. download Lincomatic's firmware fork from here https://github.com/lincomatic/Marlin using the ZIP button near the top
  2. download Arduino software v022 from here http://arduino.cc/en/Main/Software under Previous IDE Versions
  3. download Teensyduino v1.1 from here http://pjrc.com/teensy/td_download.html
  4. unzip Lincomatic's firmware
  5. move the Arduino.app from the dmg of the 022 software to your computer
  6. run Teensyduino and point it to the Arduino.app and install. I selected all and installed because I didn't know any better (I still dont)
  7. use show package contents on the Arduino.app and navigate to /Arduino.app/Contents/Resources/Java/hardware/teensy
  8. following this blog post http://blog.lincomatic.com/?p=502 unpack the at90usb1286txt.zip (which I have also included in this post) and copy all the files into the above teensy folder, over-writting boards.txt
  9. run Arduino.app
  10. in the Tools menu, under Board select [BootloaderCDC]Teesylu/Printrboard, from the Serial Port menu select dev.tty.usbmodem12341
  11. when you compile with Arduino.app, hold Shift when you click to compile. this enables verbose mode. the last line will tell you where the firmware file is. mine looked like this:
    Code: Select all
    /var/folders/hd/xlbvl1sd561cg7d95ys_5qz00000gq/T/build5805269487307849084.tmp/Marlin.cpp.hex
  12. click the > button in the upper right (press SHIFT while clicking for the verbose output that will give you the directory where the firmware was written)
  • 0

You do not have the required permissions to view the files attached to this post.
User avatar
plexus
Site Admin
 
Posts: 2115
Joined: 2011-Dec-Mon-16-Dec
Location: Toronto, Canada
Reputation: 95

Compiling and installing firmware under mac osx

Sponsor

Sponsor
 

Re: Compiling new firmware under mac osx

Postby plexus » 2012-Dec-Sat-14-Dec

These instructions pertain to the PBHQ Printrboards which typically have the DFU bootloader installed. many non-HQ Printrboards have a different bootloader, usually CDC. With the CDC bootloader you can install the firmware right from the Arduino.app IDK by following these instructions which are part of my compiling instructions just before this post. If it has the DFU bootloader, you have install the firmware outside of the Arduini.app IDK by using the dfu-programmer command discussed.

Installing the Firmware

  1. navigate to the tmp file indicated in the verbose compile output (by pressing control when click compile) and copy the Marlin.cpp.hex from that directory file to another location. this is the new firmware file
  2. i am not sure if this was needed, but I downloaded the Cross Pack for AVR Development from http://www.obdev.at/products/crosspack/download.html. i had read that it was needed, so i installed this. I used CrossPack-AVR-20121207.dmg
  3. in this post http://forum.retrode.org/index.php?topic=53.0 there is a link to a pre-compiled dfu-programmer file. download the zip and unpack. I have included the zip here
  4. move the Marlin.cpp.hex file into the directory with dfu-programmer
  5. run Terminal.app
  6. navigate to the dfu-programmer folder above
  7. plug in your Printrboard, enter dfu mode (revB: remove the jumper and press reset. revD: add a jumper and press reset)
  8. type the command
    Code: Select all
    ./dfu-programmer at90usb1286 erase
  9. type the command
    Code: Select all
    ./dfu-programmer at90usb1286 flash Marlin.cpp.hex

those commands will first erase the firmware in the board and then re-flash with the new firmware. when flashing it should output Validating... and then the number of bytes used

In Arduino.app, in the Marlin tab, I changed the line
Code: Select all
#define VERSION_STRING  "1.0.0"

to
Code: Select all
#define VERSION_STRING  "1.314.0"

only so I could see if the firmware got installed ok...

After the install, I reset the board back to normal mode and ran Repetier-host and connected. This was the output:
Code: Select all
Attempting to connect to printer
Connection opened
Marlin 1.314.0
FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:http://www.mendel-parts.com PROTOCOL_VERSION:1.0 MACHINE_TYPE:Mendel EXTRUDER_COUNT:1


You can see the Marlin 1.314.0 which is a good sign the firmware build was installed (because it has the same version number as intended).

I still have yet to test the firmware. I am only doing this at the moment on a spare board not connected up to the printer.
  • 0

You do not have the required permissions to view the files attached to this post.
User avatar
plexus
Site Admin
 
Posts: 2115
Joined: 2011-Dec-Mon-16-Dec
Location: Toronto, Canada
Reputation: 95


Return to Hack talk

Who is online

Users browsing this forum: No registered users and 2 guests