An error occurred while upgrading firmware After restarting the device, there is only /dev/mhi_BHI

An error occurred while upgrading firmware After restarting the device, there is only /dev/mhi_BHI

model:RM520NGLAP-M20-SS

QFirehose_Linux_Android_V1.4.17
Quectel_Linux_PCIE_MHI_Driver_V1.3.3

need help

[008.304]: <log value="INFO: Calling handler for erase" />
[008.305]: <log value="INFO: NAND was previously open, returning existing handle 0." />
[008.305]: <log value="INFO: [harden] project name = RM520NGL_VC" />
[008.355]: <log value="INFO: [harden]name=rawdata, start_blk=102, num_blk=10" />
[008.355]: <log value="INFO: [harden] storageDeviceRead success. start_sector=6528" />
[008.356]: <log value="INFO: [harden]magic1=0x20190424, magic2=0x20190425." />
[008.356]: <log value="INFO: [harden]rawdata_version=V1.00." />
[008.356]: <log value="INFO: [harden]project_name=13,RM520NGLAP_VB." />
[008.357]: <log value="INFO: [harden]project_type module=STD." />
[008.357]: <log value="INFO: [harden]modify project_name=10,RM520NGLAP." />
[008.358]: <log value="INFO: [harden]modify project_name firmware =8,RM520NGL." />
[008.358]: <log value="INFO: [harden] project name or type = RM520NGL error!" />
[008.358]: <response value="NAK" rawmode="false" />
[ 1521.678367] [I][mhi0][PrintBhiInfo] BHI Device Info...
[ 1521.683514] [I][mhi0][PrintBhiInfo] BHI Version               = { Major = 0x6 Minor = 0x6}
[ 1521.691771] [I][mhi0][PrintBhiInfo] BHI Execution Environment = 0x6
[ 1521.698027] [I][mhi0][PrintBhiInfo] BHI Status                = 0x6
[ 1521.704285] [I][mhi0][PrintBhiInfo] BHI Error code            = 0x6 { Dbg1 = 0x6 Dbg2 = 0x6 Dbg3 = 0x6 }
[ 1521.713750] [I][mhi0][PrintBhiInfo] BHI Serial Number         = 0x6
[ 1521.720006] [I][mhi0][PrintBhiInfo] BHI SBL Anti-Rollback Ver = 0x6
[ 1521.726261] [I][mhi0][PrintBhiInfo] BHI Number of Segments    = 0x6
[ 1521.732519] [I][mhi0][PrintBhiInfo] BHI MSM HW-Id             = 06 06 06 06 06 06 
[ 1521.740081] [I][mhi0][PrintBhiInfo] BHI OEM PK Hash           =  06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 
[003.514]: bhi_e[ 1521.752451] [I][mhi0][BhiWrite] Device current EE:EDL, M:RESET, PM:POR
e = 6
[ 1521.760338] [E][mhi0][BhiWrite] MHI is not in EDL state
[ 1521.766153] [E][mhi0][bhi_write_image] IOCTL_BHI_WRITEIMAGE BhiWrite error, ret = -22
[003.536]: fail to ioctl IOCTL_BHI_GETDEVINFO, errno: 22 (Invalid argument)
[003.536]: usb_linux.c qpcie_open 1404 fail
[003.536]: qfirehose.c main 641 fail

Dear @newyoko
Please try to specific port via QFirehose –p /dev/mhi_BHI and try again.

I tried to recompile the tool, but the problem still exists whether the module, driver, firmware does not match or other reasons.

model:RM520NGLAP-M20-SGASA
ati
RM520N-GL
Revision: RM520NGLAAR01A01M4G

model:RM520NGLAA-M20-SGASA
ati
RM520N-GL
Revision: RM520NGLAAR01A01M4G

2 types of modules

i need mhi windows and linux driver and other upgrade tools last version
modules are required

env
target mtk7988 arch64
toolschain :gcc 8.5
os: openwrt

root@OpenWrt:/tmp# qfirehose -p /dev/mhi_BHI -f x
[000.000]: Version: QFirehose_Linux_Android_V1.4.17
[000.000]: Builded: Nov  6 2023 08:57:53
[000.000]: Find md5 check file <x/md5.txt>
[000.000]: md5 checking: x/contents.xml pass
[000.003]: md5 checking: x/update/abl.elf pass
[000.006]: md5 checking: x/update/aop.mbn pass
[000.006]: md5 checking: x/update/apdp.mbn pass
[000.007]: md5 checking: x/update/devcfg_low_ddr.mbn pass
[000.007]: md5 checking: x/update/devcfg.mbn pass
[000.008]: md5 checking: x/update/firehose/partition_complete_p4K_b256K.mbn pass
[000.008]: md5 checking: x/update/firehose/patch_p4K_b256K.xml pass
[000.017]: md5 checking: x/update/firehose/prog_firehose_lite.elf pass
[000.017]: md5 checking: x/update/firehose/rawprogram_nand_p4K_b256K_update.xml pass
[000.019]: md5 checking: x/update/hyp.mbn pass
[000.020]: md5 checking: x/update/ipa_fws.elf pass
[000.020]: md5 checking: x/update/logfs_ufs_8mb.bin pass
[000.020]: md5 checking: x/update/multi_image.mbn pass
[000.020]: md5 checking: x/update/multi_image_qti.mbn pass
[001.097]: md5 checking: x/update/NON-HLOS.ubi pass
[001.108]: md5 checking: x/update/oemapp.ubi pass
[001.115]: md5 checking: x/update/oemdata.ubi pass
[001.115]: md5 checking: x/update/partition.mbn pass
[001.116]: md5 checking: x/update/partition_nand.xml pass
[001.236]: md5 checking: x/update/sdxlemur-boot.img pass
[001.429]: md5 checking: x/update/sdxlemur-recoveryfs.ubi pass
[002.372]: md5 checking: x/update/sdxlemur-sysfs.ubi pass
[002.385]: md5 checking: x/update/tz.mbn pass
[002.414]: md5 checking: x/update/uefi.elf pass
[002.469]: md5 checking: x/update/usrdata.ubi pass
[002.471]: md5 checking: x/update/xbl_config.elf pass
[002.480]: md5 checking: x/update/xbl.elf pass
[002.483]: md5 checking: x/update/xbl_ramdump.elf pass
[002.483]: Totals checking 29 files md5 value, 0 file fail!
[002.483]: find 'prog_firehose_lite.elf'
[002.483]: find_firehose_mbn prog_firehose_lite.elf
[  484.423284] [I][mhi0][PrintBhiInfo] BHI Device Info...
[  484.428428] [I][mhi0][PrintBhiInfo] BHI Version               = { Major = 0x6 Minor = 0x6}
[  484.436686] [I][mhi0][PrintBhiInfo] BHI Execution Environment = 0x6
[  484.442943] [I][mhi0][PrintBhiInfo] BHI Status                = 0x6
[  484.449200] [I][mhi0][PrintBhiInfo] BHI Error code            = 0x6 { Dbg1 = 0x6 Dbg2 = 0x6 Dbg3 = 0x6 }
[  484.458666] [I][mhi0][PrintBhiInfo] BHI Serial Number         = 0x6
[  484.464921] [I][mhi0][PrintBhiInfo] BHI SBL Anti-Rollback Ver = 0x6
[  484.471175] [I][mhi0][PrintBhiInfo] BHI Number of Segments    = 0x6
[  484.477433] [I][mhi0][PrintBhiInfo] BHI MSM HW-Id             = 06 06 06 06 06 06 
[  484.484994] [I][mhi0][PrintBhiInfo] BHI OEM PK Hash           =  06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 
[003.558]: bhi_e[  484.497360] [I][mhi0][BhiWrite] Device current EE:EDL, M:RESET, PM:POR
e = 6
[  484.505247] [E][mhi0][BhiWrite] MHI is not in EDL state
[  484.511062] [E][mhi0][bhi_write_image] IOCTL_BHI_WRITEIMAGE BhiWrite error, ret = -22
[003.579]: fail to ioctl IOCTL_BHI_GETDEVINFO, errno: 22 (Invalid argument)
[003.579]: usb_linux.c qpcie_open 1404 fail
[003.579]: qfirehose.c main 641 fail

Dear @newyoko
Actually, your current firmware are too old, we need to check which firmware to upgrade.