samskiter
Posts: 24
Joined: Wed Aug 12, 2015 6:18 pm

vcdbg doesn't seem to work on Pi Compute Module

Fri Feb 26, 2016 4:02 pm

Hi,

I'm trying to get a U-Boot setup working on the Pi compute module but I don't seem to be able to get device trees to be loaded by start.elf (despite using mkknlimg on my u-boot.bin). I saw that I should be able to to use vcdbg to get some information out from start.elf but I'm getting an error on that:

Code: Select all

sudo vcdbg log msg
debug_sym: AccessVideoCoreMemory: mmap failed: Invalid argument(22)
debug_sym: OpenVideoCoreMemoryFileWithOffset: ReadVideoCoreMemory @VC_SYMBOL_BASE_OFFSET (0x00002800) failed

Unable to open videocore memory access: -5
Do I have to change an offset or something to get this to work on the CM?

Bonus question - I've been using mkknlimg from the raspberry pi tools (https://github.com/raspberrypi/tools/bl ... e/mkknlimg) will this be sufficient or do I need a more up to date version? (getting a more recent version will be my next endeavor anyway...)

Thanks :)

samskiter
Posts: 24
Joined: Wed Aug 12, 2015 6:18 pm

Re: vcdbg doesn't seem to work on Pi Compute Module

Fri Feb 26, 2016 5:14 pm

Update: I've used the mkknlimg from the source I mentioned and again tried to tag my u-boot.bin but with no success

Dumping the u-boot binary shows the tags have been added:

Code: Select all

0004e754: 00000000 00000004 78333832 00000001    ........283x....
0004e764: 00000004 4b4f5444 0000003f 00000001    ....DTOK?.......
0004e774: 7265564b 00000038 00000004 4c545052    KVer8.......RPTL
My config.text contains:

Code: Select all

kernel=u-boot.bin

start_x=1
gpu_mem=128
dtparam=i2c_arm=on
dtparam=i2c1=on

dtoverlay=mmc

dtoverlay=gpio-poweroff,gpiopin=6,active_low=1

dtdebug=1
device_tree=0x000100
Without that last line it never seems to load anything into 0x100.

I'm stumped :?

samskiter
Posts: 24
Joined: Wed Aug 12, 2015 6:18 pm

Re: vcdbg doesn't seem to work on Pi Compute Module

Wed Mar 02, 2016 4:35 pm

OK, update:

Firstly using device_tree=0x100 was a total mistake and red herring that I got from this site:
http://dius.com.au/2015/08/19/raspberry-pi-u-boot/

The correct parameter to change the location the device tree is placed is device_tree_address. seems that device_tree=[blah] sets a filename. An error finding a file called 0x100 caused start.eld to revert to ATAGS.

Secondly I realised I needed more in my bootargs passed from u-boot after looking at the contents of the ATAGS a little more. There is a bunch of extra information tacked onto the contents of cmdline.txt. That information includes mapping info about the VideoCore - hence vcdbg wasn't working!

After cracking that I found that start.elf was loading the device tree to memory location 0x17fed200. I have no idea why this is? Can anyone help? That location appeared to be empty when inspecting from the u-boot command prompt.

At this point, device_tree_address, came in handy and I was able to get start.elf to correctly load to 0x17fed200. With the addition of the patch here http://lists.denx.de/pipermail/u-boot/2 ... 36278.html and the instructions here: http://dius.com.au/2015/08/19/raspberry-pi-u-boot/ I was able to piece together a working system.

I'm still very confused as to why start.elf is loading to an address other than 0x100...

Return to “Advanced users”