cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ra
Xilinx Employee
Xilinx Employee
3,636 Views
Registered: ‎11-12-2007

Cross-compiling mtd-utils for MicroBlaze

Jump to solution

Hi all,

 

I'm working on a small MicroBlaze system and am setting up MTD for access to the Intel flash device we have on the board. That seems to have gone well - mkdev recognizes the node, queries the flash appropriately, and sets up entries in the /dev.

 

Now that we've got the basic driver up and running we're trying to cross-compile the mtd-utils package and put it into the initrd image so that we've got it available at boot time. Here's a basic overview of the workflow so far:

 

- Download and cross-compile zlib

- Download and cross-compile lzo

- Download and cross-compile mtd-utils (note that I had a lot of problems cross-compiling ubifs, but I don't think that should make a big difference for the basic MTD tools or j2ffs).

 

All of the cross-compilation steps were essentially those detailed here:

 

http://elinux.org/CompilingMTDUtils

 

Once I had that done, I extracted the initrd_minimal.cpio.gz image as follows:

 

# gunzip initrd_minimal.cpio.gz

# mkdir temp

# cd temp

# cpio -id < ../initrd_minimal.cpio

 

Once I had that I created an sbin and lib directory under root and copied in the resulting objects. Then I rebuilt the ramdisk using

 

# find . | cpio --create --format='newc' > ../initrd_minimal.cpio

# cd ..

# gzip initrd_minimal.cpio

 

Then rebuilt the kernel using the new initrd. Everything boots fine and I can see the files in the file system, but they won't execute - I just get /bin/sh: flash_info not found... Not entirely sure what's happening.

 

I've verified that they're built as MicroBlaze binaries and they seem to be in the file system ok, so I'm a little stumped. To be fair, there are a lot of places I can make mistakes along the way here and I've been looking at it for a while, but it seems like a relatively straightforward process... 

 

If anyone's done it before and run into similar problems, or might have an alternate initrd or set of instructions I could reference I'd appreciate it!

 

Thanks,

Rob

0 Kudos
Reply
1 Solution

Accepted Solutions
ra
Xilinx Employee
Xilinx Employee
4,399 Views
Registered: ‎11-12-2007

Actually, taking a step back over the weekend helped me realize what was going on. I was using the minimal image but was compiling the mtd-utils binaries for dynamic linking, so the libraries weren't present.

 

Everything's working great now!

 

Cheers,

Rob

View solution in original post

0 Kudos
Reply
2 Replies
ra
Xilinx Employee
Xilinx Employee
4,400 Views
Registered: ‎11-12-2007

Actually, taking a step back over the weekend helped me realize what was going on. I was using the minimal image but was compiling the mtd-utils binaries for dynamic linking, so the libraries weren't present.

 

Everything's working great now!

 

Cheers,

Rob

View solution in original post

0 Kudos
Reply
linnj
Xilinx Employee
Xilinx Employee
3,615 Views
Registered: ‎09-10-2008
Great! Sorry I didn't respond earlier. Glad to see you helping out on the forums, thanks.
0 Kudos
Reply