This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to determine from software that Ulink is connected

Hi!

I have some code that puts data into the DDC channel.
The processor waits until the data is read out, by polling the W bit of the DCC control register.
If the Ulink is connected everything works fine, as it reads out the register and resets the bit.

Now another case: When the Ulink is not connected, the routine loops forever, as the W bit is never resetted.

Is there a way to determine before I write to the DDC , that the Ulink debugger is connected?
In that case i could write some code that puts the debug output to the nirwana.

Sincerely
Jens-Peter Oswald

Parents
  • Try the following function:

    // Check if free for write
    int __dbg_free (void) {
      int r;
    
      __asm {
              MRC     p14,0,r,c0,c0    // Read DCC Control
              AND     r,r,#0x02        // Mask W bit
      }
      return (r);
    }
    

    Pooling W bit in DCC Control register, you can determine does the debugger read output.

Reply
  • Try the following function:

    // Check if free for write
    int __dbg_free (void) {
      int r;
    
      __asm {
              MRC     p14,0,r,c0,c0    // Read DCC Control
              AND     r,r,#0x02        // Mask W bit
      }
      return (r);
    }
    

    Pooling W bit in DCC Control register, you can determine does the debugger read output.

Children
No data