Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

How to use FIFOed Avalon Uart under uClinux on DE2 2c35 Board?

Hi all,

I tried to use "altera uart" to exchange data between my de2 board and an PC but i failed.

Now i want to use "FIFOed Avalon Uart" for that purpose. However, I do not know how to implement "FIFOed Avalon Uart" under uclinux.

I have built the hardware following this instruction: http://www.nioswiki.com/exampledesigns/fifoed_avalon_uart and used this patch: http://www.alterauserforums.org/forum/showthread.php?t=18198

But the "dev/ttyS0" can not be created. :confused:

Can u guys plz tell me how to use "FIFOed Avalon Uart" under uClinux?

many thanks!

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    AFAIK no software changes are necessary, as the interface of the FIFOed Uart is identical to that of the Altera UART. So just use the Altera UART driver.

    -Michael
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    hi Michael,

    thanks for replying!

    i have used FIFOed Avalon Uart without any software changes. I have enabled both Altera JTAG UART support and Altera Uart support. But uClinux still told me "/dev/ttyS0 can not create".

    I really do not understand why!!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The ip class name may be wrong, please update the script,

    nios2-linux/linux-2.6/arch/nios2/scripts/nios2.h/fifoed_avalon_uart.pm

    - Hippo
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    here the script of fifoed_avalon_uart. It seems that this script is not implemented

    package fifoed_avalon_uart;
    use base qw(BasicModule);
    use strict;
    sub required_module_names {
    	("uart0", "uart1", "uart2", "uart3")
    }
    sub required_class_name {
            "fifoed_avalon_uart";
    }
    sub base_address_cast {
    	"void "
    }
    sub translate {
    	my $class = shift;
    	my ($system, $required_module_name, $module_name) = @_;
    	$class->SUPER::translate (@_);
            if (defined ($fifoed_avalon_uart::default_uart)) {
                    print "/* The default uart is always the first one found in the PTF file */\n";
                    print "#define nasys_printf_uart na_$required_module_name\n\n";
                    $fifoed_avalon_uart::default_uart = $required_module_name;
            }
    }
    sub run {
            fifoed_avalon_uart->run2 (@_);
    }
    1;
    
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    thanks for ur time spent on this topic.

    I've solved this problem by naming fidoed uart as "uart0" in SOPC builder