Is it possible to modify a flash location from the debugger?

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

Well, the title says it all.

Captcha! Argh!

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

A debugger has no magic powers here - it would have to follow the normal requirements for erasing first, then programming.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I thought that is how breakpoints are implemented in some cases (debugWire?), no? If a debugger does that to set a breakpoint, then why cannot it do that if I ask it to? (Don't have Studio installed at the moment, so I cannot try. BTW, the debugger is Atmel-ICE. Well, and I want to do that on a SAMD; so I guess technically I'm in a wrong forum.)

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

I think that the debug module in the MCU includes breakpoint registers that generate a break when the PC matches.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

And what a beautiful thing it is!

Field the chicken, ignore the ball.

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

This holds for at least some AVRs: The hardware debug module has 4 breakpoint registers. One is reserved for single stepping. When the three others are used for breakpoints then further breakpoints will be done by writing BREAK instructions to flash. Each hit of such a breakpoint results in one flash rewrite of the original instruction, a step over it and a rewrite of the BREAK instruction.
.
All this out of memory, but we have had threads here in the past where Atmel people have confirmed this scheme.
.
So, technically it is possible for an ICE debugger to write to flash while debugging.
.
Whether it is possible for a Studio user to use it (and an ICE debugger) to write to flash is dependent on if the Studio developers implemented this in the UI. I don't beleive they did.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]