X210 debug port used by common serial ports

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.