Paul Philippov

Flashing XM530 R80X30-PQ to OpenIPC and back

Flashing OpenIPC

Download OpenIPC firmware and extract it into root of your TFTP server.

cd /srv/tftp
wget https://github.com/OpenIPC/firmware/releases/download/latest/openipc.xm530-br.tgz
tar xvf openipc.xm530-br.tgz

Get access to bootloader console. Connect UART adapter to camera board, power up camera, and hit Ctrl-C to stop loading.

Set TFTP server IP address.

setenv serverip 192.168.1.254
saveenv

Set boot parameters.

setenv bootargs 'mem=36M console=ttyAMA0,115200 root=/dev/mtdblock3 rootfstype=squashfs init=/init mtdparts=xm_sfc:256k(boot),64k(env),2048k(kernel),5120k(rootfs),-(rootfs_data)'
setenv bootcmd 'sf probe 0; sf read 0x80007fc0 0x50000 0x200000; bootm 0x80007fc0'
setenv soc xm530
saveenv

Flash OpenIPC kernel and rootfs.

mw.b 0x81000000 ff 800000
tftp 0x81000000 uImage.${soc}
sf probe 0
sf erase 0x50000 0x200000
sf write 0x81000000 0x50000 ${filesize}

mw.b 0x81000000 ff 800000
tftp 0x81000000 rootfs.squashfs.${soc}
sf probe 0
sf erase 0x250000 0x500000
sf write 0x81000000 0x250000 ${filesize}

Reboot the camera.

reset

Rolling back to original firmware

Download vendor’s firmware binary file for your camera and extract it into root of your TFT server.

cd /srv/tftp
wget https://obs-xm-customer.obs.cn-east-2.myhuaweicloud.com/00030751.1IPC_XM530_R80X30-PQ_WIFIXM713G_TB.713g.Nat.dss.OnvifS_V5.00.R02.zip
unzip 00030751.1IPC_XM530_R80X30-PQ_WIFIXM713G_TB.713g.Nat.dss.OnvifS_V5.00.R02.zip

Boot into bootloader console and run printenv. Make sure that your environment includes following lines:

da=mw.b 0x81000000 ff 800000;tftp 0x81000000 u-boot.bin.img;sf probe 0;flwrite
dc=mw.b 0x81000000 ff 800000;tftp 0x81000000 custom-x.cramfs.img;sf probe 0;flwrite
dd=mw.b 0x81000000 ff 800000;tftp 0x81000000 mtd-x.jffs2.img;sf probe 0;flwrite
dr=mw.b 0x81000000 ff 800000;tftp 0x81000000 romfs-x.cramfs.img;sf probe 0;flwrite
du=mw.b 0x81000000 ff 800000;tftp 0x81000000 user-x.cramfs.img;sf probe 0;flwrite
dw=mw.b 0x81000000 ff 800000;tftp 0x81000000 web-x.cramfs.img;sf probe 0;flwrite
tk=mw.b 0x81000000 ff 800000;tftp 0x81000000 uImage; bootm 0x81000000
ua=mw.b 0x81000000 ff 800000;tftp 0x81000000 upall_verify.img;sf probe 0;flwrite
up=mw.b 0x81000000 ff 800000;tftp 0x81000000 update.img;sf probe 0;flwrite

Restore orginal boot parameters.

setenv bootargs 'mem=36M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=cramfs mtdparts=xm_sfc:256K(boot),1536K(kernel),1280K(romfs),4544K(user),256K(custom),320K(mtd)'
setenv bootcmd 'sf probe 0; sf read 0x80007fc0 0x40000 0x180000; bootm 0x80007fc0'
saveenv

Flash files from TFTP server.

run da; run dc; run dd; run dr; run du; run dw

There is no shortcut for flashing kernel, so you need to flash it with a full command.

mw.b 0x81000000 ff 800000
tftp 0x81000000 uImage.img
sf probe 0
flwrite

Reboot the camera.

reset

Published on September 07, 2022 (26 days ago)

Article tags: openipc

Comments (0)