Creating a Full UI ROM for BeagleBoard

From Symdev

Jump to: navigation, search

Contents

[edit] Status

Wikitemplatewarning.gif
{{#if: Warning | Warning
| }}We now have fully booting UI images for beagleboard , based on PDK 3.0.0 and PDK 3.0.1. PDK 3.0.2 is broken and more details about that are available on the the PDK 3.0.2 release notes.Readers are advised to follow PDK 3.0.1 instructions as it's the most stable as on 21st Sep 2010

[edit] Preparing your environment

  • Download and install the PDK (3.0.0 /3.0.1)
  • Obtain the RVCT Compiler
  • Verify that the following PERL packages needed to generate a ROM image are installed on your computer. The procedure is explained in the next section.
    • XML-Writer
    • XML-DOM
    • XML-Checker

[edit] PERL package verification / installation

  • List the currently installed perl packages to the console or to a file (append ' > perlpackages.txt' to the command below)
perl -MCPAN -e autobundle
  • In the console or file output, search for the following strings to verify the PERL package installation state.
    • XML::Writer
    • XML::DOM
    • XML::Checker
  • Install any of the missing PERL packages using ppm (Perl Package Manager)
ppm install XML::Writer
ppm install XML::DOM
ppm install XML::Checker

[edit] Patching PDK 3.0.0

A patch with pre-built binaries for PDK 3.0.0 is available here

It contains binaries which you may otherwise have to re-build from source.

Please download the patch and unzip it on your epoc32 tree. This would replace/add some binaries in /epoc32/release/armv5/...

Alternatively , if you want to do it yourself (and in the process learn on what all we had to do to create this patch), follow the recipe below. Ignore it if you are using the pre-built binaries directly.

[edit] Recipe for patching PDK 3.0.0

<toggledisplay showtext="[Show recipe for patching 3.0.0 ]" hidetext="[Hide recipe for patching 3.0.0 ]">

[edit] Build the LCD driver for NGA

Get the source for the beagleboard adaptation from the FCL from [this] changeset (or newer)

cd \sf\adaptation hg clone -r deed9c658f70 http://www.symlab.org/oss/FCL/sf/adaptation/beagleboard

Build the GCE compliant LCD driver: cd \sf\adaptation\beagleboard\omap3530\beagle_drivers\lcd\ sbs -b bld.inf -c armv5

And make sure that the latest base_beagle.iby is exported into your ROM:

cd \sf\adaptation\beagleboard\omap3530\beagleboard sbs -b bld.inf EXPORT

This will also put a copy of the C-Drive image you'll need later into \nvmemory\drive_c.img

[edit] Build the 'persistent' RAM drive PDD

These can be found in the [newer] changesets in the beagleboard FCL (and hopefully in the tip).

cd \sf\adaptation\beagleboard\omap3530\beagle_drivers\medstaticrd sbs -b bld.inf -c armv5

[edit] Fixup Hitchcock

There's a problem with TLS usage on hardware at the moment so to fix a crash in hitchcock.dll you need to get the uiacclerator package:

cd \sf\mw hg clone -r PDK_3.0.0 http://www.symlab.org/oss/FCL/sf/mw/uiaccelerator

Then #define __WINSCW__ at the top of \sf\mw\uiaccelerator\uiacceltk\hitchcock\coretoolkit\src\huistatic.cpp

And rebuild:

cd \sf\mw\uiaccelerator\uiacceltk\hitchcock\coretoolkit\group sbs -b bld.inf -c armv5 -p coretoolkit.mmp


If you're having trouble building this (there are reports of the RVCT 4 not supporting some features used by hitchcock) then you can try using these pre-built binaries hitchcock.zip More details on the issue here

[edit] Put the UI in Portrait

In \epoc32\data\wsini.ini:

  • Change the screen dimensions to 360x640 (instead of 640x360)
  • Change S60_SCR_STYLE_NAME1 from NHD4TOUCH to NHD1TOUCH

[edit] Build the Serial Keyboard

To have user inputs from the terminal.

cd \sf\adaptation\beagleboard\omap3530\shared\serialkeyb sbs -b bld.inf -c armv5 -p serialkeyboard_UI_Softkeys.mmp

  • Key mapping:
    • 'q': Left softkey
    • 'w': Center softkey
    • 'e': Right softkey
    • 'a': Green key
    • 's': Application key
    • 'd': Red key
    • Arrows: Change focus

</toggledisplay>

[edit] Build the ROM

This is simply done by calling:

iMaker --file=/epoc32/rom/config/sf_refhw/beagle/image_conf_beagle.mk flash

[edit] Patching PDK 3.0.1

A patch with pre-built binaries for PDK 3.0.1 is available here

It contains binaries which you may otherwise have to re-build from source.

Please download the patch and unzip it on your epoc32 tree. This would replace/add some binaries in /epoc32/release/armv5/...

Alternatively , if you want to do it yourself (and in the process learn on what all we had to do to create this patch), follow the recipe below. Ignore it if you are using the pre-built binaries directly.

[edit] Recipe for patching PDK 3.0.1

<toggledisplay showtext="[Show recipe for patching 3.0.1 ]" hidetext="[Hide recipe for patching 3.0.1 ]">

[edit] Build the 'persistent' RAM drive PDD

The source for the same could be found in the Beagleboard rev for PDK 3.0.1. or at [newer] changesets in the beagleboard FCL (and the tip).

cd \sf\adaptation\beagleboard\omap3530\beagle_drivers\medstaticrd sbs -b bld.inf -c armv5

[edit] Fix-up Hitchcock

There's a problem with TLS usage on hardware at the moment so to fix a crash in hitchcock.dll you need to get the uiacclerator package:

cd \sf\mw hg clone -r PDK_3.0.0 http://www.symlab.org/oss/FCL/sf/mw/uiaccelerator

Then #define __WINSCW__ at the top of \sf\mw\uiaccelerator\uiacceltk\hitchcock\coretoolkit\src\huistatic.cpp

And rebuild:

cd \sf\mw\uiaccelerator\uiacceltk\hitchcock\coretoolkit\group sbs -b bld.inf -c armv5 -p coretoolkit.mmp


If you're having trouble building this (there are reports of the RVCT 4 not supporting some features used by hitchcock) then you can try using these pre-built binaries hitchcock.zip More details on the issue here

[edit] Put the UI in Portrait

In \epoc32\data\wsini.ini:

  • Change the screen dimensions to 360x640 (instead of 640x360)
  • Change S60_SCR_STYLE_NAME1 from NHD4TOUCH to NHD1TOUCH

</toggledisplay>

[edit] Build the ROM

This is simply done by calling:

iMaker --file=/epoc32/rom/config/sf_refhw/beagle/image_conf_beagle.mk flash

[edit] Patching PDK 3.0.2 --- Neither Syborg nor Beagle seem to work on 3.0.2

The HuiStatic.cpp patch will be needed as usual, but there's also an extra fix needed - see Bug 3786 for details.

[edit] Patching PDK 3.0.3

A patch with pre-built binaries for PDK 3.0.3 is available here

It contains binaries which you may otherwise have to re-build from source.

Please download the patch and unzip it on your epoc32 tree. This would replace/add some binaries in /epoc32/release/armv5/...

Alternatively , if you want to do it yourself (and in the process learn on what all we had to do to create this patch), follow the recipe below. Ignore it if you are using the pre-built binaries directly.

[edit] Recipe for patching PDK 3.0.3

<toggledisplay showtext="[Show recipe for patching 3.0.3 ]" hidetext="[Hide recipe for patching 3.0.3 ]">

[edit] Fix-up Hitchcock

There's a problem with TLS usage on hardware at the moment so to fix a crash in hitchcock.dll you need to get the uiacclerator package:

cd \sf\mw hg clone -r PDK_3.0.3 http://www.symlab.org/oss/FCL/sf/mw/uiaccelerator

Then #define __WINSCW__ at the top of \sf\mw\uiaccelerator\uiacceltk\hitchcock\coretoolkit\src\huistatic.cpp

And rebuild:

cd \sf\mw\uiaccelerator\uiacceltk\hitchcock\coretoolkit\group sbs -b bld.inf -c armv5 -p coretoolkit.mmp

If you're having trouble building this (there are reports of the RVCT 4 not supporting some features used by hitchcock) then you can try using these pre-built binaries here More details on the issue here

</toggledisplay>


[edit] Build the ROM

There is an issue with iMake, although it spews out an error the rom actually builds, more details here http://www.symlab.org/forum/showthread.php?t=7539


Rom building is simply done by calling:

iMaker --file=/epoc32/rom/config/sf_refhw/beagle/image_conf_beagle.mk flash

[edit] Patching PDK 3.0.4

Same recipe as for PDK 3.0.3

[edit] Booting the ROM

[edit] Flashing the C Drive & ROM image to RAM

Because many components in the full UI expect to have persistent storage, but we don't have flash working on beagle yet, so we have to use a RAM drive.

  • The newer FCL changesets of the beagleboard BSP contains a "pre-configured" C drive which should have been exported to \nvmemory\drive_c.img earlier.
  • A version of this is also available in the beagleboard source here \sf\adaptation\beagleboard\omap3530\beagleboard\rom\drive_c.img
  • And if you've downloaded the Wild Ducks ROM kit, you have both drive_c.img and the beagle.rom.img you need below in that zip file.

Copy this drive_c.img to your SD card along with the beagle.rom.img image (\epoc32\rombuild\beagle\core\beagle.rom.img if you built it yourself)

Make sure you've got your beagleboard setup as per the instructions here.

However, flash the rom is now slightly different:

mmc init fatload mmc 0 0x81000000 drive_c.img fatload mmc 0 0x82000000 beagle.rom.img

Note: the C drive is loaded into address 0x81000000 and the ROM image is loaded beyond that at 0x82000000

Note: You don't need to reflash the C drive (unless you want to get back to a known "good" state), provided that you haven't powered off the board between boots.

[edit] Booting the image

If you've just loaded it, or if you've just rebooted without powering off you can just boot the rom like this:

go 0x82000000

Note: On 3.0.3 it seems that the error message "via Infrared via Infrared" needs to be dismissed (by pressing 'Q') almost immediately, otherwise displaying that message is the only thing you will get your Beagle board to do.

[edit] Automatic Beagleboard boot (for demo)

Enter manually the following command (don't copy & paste as it seems not working)

set bootcmd 'mmc init ; fatload mmc 0 0x81000000 drive_c.img ; fatload mmc 0 0x82000000 beagle.rom.img ; go 0x82000000' saveenv

Then rebooot the Beagleboard by pressing the reset button, let the Beagleboard start, don't press any key went you see the countdown from 10 to 0.

It will take about 5 minutes for the splash scren to show, and another 2 minutes before you see the homescreen.

[edit] General Troubleshooting and Notes

  • FULL_DEBUG images don't seem to work, they just crash in the AknCapServer - probably an out of memory issue or something.
  • You may find that you need to reflash the C drive between boots if it doesn't boot properly, not sure why this is at this stage, but probably something not correctly recognising that it's full booted and putting the device in a shutdown state
  • If you wish to add stuff into your C drive , you can mount the Drive_C.img file as a FAT FS on windows using ImDisk or any other tool that will mount FAT images (note on vista you may run into issues with having to run this as Administrator!) and add stuff.

You can then flash this new Drive_C.img to the Beagleboard RAM as previously .

mmc init fatload mmc 0 0x81000000 drive_c.img

Just ensure that you don't add very big files which may make your Drive_C.img grow into the 0x82000000 (beagle.rom.img) address space.

  • There is a serial keyboard driver built in to the UI rom and you can use your host PC keyboard for the same.The Key mappings are:
    • 'q': Left softkey
    • 'w': Center softkey
    • 'e': Right softkey
    • 'a': Green key
    • 's': Application key
    • 'd': Red key
    • Arrows: Change focus

[edit] The HuiStatic.cpp problem - RESOLVED

Why do we have to rebuild hitchcock.dll at every release, adding the extremely implausible #define __WINSCW__ at the top of HuiStatic.cpp? Neither Syborg nor the NaviENgineseem to require this...

The symptom of not making the change is a kernel fault - shown here from a stemkit ROM image.

CAknExtendedFader::CreateLCAknExtendedFader::ConstructL >>CAknExtendedFader::ConstructL <<
Exc 2 Cpsr=88000010 FAR=00000000  SR=00000000
 R0=3ffe4000  R1=81089028  R2=3ffe7000  R3=00000002
 R4=00000000  R5=810fcf00  R6=00408968  R7=0080009c
 R8=00000100  R9=00000040 R10=c80abb10 R11=00000000
R12=810efc80 R13=00408938 R14=8108906c R15=8108ceb0
R13Svc=c9124000 R14Svc=800289cc SpsrSvc=48000010
Thread sysstatemgr.exe::!CleSrv_9cfe7d6, KernCSLocked=0
Thread full name=sysstatemgr.exe::!CleSrv_9cfe7d6
Thread ID=27, KernCSLocked=0
FAULT: KERN 0x00000004 (4)

Using printsym.pl to decode the ROM addresses (and manually decoding the awkward ones) shows

R15     (PC) = 8108ceb0   = __sti___13_HuiStatic_cpp                  HuiStatic.o(.text) + 0xc
USR R14 (LR) = 8108906c  = __cpp_initialize__aeabi_                  ucppinit.o(.emb_text) + 0x1c

The kernel is faulting because a critical application has faulted, but it's basically just crashing in that static data initialisation function in HuiStatic.cpp. The relevant part of the code is

   __sti___13_HuiStatic_cpp
       0x00001d20:    e51f0288    ....    LDR      r0,[pc,#-648] ; [.bss$5 = 0x1aa0] = 0
       0x00001d24:    e92d4010    .@-.    PUSH     {r4,r14}
       0x00001d28:    e3a04000    .@..    MOV      r4,#0
       0x00001d2c:    ed9f0a24    $...    FLDS     s0,[pc,#144]  ; [0x1dc4] = 0
       0x00001d30:    e5804000    .@..    STR      r4,[r0,#0]

so it's that FLDS instruction (VFP load single-precision register) which is causing the problem. This is being used to initialise a TReal32 member iTimeFactor to 0, and is really less efficient that using the integer register store instruction.

When we compile with the #define added, the real effect is to remove the writeable static data and use Thread Local Storage instead. The resulting code is littered with floating point instructions, but no longer has the static initialisation.

The problem is simply that the BeagleBoard baseport doesn't enable the generic VFP code provided the the kernelhwsrv package. This has now been done by the changes in changeset 3c8e997405fe, which will remove permanently the need to recompile hitchcock.dll.

Personal tools
NAVTREE