Difference between revisions of "Leapster Explorer: UART Boot"

From eLinux.org
Jump to: navigation, search
m (:()
(AC)
 
(35 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== State of Affairs ==
+
== Summary ==
 +
UART booting the Emerald Boot boot loader, allows you to recover a device that has had the installed boot loader corrupted, or test new boot loaders, easily and non-destructively. Unlike its predecessor on the [[Didj]], [[Didj_Lightning_Boot]], Emerald Boot is significantly larger, and surpasses the [[Pollux]] 16k UART boot limit, while the hardware also prevents direct access to the pins needed to set the Pollux in the UART boot state. So this requires not only a software modification, but a hardware one also.
  
It looks like UART boot is requiring more than just this modification, the SHADOW configuration needs to be set, by pulling SD[13] high, to enable the correct memory map. Currently all attempts at this have failed. So before attempting this hardware hack, make sure you understand, it will require more work to be done, if its at all possible.
 
  
This how-to will show you how to gain UART Boot access to your Explorer. This involves a hardware hack not for the faint of smd soldering skills, or eye sight. There is two connections that need to be made to some pads that are very very tiny, takes some soldering skills, so be prepared. Also being a hardware hack, there is there is a chance of breaking something important, be careful and be warned.
+
'''Warning''' This hardware modification requires some delicate soldering skills. There 4 wires that need to be solder to rather small pads. Before proceeding take a look at what needs to be done, and make sure you are capable of making the necessary modifications with out harming your device.
  
How tiny are the pads? Here is a comparison of a normal resistor vs the pads you will be soldering to.
+
[[File:Leapster Explorer-D6 comparison.jpg|200px]]
  
[[File:Leapster Explorer-D6 comparison.jpg|200px]]
+
Notice that the width of the pad is the same size as the stripe on the resistor. This takes a light touch and a steady hand, be sure you are capable before proceeding.
 +
 
 +
 
 +
== Prerequisites ==
 +
[[LeapFrog_Pollux_Platform:_Build_Environment| Setup the build environment]]
  
Notice that the width of the pad is the same size as the stripe on the resistor. If you don't feel comfortable soldering something this small, this mod might not be good for you to attempt.
+
Some versions of Emerald Boot require being built against the kernel, it may be necessary to build a kernel first, as Emerald Boot may attempt to pull some files that it built.
== Programs Needed ==
 
  
Serial Port Terminal (hyperterminal, minicom, etc)
 
  
 
== Software Needed ==
 
== Software Needed ==
 +
Linux
 +
 +
Python 2.5+ and PySerial installed
  
A UART enabled Emerald-Boot.bin/Lightning-Boot.bin (work in progress)
+
[[Leapster_Explorer:_Emerald_Boot#Versions| Sources and corresponding UART Patch]]
  
== Hardware ==
 
  
DJHI or similar cartridge for access to UART console
+
== Hardware Needed ==
 +
[[LeapFrog_Pollux_Platform:_Console_Access| Console Access]]
  
 
Soldering Iron (with very tiny tip)
 
Soldering Iron (with very tiny tip)
Line 26: Line 31:
 
Wire (very fine gauge)
 
Wire (very fine gauge)
  
10K Ohm Resistor
+
2x 10K Ohm Resistor
  
Switch
+
2x Switches or jumper pins
  
== On Explorer ==
+
== Hardware Modification ==
[[File:Leapster Explorer-D6 Pull Down.png]]
+
Pictures SD[13] and SD[6] show the pads you will be working with. You want to connect the two pads in each picture together, with a switch or jumper, and a 10Kohm resistor in series. So that when the connection is closed via the switch or jumper, it completes the circuit. This is pulling the SD[13] high and SD[6] low, which will be read by the [[Pollux]] SoC on start up, to tell it where it should look for the boot loader, in this case, being sent over UART. When everything is soldered up, be sure to add some strain relief so the wires won't be pulling on the delicate pads.
  
D6 Circled there, is the pads you will be working with. Take your 2 pieces of wire and strip a small amount of insulation off one end of each, and solder one to each pad, watch your heat and where the tip is, so as not to destroy the pad or unsolder the resistor next to it. Magnifier would be a good idea here. Then on one of the wires attach the resistor and on the other the switch, then solder the resistor to the switch. Add a dab of hot glue or some other means of strain relief, put back together and you are done. To test, hold down the button, while you turn on your Explorer, nothing should happen. Try it with out holding down the button, to verify your Explorer still works.
+
'''SD[13]'''
 +
[[File:LX_SD13_UART_Enable.jpg | 440px]]
  
Example:
+
''' SD[6]'''
 +
[[Image:D6hack.jpg | 440px]]
  
[[Image:D6hack.jpg | 320px]]
+
To verify it works, press both switches and hold, then turn on the Explorer. Nothing should happen, the screen will stay blank. It is now expecting the boot loader to be sent to it. Try booting it with out the switches held down, it should boot normally.
  
 
== Bootloader ==
 
== Bootloader ==
 +
Technically this isn't a UART boot, what will be happening is, once Emerald Boot is compiled, the Micromon application will be used to load the bin file onto the Explorer's RAM, where Micromon will then execute the code and start Emerald Boot loading.
 +
 +
'''Compiling'''
 +
 +
Extract the emerald-boot-supplement archive. Make sure you have a clean copy of the emerald-boot/ directory in the LF-Source tree.
 +
 +
Copy screens/ to the packages/ directory in the source tree.
 +
 +
Copy host_tools/ to the root directory along side emerald-boot and packages. If you want you can make your own, just save them as png. Although they only get used when Emerald Boot is in USB boot mode.
 +
 +
Next apply the patch which makes the necessary modifications for UART booting, along with a few other mods to make things a bit more friendly. Inside the emerald-boot/ directory apply the patch.
 +
 +
  $ patch -p1 < /path/to/emerald-boot-supplement.patch
 +
 +
To compile the bootloader for UART run:
 +
  $ MICRO_BOOT=1 ./install.sh
 +
 +
 +
== UART Booting ==
 +
 +
Once you have compiled a UART enabled Emerald Boot, copy the resulting emerald-boot_UART.bin file to the micromon directory in emerald-boot-supplement/. Set the jumpers or switches to enable UART boot on the Explorer and hook up a serial cable or usb adapter, then run this command while holding down the power button.
 +
 +
  $ ./bootstrap.py emerald-boot_UART.bin 115200
 +
 +
You should see something like this
 +
  Opening serial port
 +
  Setting local baudrate to 19200
 +
  Sending block 1 of 1 block(s)
 +
  Sending block 31 of 31 block(s)
 +
  Setting target baudrate to 115200
 +
  Setting local baudrate to 115200
 +
  Remote CRC32: 0xE514244C
 +
  Local CRC32: 0xE514244C
 +
  Sending block 335 of 410 block(s)
 +
 +
This uploads a small program, Micromon to the Explorer, which allows uploading a file much larger than the 16k bytes the Pollux SoC accepts for UART booting.
 +
 +
After it changes the baudrate, you can let off the power button. This allows you to hold any buttons you may want to use to trigger different Emerald Boot modes.
 +
 +
If all goes well the Explorer should boot up as expected.
  
Doesn't exist yet, requires modifications to a current boot loader that are yet to be figured out.
+
== Flash to NOR ==
 +
Once you've tested out your Emerald Boot by running a UART version, or have found a precompiled NOR version you want to permanently install on your Explorer, you need to flash it to the NOR memory.
  
Didj examples of UART Booting, should be nearly the same.
+
Caution: This is a potentially harmful modification. Some precautions, make sure you have a known working copy of Emerald Boot for NOR and UART. If you compile you're own, make sure to test a UART version first. Before attempting this, make sure you have fresh batteries or AC adapter, and in worst case, will be able to make the hardware modifications necessary to UART boot if you have not already.
  
[http://www.elinux.org/Didj_UART_Boot_with_Linux_Host  UART Boot Didj with Linux]
+
Copy emerald-boot_NOR.bin to /LF/Bulk then run these commands on the Explorers command line.  
  
[http://www.elinux.org/Didj_Boot_From_UART UART Boot Didj with Windows]
+
  mfgmode.sh 9 > /dev/null
 +
  flashcp -v /LF/Bulk/emerald-boot_NOR.bin /dev/mtd5
 +
  mfgmode.sh 0 > /dev/null
  
== Under Windows ==
+
Then reboot your device, if all went well it should boot up fine. If there is an issue and it will not boot, make the necessary hardware modifications for UART boot if you have not. UART boot the device, and redo this process with a known working version of Emerald Boot.
  
  
== Under Linux ==
+
[[Category:Leapster Explorer]]

Latest revision as of 02:58, 27 October 2011

Summary

UART booting the Emerald Boot boot loader, allows you to recover a device that has had the installed boot loader corrupted, or test new boot loaders, easily and non-destructively. Unlike its predecessor on the Didj, Didj_Lightning_Boot, Emerald Boot is significantly larger, and surpasses the Pollux 16k UART boot limit, while the hardware also prevents direct access to the pins needed to set the Pollux in the UART boot state. So this requires not only a software modification, but a hardware one also.


Warning This hardware modification requires some delicate soldering skills. There 4 wires that need to be solder to rather small pads. Before proceeding take a look at what needs to be done, and make sure you are capable of making the necessary modifications with out harming your device.

Leapster Explorer-D6 comparison.jpg

Notice that the width of the pad is the same size as the stripe on the resistor. This takes a light touch and a steady hand, be sure you are capable before proceeding.


Prerequisites

Setup the build environment

Some versions of Emerald Boot require being built against the kernel, it may be necessary to build a kernel first, as Emerald Boot may attempt to pull some files that it built.


Software Needed

Linux

Python 2.5+ and PySerial installed

Sources and corresponding UART Patch


Hardware Needed

Console Access

Soldering Iron (with very tiny tip)

Wire (very fine gauge)

2x 10K Ohm Resistor

2x Switches or jumper pins

Hardware Modification

Pictures SD[13] and SD[6] show the pads you will be working with. You want to connect the two pads in each picture together, with a switch or jumper, and a 10Kohm resistor in series. So that when the connection is closed via the switch or jumper, it completes the circuit. This is pulling the SD[13] high and SD[6] low, which will be read by the Pollux SoC on start up, to tell it where it should look for the boot loader, in this case, being sent over UART. When everything is soldered up, be sure to add some strain relief so the wires won't be pulling on the delicate pads.

SD[13] LX SD13 UART Enable.jpg

SD[6] D6hack.jpg

To verify it works, press both switches and hold, then turn on the Explorer. Nothing should happen, the screen will stay blank. It is now expecting the boot loader to be sent to it. Try booting it with out the switches held down, it should boot normally.

Bootloader

Technically this isn't a UART boot, what will be happening is, once Emerald Boot is compiled, the Micromon application will be used to load the bin file onto the Explorer's RAM, where Micromon will then execute the code and start Emerald Boot loading.

Compiling

Extract the emerald-boot-supplement archive. Make sure you have a clean copy of the emerald-boot/ directory in the LF-Source tree.

Copy screens/ to the packages/ directory in the source tree.

Copy host_tools/ to the root directory along side emerald-boot and packages. If you want you can make your own, just save them as png. Although they only get used when Emerald Boot is in USB boot mode.

Next apply the patch which makes the necessary modifications for UART booting, along with a few other mods to make things a bit more friendly. Inside the emerald-boot/ directory apply the patch.

 $ patch -p1 < /path/to/emerald-boot-supplement.patch

To compile the bootloader for UART run:

 $ MICRO_BOOT=1 ./install.sh


UART Booting

Once you have compiled a UART enabled Emerald Boot, copy the resulting emerald-boot_UART.bin file to the micromon directory in emerald-boot-supplement/. Set the jumpers or switches to enable UART boot on the Explorer and hook up a serial cable or usb adapter, then run this command while holding down the power button.

 $ ./bootstrap.py emerald-boot_UART.bin 115200

You should see something like this

 Opening serial port
 Setting local baudrate to 19200 
 Sending block 1 of 1 block(s)
 Sending block 31 of 31 block(s)
 Setting target baudrate to 115200
 Setting local baudrate to 115200
 Remote CRC32: 0xE514244C
 Local CRC32: 0xE514244C
 Sending block 335 of 410 block(s)

This uploads a small program, Micromon to the Explorer, which allows uploading a file much larger than the 16k bytes the Pollux SoC accepts for UART booting.

After it changes the baudrate, you can let off the power button. This allows you to hold any buttons you may want to use to trigger different Emerald Boot modes.

If all goes well the Explorer should boot up as expected.

Flash to NOR

Once you've tested out your Emerald Boot by running a UART version, or have found a precompiled NOR version you want to permanently install on your Explorer, you need to flash it to the NOR memory.

Caution: This is a potentially harmful modification. Some precautions, make sure you have a known working copy of Emerald Boot for NOR and UART. If you compile you're own, make sure to test a UART version first. Before attempting this, make sure you have fresh batteries or AC adapter, and in worst case, will be able to make the hardware modifications necessary to UART boot if you have not already.

Copy emerald-boot_NOR.bin to /LF/Bulk then run these commands on the Explorers command line.

 mfgmode.sh 9 > /dev/null
 flashcp -v /LF/Bulk/emerald-boot_NOR.bin /dev/mtd5
 mfgmode.sh 0 > /dev/null

Then reboot your device, if all went well it should boot up fine. If there is an issue and it will not boot, make the necessary hardware modifications for UART boot if you have not. UART boot the device, and redo this process with a known working version of Emerald Boot.