Upload error 0xc0000135 and cfgmgr.dll

Hi All,

First off, thank you all for the excellent resource this forum provides. I think it speaks volumes that in a decade of playing with Arduino, this is the first problem that I haven't been able to solve with the information in this forum.

I've recently been forced to use a new computer, and this new setup repeatedly fails to upload any sketch that I've tried to the Arduino board. Some background info:

  • Windows 10 64bit
  • Arduino IDE 2.1.1 installed using the 'Win 10 and newer, 64 bits' install download
  • Adafruit METRO 328 board (Arduino UNO R3 compatible)
  • loopback test is successful - board is communicating on port COM5

Below is the verbose compiler and upload output, when using the example sketch Blink.ino built into the IDE:

FQBN: arduino:avr:uno
Using board 'uno' from platform in folder: C:\Users\matri\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\matri\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Detecting libraries used...
"C:\\Users\\matri\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\matri\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\matri\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "C:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035\\sketch\\Blink.ino.cpp" -o nul
Generating function prototypes...
"C:\\Users\\matri\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\matri\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\matri\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "C:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035\\sketch\\Blink.ino.cpp" -o "C:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Users\\matri\\AppData\\Local\\Arduino15\\packages\\builtin\\tools\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Users\\matri\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\matri\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\matri\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "C:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035\\sketch\\Blink.ino.cpp" -o "C:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035\\sketch\\Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core: C:\Users\matri\AppData\Local\Temp\arduino\cores\arduino_avr_uno_16b3a71eb4c9ead8de197cd666125757\core.a
Linking everything together...
"C:\\Users\\matri\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035/Blink.ino.elf" "C:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035\\sketch\\Blink.ino.cpp.o" "C:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035/..\\..\\cores\\arduino_avr_uno_16b3a71eb4c9ead8de197cd666125757\\core.a" "-LC:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035" -lm
"C:\\Users\\matri\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035/Blink.ino.elf" "C:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035/Blink.ino.eep"
"C:\\Users\\matri\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035/Blink.ino.elf" "C:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035/Blink.ino.hex"

"C:\\Users\\matri\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-size" -A "C:\\Users\\matri\\AppData\\Local\\Temp\\arduino\\sketches\\A920CEAA20100D2C2AD8D68596030035/Blink.ino.elf"
Sketch uses 924 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\matri\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\matri\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v  -patmega328p -carduino "-PCOM5" -b115200 -D "-Uflash:w:C:\Users\matri\AppData\Local\Temp\arduino\sketches\A920CEAA20100D2C2AD8D68596030035/Blink.ino.hex:i"
Failed uploading: uploading error: exit status 0xc0000135

One time while experimenting I received 'exit status 0xc000007b' but I have never been able to recreate this error.

Using the guidance from this post: https://forum.arduino.cc/t/failure-with-ide-2-0-and-megacorex/
I was able to identify cfgmgr32.dll as a potential culprit related to avrdude.exe

The problem is this file exists in the correct folder:

Things I have tried:

  • Uninstalling Arduino IDE, restarting computer, reinstalling Arduino IDE
  • Loosening access permissions to the System32 folder
  • Placing cfgmgr32.dll in the Arduino IDE installation root folder
  • Replacing cfgmgr32.dll in System32 folder with a newly downloaded version (suspecting it may have been corrupted)
  • Grasping at straws, I've tried both 32-bit and 64-bit versions of cfgmgr32.dll in the System32 folder

Are there any other suggestions on what to try? I don't have easy access to another computer, so I'm very hopefully on getting this setup working.

Thanks in advance!

  • Arduino IDE 2.1.1 installed using the 'Win 10 and newer, 64 bits' install download

Do you see this error with IDE 1.8.19?

If this is only a 2.1 issue, you can have a moderator move this to the ide 2.x section of the forum.

Thanks for the feedback and suggestion.

I tried using Arduino IDE 1.8.19 and it seems the software doesn't run on this computer, only loading the splash screen then halting.

Using the 'Win 7 and newer' install option produces the following debug information in Powershell:

PS C:\Program Files (x86)\Arduino> & ".\arduino_debug"
java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\Arduino\lib\listSerialsj.dll: Can't find dependent libraries
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
        at java.lang.Runtime.load0(Runtime.java:809)
        at java.lang.System.load(System.java:1086)
        at processing.app.Platform.loadLib(Platform.java:148)
        at processing.app.Platform.<clinit>(Platform.java:143)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at processing.app.BaseNoGui.initPlatform(BaseNoGui.java:514)
        at processing.app.Base.<init>(Base.java:210)
        at processing.app.Base.main(Base.java:150)
C:\Program Files (x86)\Arduino\lib\listSerialsj.dll: Can't find dependent libraries
Cannot load native library C:\Program Files (x86)\Arduino\lib\listSerialsj.dll
The program has terminated!
PS C:\Program Files (x86)\Arduino>

Using the zip package produces similar debug information in Powershell:

PS C:\Users\matri\Downloads\arduino-1.8.19> & ".\arduino_debug"
java.lang.UnsatisfiedLinkError: C:\Users\matri\Downloads\arduino-1.8.19\lib\listSerialsj.dll: Can't find dependent libraries
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
        at java.lang.Runtime.load0(Runtime.java:809)
        at java.lang.System.load(System.java:1086)
        at processing.app.Platform.loadLib(Platform.java:148)
        at processing.app.Platform.<clinit>(Platform.java:143)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at processing.app.BaseNoGui.initPlatform(BaseNoGui.java:514)
        at processing.app.Base.<init>(Base.java:210)
        at processing.app.Base.main(Base.java:150)
C:\Users\matri\Downloads\arduino-1.8.19\lib\listSerialsj.dll: Can't find dependent libraries
Cannot load native library C:\Users\matri\Downloads\arduino-1.8.19\lib\listSerialsj.dll
The program has terminated!
PS C:\Users\matri\Downloads\arduino-1.8.19>

In both cases, Arduino IDE fails to find listSerialsj.dll, though similar to my first post, this file does exist and is in the correct location:

I fear this suggests I'm having a broader problem with this computer. Unfortunately, troubleshooting Windows registries is well outside my skill level. I'll try reinstalling Windows on the weekend to see if that resolves the issue.

Thanks again!

If reinstalling windows does not fix your issues, then one additional idea is to try using the MegaCoreX boards package.

It uses a newer version of avrdude and it may have different dll dependencies.

You can install MegaCoreX with the boards manager following these instructions.

avrdude: Version 7.1-arduino.1  //megaCoreX
avrdude: Version 6.3-20190619  //megaavr

Thanks cattledog for your continued troubleshooting advice.

As an update, I reinstalled Windows and now Arduino IDE is successfully uploading to the Uno.

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.