Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 1 | \section{\label{ref:Rockboxinflash}Rockbox in Flash} |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 2 | |
Martin Arver | 30b0e66 | 2006-06-15 11:56:50 +0000 | [diff] [blame] | 3 | \subsection{Introduction} |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 4 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 5 | When you bought your \playertype, it came with the \playerman\ firmware in |
| 6 | flash ROM. When you power on your \dap, this \playerman\ firmware starts, |
| 7 | and then loads an updated firmware from disk if present (\firmwarefilename). |
| 8 | An ordinary Rockbox installation only replaces the on-disk firmware, leaving |
| 9 | the flash ROM contents intact. That means the \playerman\ firmware still |
| 10 | controls the boot process. |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 11 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 12 | The main reason to change this is to improve the startup time of your player. |
| 13 | The \playerman\ bootloader is rather slow. With Rockbox in flash, your \dap\ |
| 14 | will boot much faster, typically in three to five seconds. Furthermore you |
| 15 | might prefer a clean Rockbox environment, with as little remnants of the |
| 16 | \playerman\ software as possible. |
| 17 | \opt{rombox}{On your \dap\ it is also possible to execute Rockbox directly |
| 18 | from flash ROM, increasing the amount of free RAM for buffering music. This |
| 19 | is called \emph{Rombox}. |
| 20 | } |
| 21 | |
| 22 | \warn{Flashing your \dap\ is somewhat dangerous, like programming a mainboard |
| 23 | \emph{BIOS}, \emph{CD/DVD} drive firmware, mobile phone, etc. If the power |
| 24 | fails, the chip breaks while programming or most of all the programming |
| 25 | software malfunctions, you'll have a dead box. We take no responsibility of |
| 26 | any kind, you do that at your own risk. However, we tried as carefully as |
| 27 | possible to bulletproof this code. There are a lot of sanity checks. If any |
| 28 | of them fails, it will not program. |
| 29 | } |
| 30 | |
| 31 | \opt{ondio}{\warn{After flashing Rockbox, never try to ROLO the \playerman\ |
| 32 | firmware |
| 33 | \opt{ondiofm}{versions 1.31f or 1.32b! These versions are flash updates |
| 34 | themselves. If they are} |
| 35 | \opt{ondiosp}{version 1.32b! This version is a flash update itself. |
| 36 | If it is} |
| 37 | applied when Rockbox is flashed, you'll end up with a garbled flash ROM |
| 38 | and hence a dead box. |
| 39 | }} |
| 40 | |
| 41 | There's an ultimate safety net to bring back boxes with even completely |
| 42 | garbled flash content: the \emph{UART} boot mod, which in turn requires the |
| 43 | \emph{serial} mod. With that it's possible to reflash independently from the |
| 44 | outside, even if the flash ROM is completely erased. |
Alexander Levin | e8c72b6 | 2010-05-09 18:33:31 +0000 | [diff] [blame] | 45 | \nopt{ondio}{This won't work if you have one of the rare ``ROMless'' boxes. These |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 46 | have no boot ROM and boot directly from flash. |
| 47 | } |
Alex Parker | 964a5e6 | 2011-08-09 14:39:32 +0000 | [diff] [blame] | 48 | If the first $\approx$2~KB of the flash ROM are flashed OK, \emph{Minimon} can |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 49 | be used for the same purpose. |
| 50 | |
Jens Arnold | 43ad46c | 2008-10-20 07:10:14 +0000 | [diff] [blame] | 51 | \subsection{Terminology and Basic Operation} |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 52 | |
Martin Arver | 30b0e66 | 2006-06-15 11:56:50 +0000 | [diff] [blame] | 53 | \begin{description} |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 54 | \item[Firmware:] The flash ROM contents as a whole. |
| 55 | \item[Image:] One operating software started from there. |
Martin Arver | 30b0e66 | 2006-06-15 11:56:50 +0000 | [diff] [blame] | 56 | \end{description} |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 57 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 58 | The replacement firmware contains a bootloader and two images. The first image |
| 59 | is the \emph{permanent} rescue software, to be used in case something is wrong |
| 60 | with the second (main) image. In current firmware files this first image |
| 61 | contains \emph{Bootbox} (see wiki for details). The second image is what is |
Jens Arnold | a5501d6 | 2009-03-24 01:11:44 +0000 | [diff] [blame] | 62 | booted by default. The current firmware files contain a copy of Rockbox 3.2 |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 63 | in the main image. It can easily be updated/replaced later. |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 64 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 65 | The bootloader allows to select which image to run. Pressing |
| 66 | \opt{RECORDER_PAD}{\ButtonFOne}\opt{PLAYER_PAD,ONDIO_PAD}{\ButtonLeft} at boot |
| 67 | selects the first image. |
| 68 | \opt{RECORDER_PAD}{\ButtonFTwo}\opt{PLAYER_PAD}{\ButtonPlay}\opt{ONDIO_PAD}{\ButtonUp} |
| 69 | selects the second image, which will also be booted if you don't press any |
| 70 | button. The button mapping is only there for completeness. |
| 71 | \opt{RECORDER_PAD}{\ButtonFThree}\opt{PLAYER_PAD,ONDIO_PAD}{\ButtonRight} |
| 72 | selects the built-in serial monitor called \emph{Minimon}. You should know this |
| 73 | in case you invoke it by accident. Minimon won't display anything on the |
| 74 | screen. To get out of it, perform a hardware shutdown of your \dap. |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 75 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 76 | \subsection{Initial Flashing Procedure} |
Martin Arver | 30b0e66 | 2006-06-15 11:56:50 +0000 | [diff] [blame] | 77 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 78 | You only need to perform this procedure the first time you flash your |
| 79 | \playertype. You may also want to perform it in case the update procedure for |
| 80 | the second image recommends it. In the latter case do not perform the steps |
Alexander Levin | e8c72b6 | 2010-05-09 18:33:31 +0000 | [diff] [blame] | 81 | listed under ``Preparation''. |
Martin Arver | 30b0e66 | 2006-06-15 11:56:50 +0000 | [diff] [blame] | 82 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 83 | \subsubsection{Preparation} |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 84 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 85 | \nopt{ondio}{ |
| 86 | First, check whether your \playertype\ is flashable at all. Select |
| 87 | \setting{System $\rightarrow$ Debug (Keep Out!) $\rightarrow$ View HW |
| 88 | Info}. |
| 89 | \opt{lcd_charcell}{Cycle through the displayed values with \ButtonRight / |
Alexander Levin | e8c72b6 | 2010-05-09 18:33:31 +0000 | [diff] [blame] | 90 | \ButtonLeft\ until ``Flash:'' is displayed. If it shows question marks, |
Martin Arver | 30b0e66 | 2006-06-15 11:56:50 +0000 | [diff] [blame] | 91 | } |
Alexander Levin | e8c72b6 | 2010-05-09 18:33:31 +0000 | [diff] [blame] | 92 | \opt{lcd_bitmap}{Check the values in the line starting with ``Flash:''. If it |
| 93 | shows question marks after ``M='' and ``D='', |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 94 | } |
| 95 | you're out of luck, your \dap\ is not flashable without modifying the |
| 96 | hardware. You can stop here. Sorry. |
Martin Arver | 30b0e66 | 2006-06-15 11:56:50 +0000 | [diff] [blame] | 97 | } |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 98 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 99 | \nopt{ondio}{If your \dap\ is flashable, you}\opt{ondio}{You} should perform a |
| 100 | backup of the current flash ROM contents, in case you want to restore it later. |
| 101 | Select \setting{System $\rightarrow$ Debug (Keep Out!) $\rightarrow$ Dump ROM |
| 102 | contents}. You'll notice a few seconds of disk activity. When you connect your |
| 103 | \dap\ to the PC afterwards, you'll find two files in the root of your \dap. |
Andree Buschmann | 6a96037 | 2010-05-09 21:03:30 +0000 | [diff] [blame] | 104 | Copy the 256~KB-sized file named \fname{internal\_rom\_2000000-203FFFF.bin} to |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 105 | a safe place. |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 106 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 107 | \subsubsection{Flashing} |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 108 | |
Martin Arver | 30b0e66 | 2006-06-15 11:56:50 +0000 | [diff] [blame] | 109 | \begin{enumerate} |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 110 | \item Download the correct package for your \dap\ from |
| 111 | \url{http://download.rockbox.org/bootloader/archos/}. It is named |
| 112 | \fname{flash-{\textless}model{\textgreater}-{\textless}version{\textgreater}.zip}. |
Jens Arnold | a5501d6 | 2009-03-24 01:11:44 +0000 | [diff] [blame] | 113 | The current packages are v3. |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 114 | \item Unzip the flash package to the root of your \dap. |
| 115 | \nopt{ondio}{This will extract two files to the root, |
| 116 | \fname{firmware\_{\textless}model{\textgreater}.bin} and |
Jens Arnold | 43ad46c | 2008-10-20 07:10:14 +0000 | [diff] [blame] | 117 | \fname{firmware\_{\textless}model{\textgreater}\_norom.bin}. |
| 118 | \opt{recorder,recorderv2fm}{(The {\textless}model{\textgreater} part is |
| 119 | slighty different from that in the .zip file name.) |
| 120 | } |
| 121 | The flash plugin will select the correct one for your \dap. |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 122 | } |
| 123 | \opt{ondio}{This will extract one file to the root, |
| 124 | \fname{firmware\_{\textless}model{\textgreater}.bin}. |
| 125 | } |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 126 | Now safely disconnect USB. |
| 127 | \item |
| 128 | \nopt{ondio}{Make sure your batteries are in good shape and fully charged.} |
| 129 | \opt{ondio}{Make sure you use a set of fresh batteries.} |
| 130 | Flashing doesn't need more power than normal operation, but you don't want |
| 131 | your \dap\ to run out of power while flashing. |
| 132 | \item Select \setting{Plugins $\rightarrow$ Applications}, and run the |
| 133 | \fname{firmware\_flash} plugin. It will tell you about your flash and |
| 134 | which file it is going to program. After pressing |
| 135 | \opt{RECORDER_PAD}{\ButtonFOne}\opt{PLAYER_PAD}{\ButtonMenu}\opt{ONDIO_PAD}{\ButtonLeft} |
| 136 | it will check the file. If the file is OK, pressing |
| 137 | \opt{RECORDER_PAD}{\ButtonFTwo}\opt{PLAYER_PAD}{\ButtonOn}\opt{ONDIO_PAD}{\ButtonUp} |
| 138 | will give you a big warning. If we still didn't manage to scare you off, you |
| 139 | need to press |
| 140 | \opt{RECORDER_PAD}{\ButtonFThree}\opt{PLAYER_PAD,ONDIO_PAD}{\ButtonRight} |
| 141 | to actually program and verify. The programming takes just a few seconds. |
| 142 | \item In the unlikely event that the programming or verify steps should give |
| 143 | you any error, \emph{do not switch off the box!} Otherwise you'll have seen |
| 144 | it working for the last time. While Rockbox is still in RAM and operational, |
| 145 | we could upgrade the plugin via USB and try again. If you switch it off, |
| 146 | it's gone. |
Martin Arver | 30b0e66 | 2006-06-15 11:56:50 +0000 | [diff] [blame] | 147 | \end{enumerate} |
| 148 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 149 | \note{After successful flashing you may delete the \fname{.bin} files from the |
| 150 | root of your \dap. |
Martin Arver | 30b0e66 | 2006-06-15 11:56:50 +0000 | [diff] [blame] | 151 | } |
| 152 | |
Andree Buschmann | 6a96037 | 2010-05-09 21:03:30 +0000 | [diff] [blame] | 153 | \note{There are no separate flash packages for {\dap}s modified to have 8~MB |
Jens Arnold | 43ad46c | 2008-10-20 07:10:14 +0000 | [diff] [blame] | 154 | of RAM. You need to use the corresponding package for non-modified |
Alex Parker | 3a0a991 | 2009-05-10 18:53:34 +0000 | [diff] [blame] | 155 | \playertype. You should then install a Rockbox image that makes use of all |
Jens Arnold | 43ad46c | 2008-10-20 07:10:14 +0000 | [diff] [blame] | 156 | available RAM as described in the following section. |
| 157 | } |
| 158 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 159 | \subsection{Updating the Rockbox Image in Flash} |
Martin Arver | 30b0e66 | 2006-06-15 11:56:50 +0000 | [diff] [blame] | 160 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 161 | When Rockbox is booted from flash, it does not check for an updated firmware |
| 162 | on disk. This is one of the reasons why it boots faster than the \playerman\ |
| 163 | firmware. It means that whenever you update Rockbox, you also need to update |
| 164 | the image in the flash. This is a simple and safe procedure: |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 165 | |
Martin Arver | 30b0e66 | 2006-06-15 11:56:50 +0000 | [diff] [blame] | 166 | \begin{enumerate} |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 167 | \item Download (or build) the Rockbox build you want to use, and unzip it to |
| 168 | the root of your \dap. Safely disconnect USB. |
Alex Parker | 3a0a991 | 2009-05-10 18:53:34 +0000 | [diff] [blame] | 169 | \item ROLO into the new Rockbox version. |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 170 | \item Go to the file browser, and enter the \fname{.rockbox} directory (you |
| 171 | might need to set the \setting{File View} option to \setting{All}.) |
| 172 | \item Play the file \fname{rockbox.ucl}\opt{rombox}{, or preferably |
| 173 | \fname{rombox.ucl}}, and follow the instructions. The plugin handling |
| 174 | this is \fname{rockbox\_flash}, a viewer plugin. |
Martin Arver | 30b0e66 | 2006-06-15 11:56:50 +0000 | [diff] [blame] | 175 | \end{enumerate} |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 176 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 177 | \subsection{Restoring the Original Flash ROM Contents} |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 178 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 179 | In case you ever want to restore the original flash contents, you will need |
| 180 | the backup file. The procedure is very similar to initial flashing, with the |
| 181 | following differences: |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 182 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 183 | \begin{enumerate} |
| 184 | \item Check that you do not have any \fname{firmware\_*.bin} files in your |
| 185 | \dap's root. |
| 186 | \item Select \setting{Plugins $\rightarrow$ Applications}, and run the |
| 187 | \fname{firmware\_flash} plugin. Write down the filename it displays in the |
| 188 | first screen, then exit the plugin. |
| 189 | \item Connect USB, and copy the flash ROM backup file to the root of your |
| 190 | \dap. \emph{Only use the backup file from that very box, otherwise you're |
| 191 | asking for trouble!} Rename the file so that it matches the name requested |
| 192 | by the \fname{firmware\_flash} plugin. Safely disconnect USB. |
| 193 | \end{enumerate} |
Martin Arver | d3d3e34 | 2006-03-15 10:56:14 +0000 | [diff] [blame] | 194 | |
Jens Arnold | 1f2468b | 2008-10-19 23:59:46 +0000 | [diff] [blame] | 195 | Now follow the instructions given for initial flashing, starting with step 3. |