summaryrefslogtreecommitdiff
path: root/utils/jztool/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'utils/jztool/README.md')
-rw-r--r--utils/jztool/README.md135
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
3The `jztool` utility can help install, backup, and restore the bootloader on
4Rockbox players based on a supported Ingenic SoC (currently only the X1000).
5
6## Running jztool
7
8### Getting a bootloader
9
10To use `jztool` you need to compile or download a bootloader for your player.
11It's recommended to use only official released bootloaders, since bootloaders
12compiled from Git are not tested and might be buggy.
13
14You can download released bootloaders from <https://download.rockbox.org/>.
15
16The bootloader file is named after the target: for example, the FiiO M3K
17bootloader is called `bootloader.m3k`. The FiiO M3K is used as an example
18here, but the instructions apply to all X1000-based players.
19
20Use `jztool --help` to find out the model name of your player.
21
22### Entering USB boot mode
23
24USB boot mode is a low-level mode provided by the CPU which allows a computer
25to load firmware onto the device. You need to put your player into this mode
26manually before using `jztool` (unfortunately, it can't be done automatically.)
27
28To connect the player in USB boot mode, follow these steps:
29
301. Ensure the player is fully powered off.
312. Plug one end of the USB cable into your player.
323. Hold down your player's USB boot key (see below).
334. Plug the other end of the USB cable into your computer.
345. Let go of the USB boot key.
35
36The 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
44Run the following command in a terminal. Note that on Linux, you will need to
45have 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
56To allow `jztool` access to your player in USB boot mode, you need to install
57the WinUSB driver. The recommended way to install it is using Zadig, which
58may be downloaded from its homepage <https://zadig.akeo.ie>. Please note
59this is 3rd party software not maintained or supported by Rockbox developers.
60(Zadig will require administrator access on the machine you are using.)
61
62When running Zadig you must select the WinUSB driver; the other driver options
63will not work properly with `jztool`. You will have to select the correct USB
64device in Zadig. All X1000-based players use the same USB ID while in USB boot
65mode, listed below. NOTE: the device name may show only as "X" and a hollow
66square in Zadig. The IDs will not change, so those are the most reliable way
67to confirm you have selected the correct device.
68
69```
70Name: Ingenic Semiconductor Co.,Ltd X1000
71USB ID: A108 1000
72```
73
74Assuming you installed the WinUSB driver successfully, open a command prompt
75in the folder containing `jztool`. Administrator access is not required for
76this step.
77
78Type 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
87If `jztool` runs successfully your player will display the Rockbox bootloader's
88recovery menu. If you want to permanently install Rockbox to your device, copy
89the bootloader file you downloaded to the root of your SD card, insert the SD
90card to your player, and choose "Install/update bootloader" from the menu.
91
92It is _highly_ recommended that you take a backup of your existing bootloader
93in case of any trouble -- choose "Backup bootloader" from the recovery menu.
94The backup file is called `PLAYER-boot.bin`, where `PLAYER` is the model name.
95(Example: `fiiom3k-boot.bin`.)
96
97You can restore the backup later by putting it on the root of your SD card and
98selecting "Restor bootloader" in the recovery menu.
99
100After installing the Rockbox bootloader, you can access the recovery menu by
101holding 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
118There's only a bare minimum of documentation, and logging is sparse, not
119really enough to debug problems.
120
121Some of the error messages could be friendlier too.
122
123### Integration with the Rockbox utility
124
125Adding support to the Rockbox utility should be mostly boilerplate since the
126jztool library wraps all the troublesome details.
127
128Permissions 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
130a udev rule to allow access to the specific USB IDs we need, eg. allowing
131users in the "wheel" group to access the device.
132
133On Windows and Mac, no special permissions are needed to access USB devices
134assuming the drivers are set up. (Zadig does require administrator access
135to run, but that's external to the Rockbox utility.)