Error when trying to upload firmware to cr-10 I've been having trouble uploading the TH3DUF_R2 firmware to my CR-10.  I've already successfully flashed the bootloader using my Arduino,  but when I try to upload the bootloader I get this error:

avrdude: ser_open(): can't set com-state for "\\.\COM4"

Things I've tried:


Changing the usb drivers
Changing the baud rate
Using a different computers without any other usb devices


My printer is not functional right now with just a bootloader and no firmware, so I'm not really sure where to go from here.
Two possible solutions are given in this thread: Upload error: avrdude: ser_open(): can't set com-state for "\.\COM17"

This post says:


  i am able to fix this problem very easily... just press reset button on arduino and unplug from usb and go to the arduino software installation directory (c:/program files/ arduino) and open drivers folder and open 
  dpinst-amd64 by double clicking on it and just install that if it not runs may be your system runs with 32bit and open the file below the previously opened file and install it again.. close arduino programming software and open it again and choose your board and com ports and now it should upload to your board...enjoy...


Or try the solution from this post:


  I could fix this problem! Maybe this solution will works for you:
  
  
  in device manager I had unnistalled the drivers that I had. After reconnect it then it appears in "Other dispositives" with the name
  "USB 2.0Serial". There are cases that it appears like "FT232RUSB
  UART".
  my serial conversor chip on arduino uno board is "CH340G". Check this on your controller boards because others like "CN480661" has
  another fix method. If you can't find this chip maybe this video could
  help you (in spanish, sorry, is where i found the solution):
  https://www.youtube.com/watch?v=F4ar5sjbZFg
  download the drivers "CH341SE" from this url: https://www.dropbox.com/s/3csnhlsbdrznbp3/CH341SER.zip?dl=0 and then
  decompress it in a folder
  in device manager check whether the arduino is shown (reconnect it for that if you didn't do it in `step 1) then do right click -> update
  software -> browse software in the computer -> examine or browse
  Now you have to search the folder in which you decompress the drivers (step 3). After then pulse accept, ignore any advertice and
  continue. Then it will install the drivers and you will be able to use
  your arduino.
  
  
  NOTE: If in this last step windows has an error you need to enable the
  unknown digital signature installation. check other tutorials for this


These seem to be the only two solutions that worked for other people experiencing the same issue.