FPGA registers access from Linux userspace: Difference between revisions

From ArmadeusWiki
Jump to navigationJump to search
FabienM (talk | contribs)
New page: == 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 F...
 
FabienM (talk | contribs)
Line 11: Line 11:


[[Category:FPGA]]
[[Category:FPGA]]
==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

Revision as of 14:33, 8 April 2008

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