For context, programming a driver to interact with an FPGA IP core on an embedded Linux (Yocto: krogoth) on a Xilinx board.
For debugging purposes I would like to read out specific memory addresses from physical memory. /dev/mem looks promising. I wanted to ask how I can read out the value of a specific physical memory address from the command line. I was hoping for something along the lines of cat /dev/mem 0x2000000
to read the byte at 0x2000000.
Usually you should already have devmem tool installed in your Linux image:
$ devmem 0x2000000
If you don't however, you can go to Busybox menu and tweak it to make sure it gets compiled and installed:
$ bitbake busybox -c menuconfig
(search for devmem)
Hexdump is often installed in embedded systems. Then you can do
hexdump -C --skip 0x2000000 /dev/mem | head
in order to read more than a single word, and see it decoded in various ways. (The busybox hexdump is a little more limited, but still very useful.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With