Forum Discussion

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

Linux on Nios- where to start?

Hello,

After I installed all development tools and was able to run a sample linux project from alterawiki I discovered that there are no books or at least tutorials on first steps in Linux on Nios. For example, the situation with Blackfin is completely opposite, I would say too much information. Are there any simple practical projects, like read an ADC word from a parallel port (or SPI) and send the word to an IP address? All examples on alterawiki are huge projects that are just OS itself, but I can not figure out how to compile a simple data acquisition application, connect it to a conventional port and make it run. So if aanybody knows a good book to start, please advise.

7 Replies

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

    With deeply embedded Linux projects (on "small" devices), the OS itself always is part of the project and thus needs to be configured and compiled accordingly to the needs of the project.

    I once did publish a "binary distribution" for the "NEEK" development board (with the no-MMU flavor of the CPU), which might be usable for the first steps you might want to do. It should be hidden somewhere in the new NIOS Wiki, which now is much harder to use than the old one was, as the (old, no-MMU centric) "uCLinux" distribution page is no longer easily findable any more.

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

    In my understanding I need to find a description of a couple procedures. I guess that I can compile a Linux application on my PC and upload the application to Nios with some tool. So, I am looking for a sample project, that shows how to:

    -compile my application to run on Nios

    -upload the application to Nios

    -access peripherals

    For the peripheral access, I am not sure if I can use the addresses from the memory map, since probably Linux creates a separate memory space for each process. If such a simple project or tutorial, exists please let me know its name.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    To "upload the application to Nios" you first need to have a running system (Hardware, FGPGA design, Bootloader, Linux OS, drivers, gnu tools, configuration files).

    All this is project specific and not available "out of the box". That is why I did the said demo project for the NEEK hardware. It will not work on any other hardware. (In fact there is not "standard Hardware design" with a NIOS CPU at all.) Moreover I would not recommend playing too much with the said demo project, as IMHO, no-MMU is no-future (apart from some very dedicated project types).

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

    But after when you have running system you become without information like:

    -how to compile my application to run on Nios

    -how to upload the application to Nios

    -how to access peripherals

    I'm still fighting how to use peripherals like simple led or button on Linux with MMU on my De2-70 board. Do know where can I find any help?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    A description of all this is in the Wiki.

    In Short:

    As said, there is no "my Application" but it's "my embedded system" consisting of Hardware, FGPGA design, Bootloader, Linux OS, drivers, gnu tools, configuration files

    Regarding "Upload", all all this but the FPGA design can be compiled into a single file and burned into a flash (but of course there are many other very scalable possibilities).

    There are many ways to access peripherals. The decent one is writing a device driver, as in Linux, user land applications are not supposed to (and mostly prohibited from) directly accessing I/O adresses.

    Before starting "fighting" you should read the Wiki.

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

    texblues,

    In my experience, the easiest way to develop on embedded Linux is to setup an NFS share on your host system that is mounted on your development/embedded/target system.

    In this way, you can then just copy your applications to this directory on your host and run/debug them on your target.

    Accessing peripherals is another story and it depends more upon what peripheral you're talking about...the effort could be anything from writing your own driver, to using something that is already easily supported in Linux.

    Regards,

    slacker