Hi:
I have tried to printf() to different port, for example UART4 on PTC14 and 15. It doesn't have any problem. I don't see any abnormal signal on PTC13.
I also tried to output debug message by UART_DRV_SendData() instead of printf(). I still see the abnormal signal from PTC13. It looks like the PTC13 has some kind of relationship with UART1. Any idea? please let me know. Thanks!
static uint16_t i = 0;
static uint8_t msg1[]="\r\n Test Start:\r\n";
uart_state_t uart1State;
int main(void)
{
/* Write your code here */
// Init hardware
hardware_init();
uart1_init();
gpio_Init();
GPIOE_PSOR |= 0x00000001;
//PRINTF("\r\n Test Start:\r\n");
UART_DRV_SendData(BOARD_DEBUG_UART_INSTANCE, msg1, sizeof(msg1));
while (kStatus_UART_TxBusy == UART_DRV_GetTransmitStatus(BOARD_DEBUG_UART_INSTANCE, NULL)){}
GPIOE_PCOR |= 0x00000001;
/* This for loop should be replaced. By default this loop allows a single stepping. */
for (;;) {
i++;
if (!i) {
GPIOE_PSOR |= 0x00000001;
//PRINTF(".");
UART_DRV_SendData(BOARD_DEBUG_UART_INSTANCE, ".", 1);
while (kStatus_UART_TxBusy == UART_DRV_GetTransmitStatus(BOARD_DEBUG_UART_INSTANCE, NULL)){}
GPIOE_PCOR |= 0x00000001;
}
}
/* Never leave main */
return 0;
}
void uart1_init(void)
{
uart_user_config_t uartConfig;
configure_uart_pins(BOARD_DEBUG_UART_INSTANCE);
uartConfig.bitCountPerChar = kUart8BitsPerChar;
uartConfig.parityMode = kUartParityDisabled;
uartConfig.stopBitCount = kUartOneStopBit;
uartConfig.baudRate = BOARD_DEBUG_UART_BAUD;
// Initialize the uart module with base address and config structure
UART_DRV_Init(BOARD_DEBUG_UART_INSTANCE, &uart1State, &uartConfig);
}
void UART1_RX_TX_IRQHandler(void)
{
UART_DRV_IRQHandler(1);
}