This solution article explains how to make a custom .Hex (firmware) file.

Step 1. Download and install Arduino V1.0.6 (do not use a different version) from the official Arduino website. 

Step 2. Start the program

Step 3. Select the correct board (Arduino Mega 2560 or Mega ADK) at Tools/Board

Step 4. At "preferences" make sure "Show verbose output during:  -compilation- "  is checked. 

Step 5. Open the .ino file from your firmware, and make sure the related files are opened in tabs

Step 6. Click the "Verify" button, and let the process complete. 

Step 6. Find the location of your .hex file in the verbose output report

Step 7. Copy the .hex file to a usb-storage device

Step 8 Turn on your 3D printer, and complete the home-sequence if needed. 

Step 9. On the user-interface of your 3D printer, browse to update firmware location, browse USB for the .hex file, and choose 'flash'

Step 10. Wait for the process to be finished. This is normally finished in less then 1 minute.