I have also posted about this here:
https://www.avrfreaks.net/s/topic/a5C3l000000BpxfEAC/t391305 Equipment/Toolchain: IDE: Microchip Studio 7.0.2594
Extensions: Visual Micro 2023.0507.1
Target Chip: ATmega328PB
Debugger: Atmel-ICE debugger using 6-pin ISP/debugWire header
Background: I can successfully start a hardware debugging session, where Microchip studio informs me that it needs to program the DWEN fuse using SPI, and then it prompts me to power cycle the board and click OK.
I notice that after power-cycling the board, Microchip studio then uploads the new firmware to the ATmega.
So, presumably, the upload is happening using debugWire interface, right?
Once the debug session is initialized, things work as expected (step debugging, run to cursor, watch window etc etc).
If I end the debug session using the stop button (instead of using the "Disable debugWire and Close" option, then susequent attempt to launch debug session results in uploader fail because the uploader is trying to do an SPI upload (instead of debugWire)
I do notice however, that after the power cycle (when the debugWire interface has been activated), there appears to be a secondary upload happening via the debugWire interface.
So it seems that you can upload a new firmware image using only debugWire interface without needing to drop back to SPI first.
Here is a video that demonstrates as much:
https://youtu.be/roRYEvCutBo Now then:
The Question: While I am stopped on a breakpoint in the middle of a debugWire debug session, how can I make a change, and recompile/relaunch the debug session without disabling the debugWire interface?
It seems that there is a project called Bloom which has features like this. I'm not sure how I can mangle Bloom into the current setup I have though.
See the following quote from the Bloom Debugging AVR microcontrollers via debugWire page
Edited: Bloom can program debugWire targets via the debugWire interface. This removes the need to switch to the ISP interface when uploading any code changes.
Users are advised to use GDB's load command to update the target's program memory with the latest binary. See Programming the AVR target for more.
Does anyone know if Mircochip Studio or Visual Micro have this ability?