Hacking, Coding and Gaming | @[email protected]

(If you've used the older method below - "hakchi 1" - make sure you backup your "dump" folder which should contain your original kernel files)

Dumping your kernel: (this is a relatively safe step - at leat for your NES Classic - as it only reads from it)

  • Download "hakchi2"
  • Run hakchi2, from the menu select "Kernel" and "Dump kernel" (say "yes" when asked if you're sure, and follow the instructions it gives)
  • Once you've held down reset and pressed the power like the instructions tell you it, it should automatically start dumping your kernel
  • Do yourself a favour and backup the "dump" folder created in the "hakchi2" folder - this contains your original firmware which can be used later to reset/fix your NES Classic
  • If you get a "Kernel dumped but MD5 checksum is unknown: {0} xxxxxxxxxxxxxxxxxxxx. Maybe kernel already patched or it's unknown revision." error, it's probably best not to continue (unless you used the older method below in which case you should be able to copy that "dump" folder of the hakchi2 "dump" folder and choose "Kernel" -> "Flash original kernel" to reset your device to the original firmware)

Adding games:

  • Click "Add more games", browse for your NES rom files, then use the "Browse" or "Google" buttons on the right to choose the box art (image displayed on the game select screen) for each added game, modify the name and number of players as needed
  • Click "Upload selected games to NES Mini" to upload the games

Removing games:

  • Just untick the games you want to remove from the list on the left and click "Upload selected games to NES Mini" again

Debugging:

  • If you get a "Failed to read from pipe" error while dumping the kernel or uploading games, try clicking "okay" then dumping the kernel again (without pressing anything on your NES Classic). You should see the "Instructions" popup (becaues it can't detect the NES classic), then click "Install Drivers" - you should be told it found an "Unknown Device" and is installing drivers. Give it a while then unplug your NES and try again - this worked for me, after having used the "hakchi 1" method below when I had the WinUSB drivers installed and hakchi2 always gave me that error. Alternatively try a different USB cable, USB por or rebooting your PC.
  • If you get a "Kernel dumped but MD5 checksum is unknown: {0} xxxxxxxxxxxxxxxxxxxx" error, you can try searching on Google for the checksum value (shown as "xxxxxxxxxxxxxxxxxxxx" here), it's possible your "hakchi" doesn't know about your firmware but that other people have tried it and everything worked. You'll likely also get this error if you've used another mod on your NES Classic.

Other thoughts:

Make sure you backup your earliest "dump" folder (from hakchi 1 or 2) as this should contain your original, unmodified, kernel so you can always revert back to the original state. Also make note of your checksum, just incase you loose your kernel and are able to find one someone else's kernel file with the same checksum.

Hakchi2 copies your NES roms and boxart in to a folder in "hakchi2\games" (eg: "CLV-H-EMYTG") which also contains the config file for the name, number of players, and volume for the ROM - this file, and the boxart can be changed manually if you keep the path and filename the same (hakchi2 resizes the boxart but you can make the files smaller by reducing the number of colours etc)

Hakchi2 copies your NES roms and boxart in to a folder in "hakchi2\games" (eg: "CLV-H-EMYTG") which also contains the config file for the name, number of players, and volume for the ROM - this file, and the boxart can be changed manually if you keep the path and filename the same (hakchi2 resizes the boxart but you can make the files smaller by reducing the number of colours etc).


Older, slightly harder, method (hakchi1):

Before we start, make sure you have a saved game for Super Mario Bros (run the game, press the reset button, press "down" at the menu with Super Mario Bros selected, and press "A" to save the game) - without this the custom firmware will boot as normal and not show any custom ROMs.

1. go to http://zadig.akeo.ie/ and download "zadig_2.2" 2. with your NES Classic turned off, hold (and keep holding) the reset button, press power on, and hold "reset" for another 3 seconds before releasing 3. run Zadig, select the USB device (will probably be "Unknown Device #1"), make sure the "WinUSB" driver is selected, and click "Install" - my first try took a long time and eventually aborted, I had to use Device Manager to "Uninstall" the "Unknown Device" that was still listed, unplug the NES's power, and repeat steps 2 and 3 for it to work 4. Download, extract and run "hakchi-gui" from https://github.com/madmonkey1907/hakchi/releases 5. click "dump uboot"

uploading fes1.bin ... done
uploading uboot.bin ... done
sunxi_flash phy_read 43800000 8 6;fastboot_test
usb_bulk_recv() ERROR -7: Operation timed out
8ce1857653874e8f0cd3fe68abe1bb4a
void Worker::do_dumpUboot() - OK

6. check the md5 sum of your uboot file, using a tool like http://www.winmd5.com/ - the file should be in "hakchi-gui-win32\dump\uboot.bin" - known working values are: b13b538f6b7c86623ceea69c456d4eb5, and possibly 8ce1857653874e8f0cd3fe68abe1bb4a and 9b8046b47c947d9fa322976c038003e0 (mine was "8ce1857653874e8f0cd3fe68abe1bb4a")... if your md5 value doesn't match one of those, it's probably best not to continue! 7. click "dump kernel.img"

sunxi_flash phy_read 43800000 30 20;fastboot_test
usb_bulk_recv() ERROR -7: Operation timed out
07bfb800beba6ef619c29990d14b5158
void Worker::do_dumpKernel() - OK

8. in "hakchi-gui" click "unpack kernel.img"

BOARD_KERNEL_CMDLINE  root=/dev/nandb decrypt ro console=ttyS0,115200 loglevel=4 ion_cma_512m=148m ion_cma_1g=176m ion_carveout_512m=8m ion_carveout_1g=150m coherent_pool=4m consoleblank=0
BOARD_KERNEL_BASE 40000000
BOARD_NAME 
BOARD_PAGE_SIZE 2048
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 01000000
BOARD_TAGS_OFFSET 00000100
void Worker::do_unpackKernel() - OK

9. download and extract "nesromtool" in to it's own folder in the "hakchi-gui-win32" folder 10. copy one of the folders in "hakchi-gui-win32\nesromtool\roms" and replace the .nes and "label.png" files with those matching your game 11. run "hakchi-gui-win32\nesromtool\nesromtool.bat" which should put your ROM(s) in to the "hakchi-gui-win32\mod\hakchi\transfer\rootfs\usr\share\games\nes\kachikachi" folder 12. in "hakchi-gui" click "rebuild kernel"

29 File(s) copied

    826496 ->    356668   43.15%    linux/arm    cryptsetup

void Worker::do_packKernel() - OK

13. click "memboot" and wait for the NES to switch off

uploading fes1.bin ... done
uploading uboot.bin ... done
boota 43800000
void Worker::do_memboot() - OK

14. turn the NES off (so the power button is out), keep holding the reset button, press the power button, release the "reset" button after 3 seconds (as step 2 above) 15. in "hakchi-gui" click "flash kernel" (answer "yes" when prompted if you're sure)

uploading fes1.bin ... done
uploading uboot.bin ... done
sunxi_flash phy_write 43800000 30 17;fastboot_test
usb_bulk_recv() ERROR -7: Operation timed out
kernel: write ok
sunxi_flash phy_read 43800000 30 17;fastboot_test
usb_bulk_recv() ERROR -7: Operation timed out
kernel: verify ok
boota 43800000
void Worker::do_flashKernel() - OK

16. you may need to hard reboot the machine, or create the Super Mario Bros save game, to see your custom ROMs. 17. it's also worth checking the reddit thread for more news or help with this 18. there's also someone who says they've made a tool for getting ROM poster art and making the config files in that thread