The method consists of three steps:
Step 1: Modify the three functions in the file wince600 \ platform \ smdkv210 \ common \ dbgserial. C.
Oeminitdebugserial ()
{
...
If (g_puarreg = NULL)
{
# If (debug_port = debug_uart0)
// Uart0
G_puarreg = (uart_reg *) oalpatova (base_reg_pa_uart0, false );
# Elif (debug_port = debug_uart1)
// Uart1
G_puarreg = (uart_reg *) oalpatova (base_reg_pa_uart1, false );
# Elif (debug_port = debug_uart2)
// Uart2
G_puarreg = (uart_reg *) oalpatova (base_reg_pa_uart2, false );
# Elif (debug_port = debug_uart3)
// Uart3
G_puarreg = (uart_reg *) oalpatova (base_reg_pa_uart3, false );
# Else
Return; // return directly without the debug port, without subsequent initialization.
// Invalid_debug_port // Error
# Endif
}
...
}
Int oemreaddebugbyte ()
{
Uint32 status, ch;
// If there is no debug port, return directly.
Return oem_debug_read_nodata;
If (g_uartstat & uart_not_ready)
Return oem_debug_read_nodata;
Status = inreg32 (& g_puarreg-> utrstat );
If (Status & 0x01 )! = 0 ){
Ch = inreg32 (& g_puarreg-> urxh );
} Else {
Ch = oem_debug_read_nodata;
}
Return (INT) ch;
}
Void oemwritedebugstring (uint16 * string)
{
// If there is no debug port, return directly.
Return;
While (* string! = L' \ 0') oemwritedebugbyte (uint8) * string ++ );
}
Step 2: \ wince600 \ platform \ smdkv210 \ SRC \ oal \ oallib \ init. c
Static void initializeclkgating (void)
{
...
// Added by terr0.y 20120929 fro no debug UART
Pcmuclkreg-> clk_gate.clk_gate_ip3 =
# Elif (debug_port = debug_uart0)
(Clk_off <bp_clk_ip_uart3) | // all clocks for uart3
(Clk_off <bp_clk_ip_uart2) | // all clocks for uart2
(Clk_off <bp_clk_ip_uart1) | // all clocks for uart1
(Clk_on <bp_clk_ip_uart0) | // all clocks for uart0
# Else // No debug UART // when the debug port is not used, disable CLK for all serial ports
(Clk_off <bp_clk_ip_uart3) | // all clocks for uart3
(Clk_off <bp_clk_ip_uart2) | // all clocks for uart2
(Clk_off <bp_clk_ip_uart1) | // all clocks for uart1
(Clk_off <bp_clk_ip_uart0) | // all clocks for uart0
# Endif
...
}
Step 3:
Change the smdkv210.bat File
@ REM comment out this definition
@ REM set bsp_debugport = serial_uart0