Installation of Tool-Chain for the lm32 Soft CPU

THIS HOWTO IS DEPRECATED

A soft CPU based on the lm32 is embedded in the White Rabbit core. This how-to describes the installation required for a PEXARIA2A board connected to standard GSI Linux machine (Debian, Lenny). All this was provided by Wesley Terpstra (thanks!), I just write it down here.

This is a short log on getting the lm32 toolchain for a PEXARIA2A board working...

Shopping List

  • standard GSI Linux box (Debian 5.0.8, 2.6.26-2-686-bigmem "Lenny")
  • "sudo" rights for your account on that box
  • Quartus II Web Edition (I took version 11.0, no patch), installed to /opt/altera
  • USB adapter like an Altera USB-Blaster
  • get the tool-chain (from repository? from Wesley?)

Installation

USB-Port

The USB-Blaster requires to do some low-level stuff on the USB port. The USB port needs to be chunked. I have put the following
# USB-Blaster
SUBSYSTEM=="usb", ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001|6002|6003", OWNER="root", GROUP="staff", MODE="0660", SYMLINK+="usbblaster", RUN+="/bin/chmod 0666 /proc/bus/usb/$env{BUSNUM}/$env{DEVNUM}"
to "/etc/udev/rules.d/10-usbblaster.rules". This makes it work for any user in the 'staff' group. You may also have a look on the Altera homepage.

Another method of gaining the required access rights to the USB port worked as follows. From the command line do
killall jtagd
sudo /opt/altera/11.1/quartus/bin/jtagd

Tool-Chain

  • unpack toolchain to /opt/lm32
  • unpack programs for soft-CPU to my home directory (~/BEL/lm32stuff)
  • cd to ~/BEL/lm32stuff/wr-core-software/tools
  • "make clean" followed by "make"
  • cd to ~/BEL/lm32stuff/wr-core-software
  • edit Makefile: changed line "CROSS_COMPILE ?= /usr/local/bin/lm32-elf-" to "CROSS_COMPILE ?= /opt/lm32/bin/lm32-elf-"
  • "make clean" followed by "make"
  • copy lm32-ctl to ~/BEL/lm32stuff"
  • edit lm32-ctl: changed line "exec rlwrap -C lm32-ctl -I /opt/hdl/quartus/bin/quartus_stp -t "$0" "$@" " to "exec rlwrap -C lm32-ctl /opt/altera/11.0/quartus/bin/quartus_stp -t "$0" "$@" "

Usage

  • cd to ~/BEL/lm32stuff/wr-core-software
  • "../lm32-ctl"
    • get a message like "Select device: @1: (0x025030DD)."
    • get a prompt like "lm32>"
  • you are done!!!

Troubleshooting

  • If you can't connect to the device with lm32-ctl: Try accessing the device via JTAG using the Altera "Programmer". Eventually try as "sudo".
  • Have a look at the end of lm32-ctl, to see a list and the syntax of commands.

-- DietrichBeck - 30 Sep 2011
Topic revision: r4 - 19 Jun 2019, DietrichBeck
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback