I'm successfully using the renesas qspi_app and qspi kernel module to write small files ( severl kb ) to the QSPI flash on the RZA1 RSK while running an XIP Kernel. I am using the "single" qspi configuration - so I specify "s" instead of "d" as shown in the tool's help menu.
I have the latest code from github:
https://github.com/renesas-rz/rza1_qspi_flash
I figured out how to modify the u-boot environment variables from Linux userspace and now I am trying to write a Linux Kernel image to a difference location in flash so that I can perform Kernel Firmware updates in the field.
I mount a USB drive with a slightly different xipImage.bin ( 4825612 bytes ) and attempt to write it to flash with the following commands:
cp /mnt/usb/xipImage.bin /tmp/ # copy image to ramdisk - it turns out not to matter, same failure occurs
rmmod /root/usb/r8a66597-hcd.ko # I remove the usb after copying to the ram disk just to rule out USB
/mnt/apps/qspi_app e s 0x800000
/mnt/apps/qspi_app p s 0x800000 /tmp/xipImage.bin
It always fails at some non-deterministic point in time as shown below:
Erase Complete. Status = OK
Writing out 4825612 bytes
Wrote this many bytes: 1024 [4824588 remaining]
Wrote this many bytes: 1024 [4823564 remaining]
Wrote this many bytes: 1024 [4822540 remaining]
...
Wrote this many bytes: 1024 [2896396 remaining]
Wrote this many bytes: 1024 [2895372 remaining]
Wrote this many bytes: 1024 [2894348 remaining]
Wrote this many bytes: 1024 [2893324 remaining]
Wrote this many bytes: 1024 [289230Unable to handle kernel NULL pointer dereference at virtual address 00000000
0 remaining]
Wrpgd = c12e8000
ote this many by[00000000] *pgd=095ac831tes: 1024 [28912, *pte=0000000076 remaining]
W, *ppte=00000000rote this many b
ytes: 1024 [2890Internal error: Oops: 80000007 [#1] ARM
Modules linked in: qspi_flash(O) [last unloaded: r8a66597_hcd]
CPU: 0 PID: 685 Comm: qspi_app Tainted: G O 3.14.28-ltsi #92
task: c1200400 ti: c190c000 task.ti: c190c000
PC is at 0x0
LR is at 0x0
pc : [<00000000>] lr : [<00000000>] psr: 40000013
sp : c190dec8 ip : c190dee8 fp : c190c000
r10: c1e59140 r9 : c199b540 r8 : 00000000
r7 : 00000030 r6 : 00000030 r5 : 00000030 r4 : c12bca00
r3 : 00000000 r2 : ffffffd4 r1 : 00000000 r0 : c190dee4
Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 18c53c7d Table: 092e8059 DAC: 00000015
Process qspi_app (pid: 685, stack limit = 0xc190c230)
Stack: (0xc190dec8 to 0xc190e000)
dec0: c199b540 bf1627e4 00010301 bf6014ec c19c8c00 00000000
dee0: 00000000 00000000 00000005 c190df00 bf6001c0 bf6001dc a0000013 c12bca00
df00: 00000000 00000030 00000030 c199b540 b6fc3000 c1e59140 c190c000 bf15ff20
df20: 00000000 00000030 bf1627bc c190c000 c190df80 c199b540 b6fc3000 c190df80
df40: 00000030 00000030 b6fc3000 00000000 be85f71c bf08ecc4 c199b540 b6fc3000
df60: 00000030 00000000 00000000 c199b540 c199b540 00000030 b6fc3000 bf08f1cc
df80: 00000000 00000000 00000030 00000030 b6fc3000 b6f9cd80 00000004 bf006044
dfa0: c190c000 bf005ec0 00000030 b6fc3000 00000001 b6fc3000 00000030 00000000
dfc0: 00000030 b6fc3000 b6f9cd80 00000004 00000030 00000024 00009150 be85f71c
dfe0: 00000000 be85f194 b6ed2f78 b6f29bdc 60000010 00000001 00000000 00000000
Code: bad PC value
252 remaining]
---[ end trace b8c0feeeccde825c ]---
How can I reliably write larger files to flash with the qspi_app? Thanks!