Skip to content

Instantly share code, notes, and snippets.

@ValdikSS
Last active January 26, 2025 12:50
Show Gist options
  • Save ValdikSS/773b7131141380066fd8df217210ece3 to your computer and use it in GitHub Desktop.
Save ValdikSS/773b7131141380066fd8df217210ece3 to your computer and use it in GitHub Desktop.
GCW Zero flash Adam image

How to flash Adam Image on GCW Zero

You need Linux for that.

  1. Download latest PGv1 Release Image
  2. Unpack xz: xz -d adam_v2.1_PGv1.img.xz, you'll have adam_v2.1_PGv1.img in the same directory
  3. Split image into MBR, bootloader, system partition, data partition:
    • dd if=adam_v2.1_PGv1.img bs=512 count=1 of=mbr.bin
    • dd if=adam_v2.1_PGv1.img bs=512 skip=1 count=30 of=bootloader.bin
    • sudo losetup --show -Pf adam_v2.1_PGv1.img
    • mkdir m && mount /dev/loopXp1 m, where X is the device number from the previous losetup step
    • sudo mv m/gcw0/* m/ - this will copy gcw0 kernel to the root of system partition
    • sudo umount m && sync
    • sudo cat /dev/loopXp1 > system.bin, where X is the device number from the previous losetup step
    • sudo cat /dev/loopXp2 > data.bin, where X is the device number from the losetup step
    • sudo losetup -d /dev/loopX, where X is the device number from the losetup step
  4. Git clone Ingenic-boot
  5. Apply the following patch or it won't compile:
diff --git a/source/stage2_cmd_tool/stage2.h b/source/stage2_cmd_tool/stage2.h
index 54e6ce6..52b9caa 100644
--- a/source/stage2_cmd_tool/stage2.h
+++ b/source/stage2_cmd_tool/stage2.h
@@ -148,4 +148,11 @@ enum OPTION
 
 /*-------------------------------------------------------------------------*/
 
+int sd_card_init(struct ingenic_dev *ingenic_dev);
+
+int sd_card_program(struct ingenic_dev *ingenic_dev, unsigned int addr,
+                    const char *file_path, int check);
+
+int usb_ingenic_nand_ops(struct ingenic_dev *ingenic_dev, int ops);
+
 #endif /*__STAGE2_CMD_TOOL_H__ */
  1. make
  2. Press SELECT+POWER on the GCW Zero
  3. Connect GCW Zero to the PC via USB
  4. Run sudo ./ingenic-boot --mbr mbr.bin --boot bootloader.bin --system system.bin --data data.bin

It takes quite some time (around 15 minutes). New firmware would be booted automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment