We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I have a custom ARM Cortex-A9 board. My aim is to load the kernel image onto the target via ARM DSTREAM. I have u-boot loaded into SNOR memory. The u-boot is running fine. After I get the u-boot prompt I am connecting to the target via ARM DSTREAM. Then I press pause button and enter the command add-symbol-file "<path>\vmlinux". After executing this command I get the message as "Cannot determine target state".
I want to know whether I am following the correct steps for the above described problem. Please let me know if changes are required and also suggest some pointers if required.
The vmlinux file is linked at a virtual address, but in U-Boot the MMU is not on yet* so when DS-5 tries to load vmlinux it is probably trying to load into non-existent memory addresses and your target seems to be locking up. (You could probably do the same thing by using DS-5 to to write just a word at the address the kernel has been linked to.)
You should be able to use the restore command with an appropriate offset (instead of load) to place the image in physical memory (but I haven't tried myself). But that is only part of jobs that the bootloader does; there's also setting up the DTB/ATAGs/initramfs and registers. See the kernel's Documentation/arm/Booting for more info.
[*] or, if the MMU is on, it is not using the kernel's memory mapping.
Hello Scott,
Thank you for your reply. I tried the restore command but it didn't work.
I don't really have enough information to help you. Can you tell me...
Hi amitm,
There is a really good article on ARM Connected Community written by a colleague - Porting Linux made easy with DS-5 - by following these instructions you can pretty much resolve the issue.
The key here is that the "vmlinux" image is a very large, virtual-addressed image (i.e. it has been linked to run after the page tables are set up from kernel address space). You probably don't want to load this to the target, but you are right to load the symbols from it. What you should probably be loading is the "Image" or "zImage" file to your target using the restore command. These are stripped, bootable versions of vmlinux ready-to-run
The zImage contains extra startup code which will decompress and also perform some smart relocation of the kernel at startup time. The 'Image' code will assume it has been placed at a very specific physical address (start of ram + 0x8000) in most cases, something that the zImage entry code will do for you. That specific address is usually and helpfully stored in the $loadaddr variable defined by U-Boot, so you can look there.
Ta,
Matt
Hello MWSealey,
Thank you very much for your reply. I tried the zImage approach you suggested using restore command and got it working.