number of breakepoint-limits

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I am using studio (4.12sp2), JtagICEmk2 and IAR compiler together with IAR ubrof 8 debug format. (have tried other ubrof versions too and this topic relates to all of them afaik).

In several projects I have used either the mega64 or the mega128 AVR and i am doing the debug on target from studio.

By some reson, in some projects, I can only set 4 breakpoints at most including reset, but in others I can set as many breakpoints as I want. I cant figure out why. I guess I am missing something here.

I know there earlier was a "4 breakpoint limit" but that this problem now was solved with the new mk2 and studio. According to my distributor there have been similar reports on this topic but he did not know aboute any solutions.

If you know anything aboute "number of breakepoint-limits", I'll be happy for any help.
NOTE: I have also tried to use other debug formats like coff and elf, but IAR wont compile if those are selected (stupid).

Thanks

Regards
Vidar (Z)

----------------------------------------------------------

"The fool wonders, the wise man asks"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Suggest you have a look at the bottom of page 251 in the Mega128 datasheet ("Using the On-Chip Debug system"). That's where your four breakpoint limit comes from. As Mr Spock might have said "you cannot change the laws of physics"

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As is exactly the same as written in the mega64 datasheet (offcourse), but which do not affect my mega64 project on my desktop right now, debuged using JtagICEmk2 and studio, where I have had as much as 10 breakpoints simultaneous (10 as in decimal and not binary notation :)), explain that.

Another project using mega128, and same tool chain, clamps number of breakpoints to 4, still including avr studios usage of one breakpoint for reset.

Obviously has somebody tampered with physics somewhere.

Regards
Vidar (Z)

----------------------------------------------------------

"The fool wonders, the wise man asks"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah well a comparison of the two relevant XML files may be in order then as that's where Studio gets all its details about the capabilities of processor X, Y or Z

But if it's like ARM debuggers I've used in the past there were two hardware based address comparators in the ARM giving you to "hard breakpoints" but as soon as you set a 3rd (or more) it started to use "soft breakpoints". It did this replacing insttructions in RAM with a BRK (or whatever it is ARM uses). If Studio offers more than 4 in 64/128 and there are only 4 address comparators in those AVRs then the implication of this is that it's reprogramming bytes in the flash with "BRK/HALT" style opcodes to do any more than 4 breaks simultaneously.

(actually that sparks a memory I think the JTAG instructions said to not use processors you have been debugging with in production as their flash may be "worn" because of repeated insertions of breakpoints but hopefully the Studio guys from Atmel can give more accurate chapter and verse on this?)

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Cliff, I guess this is the reason. Will try to reach the Atmel gyus and report evt. responce. I am aware of the "dont use processors you have been debugging with in production" warning (your mind is truly sparkling) so that is not an issue.

Your answer cleared up my mind a bit.

According to why it works on some projects and others not, I beleive I youst have to keep on investigate.

Regards
Vidar (Z)

----------------------------------------------------------

"The fool wonders, the wise man asks"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Zainka,

mega128 is limited to using hardware breakpoints, thus you will only get three (the fourth is reserved by the JTAGICE mkII for temporary breakpoints used for stepping etc).

All other parts will permit (unlimited) software breakpoints to be used, and debugWIRE parts only use software breakpoints.

Tore

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, but why is mega64 not limited (even though datasheet say it should be)? Also, m64 and m128 should be equal except for flash/ram/eeprom size. Youst curious.

Regards
Vidar (Z)

----------------------------------------------------------

"The fool wonders, the wise man asks"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

> Thanks, but why is mega64 not limited

Because it does not suffer from the unbility to use BREAK instructions.
That's the second difference between the ATmega64 and the ATmega128.
I think it's rather a bug in the '128 than a feature.

Anyway, if you limit yourself to hardware breakpoints, the overall
performance will be better. Software breakpoints require entire pages
of flash to be rewritten all the time.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.