Hello everyone! I'm trying to get the usb_host_msc example to run on the Beaglebone Black. The example works fine until I try to issue the ls, cat or cd commands. Any of those end up triggering a Data Abort exception somewhere inside the disk_status function. Since StarterWare simply places an endless loop as a Data Abort handler, I wrote a small function which examines the instructions around the one pointed at by LR and prints their opcodes using ConsoleUtilsPrintf. The results were surprising: the instruction pointed at by LR, as well as the 3 instructions that preceeded it showed junk opcodes, and so did the 7 or so that followed it.
I'm compiling with the Linaro gcc-arm-none-eabi-4_7-2012q4 recommended by the Wiki and the project Makefiles. I'm recording the app binaries into an SD card and booting using U-Boot. Here's the script I'm using for preparing the SD card (it was originally written by Ben Gras to record RTEMS executables):
# we store all generated files here. TMP_BASE_NAME=tmp_sdcard_dir TMPDIR=$TMP_BASE_NAME.$$ FATIMG=$TMPDIR/bbxm_boot_fat.img OFFSET=2048 FATSIZE_KB=2880 FATSIZE=`expr $FATSIZE_KB \* 2` SIZE=`expr $FATSIZE + $OFFSET` UENV=uEnv.txt rm -rf $TMPDIR mkdir -p $TMPDIR if [ $# -ne 2 ] then echo "Usage: $0 <executable> <image name>" exit 1 fi executable=$1 app=app.img if [ ! -f "$executable" ] then echo "Expecting executable as arg; $executable not found." exit 1 fi set -e IMG=$2 # Make an empty image dd if=/dev/zero of=$IMG bs=512 seek=$SIZE count=1 # Make an ms-dos FS image rm -f $FATIMG export MTOOLSRC=$TMPDIR/mtools-conf echo "drive a: file=\"$FATIMG\" fat_bits=16 " >$MTOOLSRC mformat -C -f $FATSIZE_KB a: # Prepare the executable. base=`basename $executable` arm-none-eabi-objcopy $executable -O binary $TMPDIR/$base.bin gzip -9 $TMPDIR/$base.bin mkimage -A arm -T standalone -a 0x80000000 -e 0x80000000 -n APP -d $TMPDIR/$base.bin.gz $TMPDIR/$app echo "setenv bootdelay 5 uenvcmd=run boot boot=fatload mmc 0 0x80800000 $app ; bootm 0x80800000" >$TMPDIR/$UENV # Copy the uboot and app image onto the FAT image mcopy -bsp -i $FATIMG $MLO_PATH/MLO ::MLO mcopy -bsp -i $FATIMG $UBOOT_PATH/u-boot.img ::u-boot.img mcopy -bsp -i $FATIMG $TMPDIR/$app ::$app mcopy -bsp -i $FATIMG $TMPDIR/$UENV ::$UENV # Just a single FAT partition (type C) that uses all of the image partition $IMG $OFFSET 'c:0*+' # Put the FAT image into the SD image dd if=$FATIMG of=$IMG seek=$OFFSET # cleanup rm -rf $TMP_BASE_NAME.* echo "Result is in $IMG."
I finish by recording the resulting image to the SD card using dd.
Now, the weird thing is that this only happens with Rev. C boards. I tried doing this on a Rev A5C and got a Prefetch Abort inside U-Boot.
Any help would be appreciated. Thanks a lot!