From 152f07e4785a29f912152f9fc0a5b461c9d79cc7 Mon Sep 17 00:00:00 2001 From: Jörg Hohensohn Date: Mon, 24 Nov 2003 18:42:04 +0000 Subject: Updated by Peter Schlenker for the manual git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4065 a1c6a512-1295-4272-9138-f99709370657 --- www/docs/flash.t | 597 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 355 insertions(+), 242 deletions(-) (limited to 'www') diff --git a/www/docs/flash.t b/www/docs/flash.t index 4ce6785bf5..20c31e16b3 100644 --- a/www/docs/flash.t +++ b/www/docs/flash.t @@ -3,301 +3,414 @@

by Jörg Hohensohn aka [IDC]Dragon

-1. What is this about?
-2. How is it working?
-3. Is it dangerous?
-4. Will it work for me?
-5. How do I flash the firmware?
-6. How do I bring in a current / my personal build of Rockbox?
-7. Known issues, limitations
+1. Introduction
+2. Method
+3. Risks
+4. Requirements
+5. Flashing procedure
+6. Bringing in a current or personal build of Rockbox
+7. Known issues and limitations
8. Movies and images
-

1. What is this about?

+ +

1. Introduction

-Flashing in the sense used here and elsewhere in regard to Rockbox means -reprogramming the flash memory of the Archos unit. Flash memory (sometimes -called "Flash ROM") is a type of nonvolatile memory that can be erased and -reprogrammed in circuit. It is a variation of electrically erasable -programmable read-only memory (EEPROM). +Flashing +in the sense used here and elsewhere in regard to Rockbox means +reprogramming the flash memory of the Archos unit. Flash memory +(sometimes called "Flash ROM") is a type of nonvolatile +memory that can be erased and reprogrammed in circuit. It is a +variation of electrically erasable programmable read-only memory +(EEPROM). +

- When you bought Your Archos, it came with the Archos firmware flashed. Now, -you can replace the built-in software with Rockbox. +When +you bought your Archos, it came with the Archos firmware flashed. +Now, you can replace the built-in software with Rockbox. +

-Some terminology I'm gonna use in the following:
+Terminology used in the following:
Firmware means the flash ROM content as a whole.
Image means one operating software started from there. +

-By reprogramming the firmware we can bot much faster. Archos has a pathetic -boot loader, versus the boot time for Rrockbox is much faster than the disk -spinup, in fact it has to wait for the disk. Your boot time will be as quick as -a disk spinup. In my case, that's 4 seconds from powerup until resuming -playback. - -

2. How is it working?

+By +reprogramming the firmware we can boot much faster. Archos has a +pathetic boot loader, versus the boot time for Rockbox is much faster +than the disk spinup, in fact it has to wait for the disk. Your boot +time will be as quick as a disk spinup (e.g. 4 seconds from powerup +until resuming playback). +

+ +

2. Method

-The replaced firmware will host a bootloader and 2 images. I use data -compression to make this possible. The first is the "permanent" backup, not to -be changed any more. The second is the default one to be started, the first is -only used when you hold the F1 key during start. Like supplied here, the first -image is the original Archos firmware, the second is a current build of -Rockbox. This second image is meant to be reprogrammed, it can contain anything -you like, if you prefer, you can program the Archos firmware to there, too. +The +replaced firmware will host a bootloader and 2 images. This possible +by compression. The first is the "permanent" backup, not to +be changed any more. The second is the default one to be started, the +first is only used when you hold the F1 key during start. Like +supplied here, the first image is the original Archos firmware, the +second is a current build of Rockbox. This second image is meant to +be reprogrammed, it can contain anything you like, if you prefer, you +can program the Archos firmware to there, too. +

-I supply two programming tools: +There are two programming tools supplied: +

-I will provide more technical details in the future, as well as my non-user +More technical details will be provided in the future, as well as non-user tools. There's an authoring tool which composed the firmware file with the bootloader and the 2 images, the bootloader project, the plugin sources, and the tools for the UART boot feature: a monitor program for the box and a PC -tool to drive it. Feel free to review the -sources +tool to drive it. Feel free to review the +sources for all of it, but be careful when fooling around with powerful toys! +

-

3. Is it dangerous?

+

3. Risks

-Yes, certainly, like programming a mainboard BIOS, CD/DVD drive firmware, -mobile phone, etc. If the power fails, your chip breaks while programming or -most of all the programming software malfunctions, you'll have a dead box. And -I take no responsibility of any kind, you do that at your own risk. However, I -tried as carefully as possible to bulletproof this code. The new firmware file -is completely read before it starts programming, there are a lot of sanity -checks. If any fails, it will not program. Before releasing this, I have -checked the flow with exactly these files supplied here, starting from the -original firmware in flash. It worked reliably for me, there's no reason why -such low level code should behave different on your box. +Well, +is it dangerous? Yes, certainly, like programming a mainboard BIOS, +CD/DVD drive firmware, mobile phone, etc. If the power fails, your +chip breaks while programming or most of all the programming software +malfunctions, you'll have a dead box. We take no responsibility of +any kind, you do that at your own risk. However, we tried as +carefully as possible to bulletproof this code. The new firmware file +is completely read before it starts programming, there are a lot of +sanity checks. If any fails, it will not program. Before releasing +this, we have checked the flow with exactly these files supplied +here, starting from the original firmware in flash. It worked +reliably, there's no reason why such low level code should behave +different on your box. +

-There's one ultimate safety net to bring back boxes with even completely -garbled flash content: the UART boot mod, which in turn requires the serial -mod. It can bring the dead back to life, with that it's possible to reflash -independently from the outside, even if the flash is completely erased. I used -that during development, else Rockbox in flash wouldn't have been possible. -Most of the developing effort went into this tooling. So people skilled to do -these mods don't need to worry. The others may feel unpleasant using the first +There's +one ultimate safety net to bring back boxes with even completely +garbled flash content: the UART boot mod, which in turn requires the +serial mod. It can bring the dead back to life, with that it's +possible to reflash independently from the outside, even if the flash +is completely erased. It has been used that during development, else +Rockbox in flash wouldn't have been possible. Most of the developing +effort went into this tooling. So people skilled to do these mods +don't need to worry. The others may feel unpleasant using the first tool for reflashing the firmware. +

-To comfort you a bit again: The flash tools are stable since quite a while. -I use them a lot and quite careless meanwhile, even reflashed while playing. -However, I don't generally recommend that. ;-) +To +comfort you a bit again: The flash tools are stable since quite a +while. Several people use them a lot and quite careless meanwhile, +even reflashed while playing. However, we don't generally recommend +that. ;-) +

-About the safety of operation: Since we have dual boot, you're not giving up -the Archos firmware. It's still there when you hold F1 during startup. So even -if Rockbox from flash is not 100% stable for everyone, you can still use the -box, reflash the second image with an updated Rockbox copy, etc. +About +the safety of operation: Since we have dual boot, you're not giving +up the Archos firmware. It's still there when you hold F1 during +startup. So even if Rockbox from flash is not 100% stable for +everyone, you can still use the box, reflash the second image with an +updated Rockbox copy, etc. +

-The flash chip being used by Archos is specified for 100,000 cycles (in words: -one hundred thousand), so you don't need to worry about that wearing out. +The +flash chip being used by Archos is specified for 100,000 cycles (in +words: one hundred thousand), so you don't need to worry about that +wearing out. +

-

4. Will it work for me?

+

4. Requirements

-You need three things: +You need two things: +

-

5. How do I flash the firmware?

-

-Short explaination: copy the firmware_*.bin files for your model from my distribution -to the root directory of your box, then run the "firmware_flash.rock" plugin. -Long version: +

5. Flashing procedure

- -I'm using the new plugin feature to run the flasher code. There's not really a -wrong path to take, however here's a suggested step by step procedure: +Short +explanation: copy the firmware_*.bin files for your model from the +distribution to the root directory of your box, then run the +"firmware_flash.rock" plugin. Long version, step by step +procedure: +

- -When for any reason you'd like to revert to the original firmware, you can do -like above, but copy and rename your backup to be "firmware_rec.bin" on the -box this time. Keep the Rockbox copy and the plugins of this package for that -job, because that's the one it was tested with. - -

6. How do I bring in a current / my personal build of Rockbox?

-

Short explaination: very easy, just play a .ucl file like "rockbox.ucl" +

+When +for any reason you'd like to revert to the original firmware, you can +do like above, but copy and rename your backup to be +"firmware_rec.bin" on the box this time. Keep the Rockbox +copy and the plugins of this package for that job, because that's the +one it was tested with. +

+ +

6. Bringing in a current or personal build of Rockbox

+

+Short +explanation: very easy, just play a .ucl file like "rockbox.ucl" from the download or build. Long version: - +

-The second image is the working copy, the "rockbox_flash.rock" plugin from this -package reprograms it. The plugins needs to be consistant with the Rockbox -plugin API version, otherwise it will detect mismatch and won't run. - -

It requires an exotic input, a UCL-compressed image, because -that's my internal format. UCL is a nice open-source compression library I -found and use. The decompression is very fast and less than a page of -C-code. The efficiency is even better than Zip with maximum compression, cooks -it down to about 58% of the original size. For details on UCL, see: www.oberhumer.com/opensource/ucl/ - -

Linux users will have to download it from there and compile it, for Win32 -and Cygwin I can do that, so the executables are in +The +second image is the working copy, the "rockbox_flash.rock" +plugin from this package reprograms it. The plugins needs to be +consistant with the Rockbox plugin API version, otherwise it will +detect mismatch and won't run. +

+

+It +requires an exotic input, a UCL-compressed image, because that's the +internal format. UCL is a nice open-source compression library. The +decompression is very fast and less than a page of C-code. The +efficiency is even better than Zip with maximum compression, cooks it +down to about 58% of the original size. For details on UCL, see: +www.oberhumer.com/opensource/ucl/ + +

+

+Linux +users will have to download it from there and compile it, for Win32 +and Cygwin the executables are in the packages. -The sample program from that download is called "uclpack". We'll use that to -compress "rockbox.bin" which is the result of the compilation. This is -a part of the build process meanwhile. If you compile Rockbox yourself, -you should copy uclpack to a directory which is in the path, I recommend -placing it int the same dir as SH compiler. - +The sample program from that download is called "uclpack". +We'll use that to compress "rockbox.bin" which is the +result of the compilation. This is a part of the build process +meanwhile. If you compile Rockbox yourself, you should copy uclpack +to a directory which is in the path, we recommend placing it in the +same dir as SH compiler. +

-Don't flash any "old" builds which don't have the latest coldstart ability I -brought into cvs these days. They won't boot. These instructions refer to +Don't +flash any "old" builds which don't have the latest +coldstart ability. They won't boot. These instructions refer to builds from cvs state 2003-07-10 on. +

Here are the steps: +

- -A more luxurious version of the plugin could do the descrambling and -compression by itself, but that's hard to do because a plugin is very limited -with memory (32kB for code and data). Currently I'm doing one flash sector -(4096 bytes) at a time. Don't know how slow the compression algorithm would be -on the box, that's the strenuous part.

-If you like or have to, you can also flash the Archos image as the second one, -e.g. in case Rockbox from flash doesn't work for you. This way you keep the -dual bootloader and you can easily try different later. I prepared +If +you like or have to, you can also flash the Archos image as the +second one, e.g. in case Rockbox from flash doesn't work for you. +This way you keep the dual bootloader and you can easily try +different later. You can download UCLs -for the latest Recorder and FM firmware. +for the latest Recorder and FM firmware +here. -

7. Known issues, limitations

-

-Latest Rockbox now has a charging screen, but it is in an early stage. You'll -get it when the unit is off and you plug in the charger. The Rockbox charging -algorithm is first measuring the battery voltage for about 40 seconds, after -that it only starts charging when the capacity is below 85%. -You can use the Archos charging (which always tops off) by holding F1 -while plugging in. Some FM users reported charging problems even with F1, -they had to revert to the original flash content. +

+

7. Known issues and limitations

-If the plugin API is changed, new builds may render the plugins -incompatible. When updating, make sure you grab those too, and rolo into -the new version before flashing it. - +Latest +Rockbox now has a charging screen, but it is in an early stage. +You'll get it when the unit is off and you plug in the charger. The +Rockbox charging algorithm is first measuring the battery voltage for +about 40 seconds, after that it only starts charging when the +capacity is below 85%. You can use the Archos charging (which always +tops off) by holding F1 while plugging in. Some FM users reported +charging problems even with F1, they had to revert to the original +flash content. +

-There are two variants of how the boxes starts, therefore the normal and the _norom -firmware files. The vast majority of the Player/Recorder/FM all have the same boot -ROM content, differenciation comes later by flash content. Rockbox identifies this -boot ROM with a CRC value of 0x222F in the hardware info screen. Some recorders -have the boot ROM disabled (it might be unprogrammed) and start directly from a -flash mirror at address zero. They need the new _norom firmware, it has a slightly -different bootloader. Without a boot ROM there is no UART boot safety net. To -compensate for that as much as possible I have included my MiniMon monitor, -it starts with F3+On. Using that the box can be reprogrammed via serial if the -first ~2000 bytes of the flash are OK. +If +the plugin API is changed, new builds may render the plugins +incompatible. When updating, make sure you grab those too, and rolo +into the new version before flashing it. +

+

+There +are two variants of how the boxes starts, therefore the normal and +the _norom firmware files. The vast majority of the +Player/Recorder/FM all have the same boot ROM content, +differentiation comes later by flash content. Rockbox identifies this +boot ROM with a CRC value of 0x222F in the hardware info screen. Some +recorders have the boot ROM disabled (it might be unprogrammed) and +start directly from a flash mirror at address zero. They need the new +_norom firmware, it has a slightly different bootloader. Without a +boot ROM there is no UART boot safety net. To compensate for that as +much as possible the MiniMon monitor is included, it starts with +F3+On. Using that the box can be reprogrammed via serial if the first +~2000 bytes of the flash are OK. +

8. Movies and images

- Jörg's AVI movie (1.5MB) rockbox_flash_boot.avi + Jörg's AVI movie (1.5MB) rockbox_flash_boot.avi showing his unit booting Rockbox from flash.

Roland's screendump from the movie:
#include "foot.t" + -- cgit v1.2.3