Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opening programmer "snap_isp" on port "usb" failed #1017

Closed
lkoepsel opened this issue Jun 30, 2022 · 5 comments
Closed

opening programmer "snap_isp" on port "usb" failed #1017

lkoepsel opened this issue Jun 30, 2022 · 5 comments
Labels
invalid This doesn't seem right question Further information is requested

Comments

@lkoepsel
Copy link

I'm running Manjaro (Arch Linux) and am having problems using avrdude programming an Uno with a Microchip SNAP. I have been successful using the same hardware combination and command on macOS Monterey.

avrdude -c snap_isp -p atmega328p -P usb -vv -t 

On Manjaro, I get the following:

lkoepsel@manjaroMBP  » avrdude -c snap_isp -p atmega328p -P usb -vv -t                     1 ↵

avrdude: Version 7.0
         Copyright (c) Brian Dean, http://www.bdmicro.com/
         Copyright (c) Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/lkoepsel/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : snap_isp
avrdude: stk500v2_jtag3_open()
avrdude: usbdev_open(): Found MPLAB Snap ICD CMSIS-DAP, serno: BUR190971368
avrdude: usbdev_open(): WARNING: failed to set configuration 1: Device or resource busy
avrdude: Found CMSIS-DAP compliant device, using EDBG protocol
avrdude: usbdev_send(): wrote -5 out of 912 bytes, err = Input/output error
avrdude: jtag3_edbg_prepare(): failed to send command to serial port
avrdude: failed to sync with the JTAGICE3 in ISP mode
avrdude: opening programmer "snap_isp" on port "usb" failed

avrdude done.  Thank you.

On the mac, I get the following:

avrdude -c snap_isp -p atmega328p -P usb -vv -t

avrdude: Version 7.0
         Copyright (c) Brian Dean, http://www.bdmicro.com/
         Copyright (c) Joerg Wunsch

         System wide configuration file is "/opt/homebrew/etc/avrdude.conf"
         User configuration file is "/Users/lkoepsel/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : snap_isp
avrdude: stk500v2_jtag3_open()
avrdude: usbhid_open(): No device found
avrdude: Found CMSIS-DAP compliant device, using EDBG protocol
avrdude: jtag3_edbg_prepare(): connection status 0x01
avrdude: Sending sign-on command: 0x80 (3 bytes msg)
         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
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                           Block Poll               Page                       Polled
           Memory Type Alias    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    1      0  4500  4500 0x00 0x00
           hfuse                   0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           efuse                   0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           lock                    0     0     0    0 no          1    1      0  4500  4500 0x00 0x00
           calibration             0     0     0    0 no          1    1      0     0     0 0x00 0x00
           signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00

         Programmer Type : JTAG3_ISP
         Description     : MPLAB(R) SNAP in ISP mode
avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x01, section 1, parm 0) command: 0x84 (6 bytes msg)
         Vtarget         : 5.2 V
         SCK period      : 8.00 us

avrdude: jtag3_setparm()
avrdude: Sending set parameter (scope 0x12, section 0, parm 0) command: 0x80 (3 bytes msg)
avrdude: jtag3_setparm()
avrdude: Sending set parameter (scope 0x12, section 0, parm 1) command: 0x80 (3 bytes msg)
avrdude: jtag3_setparm()
avrdude: Sending set parameter (scope 0x12, section 1, parm 0) command: 0x80 (3 bytes msg)
avrdude: AVR device initialized and ready to accept instructions

Reading |                                                    | 0% 0.00savrdude: stk500isp_read_byte(.., signature, 0x0, ...)
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: stk500isp_read_byte(.., signature, 0x1, ...)
Reading | #################                                  | 33% 0.00savrdude: stk500isp_read_byte(.., signature, 0x2, ...)
Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude>

Any guidance as to how to solve?

Thank you,
Lief

@mcuee
Copy link
Collaborator

mcuee commented Jul 1, 2022

avrdude: usbdev_open(): WARNING: failed to set configuration 1: Device or resource busy

Looks like missing udev rules to have the proper access right.
Ref: https://pypi.org/project/pyedbglib/2.10.0.43/

Or you have not installed hidapi.

Please install hidapi and set up the udev rules to see if that sorted out the issue.

@mcuee mcuee added the question Further information is requested label Jul 1, 2022
@lkoepsel
Copy link
Author

lkoepsel commented Jul 1, 2022

Thank you.
I have checked for both issues and neither seems to be the problem. I'll continue to debug and advise/close when I've solved it.

@dl8dtl
Copy link
Contributor

dl8dtl commented Jul 1, 2022

Do you have a VM system (Virtualbox, VMware) running?
In that case, check that the VM didn't grab the device. In those situations, I've seen similar error messages.

@lkoepsel
Copy link
Author

lkoepsel commented Jul 1, 2022

Thank you, @dl8dtl, however, I'm not using a VM.

I did use the example from pyedbglib and was able to get information from the device:

pedgb.py
pyedbglib version 2.20.3.105
Debugger firmware is version 1.10.249
Target voltage is 5.10V

If I disconnect the target, the voltage goes to 0.3V as expected, so clearly pyedbglib is chatting with the board.

Bloom as in https://bloom.oscillate.io/ is also able to speak to the board. I thought I might have a contention/conflict, however when I uninstalled Bloom the problem remained.

I'll continue to debug...its a bit maddening.

@lkoepsel
Copy link
Author

lkoepsel commented Jul 2, 2022

Thanks to guidance from @navnavnav, I downloaded the latest artifact and it now works.

@lkoepsel lkoepsel closed this as completed Jul 2, 2022
@mcuee mcuee added invalid This doesn't seem right labels Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants