Replies: 2 comments 19 replies
-
The MPLAB Snap is quite slow, and OCD with JTAG is noticeably slower than the other physical interfaces, in my experience. Not much I can do about this.
This is probably due to the back-and-forth with GDB and Bloom - GDB will step a single instruction at a time, so stepping a single line could mean a lot of back-and-forth with GDB. Range stepping may help with this, but Bloom doesn't support this ATM.
When programming the target, we have to erase its program memory. With EDBG tools (like the Snap), according to the EDBG protocol documentation, JTAG targets only support chip erase mode, meaning we have to perform a full chip-erase when erasing program memory. Some AVR targets have a fuse that can be set to preserve EEPROM when erasing the chip, but Bloom does not utilise this ATM. This is why Bloom has to backup the EEPROM and restore after a chip erase. There's no way to disable this ATM.
This is something GDB does. Range stepping may help here, but I'm not sure about that. I might have a look at implementing support for range stepping at some point, but won't be anytime soon. |
Beta Was this translation helpful? Give feedback.
-
Studio usually programs flash, but always goes in and manipulates the OCDEN fuse for debugging (and switches it off afterwards). While its in there it can also set the preserve EEPROM fuse, but this is optional, and in the end the user's problem to either set the fuse itself or the debug-option to set the fuse. I think all AVRs have this fuse
You don't have to do this - also if you 'take a copy' of flash that is programmed in outside of GDB to populate the cache with, then assume its constant after that? (or am I missing something...)
If I remember correctly, inside prog mode EEPROM_PAGE might be faster?
These devices have the most generous number of hardware breakpoints of all AVRs (4?) - are they being used? Software breaks are very much slower... |
Beta Was this translation helpful? Give feedback.
-
Hello again, I am using a MPLAB Snap to debug an Atmega2560 and this works great, however the whole debugging process is very slow, stepping a single line of code takes roughly 5 seconds, and flashing a new program takes almost one full minute. This is a bit annoying when trying to do fast iterations of debug -> code -> flash -> debug.
I have enabled debug output in Bloom and see that a lot of time is spent on backing up and re-flashing the EEPROM, however I have no need for this. Is there any way of disabling this in Bloom?
Also when single stepping through code I see in the output from Bloom that it is setting a breakpoint, resuming running, breaking on the breakpoint, then removing breakpoint again, instead of simply just stepping. I wonder if this is the cause of why it is so slow. Is this because of a limitation in the (reverse engineered?) protocol of the Snap?
Beta Was this translation helpful? Give feedback.
All reactions