|
I have never had an issue with my DEBUG port as long as it was initialized and configured for the correct baud rate.
Here is my init code (Note: I don't use IAR but the Atmel Config file should be similar)
/* Write DBGU register */ static inline void write_dbgu(unsigned int offset, const unsigned int value) { writel(value, offset + AT91C_BASE_DBGU); }
/* Read DBGU registers */ static inline unsigned int read_dbgu( unsigned int offset) { return readl(offset + AT91C_BASE_DBGU); }
/* Disable interrupts */ write_dbgu(US_IDR, -1); /* Reset the receiver and transmitter */ write_dbgu(US_CR, AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS); #if (MASTER_CLOCK == 133333333) /* Configure the baudrate 115200 = 133333333 / 16 * CD */ write_dbgu(US_BRGR, 72); #else /* Configure the baudrate 115200 = 100000000 / 16 * CD */ write_dbgu(US_BRGR, 54); #endif /* Configure USART in Asynchronous mode */ write_dbgu(US_MR, AT91C_US_PAR); /* Enable RX and Tx */ write_dbgu(US_CR, AT91C_US_RXEN | AT91C_US_TXEN);
|