AN 693: Remote Hardware Debugging over TCP/IP for Altera SoC

ID 723698
Date 5/11/2015
Public

1.7. Appendix

Getting the Source Code for the SLD Hub Controller Driver

The SLD Hub Controller driver provided with Application Note 693 is only compatible with Linux kernel 3.8.0-00069-g54902df-dirty. You can get the source code for the sld_hub.ko driver from the RocketBoards.org website. RocketBoards is an open source community that provides resources for embedded solutions that allow you to explore and prototype applications for Altera SoC.

You can find detailed instructions to use the git repository on the RocketBoards website. The following is a high-level flow for using the git repository:

  1. Clone the Linux kernel git tree.
  2. Checkout the appropriate branch.
  3. Configure the kernel to enable the driver. Use the following commands.
    make menuconfig
    Note: Navigate to the Device Drivers/Character Devices/Altera MM Debug Link Driver and click M to compile the driver as a loadable module.
  4. Compile the Linux kernel.

Driver Permissions

The user-mode app mmlink bridges between TCP/IP and the mm-debug-link device driver. The default device driver has permissions 0600, which can prevent you from opening the driver. If you encounter an error when you run the mmlink with these permissions in the driver, you may see an error such as below:

socfpga_cyclone5:~$ mmlink
failed to init driver: 13 (Permission denied)

The permissions of the driver can be modified, and the error avoided, by adding a udev rules file as follows:

root@testsocfpga# cat/etc/udev/rules.d/mm_debug_link.rules
KERNEL=="mm_debug_link", MODE="0666"

With this rules file in place, the next time the mm-debug-link driver is loaded, it will have permissions 0666, and any user can open it for read/write.

Alternatively, Altera has released an revised version of the device driver on RocketBoards.com that has the modified driver permissions already in place.