nec-usbatermfw: add tool for NEC "USB ATERM" format
Add a tool for NEC Aterm devices using "USB ATERM" format.
This format is mainly used on the devices based on NetBSD, such as
WR8750N, WG600HP and WG1400HP.
A workaround in write_blockheader() is needed to resolve an unknown bug
when generating an image if built with gcc 9.4.0
(Ubuntu 9.4.0-1ubuntu1~20.04.2) and cmake.
example:
index 1 and 4 are fixed data and checksum of them shouldn't be changed
- with the workaround
nec-usbatermfw \
openwrt-ath79-tiny-nec_wr9500n-initramfs-factory.bin.new \
-t H033 \
-f 0x0003 -d loader-nec_wr9500n.bin \
-d openwrt-ath79-tiny-nec_wr9500n-initramfs-factory.bin
Flags Total Len. Load Addr Entry Point Checksum
1: 0x0000, 0x0000003e, 0x00000000, 0x00000000, 0x00001988
2: 0x0003, 0x00000a14, 0x80040000, 0x80040000, 0x00001526
3: 0x0002, 0x0054df20, 0x80040000, 0x80040000, 0x0000c41f
4: 0x0001, 0x00000018, 0x00000000, 0x00000000, 0x0000cfff
- without the workaround
nec-usbatermfw \
openwrt-ath79-tiny-nec_wr9500n-initramfs-factory.bin.new \
-t H033 \
-f 0x0003 -d loader-nec_wr9500n.bin \
-d openwrt-ath79-tiny-nec_wr9500n-initramfs-factory.bin
Flags Total Len. Load Addr Entry Point Checksum
1: 0x0000, 0x0000003e, 0x00000000, 0x00000000, 0x00001988
2: 0x0003, 0x00000a14, 0x80040000, 0x80040000, 0x00009528
3: 0x0002, 0x0054df20, 0x80040000, 0x80040000, 0x00004422
4: 0x0001, 0x00000018, 0x00000000, 0x00000000, 0x00005002
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>