diff options
Diffstat (limited to 'utils/jztool/README.md')
-rw-r--r-- | utils/jztool/README.md | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/utils/jztool/README.md b/utils/jztool/README.md new file mode 100644 index 0000000000..72c630c6c3 --- /dev/null +++ b/utils/jztool/README.md | |||
@@ -0,0 +1,135 @@ | |||
1 | # jztool -- Ingenic device utility & bootloader installer | ||
2 | |||
3 | The `jztool` utility can help install, backup, and restore the bootloader on | ||
4 | Rockbox players based on a supported Ingenic SoC (currently only the X1000). | ||
5 | |||
6 | ## Running jztool | ||
7 | |||
8 | ### Getting a bootloader | ||
9 | |||
10 | To use `jztool` you need to compile or download a bootloader for your player. | ||
11 | It's recommended to use only official released bootloaders, since bootloaders | ||
12 | compiled from Git are not tested and might be buggy. | ||
13 | |||
14 | You can download released bootloaders from <https://download.rockbox.org/>. | ||
15 | |||
16 | The bootloader file is named after the target: for example, the FiiO M3K | ||
17 | bootloader is called `bootloader.m3k`. The FiiO M3K is used as an example | ||
18 | here, but the instructions apply to all X1000-based players. | ||
19 | |||
20 | Use `jztool --help` to find out the model name of your player. | ||
21 | |||
22 | ### Entering USB boot mode | ||
23 | |||
24 | USB boot mode is a low-level mode provided by the CPU which allows a computer | ||
25 | to load firmware onto the device. You need to put your player into this mode | ||
26 | manually before using `jztool` (unfortunately, it can't be done automatically.) | ||
27 | |||
28 | To connect the player in USB boot mode, follow these steps: | ||
29 | |||
30 | 1. Ensure the player is fully powered off. | ||
31 | 2. Plug one end of the USB cable into your player. | ||
32 | 3. Hold down your player's USB boot key (see below). | ||
33 | 4. Plug the other end of the USB cable into your computer. | ||
34 | 5. Let go of the USB boot key. | ||
35 | |||
36 | The USB boot key depends on your player: | ||
37 | |||
38 | - FiiO M3K: Volume Down | ||
39 | - Shanling Q1: Play | ||
40 | - Eros Q: Menu | ||
41 | |||
42 | ### Linux/Mac | ||
43 | |||
44 | Run the following command in a terminal. Note that on Linux, you will need to | ||
45 | have root access to allow libusb to access the USB device. | ||
46 | |||
47 | ```sh | ||
48 | # Linux / Mac | ||
49 | # NOTE: root permissions are required on Linux to access the USB device | ||
50 | # eg. with 'sudo' or 'su -c' depending on your distro. | ||
51 | $ ./jztool fiiom3k load bootloader.m3k | ||
52 | ``` | ||
53 | |||
54 | ### Windows | ||
55 | |||
56 | To allow `jztool` access to your player in USB boot mode, you need to install | ||
57 | the WinUSB driver. The recommended way to install it is using Zadig, which | ||
58 | may be downloaded from its homepage <https://zadig.akeo.ie>. Please note | ||
59 | this is 3rd party software not maintained or supported by Rockbox developers. | ||
60 | (Zadig will require administrator access on the machine you are using.) | ||
61 | |||
62 | When running Zadig you must select the WinUSB driver; the other driver options | ||
63 | will not work properly with `jztool`. You will have to select the correct USB | ||
64 | device in Zadig. All X1000-based players use the same USB ID while in USB boot | ||
65 | mode, listed below. NOTE: the device name may show only as "X" and a hollow | ||
66 | square in Zadig. The IDs will not change, so those are the most reliable way | ||
67 | to confirm you have selected the correct device. | ||
68 | |||
69 | ``` | ||
70 | Name: Ingenic Semiconductor Co.,Ltd X1000 | ||
71 | USB ID: A108 1000 | ||
72 | ``` | ||
73 | |||
74 | Assuming you installed the WinUSB driver successfully, open a command prompt | ||
75 | in the folder containing `jztool`. Administrator access is not required for | ||
76 | this step. | ||
77 | |||
78 | Type the following command to load the Rockbox bootloader: | ||
79 | |||
80 | ```sh | ||
81 | # Windows | ||
82 | $ jztool.exe fiiom3k load bootloader.m3k | ||
83 | ``` | ||
84 | |||
85 | ## Using the recovery menu | ||
86 | |||
87 | If `jztool` runs successfully your player will display the Rockbox bootloader's | ||
88 | recovery menu. If you want to permanently install Rockbox to your device, copy | ||
89 | the bootloader file you downloaded to the root of your SD card, insert the SD | ||
90 | card to your player, and choose "Install/update bootloader" from the menu. | ||
91 | |||
92 | It is _highly_ recommended that you take a backup of your existing bootloader | ||
93 | in case of any trouble -- choose "Backup bootloader" from the recovery menu. | ||
94 | The backup file is called `PLAYER-boot.bin`, where `PLAYER` is the model name. | ||
95 | (Example: `fiiom3k-boot.bin`.) | ||
96 | |||
97 | You can restore the backup later by putting it on the root of your SD card and | ||
98 | selecting "Restor bootloader" in the recovery menu. | ||
99 | |||
100 | After installing the Rockbox bootloader, you can access the recovery menu by | ||
101 | holding a key while booting: | ||
102 | |||
103 | - FiiO M3K: Volume Up | ||
104 | - Shanling Q1: Next (button on the lower left) | ||
105 | - Eros Q: Volume Up | ||
106 | |||
107 | ### Known issues | ||
108 | |||
109 | - When using the bootloader's USB mode, you may get stuck on "Waiting for USB" | ||
110 | even though the cable is already plugged in. If this occurs, unplug the USB | ||
111 | cable and plug it back in to trigger the connection. | ||
112 | |||
113 | |||
114 | ## TODO list | ||
115 | |||
116 | ### Add better documentation and logging | ||
117 | |||
118 | There's only a bare minimum of documentation, and logging is sparse, not | ||
119 | really enough to debug problems. | ||
120 | |||
121 | Some of the error messages could be friendlier too. | ||
122 | |||
123 | ### Integration with the Rockbox utility | ||
124 | |||
125 | Adding support to the Rockbox utility should be mostly boilerplate since the | ||
126 | jztool library wraps all the troublesome details. | ||
127 | |||
128 | Permissions are an issue on Linux because by default only root can access | ||
129 | "raw" USB devices. If we want to package rbutil for distro we can install | ||
130 | a udev rule to allow access to the specific USB IDs we need, eg. allowing | ||
131 | users in the "wheel" group to access the device. | ||
132 | |||
133 | On Windows and Mac, no special permissions are needed to access USB devices | ||
134 | assuming the drivers are set up. (Zadig does require administrator access | ||
135 | to run, but that's external to the Rockbox utility.) | ||