Fixed. For anyone who might encounter this issue : Make sure pin 0 and 1 are not in use while uploading to the board