1   Lab notes

Day 1.

  1. got a de0 nano.
  2. installed Lubuntu 13.04 in VirtualBox, 32-bit, 6GB space.
  3. tried to install the Altera Quartus II suite. Not enough space.
  4. bigger HD image: 10GB.
  5. installed the tools. Fits.
  6. tried to download/install OpenRISC tools. Not enough space.
  7. ordered external SSD drive.

Day 2, new HD delivered.

  1. configured/installed VirtualBox/Lubuntu again, 30GB HD space.
  2. installed Quartus II suite from Altera, OK.
  3. installed the or1k-elf- tool chain (binutils, gcc) as per OpenCores wiki, OK.

Day 3.

  1. looked at OpenCores wiki page on FPGA dev boards, saw a reference to a pre-build image from Stefan K from October 2012.
  2. quartus_pgm complains that it cannot find a JTAG hardware.
  3. (lots of search / trying things out afterwards) Quartus II 10.1 as shipped on the de0 nano DVD can’t work directly with Ubuntu 13.04 because it required usbdevfs mounted /proc/bus/usb and Ubuntu does not provide that.
  4. Used a workaround to make /proc/bus/usb available.
  5. uploaded Stefan K’s prebuilt image to the board. OK.
  6. found the UART pin assignments from a file UART0_pin_assignments.tcl in Stefan’s orpsoc repository. Says PIN_C16 and PIN_D15, which according to the de0 manual map to GPIO_23 and GPIO_25 at the back of the board.
  7. Missing some cables to connect to the configured UART.
  8. upgraded Quartus II install to 13sp1.
  9. wrote this doc.
  10. discovered the OpTiMSoC project which provides ready-to-use VirtualBox images.
  11. discovered the “new OpenRISC SoC dev board” page on the OpenRISC wiki.

Things to do: find some cables to connect to the image already flashed to the de0 nano. Build own linux image. Build own orpsoc image. Check the OpTiMSoC virtualbox image out.

Learned on the way:

  • Quartus tools are required to upload an image to the board (quartus_pgm).
  • Both the SoC bitstream and the linux kernel image can be integrated into one image that flashes both the FPGA and attached SPI flash. The orpsoc image can boot from the SPI flash.
  • binutils, gcc, built for target “or1k-elf”, are required to build the linux kernel and other binaries.
  • Quartus tools are required to build orpsoc and core Verilog code to FPGA bitstream.
  • pre-built bitstreams available from various people (ask on IRC).

2   Web Resources

3   Snippets

  • The Quartus II delivered on DVD with the de0 nano board (v10.1) does not work directly with Ubuntu 13.04. In particular its JTAG flashing component requires usbfs in /proc/bus/usb which is disabled in the latest versions of Ubuntu. Solutions:

    • Install Quartus II 13+ from the Altera web site. This can use /sys/bus/usb directly; or

    • alternatively, work around the problem using the following:

      sudo killall jtagd
      sudo chmod 755 /sys/kernel/debug/usb/devices
      sudo chmod 755 /sys/kernel/debug/usb
      sudo chmod 755 /sys/kernel/debug
      sudo mount --bind /dev/bus /proc/bus
      sudo ln -s /sys/kernel/debug/usb/devices /proc/bus/usb/devices
      
  • The guide from Kevin Mehall suggests uploading the Linux kernel to the board via the USBBlaster link and an OCD utility. Instead, it is possible to flash the vmlinux image on the board so it can boot autonomously. Use the following snippet (courtesy of Stefan K.):

    rm linux/vmlinux.bin.gz orpsoc.jic
    make -C linux -j3
    make -C u-boot -j3
    gzip linux/vmlinux.bin
    u-boot/tools/mkimage -A or1k -T kernel -C gzip -a 0 -e 0x100 -d linux/vmlinux.bin.gz uImage.bin
    orpsoc/sw/utils/bin2binsizeword u-boot/u-boot.bin bu-boot.bin
    bin2hex.py uImage.bin uImage.hex
    bin2hex.py bu-boot.bin bu-boot.hex
    cp orpsoc/boards/altera/de0_nano/syn/quartus/run/orpsoc.sof ./
    quartus_cpf -c orpsoc.cof
    quartus_pgm --mode=jtag -o pi\;orpsoc.jic
    

4   People

  • Olof Kindgren / irc: olofk / OpenCores: olof / SE
  • Stefan Kristiansson / irc: stekern / OpenCores: stekern / SE
  • Julius Baxter / irc: juliusb / OpenCores: julius / UK
  • Jonas Bonn / / OpenCores: jonibo / South Pole / SE
  • Jeremy Benett / / OpenCores: jeremybenett / Embecosm / UK
  • Stefan Wallentowitz / / TUM
  • Philipp Wagner / / TUM
  • Michael Tempelmeier / / TUM

Like this post? Share on: TwitterHacker NewsRedditLinkedInEmail


Raphael ‘kena’ Poss Avatar Raphael ‘kena’ Poss is a computer scientist and software engineer specialized in compiler construction, computer architecture, operating systems and databases.
Comments

So what do you think? Did I miss something? Is any part unclear? Leave your comments below.


Keep Reading


Published

Last Updated

Category

Programming

Tags

Stay in Touch