Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problem when trying to burn bootloader (Read 9236 times)
Felipe
Junior Member
**
Offline


Posts: 12
Joined: Sep 16th, 2015
Problem when trying to burn bootloader
Sep 19th, 2015 at 7:16pm
Print Post  
Hi,

I'm using Atmel Studio 6.2 and I'm trying to burn a bootloader an arduino nano using an AVR ISP mkII. I'm selecting the Atmel Studio AVR ISP mkII (ISP) option in the programmer list and every time I try to burn the bootloader, this error shows up.

Any pointers?

Code
Select All
"Burning bootloader to board 'Arduino Nano w/ ATmega328' using 'Atmel Studio AVRISP MkII (ISP)'
System.Exception: Burn bootloader failed with an exception ---> Visual.Micro.MiroAppAPI.debug.RunnerException: avrdude: invalid isp clock delay specified 'ISP'

   at Visual.Micro.MiroAppAPI.debug.Uploader.executeUploadCommand(ICollection commandDownloader, String workingPath)
   at Visual.Micro.MiroAppAPI.debug.Uploader.executeUploadCommand(ICollection commandDownloader)
   at  programmerPrefs, String programmer)
   --- End of inner exception stack trace ---
   at  programmerPrefs, String programmer)
   at Visual.Micro.MiroAppAPI.debug.AvrdudeUploader.burnBootloader(Board boardPreferences, String programmerName) 

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problem when trying to burn bootloader
Reply #1 - Sep 20th, 2015 at 3:56pm
Print Post  
Hi,

The (Atmel) programmer options are non standard arduino and are contributions from users that I can extend as required.

This error means the clock delay switch is either wrong or missing for the programmer definition

You can edit the definition via the programmers.atmel.txt below the visual micro hardware folder.

The file/folder is probably in:-

C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\arduino16x\hardware\avr\programmers.atmel.txt

You can either change or create an entry in the txt file. The current one is:-

Code
Select All
atprogram_avrispmkii_isp.name=Atmel Studio AVRISP MkII (ISP)
atprogram_avrispmkii_isp.program.tool=atprogram
atprogram_avrispmkii_isp.program.extra_params=-t avrispmk2 -i ISP
atprogram_avrispmkii_isp.help=Connect the programmer to the ICSP port
 



but you could add a new entry to try different settings

Code
Select All
atprogram_avrispmkii_isp_custom1.name=Atmel Studio AVRISP MkII (ISP) (Custom1)
atprogram_avrispmkii_isp_custom1.program.tool=atprogram
atprogram_avrispmkii_isp_custom1.program.extra_params=-t avrispmk2 -i ISP
atprogram_avrispmkii_isp_custom1.help=Connect the programmer to the ICSP port
 




After changing the "extra_params" value to have the correct values you can either restart atmel studio or click "tools>visual micro>reload toolchains"

If you find the correct values please post and I will add support to the next release of visual micro.

Thanks
  
Back to top
WWW  
IP Logged
 
Felipe
Junior Member
**
Offline


Posts: 12
Joined: Sep 16th, 2015
Re: Problem when trying to burn bootloader
Reply #2 - Sep 20th, 2015 at 6:21pm
Print Post  
I've run the atprogram command line to test it. I've been able to program the bootloader using this command line. I suppose visual micro adds the rest of the commands.

Code
Select All
atprogram -d atmega328p -t avrispmk2 -i ISP program -c --verify -f "C:\Program Files ex" 



Trying again in Atmel Studio, now enabling the Verbose Mode, I see that it uses AvrDude instead of atprogram... I've attached a screenshot of what is selected when trying to run it.

Code
Select All
Burning bootloader to board 'Arduino Pro or Pro Mini w/ ATmega328 (5V, 16 MHz)' using 'Atmel Studio AVRISP MkII (ISP)'
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude "-CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -patmega328p -c{protocol} -t avrispmk2 -i ISP -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m
System.Exception: Burn bootloader failed with an exception ---> Visual.Micro.MiroAppAPI.debug.RunnerException: avrdude: invalid isp clock delay specified 'ISP'

   at Visual.Micro.MiroAppAPI.debug.Uploader.executeUploadCommand(ICollection commandDownloader, String workingPath)
   at Visual.Micro.MiroAppAPI.debug.Uploader.executeUploadCommand(ICollection commandDownloader)
   at  programmerPrefs, String programmer)
   --- End of inner exception stack trace ---
   at  programmerPrefs, String programmer)
   at Visual.Micro.MiroAppAPI.debug.AvrdudeUploader.burnBootloader(Board boardPreferences, String programmerName) 

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problem when trying to burn bootloader
Reply #3 - Sep 20th, 2015 at 7:24pm
Print Post  
Thanks for all the info.

I just noticed the path to the command is not being resolved correctly. It's falling back to normal arduino avrdue instead of calling atprogram

This must be a bug since the new downloaded boards manager was implement a couple of months ago.

I will investigate and report back.
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problem when trying to burn bootloader
Reply #4 - Sep 20th, 2015 at 9:42pm
Print Post  
I found the problem is that burning of bootloader has never been tested or used before with the atmel options. The definitions didn't exist.

This file/zip contains two text files that can be expanded into C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\arduino16x\hardware\avr

The files should overwrite the existing. Then restart as6 or click tools>visual micro>reload toolchains

« Last Edit: Sep 20th, 2015 at 9:45pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Felipe
Junior Member
**
Offline


Posts: 12
Joined: Sep 16th, 2015
Re: Problem when trying to burn bootloader
Reply #5 - Sep 21st, 2015 at 1:38am
Print Post  
Did that, but still no go. It didn't have the extra parameters for the bootloader. I've changed the files to add them, but I still can't run it. Maybe because of the forward slashed in the bootloader path?

I've tried to program the bootloader with the AS62 Device Programming utility and I had no problem, so it's not a connection problem between the ISP mkII and the arduino.

Code
Select All
Burning bootloader to board 'Arduino Pro or Pro Mini w/ ATmega328 (5V, 16 MHz)' using 'Atmel Studio AVRISP MkII (ISP)'
C:\Program Files (x86)\Atmel\Atmel Studio 6.2\atbackend\atprogram -d atmega328p -v -t avrispmk2 -i ISP program -c -f "C:\Program Files ex"
Firmware check OK

System.Exception: Burn bootloader failed with an exception ---> Visual.Micro.MiroAppAPI.debug.RunnerException: [DEBUG] Starting execution of "program"
[DEBUG] Starting process 'C:\Program Files (x86)\Atmel\Atmel Studio 6.2\atbackend\atbackend.exe'
[DEBUG] Connecting to TCP:127.0.0.1:10065
[INFO] Connected to ispmk2, fw version: 1.17
[INFO] Firmware check OK
[ERROR] Could not establish connection to device. Please check input parameters, hardware connections and clock values.
Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00 (Command has failed to execute on the tool). (TCF Error code: 1)

   at Visual.Micro.MiroAppAPI.debug.Uploader.executeUploadCommand(ICollection commandDownloader, String workingPath)
   at Visual.Micro.MiroAppAPI.debug.Uploader.executeUploadCommand(ICollection commandDownloader)
   at  programmerPrefs, String programmer)
   --- End of inner exception stack trace ---
   at  programmerPrefs, String programmer)
   at Visual.Micro.MiroAppAPI.debug.AvrdudeUploader.burnBootloader(Board boardPreferences, String programmerName)
 

« Last Edit: Sep 21st, 2015 at 1:41am by Felipe »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Felipe
Junior Member
**
Offline


Posts: 12
Joined: Sep 16th, 2015
Re: Problem when trying to burn bootloader
Reply #6 - Sep 21st, 2015 at 1:45am
Print Post  
Success! The forward slashes were the problem. They were inside the platform.txt file, so I've changed them. Here is the final file.

Now I see that there are some forward slashes in the intellisense path in this file. Are they correct or do I need to change them to back slashes?
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint