Author Topic: avrstudio7, fuses set in code, can't enter debug anymore?  (Read 4754 times)

0 Members and 2 Guests are viewing this topic.

Offline cdwijsTopic starter

  • Regular Contributor
  • *
  • Posts: 57
avrstudio7, fuses set in code, can't enter debug anymore?
« on: February 26, 2016, 04:30:14 pm »
Hi All,

I'm working with an ATMega32. Everything works fine, until I add this to my code:
#include <avr/io.h> //for fuses
FUSES =
{
   .high = 0x91,
   .low = 0xFF,
};
This triggers the error message: "error an unknown emulator error occureed debugger command leaveprogmode failed". When I remove the above lines, all is well again, and I can enter debug mode no problem, until I add the lines again.

My setup:
windows7 64bit, (microsoft windows NT6.1.7601 service pack 1 (platform win32NT))
atmel studio 7.0.634
JTAGICE mkII 0700000589B
ATmega32A

I have added the lines, hoping atmel studio would program the fuses when I start debugging. Then I have one thing less to worry about :-)

Kind regards,
Cedric
 

Offline cjuried

  • Contributor
  • Posts: 32
  • Country: 00
    • Juried Engineering
Re: avrstudio7, fuses set in code, can't enter debug anymore?
« Reply #1 on: February 27, 2016, 12:28:44 am »
Hi All,

I'm working with an ATMega32. Everything works fine, until I add this to my code:
#include <avr/io.h> //for fuses
FUSES =
{
   .high = 0x91,
   .low = 0xFF,
};
This triggers the error message: "error an unknown emulator error occureed debugger command leaveprogmode failed". When I remove the above lines, all is well again, and I can enter debug mode no problem, until I add the lines again.

My setup:
windows7 64bit, (microsoft windows NT6.1.7601 service pack 1 (platform win32NT))
atmel studio 7.0.634
JTAGICE mkII 0700000589B
ATmega32A

I have added the lines, hoping atmel studio would program the fuses when I start debugging. Then I have one thing less to worry about :-)

Kind regards,
Cedric
I let Atmel Studio set the fuses in the tool chain settings. That way I do not have to add that code manually. 

Sent from my SM-G900P using Tapatalk

juriedengineering.com/
 

Offline cdwijsTopic starter

  • Regular Contributor
  • *
  • Posts: 57
Re: avrstudio7, fuses set in code, can't enter debug anymore?
« Reply #2 on: February 27, 2016, 08:44:53 am »
Thanks cjuried, I am looking at project->properties, but I can't find a clear place to enter the fuse values. How did you do it? Is it under toolchain->AVR/GNU linker->memory settings?

Kind regards,
Cedric

 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: avrstudio7, fuses set in code, can't enter debug anymore?
« Reply #3 on: February 27, 2016, 12:22:40 pm »
It is much easier to use those predefined macros for fuse setting - read the header files for sure.

PICs are much better in this regard.
================================
https://dannyelectronics.wordpress.com/
 

Offline cdwijsTopic starter

  • Regular Contributor
  • *
  • Posts: 57
Re: avrstudio7, fuses set in code, can't enter debug anymore?
« Reply #4 on: February 27, 2016, 09:57:41 pm »
It is much easier to use those predefined macros for fuse setting - read the header files for sure.

PICs are much better in this regard.

Hi Danny,

Could you send me a small project that does this? My atmel studio fails to enter debug mode, so I am doing something wrong :-)

Kind regards,
Cedric
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->