UART debugging of dm355

Source: Internet
Author: User
Uart1 is not supported in the default kernel. You need to initialize it during kernel initialization. Modify the file ARCH/ARM/Mach-DaVinci/board-dm355-evm.c and add the following red section to the function board-init function:
Board_setup_psc (davinci_gpsc_armdomain, davinci_lpsc_mcbsp1, 1 );
Board_setup_psc (davinci_gpsc_armdomain, davinci_lpsc_spi, 1 );
/* Turn On watchdog timer lpsc. Needed for reset to work */
Board_setup_psc (davinci_gpsc_armdomain, davinci_lpsc_timer2, 1 );
/* Add uart1 by xujiaxin */
Board_setup_psc (davinci_gpsc_armdomain, davinci_lpsc_uart1, 1 );
/* End add */
Davinci_serial_init (& serial_device );
Davinci_writel (0x56837210, davinci_vpss_regs_base + 0x810 );
Davinci_writel (0x7b3c0004, davinci_vpss_regs_base + 0x814 );
/* Enable uart1 by jiaxinxu */
Ptr_pgmgt = (volatile int *) io_address (davinci_uart+base + 0x30 );
Ptr_ier = (volatile int *) io_address (davinci_uart+base + 0x4 );
* Ptr_pgmgt = 0x0;
* Ptr_ier = 0x0;
Int del;
For (DEL = 0; del <100000; del ++)
* Ptr_pgmgt = 0x6001;
/* End enable */
Run the RS232 program. When the function sends 0x0a, it always sends a 0x0d first, and then adds the following two sentences to the program:
/* Raw format errors */
Options. c_lflag & = ~ (Icanon | echo | echoe | isig );
Options. c_oflag & = ~ Opost;
No error occurs.
The board_setup_psc function is used to set the PSC module. The function of this module is to enable the power supply of a module and enable a module.
When initializing uart2, you must note that uart2 and sd1 are reused. Before kernel initialization, sd1 is automatically initialized instead of uart2. Several actions are required to block the initialization of sd1.
// Choose uart2 instead of sd1 jiaxinxu
Pinmux3 & = ~ 0x0000ffff;
Pinmux3 | = 0x0000a000;
Set the pin function to uart2,
// Conflict with uart2 by jiaxinxu
Board_setup_psc (davinci_gpsc_armdomain, davinci_lpsc_mmc_sd1, 0 );
Ban PSC
# If defined (config_mmc_davinci) | defined (config_mmc_davinci_module)
& Mmc0_device,
// Conflict with uart2 by jiaxinxu
// & Mmc1_device,

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.