您的位置 首页 汽车

fl2440运用u-boot-1.1.6原版串口没信息问题

问题描述:硬件条件:fl2440开发板jtag下载器串口接在com11152008n1软件条件:官方原版u-boot-116arm-linux-gcc-332make

问题描绘:

硬件条件:fl2440开发板 jtag下载器 串口接在com1 115200 8n1

软件条件:官方原版u-boot-1.1.6 arm-linux-gcc-3.3.2 make 3.81 os ubuntu 10.04

uboot解压缩今后,履行

make smdk2410_config

make

成功生成u-boot.bin,运用jtag烧写今后,复位arm板子,串口无信息输出

解决办法:

1.检查uboot代码中串口初始化进程是不是契合 115200 8n1 串口1

首要理解uboot中串口的初始化及装备分为三个过程

step1:ns16550.c这个文件完结DUART异步串口收发器驱动

———————–ns16550.c全文代码如下——————————————-

#include 包括的是./include/linux/config.h

#ifdef CFG_NS16550 假如装备相应的控制变量要求装备ns16550,则编译下面的代码

#include 包括ns16550头文件

#define LCRVAL LCR_8N1实际上是0x03
#define MCRVAL (MCR_DTR | MCR_RTS)
#define FCRVAL (FCR_FIFO_EN | FCR_RXSR | FCR_TXSR)

void NS16550_init (NS16550_t com_port, int baud_divisor)
{
com_port->ier = 0x00;
#ifdef CONFIG_OMAP
com_port->mdr1 = 0x7;
#endif
com_port->lcr = LCR_BKSE | LCRVAL;
com_port->dll = baud_divisor & 0xff;
com_port->dlm = (baud_divisor >> 8) & 0xff;
com_port->lcr = LCRVAL;
com_port->mcr = MCRVAL;
com_port->fcr = FCRVAL;
#if defined(CONFIG_OMAP)
#if defined(CONFIG_APTIX)
com_port->mdr1 = 3;
#else
com_port->mdr1 = 0;
#endif
#endif
}

void NS16550_reinit (NS16550_t com_port, int baud_divisor)
{
com_port->ier = 0x00;
com_port->lcr = LCR_BKSE;
com_port->dll = baud_divisor & 0xff;
com_port->dlm = (baud_divisor >> 8) & 0xff;
com_port->lcr = LCRVAL;
com_port->mcr = MCRVAL;
com_port->fcr = FCRVAL;
}

void NS16550_putc (NS16550_t com_port, char c)
{
while ((com_port->lsr & LSR_THRE) == 0);
com_port->thr = c;
}

char NS16550_getc (NS16550_t com_port)
{
while ((com_port->lsr & LSR_DR) == 0) {
#ifdef CONFIG_USB_TTY
extern void usbtty_poll(void);
usbtty_poll();
#endif
}
return (com_port->rbr);
}

int NS16550_tstc (NS16550_t com_port)
{
return ((com_port->lsr & LSR_DR) != 0);
}

#endif
———————————–ns16550.c全文代码完毕————————————

声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/qiche/262912.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: kf@86ic.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部