Maximum debug interface frequency ensures that under all circumstances the debug interface communication works reliably, which is especially important during FLASH programming, where in the worst case an error in transmission could cause the CPU/SoC device failure.
Higher debug interface frequency brings shorter FLASH programming times while regular debugging experience using run/step/stop control and available debug windows might not be affected noticeably by increasing the debug interface frequency.
Programming special regions of FLASH with an unstable debug clock can lock the chip.
Refer to the topic How to find maximum debug frequency.
Before you program the device flash you must test if a debug session is stable.
1. Open Hardware | CPU Options | SoC.
2. Steadily increase the debug clock to determine the max value.
3. Perform the following actions:
With certain CPUs/SoCs, RAM must be initialized before you can use it and ECC (Error-Correction Code) protection must be disabled (or else "??" will be shown in the Memory Window). Refer to CPU/SoC Reference Manual for more details on RAM usage and operation.
Real-time memory updates should be enabled for this particular test and RAM data values shouldn't change. If the values do change, it means that each time a different value is read. That usually indicates an unstable debug connection. Don't forget to disable real-time memory updates for the memory window after the tests are completed.
Note that the FLASH data shouldn't change while scrolling down and up in the FLASH address range.
4. Repeat steps 1 - 3 until you find a maximum debug interface frequency, which still works.
5. Once you reach the highest clock at which all of the above tests pass, reduce the debug clock by 10%. This adds a safety margin that ensures that the debug interface communication will work reliably under all circumstances.