bkpmind Just some notes

10Jan/110

Timer Bash Script

I've used this script to wait a download (through Firefox or Chromium) finishes then shutdown my PC.

while true
  do
   sleep 10;
   if [ ! -e YourFile.zip.part ] ; then init 0; fi
  done
Tagged as: , , No Comments
9Jan/110

Embedded Systems

That is what we could call an "embedded system" ;)

Source: Google Images

Source: Google Images

9Jan/110

MySQL command line backup and restore

Backup:

$ mysqldump -u root -p -v DB_NAME > BkpDec2010.sql

Restore:

$ mysql -u root -p DB_NAME < BkpDec2010.sql

To create a database:

$ mysqladmin -u root -p create DB_NAME
9Jan/110

Putting the USB Blaster to work on Linux

You'll need to edit rc.local file and create a new one in udev rules:

1) edit rc.local (sudo vi /etc/rc.local) and append the following lines before "exit 0" line.

mount --bind /dev/bus /proc/bus
ln -s /sys/kernel/debug/usb/devices /proc/bus/usb/devices

2) create altera-usb-blaster.rules file (sudo vi /etc/udev/rules.d/altera-usb-blaster.rules) with this line:

ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="666"

For more information about this fix:

http://www.philpem.me.uk/elec/fpga/quartus-ubuntu/

EDIT1: To check if it's working properly execute jtagconfig. You can found it inside Quartus bin folder. If necessary, sudo killall jtagd.

EDIT2: There's an alternative to put usb blaster working on Linux. I've got this tip on Altera Forum but I have not tested yet.

sudo ln -s /sys/kernel/debug/usb/devices /dev/bus/usb/devices
sudo vim <altera path>/quartus/linux/jtagd
:%s/\/proc\/bus\/usb\/%03u\/%03u/\/dev\/bus\/usb\/%03u\/%03u\n/
:%s/\/proc\/bus\/usb\/devices/\/dev\/bus\/usb\/devices\n/
:wq
sudo vim <altera path>/quartus/linux64/jtagd
:%s/\/proc\/bus\/usb\/%03u\/%03u/\/dev\/bus\/usb\/%03u\/%03u\n/
:%s/\/proc\/bus\/usb\/devices/\/dev\/bus\/usb\/devices\n/
:wq
9Jan/110

Altera Quartus II 10.0 installation

Version 10.0 of Altera's products crash during installation on Linux environment. The workaround is to remove the file libX11.so.6 before starting the installer. So, follow this steps:

1) bash ./10.0_quartus_free_linux.sh --noexec
2) cd 10.0_quartus_free_linux
3) rm altera_installer/bin/libX11.so.6
4) sudo bash ./setup

PS: Step 1 is to decompress all installer files.

EDIT: if you got error on step 4, type:  sudo -i; export DISPLAY=:0.0; ./setup

For more detailed information go to

http://www.philpem.me.uk/elec/fpga/quartus-ubuntu/

28Dec/100

Nios II IDE execute script

Altera Nios II IDE is an software environment based on Eclipse IDE and comes with a modified GCC version. Its purpose is to be used along Nios II software core processor. To execute Nios II IDE on Linux box you need set some environment variables.

My system is Linux Mint 10 "Julia" x64 (based on Ubuntu 10.10 "Maverick"), but things should go well in other distro flavors. My Nios II version is 10.1, released this month (December, 2010) but I have been using this script since version 9.1

You have to create "nios2.sh" file with this lines:

export SOPC_KIT_NIOS2=/opt/altera/10.1/nios2eds
export QUARTUS_ROOTDIR=/opt/altera/10.1/quartus
. $SOPC_KIT_NIOS2/bin/nios2-ide

This should be unnecessary but to avoid problems, check the path where you have installed the Altera softwares. In my case is /opt/altera/10.1

8Jul/100

Problem when installing NIOS II SP2

When trying to install SP2 for Altera NIOS II i've got this error:

$ ./install_patch
bindkey: Command not found.
Illegal variable name.

To resolve that problem open "install_patch" script and remove these lines:

bindkey "^[[3~" delete-char
set KBS=`tput kbs`
if (${%KBS} == 1) then
    stty erase $KBS
endif
Tagged as: , No Comments
8Jul/100

Problem after Quartus II 9.1 SP2 installation

After install Quartus II SP2 it stop working. When you execute Quartus a blank window appears. This problem seems related to the graphical interface. I found two solutions that work on my environment (Linux Mint 8 64 bits (an Ubuntu-based distribution)):

1) a simple work-around is execute a QT GUI version of Quartus II. Just execute "qgui" instead of "quartus". But this is a beta interface.

or

2) copy "mw" and "mw64" directory from previous Quartus II to location where you installed it.

Tagged as: , No Comments