Add code to check Device Response for the commands requiring response. Test and debug of the upload command