Problem load sketch CJMCU TF ATMEGA32U4

Hi, let me start by saying that I'm new to this sector, but I understand a couple of things quite well. I ordered this CJMCU TF ATMEGA32U4 controller (leonardo) on Aliexpress

The problem lies in loading the sketches. Nothing ever loads. Every time I get the error "ttyACM0 Permission Denied"
.

I have already done all the necessary checks. my user was added to the dialout group, I also set all the permissions on ttyACM0 via chmod but nothing. After various searches I read that before loading the code you must hold down the button on the card. I did it, even part of the loading starts but shortly after it stops with the error "butterfly_recv(): programmer is not responding"

Here is more information regarding this controller from arduino ide:

How is it possible? I really appreciate your help because I don't know where to turn anymore, thanks.

Did you add yourself to the dialout group?

More useful info: https://support.arduino.cc/hc/en-us/articles/360016495679-Fix-port-access-on-Linux

yes, without results.

Can anyone help me?

Please do not cross post. I understand that you're not getting the solution that you need but cross post is against the rules of the forum.

You say that, but then in your screenshot the error is something different: "avrdude: ser_open(): can't open device "/dev/ttyACM0": No such file or directory":

We can see from the "[non connesso]" ("not connected") on the status bar that indeed that port does not exist on your computer:

image

Please perform this experiment to determine whether your board is producing a serial port:

  1. Disconnect the USB cable of the Arduino board from your computer.
  2. Select Tools > Port from the Arduino IDE menus.
  3. Take note of the ports, if any, listed in the menu.
  4. Close the Tools menu.
    :exclamation: The ports list is only updated when the Tools menu is re-opened, so this step is essential.
  5. Connect the Arduino board to your computer with a USB cable.
  6. Select Tools > Port from the Arduino IDE menus.

Now add a reply here on the forum thread to tell us whether you saw a new port in the Tools > Port at step (6) of the instructions.

I understood the problem, in part. This tab has a button and from what I have read it is used when loading the sketch. So before loading the sketch I held the button down and released it immediately afterwards. This starts the loading procedure (and in this way the "Permission Denied" error also disappears!). the problem comes later, i.e. when you turn the card back on after releasing the button. Since it is mapped to ACM0 upon first insertion, during shutdown it is no longer able to map to ACM0 as it is still in use in the Arduino IDE. As a result the card changes the mapping to ACM1. Now, since the IDE expects the device to be "called" ACM0 it still crashes as it cannot find it. The question now is this. Why does this happen? should I keep the button pressed? the problem is that if I don't press it the procedure doesn't start at all, with the classic "Permission Denied" error.

The IDE only expects it to be "called" ACM0 because you selected that port from the Arduino IDE menus. Simply select the real port of the board from the Tools > Port menu in Arduino IDE and you should then be able to upload to the board normally without any need for pressing the button.

Maybe I explained myself badly because of my bad English. What I mean is that the device has a name just entered into the PC and it is "ACM0". The problem arises when you press the button on this tab. When you press it it turns off and when released it turns on, consequently there will be a new reading of the device by the Linux kernel. Now since ACM0 is still busy in the IDE and it is not possible to change the settings in the IDE (because the sketch is still being loaded) the kernel changes its name to an unused one, i.e. ACM1... consequently the IDE is not finding more ACM0 goes into error with the message of the 3rd photo. It's as if I inserted a USB into the PC and instead of having /dev/sdb it has /dev/sdc because sdb is occupied by another resource...

Then the solution is clear: don't push the button.

There's another problem. If I don't press the button, the sketch in the IDE doesn't start at all and the "Permission Denied" error appears, even though the permissions are there

I'm going to ask you to post the full verbose output from an upload attempt.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Uncheck the box next to Show verbose output during: compilation in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Click the "OK" button.
  5. Attempt an upload, as you did before when you experienced the "Permission Denied" error.
  6. Wait for the upload to fail.
  7. You will see a "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  8. Open a forum reply here by clicking the "Reply" button.
  9. 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.
    Code block icon on toolbar
  10. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the error output from the upload into the code block.
  11. Move the cursor outside of the code block markup before you add any additional text to your reply.
  12. Click the "Reply" button to post the output.

Without touch button on board:

Performing a 1200-bps touch reset on the /dev/ttyACM0 serial port
Waiting for the loading port...
No upload port was found, /dev/ttyACM0 will be used instead

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 "/var/home/enzo/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
"/var/home/enzo/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude" "-C/var/home/enzo/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf" -v  -patmega32u4 -cavr109 "-P/dev/ttyACM0" -b57600 -D "-Uflash:w:/var/home/enzo/.var/app/cc.arduino.IDE2/cache/arduino/sketches/2DF60BE76A24D86D4A034766214BD8D1/sketch_mar1a.ino.hex:i"
         User configuration file is "/var/home/enzo/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
avrdude: ser_open(): can't open device "/dev/ttyACM0": No such file or directory

avrdude done.  Thank you.

exit status 1

With press button:

The sketch uses 3462 bytes (12%) of the space available for programs. The maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving another 2411 bytes free for local variables. The maximum is 2560 bytes.
Waiting for the loading port...
Upload port found at /dev/ttyACM0

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 "/var/home/enzo/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
"/var/home/enzo/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude" "-C/var/home/enzo/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf" -v  -patmega32u4 -cavr109 "-P/dev/ttyACM0" -b57600 -D "-Uflash:w:/var/home/enzo/.var/app/cc.arduino.IDE2/cache/arduino/sketches/2DF60BE76A24D86D4A034766214BD8D1/sketch_mar1a.ino.hex:i"
         User configuration file is "/var/home/enzo/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega32U4
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         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  9000  9000 0x00 0x00
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 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 : butterfly
         Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding

avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = "�]��"; type = �
    Software Version = .; Hardware Version = @.�
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader

avrdude done.  Thank you.

exit status 1

I can see you had "/dev/ttyACM0" selected as the port when you performed the "Without touch button on board" upload. We have already established that is not the correct port:

So now I will once more ask you the same thing I did a week ago without receiving the requested information:


:warning: Do not press the reset button on the board at any time while following the quoted instructions.


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