Difference between revisions of "Didj BootLoader Firmware Updating"

From eLinux.org
Jump to: navigation, search
m
(Trigger Update With OpenLFConnect)
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
This is a way to manually upgrade your firmware and bootloader.
+
== Summary ==
 +
There are several ways to commit your firmware, or bootloader to NAND. These methods can update your Didj with a fresh firmware, or a modified one with proper packaging.
 +
 
 +
''' Caution ''' Make sure your batteries are charged, or you have an A/C adapter. Also that you understand, there is a certain level of risk making these modifications. Make sure you read through it first, and understand what is being done, before proceeding. Its best to first test these methods with a known working firmware or bootloader. And reading through [[Didj_U-Boot_NAND_Flashing| U-Boot NAND Flashing]] to make sure you can recover if things go wrong.
  
 
== Prerequisites ==  
 
== Prerequisites ==  
Line 9: Line 12:
  
 
== Hardware Needed ==
 
== Hardware Needed ==
* [[Didj]] handheld device
 
 
* [[LeapFrog_Pollux_Platform:_Console_Access| Console Access]]
 
* [[LeapFrog_Pollux_Platform:_Console_Access| Console Access]]
  
== Files Needed ==
+
== Software Needed ==
 
* DIDJ-0x000E0002-000001.lfp (bootloader)  
 
* DIDJ-0x000E0002-000001.lfp (bootloader)  
 
* DIDJ-0x000E0003-000001.lfp (firmware)
 
* DIDJ-0x000E0003-000001.lfp (firmware)
Line 25: Line 27:
 
For firmware this method will install into the opposite partitions, than the one you are on, so if you are on RFS0, the update will be installed to RFS1. And the Didj will be configured to boot from that one.
 
For firmware this method will install into the opposite partitions, than the one you are on, so if you are on RFS0, the update will be installed to RFS1. And the Didj will be configured to boot from that one.
  
The firmware folder needs to be prefixed with "firmware-" (ex. firmware-LF_1000).
+
The firmware folder should be named firmware-LF_LF1000.
  
 
Mount your Didj and copy you're prepared folder to the /Didj/Base directory on your Didj.
 
Mount your Didj and copy you're prepared folder to the /Didj/Base directory on your Didj.
Line 33: Line 35:
 
'' On Didj ''
 
'' On Didj ''
 
  # fwcheck
 
  # fwcheck
  /Didj/Base/firmware-<your name>
+
  /Didj/Base/firmware-LF_LF1000
 
This should return the path to your folder, indicating it was found.
 
This should return the path to your folder, indicating it was found.
  
Line 59: Line 61:
  
 
  # blcheck
 
  # blcheck
  /Didj/Base/bootstrap-<your name>
+
  /Didj/Base/bootstrap-LF_LF1000
  
 
Then run:
 
Then run:
  # blupdate /Didj/Base/boostrap-<your name> > /dev/console
+
  # blupdate /Didj/Base/bootstrap-LF_LF1000 > /dev/console
 
  Found /Didj/Base/bootstrap-LF_LF1000/
 
  Found /Didj/Base/bootstrap-LF_LF1000/
 
  Package Integrity Test Passed
 
  Package Integrity Test Passed
Line 68: Line 70:
 
  Bootloader install successful.
 
  Bootloader install successful.
  
== Force Update with Custom SCSI Commands ==
+
''' Caution '''
This update can be done with out a console connection, and mimics how LFConnect handles the task. They can be done at the same time.
+
* If you keep getting the Tune Up screen after ejecting your device, you'll need to remove firmware-LF_LF1000/ and/or bootstrap-LF_LF1000 from /Didj/Base on the device. As it will keep thinking it needs an update.
  
Check out [[Didj_SCSI_Commands|SCSI Commands]] for how to use SCSI Commands.
+
==== Manually ====
 +
This method is for the advanced user. You must understand the partition layouts. Copy your file to /Didj/Base and run the following commands:
 +
flash_eraseall /dev/mtd0
 +
nandwrite -p /dev/mtd0 /Didj/Base/lightning-boot.bin
  
Mount the Didj usb storage
+
== Update With Out Console Access ==
 +
==== Force Update with Custom SCSI Commands ====
 +
This update can be done with out a console connection, and mimics how LFConnect handles the task. Both updates can be done at the same time. This is exactly like '''With Built in Tools''' except we trigger the Didj to run those commands for us, by giving our package a higher version number and telling the Didj to eject. This is nice if you do not have console access to the device.
  
'''bootloader'''
+
There are two ways to do trigger the update with the eject command.
 +
* [[Didj_SCSI_Commands|SCSI Commands]] for how to use SCSI Commands.
 +
* [[LeapFrog_Pollux_Platform:_OpenLFConnect | OpenLFConnect ]]
  
For bootloader create a folder in /Didj/Base called bootstrap-LF_LF1000
+
If you want to do both at the same time, load both folders into /Didj/Base then run the command to eject.
  
It should have the same files as in LFP package DIDJ-0x000E0002-000001
+
''' Bootloader '''
 
 
Make sure meta.inf has a version number higher than Version="1.35.2.4222" or if you've changed the version number in your file system, higher than that one.
 
  
Then run the SCSI Command C6 "Disconnect Ok", which will cause it to say its "Learning New Tricks" before saying its okay to disconnect your Didj.
+
For bootloader create a folder in /Didj/Base called prefixed with 'bootstrap-' (ex. bootstrap-LF_LF1000)
  
Then turn the Didj off.  
+
It should have the same files as the lfp package.
  
This processes causes the Didj state machine to look for a folder called bootstrap-LF_LF1000, if its a newer version, which is found in meta.inf and compared to /etc/version on the Didj, it will update the files with the new ones.
+
Make sure meta.inf has a version number higher than Version="1.35.2.4222" or if you've changed the version number in your file system, higher than that one.
  
 +
''' Firmware '''
  
'''firmware'''
 
 
For the firmware create a folder in /Didj/Base called firmware-LF_LF1000
 
For the firmware create a folder in /Didj/Base called firmware-LF_LF1000
  
Line 96: Line 103:
  
 
Make sure meta.inf has a version number higher than Version="1.35.2.4222" or if you've changed the version number in your file system, higher than that one.
 
Make sure meta.inf has a version number higher than Version="1.35.2.4222" or if you've changed the version number in your file system, higher than that one.
 +
 +
''' Trigger Update With SCSI Commands'''
 +
 +
If you're on Linux run the sync command, to flush the filesystem buffers.
  
 
Then run the SCSI Command C6 "Disconnect Ok", which will cause it to say its "Learning New Tricks" before saying its okay to disconnect your Didj.
 
Then run the SCSI Command C6 "Disconnect Ok", which will cause it to say its "Learning New Tricks" before saying its okay to disconnect your Didj.
Line 103: Line 114:
 
This processes causes the Didj state machine to look for a folder called firmware-LF_LF1000, if its a newer version, which is found in meta.inf and compared to /etc/version on the Didj, it will update the files with the new ones.
 
This processes causes the Didj state machine to look for a folder called firmware-LF_LF1000, if its a newer version, which is found in meta.inf and compared to /etc/version on the Didj, it will update the files with the new ones.
  
== OpenDidjConnect ==  
+
== Update With OpenLFConnect ==
 
 
[http://code.google.com/p/opendidj-connect/ OpenDidjConnect Latest Version]
 
 
 
'''For Windows'''
 
 
 
Download and extract the program, then cd to the directory you extracted it to. Plug your Didj USB in and turn it on. This works with out LFConnect being installed, so close it if it opened. Check under My Computer for which drive letter the Didj is, if LFConnect is installed or started up after plugging the Didj in, you may need to go in and [http://wtfmoogle.com/?page_id=741 assign it a drive letter] Run ''OpenDidjConnect.exe -d <drive_letter> -c unlock'' you can run it with -h only for the help. On WinXP autoplay starts up, then it asks what to do, open the folder, and navigate to /Didj/Base. Place you folders in there, like in the above methods, then close out the explorer window. Now run the program again, ''OpenDidjConnect -d <drive_letter> -c eject'' if you are running batteries, run OpenDidjConnect -d <drive_letter> while the Didj is unlocked, and make sure your battery is not critically low, to prevent it dying in the middle of an update. Once you eject it, you should see the screen say, learning new tricks, before it says okay to disconnect. Unplug the usb and turn it back on to test you're work. If you get the learning new tricks screen, when ever you eject, when you haven't put a new firmware/bootloader on the usb drive, its because of version issues, so either change the version number or delete the files to prevent the constant reflashing of the new files.
 
 
 
 
 
'''For Linux'''
 
  
Extract the files in the archive, then open a terminal window and cd to the directory
+
Once OpenLFConnect is installed and set up, you can update the firmware and or boot loader by using its specific commands and pointing them at the files to use. This is basically a python script that runs the necessary sg3_utils programs on Windows or Linux.
  
you extracted the files to.
+
Mount Didj
  
run gcc -o OpenDidjConnect OpenDidjConnect.c
+
local>didj_mount
 +
... device info ...
  
 +
Run firmware update command giving it a path.
 +
remote>didj_update_firmware /path/to/firmware-LF_LF1000
 +
Didj will upload the firmware, then eject when files have synced.
  
 +
For bootloader its the same process.
 +
local>didj_mount
 +
... device info ...
 +
remote>didj_update_bootloader /path/to/bootstrap-LF_LF1000
  
Plug in your Didj to a usb port and turn it on. Run dmesg
+
Or us just plain didj_update and point it to the parent directory of both.
in a terminal, and look for the device, usually something
 
like [25905.905635] sd 10:0:0:0: Attached scsi generic sg2 type 0
 
which would make the device /dev/sg2 that will be used as the
 
<device> in the command line options. In Ubuntu 9.10 the Didj mounts and opens a folder window of is contents, navigate to /Didj/Base. Place you firmware/lightning folders in there, like in the above methods, then close out the folder window. Now run the program again, ''OpenDidjConnect -d <device> -c eject'' if you are running batteries, run OpenDidjConnect -d <device> while the Didj is unlocked, and make sure your battery is not critically low, to prevent it dying in the middle of an update. Once you eject it, you should see the screen say, learning new tricks, before it says okay to disconnect. Unplug the usb and turn it back on to test you're work. If you get the learning new tricks screen, when ever you eject, when you haven't put a new firmware/bootloader on the usb drive, its because of version issues, so either change the version number or delete the files to prevent the constant reflashing of the new files.
 
  
== Caution ==
+
Once the Didj has rebooted after the update.
It is possible to cause a major malfunction with your Didj by replacing these files. Familiarize yourself with the procedure using known-good packages first.  
+
local>didj_mount
 +
... device info ...
 +
remote>didj_update_cleanup
  
You should also be familiar with [[Didj_UART_Boot| Didj UART Boot]] before using these procedures. The UART boot allows non-destructive testing of bootloaders and firmware/kernels; it also provides a recovery method in case a new bootloader or firmware/kernel written to the NAND fails.
+
This will delete the update directories from the Didj, to prevent updates from running every time it is didj_eject is run.
  
When using SCSI commands, check that you are using the correct syntax and that you are sending them to the correct device.
+
== Update With LFConnect ==
 +
If you are using Windows, and have LFConnect installed, you may find this way suites your needs. There is no special programs or need to run commands on the device itself.
  
 +
[[LeapFrog_Pollux_Platform:_LFConnect#Force_Firmware_Updates| LFConnect Force Firmware Updates]]
  
 
[[Category:Didj]]
 
[[Category:Didj]]
 
[[Category:LeapFrog Pollux Platform]]
 
[[Category:LeapFrog Pollux Platform]]

Latest revision as of 14:18, 3 February 2012

Summary

There are several ways to commit your firmware, or bootloader to NAND. These methods can update your Didj with a fresh firmware, or a modified one with proper packaging.

Caution Make sure your batteries are charged, or you have an A/C adapter. Also that you understand, there is a certain level of risk making these modifications. Make sure you read through it first, and understand what is being done, before proceeding. Its best to first test these methods with a known working firmware or bootloader. And reading through U-Boot NAND Flashing to make sure you can recover if things go wrong.

Prerequisites

Programs Needed

Terminal program: Hyperterminal or equivalent

Hardware Needed

Software Needed

  • DIDJ-0x000E0002-000001.lfp (bootloader)
  • DIDJ-0x000E0003-000001.lfp (firmware)

Update With Console Access

Using Built in Tools

This method will use a few built in programs that come with the Didj for updating the firmware and bootloader. You will need to copy, or create a folder, and certain files in it for this to work It is easiest to extract the folder from the lfp archives and modify it as needed.

Firmware

For firmware this method will install into the opposite partitions, than the one you are on, so if you are on RFS0, the update will be installed to RFS1. And the Didj will be configured to boot from that one.

The firmware folder should be named firmware-LF_LF1000.

Mount your Didj and copy you're prepared folder to the /Didj/Base directory on your Didj.

After loading your folder onto the Didj, its best to run the check program, to make sure it can find it.

On Didj

# fwcheck
/Didj/Base/firmware-LF_LF1000

This should return the path to your folder, indicating it was found.

Now you can run the actual update program:

# fwupdate /Didj/Base/firmware-LF_LF1000/ > /dev/console
Found /Didj/Base/firmware-LF_LF1000/
Package Integrity Test Passed
Installing kernel.bin in Kernel1 (mtd5)
Kernel install successful.
Installing erootfs.jffs2 in Linux_RFS1 (mtd6)
Rootfs install successful.
Switching from RFS0 to RFS1

Bootloader

The folder must be prefixed with 'bootstrap-' (ex. bootstrap-LF1000).

The only files that are needed are:

lightning-boot.bin
lightning-boot.md5

Check that the updater can find your folder.

On Didj

# blcheck
/Didj/Base/bootstrap-LF_LF1000

Then run:

# blupdate /Didj/Base/bootstrap-LF_LF1000 > /dev/console
Found /Didj/Base/bootstrap-LF_LF1000/
Package Integrity Test Passed
Installing lightning-boot.bin in LF1000_uniboot (mtd0)
Bootloader install successful.

Caution

  • If you keep getting the Tune Up screen after ejecting your device, you'll need to remove firmware-LF_LF1000/ and/or bootstrap-LF_LF1000 from /Didj/Base on the device. As it will keep thinking it needs an update.

Manually

This method is for the advanced user. You must understand the partition layouts. Copy your file to /Didj/Base and run the following commands:

flash_eraseall /dev/mtd0
nandwrite -p /dev/mtd0 /Didj/Base/lightning-boot.bin

Update With Out Console Access

Force Update with Custom SCSI Commands

This update can be done with out a console connection, and mimics how LFConnect handles the task. Both updates can be done at the same time. This is exactly like With Built in Tools except we trigger the Didj to run those commands for us, by giving our package a higher version number and telling the Didj to eject. This is nice if you do not have console access to the device.

There are two ways to do trigger the update with the eject command.

If you want to do both at the same time, load both folders into /Didj/Base then run the command to eject.

Bootloader

For bootloader create a folder in /Didj/Base called prefixed with 'bootstrap-' (ex. bootstrap-LF_LF1000)

It should have the same files as the lfp package.

Make sure meta.inf has a version number higher than Version="1.35.2.4222" or if you've changed the version number in your file system, higher than that one.

Firmware

For the firmware create a folder in /Didj/Base called firmware-LF_LF1000

It should have the same files as in LFP package DIDJ-0x000E0003-000001

Make sure meta.inf has a version number higher than Version="1.35.2.4222" or if you've changed the version number in your file system, higher than that one.

Trigger Update With SCSI Commands

If you're on Linux run the sync command, to flush the filesystem buffers.

Then run the SCSI Command C6 "Disconnect Ok", which will cause it to say its "Learning New Tricks" before saying its okay to disconnect your Didj.

Then turn the Didj off.

This processes causes the Didj state machine to look for a folder called firmware-LF_LF1000, if its a newer version, which is found in meta.inf and compared to /etc/version on the Didj, it will update the files with the new ones.

Update With OpenLFConnect

Once OpenLFConnect is installed and set up, you can update the firmware and or boot loader by using its specific commands and pointing them at the files to use. This is basically a python script that runs the necessary sg3_utils programs on Windows or Linux.

Mount Didj

local>didj_mount
... device info ...

Run firmware update command giving it a path.

remote>didj_update_firmware /path/to/firmware-LF_LF1000

Didj will upload the firmware, then eject when files have synced.

For bootloader its the same process.

local>didj_mount
... device info ...
remote>didj_update_bootloader /path/to/bootstrap-LF_LF1000

Or us just plain didj_update and point it to the parent directory of both.

Once the Didj has rebooted after the update.

local>didj_mount
... device info ...
remote>didj_update_cleanup

This will delete the update directories from the Didj, to prevent updates from running every time it is didj_eject is run.

Update With LFConnect

If you are using Windows, and have LFConnect installed, you may find this way suites your needs. There is no special programs or need to run commands on the device itself.

LFConnect Force Firmware Updates