- To debug a device when you cannot access the JTAG connections (due to mechanical restrictions or regulatory restrictions).
- To debug a device remotely, such as at a customer site.
- In a team-based situation with several people working on a single device.
- Quartus II software version 13.0 or later installed on your local PC
- Familiarity with networking setup requirements
- SLD Hub Controller Linux driver (for SoC device)
- Linux running on the HPS
- SLD Hub Controller
- Microprocessor connected to the Altera FPGA (either internally or externally)
- Altera SoC with the HPS connected to an Ethernet port
- TCP/IP stack
- Programming device connected to an Ethernet cable at the remote location
- SignalTap II Logic Analyzer
- In-System Sources and Probes
- In-System Memory Content Editor
- Logic Analyzer Interface
- System Console
Verify your design can run a TCP server with memory-mapped access
to the device.
For Altera SoC, the Linux kernel handles the TCP/IP connection.
SLD Hub Controller System component from the
Figure 4. SLD Hub Controller System
- Generate the Qsys system.
- Tap some nodes using SignalTap II Logic Analyzer.
- Compile the design.
- Using the existing remote configuration setup, update the remote board with firmware which contains the SLD Hub Controller System instantiated in the FPGA over the TCP server (enabled to listen for incoming debug connections).
Console in JTAG server mode using the Tcl script in the Reference Design or
using a custom script.
System-console-jtag_server-rc_script=mmlink_setup.tcl<path to .sof><IP><port number>
- After connecting, start the SignalTap II Logic Analyzer. You should see a System Console cable as an option under Hardware.
- microSD card for the Linux image
- USB cables
- Cyclone V SoC golden hardware reference design (GHRD)
- Linux drivers
- Setup Tcl script
- Start Linux on the Altera SoC.
Get the USB serial
UART cable and driver.
- Connect by serial to the board using PuTTY and selecting serial and the correct COM number with speed 57600.
Enter and login as root.
If the above fails, double-check that the serial driver is in the Device Manager.If you are sure the failure is not due to a configuration issue, then the Linux kernel might not be on the SD card.
- After you get a connection via serial, get the board's IP with >>ifconfig
Add the SLD Hub
Controller from the GHRD.1
Figure 6. SLD Hub Controller in GHRD
- Generate in Qsys.
- Compile the design.
- Program the board with the GHRD .sof.
- Transfer the sld_hub.ko driver to the board via SFTP.
Transfer the mmlink
user application to the board via SFTP.
Figure 7. mmlink Application
Run the SLD Hub
Controller Linux driver and mmlink application.
Use System Console
to connect to the board.
>>system-console-jtag_server--rc_script=mmlink_setup.tcl<design>.sof<ip>3333Figure 8. Connect with System Console
Open the SignalTap
II Logic Analyzer and select SystemConsole on localhost:xxxx under
Hardware and Sld Hub Controller System under
Figure 9. Selecting Hardware and Device
- Run analysis and view the waveforms.
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:
- Clone the Linux kernel git tree.
- Checkout the appropriate branch.
- Configure the kernel to enable the
driver. Use the following commands.
make menuconfigNote: Navigate to the Device Drivers/Character Devices/Altera MM Debug Link Driver and click M to compile the driver as a loadable module.
- Compile the Linux kernel.
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.
|May 2015||2015.05.11||Added appendix. Added information about modifying driver permissions.|
|June 2014||2014.06.18||Added instructions to get source code for SLD Hub Controller driver.|
|December 2013||2013.12.05||Changed document title. Added setup Tcl script.|
|September 2013||2013.09.18||Initial release.|