Hello to anyone who can help! I recently bought an arduino nano clone (there isn't any writing or identifying marks on the chip), it was very cheap but now I wish I hadn't skimped! Anyways, I have read a bunch of people have had similar issues to me, and I have tried a few of the suggestions but to no avail. What I have done so far; -renamed the com port from com5 to com14. The computer and IDE do consistently pick up that it's a nano on com14 ('nano' in bold in the ide) -I have perfomed the loop back test, which it passed. -I have installed some old ch340 drivers, I think this is just giving me new errors. -I have tried selecting 'old bootlader' in the tools-processor menu in the IDE. This gives a slighlty different issue but still does not work.
I have nothing connected to the board, am trying to upload a blank piece of code. The board came with some sort of code already preloaded, it gives input and output values in the serial monitor. When I had a bunch of puts connected to the analogue inputs, I could change these values. As mentioned earlier, I have since disconnected everything and am trying to upload basically a blank code with only void setup and void loop that don't do anything.
When I select the current (up to date) bootloader, it gets stuck in the upload phase, and would seemingly try to upload forever. When I select 'old bootlader' I gate the following error; avrdude: ser_open(): can't open device "\.\COM14": Access is denied. I have tried checking for anything using the com, making sure that the serial monitor is closed before uploading the code, nothing. This makes me think that whatever code was preloaded on the board is constantly sending something (the output values of which can be seen in the serial monitor) that is using and blocking the com port. I don't know if the fact that it passed the loop test is helpful. I would appreciate any help. Regards Gareth
Hi there, thanks for the reply No it doesn't blink multiple times, when I press it, the TX led goes out, the L led flashes once, then the TX led comes on again. I hope that means something useful!
This indicates that you have the "old" bootloader on your Nano (which is common for the cheap Chinese derivative boards). This information allows us to eliminate the uncertainty about which selection you should have under Arduino IDE's Tools > Processor menu going forward.
I'm going to ask you to provide the full verbose output from an upload attempt.
This procedure is not intended to solve the problem. The purpose is to gather more information.
Please do this:
Select Tools > Processor > ATmega328P (Old Bootloader) from the Arduino IDE menus. Please leave the menu in this configuration from here on, unless a forum helper instructs you otherwise.
Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus. The "Preferences" dialog will open.
Uncheck the box next to Show verbose output during: ☑ compile in the "Preferences" dialog.
Check the box next to Show verbose output during: ☐ upload.
Click the "OK" button. The "Preferences" dialog will close.
Attempt an upload, as you did before.
Wait for the upload to fail. If you are using Arduino IDE 2.3.3, you will see a "CANCEL" button in the uploading progress notification. If the upload seems to be hanging, you might be tempted to click that button. DO NOT. This button is bugged and using it will put your computer into a bad state that will cause even otherwise valid uploads to fail with an "Access is denied" error.
You will see an "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
Open a forum reply here by clicking the "Reply" button.
Click the <CODE/> icon on the post composer toolbar. This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press the Ctrl+V keyboard shortcut (Command+V for macOS users). This will paste the error output from the upload into the code block.
Move the cursor outside of the code block markup before you add any additional text to your reply.
Make sure that nothing else is using COM14. It might be the port being locked by a previous upload attempt or something totally different.
I suspect that your board has the FT232 chip on the bottom. If you're using IDE 2.x, there is a known issue when uploading to a board with FTDI chips while the serial monitor is open. So close that if it's open.
I think those two contradict each other. The loopback usually fails if your board has the CH340.
You can determine what the serial-to-usb converter (the chip on the bottom of the board) using Windows device manager.
I'm using Windows 11; in both images, it's the bottom one in the list CH340 FT232
You can take it a step further.
Double click the entry for the port in device manager.
0403 identifies the manufacturer as FTDI and the chip as a FT232 chip.
Is that for the chip at the bottom or for the chip on the top? Note that markings can be difficult to read. I usually take a close-up photo; you might have to angle the board a little to get the right light conditions.
Ok so, sterretje, you have confirmed what I thought in that my PC does not show the serial device as a CH340. but as FT232. Anways, I did what ptillisch asked and checked the 'show verbose output during upload' , the 'show verbose output during compile was already unticked. Well, I got what I think was some unexpected behaviour, a bunch of red writing in messages, but no 'errors' so sorry I couldn't copy the error messages, coz there weren't any! Even stranger, the IDE says that it has uploaded?! At the moment my 'code' doesn't do anything, so I will write something simple that maybe outputs a pot value or something and then I will see if it is actually uploading. In any case, here is the 'verbose output' from the upload; vrdude: Version 6.3-20190619 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\user-pc\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" Using Port : COM14 Using Programmer : arduino Overriding Baud Rate : 57600 AVR Part : ATmega328P Chip Erase delay : 9000 us PAGEL : PD7 BS2 : PC2 RESET disposition : dedicated RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail : Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00 signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00 Programmer Type : Arduino Description : Arduino Hardware Version: 2 Firmware Version: 1.16 Vtarget : 0.0 V Varef : 0.0 V Oscillator : Off SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Also just to say that i dont think its the cable, as the board passed the loop back test, which tells me that data is being transferred between the PC and the board. My son's arduino uno uploads perfectly, tested it for DCS Bios last night an zero issues.
One other thing, I noticed that the ouput from whatever code was on it before is no longer outputting to the serial monitor, so I don't know if that is indicative of a successful upload of nothing. However, I have since uploaded a basic hello world program, I don't get any output from that either;
The output of the avrdude command goes to stderr and therefore it's red coloured; nothing to worry about. You will get a clear indication when it fails.
There is one additional step that can be performed during the upload and that is the reading back of the program that was send to (and hopefully programmed in) the Nano and verifying it against the code on your PC. You can enable Verify code after upload in file/preferences in the IDE and upload again.
That should print "Hello world" every second. Maybe you have selected a different baud rate in serial monitor.
Maybe try an close/open of the Serial monitor or a reboot of your PC (you probably already did that 10s of times) and check what happens.
Note: I can't find if you mentioned which IDE you're using but there is a known issue in IDE 2.x when uploading to boards with FTDI adapter when the serial monitor is open. You will get an "access denied" message as you reported in the opening post.
Sorry for not mentioning, its IDE 2.xx , i updated it recently. I checked the baud rate on the serial monitor, its also 9600, same as the code. Strange that the output of whatever code was on the board as it came from the supplier, definitely stopped as soon as i had a seemingly semi successful upload of blank code. Pitty that i cant get the hello world code to work, if i could i would say we are golden, but alas, dont know what else to try
New boards should come the the blink (not blank) example pre-installed; L-LED on for one second, L-LED off for one second. If it did not do that when you got the board you did get a faulty board and if it did something else you did get a second hand board.
Ok so, I tried to upload this code which worked perfectly with my son's arduino uno, with the IDE set to 'old bootloader, had the original problem of it taking forever, seemingly on some sort of endlessly failing attempt to upload. I would like to get this to work as I enjoy problem solving but this is getting rathe frustrating. Anyways, the code;
/* Tell DCS-BIOS to use a serial connection and use interrupt-driven communication. The main program will be interrupted to prioritize processing incoming data. This should work on any Arduino that has an ATMega328 controller (Uno, Pro Mini, many others). */ #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" DcsBios::Potentiometer pltAim9Vol("PLT_AIM9_VOL", A0); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); }
and then this, same code, 2 minutes later, after closing and reopning the IDE. Literally the only thing I have done is soldered a pot onto board. I am wondering if the board is faulty, yet it passed the loop test? Anyway, the error;
Sketch uses 3934 bytes (12%) of program storage space. Maximum is 30720 bytes. Global variables use 196 bytes (9%) of dynamic memory, leaving 1852 bytes for local variables. Maximum is 2048 bytes. "C:\Users\user-pc\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\user-pc\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM14" -b57600 -D "-Uflash:w:C:\Users\user-pc\AppData\Local\Temp\arduino\sketches\D57359851A4946B23A4E6F1240750077/PicoGamepad_copy_20240812174731.ino.hex:i"
avrdude: Version 6.3-20190619 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\user-pc\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" Using Port : COM14 Using Programmer : arduino Overriding Baud Rate : 57600
avrdude: ser_open(): can't open device "\.\COM14": Access is denied.
And now its working!! Well, not with DCS bios, but with a pot, outputing the values to the serial monitor. Had to restart the PC, restart the IDE a few times, but now it works? Hopefully it's stable now. Will report back soon.
And it works! Other than the pot working back to front in DCS but that is easily fixed. I have no idea why it seemingly randomnly started working in terms of uploading the code, but I won't complain! Thanks so much everyone
Did you click the "CANCEL" button on the upload progress notification at the bottom of the Arduino IDE window while it was in that "endlessly failing attempt to upload" state during a previous upload attempt?
I ask because there is a bug in this "upload cancel" feature that causes it to leave the upload process running. If you try another upload which the previous upload process is still running, then this "Access is denied" error will occur. The reason is that only one process at a time can have control over the serial port of the Nano board, so if the previous upload process is still using the port then the new upload process can't access it.
The way to stop an upload when it gets into the "endlessly failing attempt to upload" state is to unplug the USB cable from the board, then plug the cable back in. You will see the upload immediately fails when you do that. Alternatively, you can wait out the upload. It might seem like it is endless while you are sitting there waiting to get on with your project, but it does eventually give up and fail the upload. It just makes a ridiculous number of attempts before doing that, even though if the first attempt failed there is no hope one of the next nine is going to succeed.