Forum Discussion

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

two cpus, uClinux on cpu1

I&#39;ve got a design with two nios2 cpus. The idea is that cpu1 runs uClinux to provide a webserver front end, whilst cpu2 is working with some custom on-chip hardware. I &#39;ve been able to get both cpus running in a simple test using two C applications made in the nios2 IDE (no operating systems). Now I&#39;d like to get uClinux running on cpu1 and my stand alone C code on cpu2. cpu1 is similar to the std_2s60 design. I&#39;ve followed Hippo&#39;s wiki and got uClinux running on a std_2s60. I then made a zImage for uClinux for cpu1. (Upon going "make linux_hwselect SYSPTF=<my two cpu .ptf>" I was able to select the correct cpu to run uClinux. ) Then, I copied the zImage to Windows, ran the nios2 shell in Windows

and tried various combinations of the form,

SOPC Builder>nios2-download --device <any number> --instance <any number> -g zImage

and it says that it does not know which debug module to use, or that I should try setting things up using RUN/RUN or RUN/DEBUG (presumablly in the nios2 IDE). How do I persuade the zImage go to cpu1?

2 Replies

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

    I&#39;ve fixed my problem, but in a rather convoluted way, and I&#39;d be grateful if someone could explain how to do it properly.

    Here&#39;s what I did.

    Step 1) In the nios2 shell in Windows, changed directory to the /Debug directory in the nios2 IDE that held the C application for cpu2.

    SOPC Builder>nios2-download -g <cpu2 code>.elf

    ... loads and runs stand-alone C application happily in cpu2

    Step 2) Copied the zImage for uClinux (that I&#39;d made on my Linux box following Hippo&#39;s wiki) into the /Debug directory in the nios2 IDE that I&#39;d already used to test a stand-alone C application running in cpu1. Then, in this directory,

    SOPC Builder>nios2-download -g zImage

    ... loads ok

    SOPC Builder>nios2-terminal

    ... uClinux running ok in cpu1

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

    Here is the correct syntax. I did not understand that --device is not the cpu.

    (Background, design with two nios2 cpus. cpu1 to run uClinux, zImage file made using Linux toolchain, cpu2 to run stand alone C application, image is (say) cpu2code.elf made using nios2 IDE under Windows. )

    In Windows launch nios2 shell.

    [SOPC Builder]$ nios2-download --device 1 --instance 2 -g cpu2code.elf

    cpu2 application starts to run

    [SOPC Builder]$ nios2-download --device 1 --instance 1 -g zImage

    [SOPC Builder]$ nios2-terminal

    /> (prompt from uClinux running on cpu1)