一本精品热在线视频,久久免费视频分类,精品婷婷乱码久久久久久蜜桃,在线可以免费观看的Av

<mark id="vd61v"><dl id="vd61v"></dl></mark>
    <sub id="vd61v"><ol id="vd61v"></ol></sub>

  • <sub id="vd61v"><ol id="vd61v"></ol></sub>

    新聞中心

    EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > fl2440使用u-boot-1.1.6原版串口沒(méi)信息問(wèn)題

    fl2440使用u-boot-1.1.6原版串口沒(méi)信息問(wèn)題

    作者: 時(shí)間:2016-11-21 來(lái)源:網(wǎng)絡(luò) 收藏
    問(wèn)題描述:

    硬件條件:fl2440開(kāi)發(fā)板 jtag下載器 串口接在com1 115200 8n1

    本文引用地址:http://www.ekcard.cn/article/201611/319267.htm

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

    uboot解壓縮以后,執(zhí)行

    make smdk2410_config

    make

    成功生成u-boot.bin,使用jtag燒寫(xiě)以后,復(fù)位arm板子,串口無(wú)信息輸出

    解決辦法:

    1.查看uboot代碼中串口初始化過(guò)程是不是符合 115200 8n1 串口1

    首先明白u(yù)boot中串口的初始化及配置分為三個(gè)步驟

    step1:ns16550.c這個(gè)文件完成DUART異步串口收發(fā)器驅(qū)動(dòng)

    -----------------------ns16550.c全文代碼如下-------------------------------------------

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

    #ifdef CFG_NS16550 如果配置相應(yīng)的控制變量要求配置ns16550,則編譯下面的代碼

    #include 包含ns16550頭文件

    #define LCRVAL LCR_8N1實(shí)際上是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全文代碼結(jié)束------------------------------------



    評(píng)論


    相關(guān)推薦

    技術(shù)專(zhuān)區(qū)

    關(guān)閉