How to debug over UPDI #342
-
UPDI = "Unified Programming and Debug Interface" Is the debug interface here low-level aka checking register values, breakpoint stuff, or is there a way to use it exfiltrate debug messages like you would with UART? Just wondering if it could replace a Serial debug workflow or if its too low-level for that? For example, reading/debugging sensor values (int or float) when building boards? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 22 replies
-
It is a low level hardware debugger. They keep talking about hardware debugging support in future versions of Arduino though, so that may become usable, but right now? It's Microchip's tools only if you want to do that :-/ |
Beta Was this translation helpful? Give feedback.
-
Is there anything new about this topic. I want to debug UPDI via casual UART USB Bridge? |
Beta Was this translation helpful? Give feedback.
-
I have a copy of the data sheet here. The OCD key is 0x4F43442020202020; or The sheet goes on to explain the UPDI registers 0x04 and 0x05. 0x06 is still "reserved". The key status register at 0x07 does indeed have an OCD bit in it: The various bits seem to interract with onchip debug message register at 0x0D, but the data sheet doesn't further explain the content or meaning of those messages.
I do have an mEDBG board with an ATtiny814 on it, that I keep meaning to fiddle with. Probably to start with I'd work through Sigrok and write a UPDI decoder for this. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
FYI: I've created a Python script that lets you establish a serial connection over a UPDI link. It uses a virtual UART on the AVR that is accessed via the UPDI interface, so you can flash the device and have a serial communication channel via the single UPDI pin. I noticed that you can access the I/O registers in the 0x00..0x3F range via UPDI without switching to OCD mode, so it uses the GPIORx registers in that range to implement the virtual UART. You can find the script and a demo program in this repository: |
Beta Was this translation helpful? Give feedback.
-
The 's' key should show the chip device id from the signature row, which for instance is 1e 92 23 for the ATtiny412. The program uses the following declaration to access it:
Perhaps that doesn't work with your compiler version. |
Beta Was this translation helpful? Give feedback.
It is a low level hardware debugger. They keep talking about hardware debugging support in future versions of Arduino though, so that may become usable, but right now? It's Microchip's tools only if you want to do that :-/