Problem uploading code to custom Arduino Due clone

I designed a custom Arduino Due clone pcb for a project. I was able to bootload the firmware to the atmega16u2 using the ICSP headers and the port is now being detected in the control panel and even in the Arduino IDE. But when I upload a code, I get the error "No device found at Com XX" even though it shows up in the list of ports. To reduce the size of the pcb, I had omitted the Native usb port circuitry and not given any headers for the Serial0. My only option is to upload through the Programming port as Jtag is out of my budget. How should I proceed? I have tried shorting the resistance connected to the master reset, replaced the 12MHz oscillator with a 16Mhz one. The firmware I flashed on the 16u2 is the one in \arduino-1.5.2\hardware\arduino\sam\firmwares\atmega16u2.

Do you have Tools > Board > Arduino Due (Programming Port) selected in the Arduino IDE?

Yes it is selected.
This is the error message I'm getting-
No device found on COM28
An error occurred while uploading the sketch

Please do this:

  • (In the Arduino IDE) File > Preferences
  • Uncheck the checkbox next to “Show verbose output during: compilation”
  • Check the checkbox next to "Show verbose output during: upload
  • Click “OK”
  • Sketch > Upload
  • After the upload fails, you’ll see a button on the right side of the orange bar “Copy error messages” (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply.
  • Press “Ctrl + V”. This will paste the upload output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.
Arduino: 1.8.8 (Windows 10), Board: "Arduino Due (Programming Port)"

Sketch uses 16408 bytes (3%) of program storage space. Maximum is 524288 bytes.
Forcing reset using 1200bps open/close on port COM28
C:\Users\varun\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.6.1-arduino/bossac.exe -i -d --port=COM28 -U false -e -w -v -b C:\Users\varun\AppData\Local\Temp\arduino_build_344464/due_can_rpm.ino.bin -R 
Send auto-baud
No device found on COM28
Set binary mode
An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

First off, push the Erase button for 3 seconds before uploading a new .bin file (I guess you have an Erase button...).

Then you can try uploading the .bin file with bossac as you did:

....\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.6.1-arduino\bossac -U true -e –u -w -b -R image.bin

Note : -U true is for an automatic scanning of an available COM port (will work either for a programming port or a Native USB port). Of course you'll have to adapt the name and the right path to the .bin file in the line above.