1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Learning to compile the Marlin Firmware - step by step, cause I was a dummy...

Discussion in 'Troubleshooting' started by supercazzola, Feb 10, 2018.

  1. supercazzola

    supercazzola Active Member

    Joined:
    Jun 1, 2017
    Messages:
    380
    Likes Received:
    98
    I am starting from scratch. I had zero experience compiling Marlin. Took me half the day. Figured I would share the steps so you, too, could start to play with the features in Marlin that Robo is not using yet.

    Hope this post will help others too timid to try. It is really not all that crazy, but seems overwhelming at first.

    Here is what I did.
    Before I tackled compiling Waldo's version of the Marlin f/w, I started with Robo's, just to convince myself I could. Then I moved on to the excellent work @WheresWaldo did, with the hopes of using UBL and eventually the g-code controlled lighting mod. I already have the light mod that @Kilrah came up with, and love it. Thank you both for all of your contributions to these forums. Along with others, you have helped me numerous times.

    Without further delay, the steps:

    1. installed GitHub desktop from here: https://desktop.github.com/
    2. installed Arduino IDE from here: https://www.arduino.cc/en/Main/Software
    3. in the GitHub IDE, I downloaded the Robo f/w from https://github.com/Robo3D/Marlin
    4. in the Arduino IDE, I opened this file: Marlin.ino
    5. in the Arduino IDE, I tried to compile, and quickly got an error: Pins for this chip not defined in Arduino.h!
    6. in the Arduino IDE, I set the board type to Arduino / Genuino Mega or Mega 2560. I got this info from reading through @WheresWaldo comments in his code. It wasn't obvious to me, so that is why I am emphasizing it here. Tried to compile again, success in compiling.
    7. in the Arduino IDE, I chose sketch, export compiled binary. That made the hex files (for R2 and C2).
    8. now the fun began. I downloaded @WheresWaldo version from here: https://github.com/WheresWaldo/Marlin_for_R2/tree/1.1.8
    9. in the Arduino IDE, I opened the Marlin.ino file inside the folder from @WheresWaldo
    10. compiled it and exported the hex file. Now once the parts come in from China, I will be able to make the light mods as specified in this excellent mod: http://community.robo3d.com/index.php?threads/g-code-controlled-case-lighting.19871/
    In the meantime, I will load the hex file from #10 above and try to get UBL working with my R2, as outlined by @WheresWaldo in this thread: http://community.robo3d.com/index.php?threads/marlin-for-the-r2-ubl-enabled.19405/

    Thanks again, and I hope this thread will help owners of the R2 play more with the capabilities of Marlin on their R2.
     
    #1 supercazzola, Feb 10, 2018
    Last edited: Feb 10, 2018
    Bogiewon and Geof like this.
  2. tkoco

    tkoco - -.- --- -.-. ---
    Staff Member

    Joined:
    May 7, 2018
    Messages:
    626
    Likes Received:
    243
    Is there a way to "unbrick" the main board when it refuses to flash firmware?
     
  3. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    22,446
    Likes Received:
    7,187
    The Arduino Mega has a couple of ways to forcibly clear/overwrite the program memory. I am not sure if the Robo custom board supports any of that...
     
  4. tkoco

    tkoco - -.- --- -.-. ---
    Staff Member

    Joined:
    May 7, 2018
    Messages:
    626
    Likes Received:
    243
    Any links to that information?
     
  5. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    22,446
    Likes Received:
    7,187
  6. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    22,446
    Likes Received:
    7,187
    It is possible (but not likely) that Robo used a custom bootloader on their board.
     

Share This Page