Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1583

RE: RZA1 qspi_app kernel NULL pointer dereference with large files

$
0
0

Thanks for the info, Chris.

I tried erasing the entire flash region prior to flashing, but I still sporadically see the kernel panics. It fails probably 80% of the time but sometimes works fine. I also saw issues where the update hardlocked the board and I had to reset. Here is my test bash script:

#!/bin/sh

rm -rf /mnt/usb/fw_unpack/1.2.3/xipImage2.bin
cp /mnt/usb/fw_unpack/1.2.3/xipImage.bin /tmp/xipImage.bin # Try to read the file from RAM to see if it helps
cd /mnt/apps
rmmod r8a66597-hcd # Try to remove USB as a possible cause of failure
insmod ./qspi_flash.ko
nice -n -19 chrt -f 99 ./qspi_app b s 0x800000 /tmp/xipImage.bin && nice -n -19 chrt -f 99 ./qspi_app p s 0x800000 /tmp/xipImage.bin && nice -n -19 chrt -f 99 ./qspi_app r s 0x800000 /tmp/xipImage2.bin `stat -c %s /tmp/xipImage.bin`
md5sum /tmp/xipImage.bin
md5sum /tmp/xipImage2.bin

I then tried to split the file into multiple smaller files and program each one individually ( since sending a single small file seems to work all the time ). This caused the same random kernel panics and hardlocks:

#!/usr/bin/python

import os
import subprocess
import shutil

os.chdir("/mnt/usb")
print "Performing flash test"

try:
    shutil.rmtree("test")
except:
    pass
chunkSize = 1024
startAddress = 0x800000
os.makedirs("test")
shutil.copy("/mnt/usb/fw_unpack/1.2.3/xipImage.bin","test")
os.chdir("test")
subprocess.call("split -b %s xipImage.bin chunks"%(chunkSize),shell=True)
testSize = os.path.getsize("xipImage.bin")
print "Test Size is: %s"%(testSize)
#os.remove("xipImage.bin")
files = os.listdir(".")
print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
counter = 1
acc = 0
subprocess.call("nice -n -19 chrt -f 99 /root/qspi/qspi_app b s 0x800000 /mnt/usb/fw_unpack/1.2.3/xipImage.bin",shell=True)
for x in sorted(files):
    acc = acc + os.path.getsize(x)
    print counter,x, str(hex(startAddress)).replace("L",""), os.path.getsize(x),acc
    cmd = "nice -n -19 chrt -f 99 /root/qspi/qspi_app p s %s %s"%(str(hex(startAddress)).replace("L",""),x)
    print "Running: %s"%(cmd)
    subprocess.call(cmd,shell=True)
    startAddress = startAddress + os.path.getsize(x)
    counter = counter + 1
subprocess.call("nice -n -19 chrt -f 99 /root/qspi/qspi_app r s 0x800000 /mnt/usb/fw_unpack/1.2.3/xipImage2.bin",shell=True)
subprocess.call("md5sum /mnt/usb/fw_unpack/1.2.3/xipImage.bin",shell=True)
subprocess.call("md5sum /mnt/usb/fw_unpack/1.2.3/xipImage2.bin",shell=True)

I think the L2 cache flushing is something I need. Can you shed some light on how to do that? Thanks alot!


Viewing all articles
Browse latest Browse all 1583

Trending Articles