FPGA registers access from Linux userspace

From ArmadeusWiki
Revision as of 14:33, 8 April 2008 by FabienM (Talk | contribs) (FPGARegs usage)

Jump to: navigation, search

FPGARegs usage

  • Write to a FPGA address: fpgareg addr value
# fpgaregs 1000 abcd

this will write 0xabcd (16bits only interface) at the FPGA internal address 0x1000

  • Read a FPGA address: fpgareg addr
# fpgaregs 1000

this will read the address 0x1000

For details take a look at this page: Tips to debug under Linux


Changing FPGA IP's registers from Linux user space with fpgaregs

This tool allows you to access FPGA registers from linux userspace/console. This way you can easily debug your driver directly from the Linux console.

First, you have enable this tool in Buildroot (package selection for target):

$ make menuconfig

Once done, compile it:

$ make

The generated file is located in buildroot/build_arm_nofpu/fpgaregs-1.0/. Now you can copy it on your target. Then in linux, launch it like that:

# fpgaregs address (for read) or fpga address value (for write)

Examples:

Show register at internal FPGA address 0x0010:

# fpgaregs 10

Write 0x0123 to FPGA register 0x0020:

# fpgaregs 20 0123