Go Down

Topic: Cannot upload to SAMD21 MINI-PORT BUSY (Read 613 times) previous topic - next topic

TheRealdps

Aug 10, 2019, 06:53 pm Last Edit: Aug 11, 2019, 07:04 am by TheRealdps
hello all, as the title entails I am not able to upload anything to my SAMD21 MINI board, like the blink sketch for example. All of my other (non-arm boards, AVR) work perfectly, but just not these two. I followed the guide that tells you to add the boards in board manager, and then I made sure I was added to dial out in my system. Still nothing. On the desktop IDE it gives these errors (sorry it wouldn't let me copy the error for some reason)

Code: [Select]

Uploading using selected port: /dev/ttyACM0
/home/dps/arduino-1.8.9/hardware/tools/avr/bin/avrdude -C/home/dps/arduino-1.8.9/hardware/tools/avr/etc/avrdude.conf -v -v -patmega2560 -cstk500v2 -P/dev/ttyACM0 -b57600 -Uflash:w:/tmp/arduino_build_180607/sketch_aug11a.ino.hex:i

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/dps/arduino-1.8.9/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/dps/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : stk500v2
         Overriding Baud Rate          : 57600
avrdude: ser_open(): can't open device "/dev/ttyACM0": Device or resource busy

avrdude done.  Thank you.

Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
processing.app.SerialException: Error opening serial port '/dev/ttyACM0'.
 at processing.app.Serial.<init>(Serial.java:147)
 at processing.app.Serial.<init>(Serial.java:82)
 at processing.app.SerialMonitor$4.<init>(SerialMonitor.java:101)
 at processing.app.SerialMonitor.open(SerialMonitor.java:101)
 at processing.app.AbstractMonitor.resume(AbstractMonitor.java:104)
 at processing.app.Editor.resumeOrCloseSerialMonitor(Editor.java:2126)
 at processing.app.Editor.access$1300(Editor.java:115)
 at processing.app.Editor$UploadHandler.run(Editor.java:2104)
 at java.lang.Thread.run(Thread.java:748)
Caused by: jssc.SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Port busy.
 at jssc.SerialPort.openPort(SerialPort.java:164)
 at processing.app.Serial.<init>(Serial.java:136)
 ... 8 more
Error opening serial port '/dev/ttyACM0'.

TheRealdps

There we go, I finally figured out how to get the right error messages here!

TheRealdps

Ok, so I tried to switch to a different port (from acm to s0), and the output is different now, and the led changes. The led actually just switched off and isnt blinking now, and the output in the IDE just keeps repeating "timeout communicating with programmer", and "stk500v2_receiveMessage() : timeout", and "ser_recv(): programmer is not responding"

pert

The first thing you need to do is figure out which port is the port of your Arduino board.

Try this:
  • With the Arduino board unplugged from the USB open the Tools > Port menu and note the listed ports. If the Port menu is gray and disabled then that means there are no ports available.
  • Close the Tools > Port menu.
  • Plug in the USB cable on the Arduino board
  • Wait a little while for the Arduino board to connect
  • Open Tools > Port, the new port on the list is your Arduino board.
  • Select your Arduino's port from the menu.


Once you have the correct port selected, try an upload. If that fails, post the full output here.

TheRealdps

is there anyway to stop the sketch from uploading? It seems that it just wants to keep uploading and uploading without stopping (following your instructions, which seem to work).

TheRealdps

Well, what's weird is that its actually uploading to the board. At least it seems to have accepted the "blink" sketch, because it is blinking now lol

TheRealdps

#6
Aug 11, 2019, 05:49 pm Last Edit: Aug 11, 2019, 05:50 pm by TheRealdps
ok, so I tried it again a few times and it finally stopped uploading (but it did actually upload the blink sketch). Here are the error messages:

Code: [Select]
Arduino: 1.8.9 (Linux), Board: "Arduino M0 Pro (Native USB Port)"

Sketch uses 11536 bytes (4%) of program storage space. Maximum is 262144 bytes.
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
Forcing reset using 1200bps open/close on port /dev/ttyACM1
PORTS {/dev/ttyACM1, /dev/ttyS0, } / {/dev/ttyS0, } => {}
PORTS {/dev/ttyS0, } / {/dev/ttyS0, } => {}
PORTS {/dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {/dev/ttyACM0, }
Found upload port: /dev/ttyACM0
/home/dps/arduino-1.8.9/hardware/tools/avr/bin/avrdude -C/home/dps/arduino-1.8.9/hardware/tools/avr/etc/avrdude.conf -v -v -patmega2560 -cstk500v2 -P/dev/ttyACM0 -b57600 -Uflash:w:/tmp/arduino_build_37156/Blink.ino.hex:i

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/dps/arduino-1.8.9/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/dps/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : stk500v2
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega2560
         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    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  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 : STK500V2
         Description     : Atmel STK500 Version 2.x firmware
         Programmer Model: AVRISP
         Hardware Version: 3
         Firmware Version Master : 4.05
         Vtarget         : 0.0 V
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "/tmp/arduino_build_37156/Blink.ino.hex"
avrdude: writing flash (28064 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 28064 bytes of flash written
avrdude: verifying flash memory against /tmp/arduino_build_37156/Blink.ino.hex:
avrdude: load data flash data from input file /tmp/arduino_build_37156/Blink.ino.hex:
avrdude: input file /tmp/arduino_build_37156/Blink.ino.hex contains 28064 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.00s

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


TheRealdps

#7
Aug 11, 2019, 11:32 pm Last Edit: Aug 11, 2019, 11:35 pm by TheRealdps
Ok so IDK whats going on, I just tried it again and it went through perfectly. I havent changed any settings, all I did was plug it back in when I got back home, and tried uploading the blink sketch to it, and it worked like a charm. Now, after trying after the time it worked like a charm, it goes back to the infinite upload, but the board acts like its uploaded to it

pert

The below was written in response to your reply with the error output:

The output shows that the flashing step of the upload was successful and the reading part of the verification step of the upload finished, but then there should be a message like:
Code: [Select]
avrdude: verifying ...
avrdude: 28064 bytes of flash verified

which is missing. It's like avrdude is silently failing at the end of the verification. That is not normal. Usually when avrdude fails it gives a nice descriptive error message. I'm not sure what could cause this. We do get rare reports of this sort of silent avrdude failure but they are usually earlier in the upload process. I don't know that we have pinpointed a specific cause of that.

Please try this:

Attempt an upload in the Arduino IDE.

Examine the output in the black console window to find the upload command generated by the Arduino IDE. Select that command and copy it (Ctrl + C). In the last output you posted the command was:
Code: [Select]
/home/dps/arduino-1.8.9/hardware/tools/avr/bin/avrdude -C/home/dps/arduino-1.8.9/hardware/tools/avr/etc/avrdude.conf -v -v -patmega2560 -cstk500v2 -P/dev/ttyACM0 -b57600 -Uflash:w:/tmp/arduino_build_37156/Blink.ino.hex:i
but it may be different the next time you try to upload (because the build folder changes every time you restart the Arduino IDE) so do a fresh upload and get the fresh command from it.

Press the reset button on your M0 board twice in quick succession. You should now see the on board LED pulsing. This indicates the board has been put into bootloader mode.

Start a Linux console window.

Paste (Ctrl + V) the upload command into the console.

Press Enter.

Tell us what the results are of running the upload command from the command line.

TheRealdps

#9
Aug 12, 2019, 06:54 pm Last Edit: Aug 12, 2019, 06:56 pm by TheRealdps
Ok, so I opened up a fresh instance of the IDE and (since the port wasnt already selected) chose the port (dev/tty/ACM1 (Arduino M0 native usb), and then uploaded the sketch, and it finished without messing up. It flashed, and then said "avrdude done, thank you".
 

  I closed the instance out and reopened the IDE, and went to select the port but it was already selected. So I left that alone and hit "upload". Now it's just sitting at "uploading", but the board did already accept the upload. I notice that it deselected the port that I chose, I checked to see... and theres nothing selected in "port".

The second upload just finished, here is the output:
Code: [Select]
Arduino: 1.8.9 (Linux), Board: "Arduino M0 Pro (Native USB Port)"

Sketch uses 11536 bytes (4%) of program storage space. Maximum is 262144 bytes.
Forcing reset using 1200bps open/close on port /dev/ttyACM0
PORTS {/dev/ttyACM0, /dev/ttyS0, } / {/dev/ttyS0, } => {}
PORTS {/dev/ttyS0, } / {/dev/ttyS0, } => {}
PORTS {/dev/ttyS0, } / {/dev/ttyACM0, /dev/ttyS0, } => {/dev/ttyACM0, }
Found upload port: /dev/ttyACM0
/home/dps/arduino-1.8.9/hardware/tools/avr/bin/avrdude -C/home/dps/arduino-1.8.9/hardware/tools/avr/etc/avrdude.conf -v -v -patmega2560 -cstk500v2 -P/dev/ttyACM0 -b57600 -Uflash:w:/tmp/arduino_build_622437/Blink.ino.hex:i

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/dps/arduino-1.8.9/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/dps/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : stk500v2
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega2560
         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    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  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 : STK500V2
         Description     : Atmel STK500 Version 2.x firmware
         Programmer Model: AVRISP
         Hardware Version: 3
         Firmware Version Master : 4.05
         Vtarget         : 0.0 V
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "/tmp/arduino_build_622437/Blink.ino.hex"
avrdude: writing flash (28064 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 28064 bytes of flash written
avrdude: verifying flash memory against /tmp/arduino_build_622437/Blink.ino.hex:
avrdude: load data flash data from input file /tmp/arduino_build_622437/Blink.ino.hex:
avrdude: input file /tmp/arduino_build_622437/Blink.ino.hex contains 28064 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.00s

avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
Couldn't find a Board on the selected port. Check that you have the correct port selected.  If it is correct, try pressing the board's reset button after initiating the upload.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.



Here is the output of me grabbing that new command from the IDE's black console, and trying it in the terminal. I havent messed with anything, I just typed it out EXACTLY how it was in the IDE output:

Code: [Select]
avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/dps/arduino-1.8.9/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/dps/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

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

avrdude done.  Thank you.



I'm suspecting that the reason that it didnt find that "file or directory" has something to do with the fact that it didnt show the M0 in the selected port anymore... like it had uploaded and then reset the board, so it had changed the location of the board.

TheRealdps

Also, I think I should add that it is only doing this on the SAMD21 based boards that I have, and not on any of the other AVR based board (i.e 2560, or the nano)

TheRealdps

I'm really new to this, so I apologize if I haven't provided the correct information. If I didn't, please let me know and I will try my best to correct it... I promise. This has become my life here recently, well... this and GNU/Linux ecosystem. So, improving anything that I can and in any way that I can is top priority for me. Also, I'm always ready to be taught. I really am dedicating myself, so if anyone sees this, and needs an Apprentice, I'm all ears.

Meyers569

#12
Aug 17, 2019, 01:15 pm Last Edit: Aug 21, 2019, 06:42 am by Meyers569
Feather is the new development board from Adafruit, and like it's namesake it is thin, light, and lets you fly! We designed Feather to be a new standard for portable microcontroller cores mywegmansconnect

Go Up