Elektroda.com
Elektroda.com
X

[Solved] Arduino Nano (clone CH340) uploading

5979 19
This content has been translated » The original version can be found here
  • Level 2  
    Hello
    When it comes to programming, I am "fresh" like in Arduino programming. I am asking for help in the following matter:
    Arduino Nano (clone CH340), Windows 7 system, driver installed, after connecting the system sees Arduino as USB-SERIAL CH340 (COM12).
    When trying to load a program (basic with a flashing LED) to Arduino using Arduino 1.8.7 after a long time displays the message: Problem with uploading to the board. "

    LEDs on Arduino:
    - L flashes every 3 seconds,
    - POW - steady on (power supply, as I presume ;) )
    - EX - not lit,
    - RX will "wink" in a period of approx. 1 sec. incomplete brightness for a few seconds and then silence
    Below is a description of the errors
    Arduino: 1.8.7 (Windows 7), Board: "Arduino Nano, ATmega328P"

    The sketch uses 930 bytes (3%) of program memory. The maximum is 30720 bytes.
    Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. The maximum is 2048 bytes.
    avrdude: stk500_recv (): programmer is not responding
    avrdude: stk500_getsync () attempt 1 of 10: not in sync: resp = 0xb2
    avrdude: stk500_recv (): programmer is not responding
    avrdude: stk500_getsync () attempt 2 of 10: not in sync: resp = 0xb2
    avrdude: stk500_recv (): programmer is not responding
    avrdude: stk500_getsync () attempt 3 of 10: not in sync: resp = 0xb2
    avrdude: stk500_recv (): programmer is not responding
    avrdude: stk500_getsync () attempt 4 of 10: not in sync: resp = 0xb2
    avrdude: stk500_recv (): programmer is not responding
    avrdude: stk500_getsync () attempt 5 of 10: not in sync: resp = 0xb2
    avrdude: stk500_recv (): programmer is not responding
    avrdude: stk500_getsync () attempt 6 of 10: not in sync: resp = 0xb2
    avrdude: stk500_recv (): programmer is not responding
    avrdude: stk500_getsync () attempt 7 of 10: not in sync: resp = 0xb2
    avrdude: stk500_recv (): programmer is not responding
    avrdude: stk500_getsync () attempt 8 of 10: not in sync: resp = 0xb2
    avrdude: stk500_recv (): programmer is not responding
    avrdude: stk500_getsync () attempt 9 of 10: not in sync: resp = 0xb2
    avrdude: stk500_recv (): programmer is not responding
    avrdude: stk500_getsync () attempt 10 of 10: not in sync: resp = 0xb2
    Problem with uploading to the plate.


    The driver is current, the board and processor selected are correct, the AVRISP mkII programmer.
    Am I doing something wrong? Should I burn the bootloader beforehand?
    I tried with the second board and the cable replaced - it's the same.
    Thank you in advance for your help.
    Do you have a problem with Arduino? Ask question. Visit our forum Arduino.
  • Level 31  
    Try pressing the reset button on the board for a moment.

    Pozdr!
  • Level 2  
    Thanks, but nothing has changed; (
  • Spec of ESP32, ESP8266
    lighter1974 wrote:
    The driver is current, the board and processor selected are correct, the AVRISP mkII programmer.


    I uploaded to Nano via CH340 with the AVR ISP programmer set (without mkII).
  • Helpful post
    Level 36  
    lighter1974 wrote:
    Hello

    The driver is current, the board and processor selected are correct, AVRISP mkII programmer.
    Am I doing something wrong? Should I burn the bootloader beforehand?
    I tried with the second board and the cable replaced - it's the same.
    Thank you in advance for your help.


    Of course (!), You are making a mistake; otherwise there would be no problem with uploading the program ...

    The programmer selected in this method of communication does not matter, because you do not use it at all and this option is ignored. The programmer is used for the programming method via ICSP (MISO, MOSI, SCK, RST) bypassing the bootloader.
    Programming is done via USB / CH340 / UART (Txd / Rxd) - supported by the bootloader.

    Are you sure you have the correct options selected: ' board and processor selected are valid '? .
    Note that Nano / Clone may have a different bootloader than the original NANO (it may be 'old' standard (2k) or newer 'Opti' (512 bits).
    Try alternatively the latter option, because from your description it is not known what you have.
    Below you have the way to choose the settings, or try to choose UNO instead of NANO before compiling and trying to enter.
    Arduino Nano (clone CH340) uploading

    One of these options should work properly, and then you will find out what you have installed ...

    Max limitation program size up to 30720 indicates the use of the 'old' bootloader (2k = 2048).
    The calculation is: The processor has 32k flash mem., Which is 32768; subtract the bootloader occupation from it, i.e. 32768 - 2048 = 30720 and that's how much it stays on the program.
    After 'Opti' bootloader takes 512 bits; therefore: 32768 - 512 = 32256 - available memory space for the program.

    e marcus
  • Level 2  
    [Quote = "emarcus"]
    Are you sure you have the correct options selected: ' board and processor selected are valid '? .
    Note that Nano / Clone may have a different bootloader than the original NANO (it may be 'old' standard (2k) or newer 'Opti' (512 bits).
    Try alternatively the latter option, because from your description it is not known what you have.
    Below you have the way to choose the settings, or try to choose UNO instead of NANO before compiling and trying to enter.


    After changing the tile to OLD it helped.
    Thank you so much for the tips and help.
  • Level 36  
    lighter1974 wrote:


    After changing the tile to OLD it helped.
    Thank you so much for the tips and help.


    Well now enter the new bootloader "OPTI" and you will have a fully-stable plate -UNO, much faster in programming; 115200 baud instead of 57600 and slightly more available flash memory (difference of 1.5k).
    If you have two tiles, use one for the temporary programmer for the other.
    It is not a long or complicated process ...
  • Level 32  
    To upload a new bootloader to Arduino, the easiest way to use the clones of the USBASP programmer (troublesome in the Arduino IDE> 1.8.5, but there is information on the forum how to override AVRDUDE) or AVR ISP MKII. You can also make a programmer from another Arduino, description e.g. here: link and there are a lot of tutorials on Youtube, e.g .: link .
  • Level 29  
    I have two identical nano clones and tried to upload via ISP, but I can't. Just like the first time you started without a variable on Old bootloader, the signature doesn't match. And no matter whether we choose the old or new bootloader, it always ends in error.
  • Level 32  
    Either you have damaged equipment or you can't upload. Describe how you do it, assuming that I just landed on Earth and I have no idea how to do it, and you want to explain to me how, upload your error log (with full messages set in options), show the connection diagram you use, maybe someone will notice where do you make a mistake. As, for example, I used AVR LAB ++ with a programmer made on NANO, the only acceptable speed was 115200 (in the example sketch it is 19200). The AVRDUDE version from Arduino may also be a problem, you have to replace it with the one from AVR LAB ++ 2.4.
  • Level 29  
    In the end I bought a USBasp programmer and uploaded it the first time.

    Thank you for your willingness to help.
  • Level 32  
    You don't do exactly the same, the guy uses Arduino 1.8.3.
  • Level 29  
    He had one with the new bootloader, and I had both "left", probably because it was impossible to upload
  • Level 32  
    The bootloder is invalid in this programming mode, the AVRDUDE version is important, the new one does not support Arduino ISP and USBASP, at least that was the case with me. After installing newer as USBASP does not work, replace AVR DUDE, I recommend the one with AVR LAB link , exe and configuration file in Arduino are in different directories. You can have more errors, the easiest way to invest is in USBASP. If you have an Arduino Micro, you can also do the MKII programmer described by me here: link , works in the new version of AVR DUDE without a problem and Atmel Studio 6 and 7.
  • Level 29  
    I bought USBasp, connected the cables, in arduino I chose this programmer (USBasp) and it uploaded without problems. I did not install AVRDUDE and I see that I have avoided additional problems.
  • Spec of ESP32, ESP8266
    Wlodek22 wrote:
    I bought USBasp, connected the cables, in arduino I chose this programmer (USBasp) and it uploaded without problems. I did not install AVRDUDE and I see that I have avoided additional problems.

    What version of Arduino IDE do you have installed?
  • Level 29  
    1.8.8 (Windows Store 1.8.19.0)
    Installed from the Microsoft Store
  • Level 32  
    They probably removed this bug in a newer version.
  • Level 29  
    Not having a clue about C ++, here's what I was able to engineer for two days, where I spent one and a half trying to read the wrong modbus register.
    It is a two-phase energy monitor based on the Chinese PZEM-016 on rs485. Made in FLprog program.