Author Topic: Trouble uploading through the Arduino IDE on Win7 [solved:driver!]  (Read 996 times)

StanJ

  • NewMember
  • *
  • Posts: 2
Howdy!

I bought a CR R3 in September and tweaked the .ino file a couple of times for personal preferences, last time in December.  Since then I haven't updated any of the required libraries nor the IDE.  On compiles last year everything went smoothly other than a few warnings. 

Fast-forward to April: I saw you'd updated the file, and before changing anything I tried to recompile and upload my last revision.  It's a no-go.  The CR initially enumerates as a serial port, then when the IDE hits it with a reset to begin the upload the CR re-enumerates as a mass storage device and then eventually the IDE quits as it can't find the serial port any longer.  It's definitely in bootloader mode as the LPF LED is slowly breathing.  Whatever partial upload it gets from the IDE corrupts the CURRENT.EF2 file on the CR, but copying over the stored file recovers it.

Have I suddenly acquired Alzheimer's or something?  I don't see anything I'm doing differently than I did in December, yet I'll be darned if I can get it to upload through the IDE now.  I can copy the new v1.1.0 UF2 file over, but can't recompile with changes and upload. 

The only change in my environment in the last 4 months was an update to the ESP8266 board files a couple of months ago, which maybe (or likely) changed the GCC version.  I don't recall which 'programmer' I chose back last year for the CR, but none of the available options seems more likely than what I normally use, the AVRISP mkII.  That's the only point not mentioned in the CR Guide.



Please, someone DO feel free to point out the error of my ways!  :-[  I've re-read through all of the 'Compiling from source' in the Guide (twice!), and the only difference is that I leave that 'update without asking' box unchecked.  I only update manually, on purpose.  I hate surprises.

Here's the output from the IDE just as it disconnects and re-enumerates as mass storage:
Quote
"C:\\Users\\NOYB\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-size" -A "D:\\Temp\\arduino_build_584593/CurrentRanger_R3.ino.elf"
Sketch uses 82652 bytes (32%) of program storage space. Maximum is 253952 bytes.
Forcing reset using 1200bps open/close on port COM17
PORTS {COM1, COM17, } / {COM1, COM17, } => {}
PORTS {COM1, COM17, } / {COM1, } => {}                 (It's dead, Jim)
PORTS {COM1, } / {COM1, } => {}
PORTS {COM1, } / {COM1, } => {}
« Last Edit: April 30, 2021, 10:18:03 AM by Felix »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Embarrassing question about uploading through the Arduino IDE
« Reply #1 on: April 25, 2021, 08:45:37 PM »
Very strange. If you're used to uploads to SAMD boards this should be very straight forward.
But assuming the CR is the same as before and hasn't been damaged in some way, this sounds like a IDE problem of some kind. Installing other boards in the IDE should be totally fine.
After a failed upload maybe it's a good idea to reset the CR for another attempt.
I would also look at the USB cable, I've seen lots of issues because of worn out / flimsy chinese USB cables/connectors.
PS. For the stock firmware, at the moment I would recommend the 1.0.0 version.

StanJ

  • NewMember
  • *
  • Posts: 2
Re: Embarrassing question about uploading through the Arduino IDE
« Reply #2 on: April 29, 2021, 07:46:04 PM »
I finally got my CR running again.  I'd clean forgot about the CR tossing up a new serial port when it went into bootloader mode, and blindly assumed it was all OK since it'd enumerated as a mass storage device in bootloader mode.  I went back over to Sparkfun's site and saw it mentioned there.  OK, let's check devmtmt.msc while it's in bootloader mode...

Nope! Sometime in the last 4 months Win7 has decided that it didn't like the bootloader driver; I had a spat in OTHER DEVICES in the Device Manager.  I told Win7 to update the driver with the file from the directory that still had the two .INF files for the Current Ranger, and viola! it compiles and uploads at last.  Not a broken board, no brain damage, just Windoze. <shrugs>

https://learn.sparkfun.com/tutorials/samd21-minidev-breakout-hookup-guide/troubleshooting

Figured I'd post the solution in case someone else is frustrated.  :)