New tutorial on RRP wiki describing how to install real time patches on PandaBoard

138 views
Skip to first unread message

Osman Eralp

unread,
Feb 22, 2012, 2:19:04 PM2/22/12
to robotrefere...@googlegroups.com
I just posted a tutorial that describes how to install on the PandaBoard a version of Ubuntu with the real time kernel patches. The tutorial includes instructions for installing Ubuntu from scratch, compiling a new kernel from source, and testing the latency of the system with the real time patches.


I started on the tutorial when I was working on my balancing robot last year. The robot was having trouble balancing when moving forward. I discovered that the OS on my robot would "go away" for a hundred ms at random intervals. Such lapses are fatal for a balancing robot. I'm hoping to use the real time version of Ubuntu for the next version of a balancing robot.

--Osman

Leo

unread,
Mar 15, 2012, 9:38:48 PM3/15/12
to robotrefere...@googlegroups.com

Now I am studying an unicycle robot with Pandaboard.

And I had the same latency problem you had.

Your tutorial save me.

I really appreciate you sharing it


Thank you

 

Ji-Hyuk Yang

 

School of Electrical Engineering

Inha University



2012년 2월 23일 목요일 오전 4시 19분 4초 UTC+9, Osman Eralp 님의 말:

wally_666

unread,
Nov 8, 2012, 11:56:20 AM11/8/12
to robotrefere...@googlegroups.com
On Wednesday, February 22, 2012 1:19:04 PM UTC-6, Osman Eralp wrote:
> I just posted a tutorial that describes how to install on the PandaBoard a version of Ubuntu with the real time kernel patches. The tutorial includes instructions for installing Ubuntu from scratch, compiling a new kernel from source, and testing the latency of the system with the real time patches.
>
>
> You can find the tutorial here: http://hbrobotics.org/wiki/index.php?title=Installing_Ubuntu_With_Real_Time_Patches_On_The_PandaBoard
>

Your instructions were very clear but it seems something is missing after the

sudo cp ./arch/arm/boot/uImage /media/1
sudo cp -r ./mymodules/lib/modules/3.0.9-rt26 /media/2/lib/modules

steps, as my SD card would not boot when reinserted into the Pandaboard :(

Here are the messages I get from minicom trying to boot, it hangs at the last line with both LEDs on the board lit up.

U-Boot SPL 2011.09-rc2 (Oct 06 2011 - 17:56:54)
Texas Instruments OMAP4460 ES1.1
OMAP SD/MMC: 0
ot.bin ..
reading u-boot.bin
30
Board: OMAP4 Panda
I2C: ready
DRAM: 1 GiB
WARNING: Caches not enabled
MMC: OMAP SD/MMC: 0
Using default environment

In: serial
Out: serial
Err: serial
Net: No ethernet found.
Hit any key to stop autoboot: 0
reading uEnv.txt

** Unable to read "uEnv.txt" from mmc 0:1 **
reading boot.scr

373 bytes read
Loaded script from boot.scr
Running bootscript from mmc0 ...
## Executing script at 82000000
reading uImage

3961680 bytes read
reading uInitrd

4357212 bytes read
## Booting kernel from Legacy Image at 8...
Image Name: Linux-3.0.9-rt26
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3961616 Bytes = 3.8 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 81600000 ...
Image Name: Ubuntu Id Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Osman Eralp

unread,
Nov 8, 2012, 3:53:37 PM11/8/12
to robotrefere...@googlegroups.com

steps, as my SD card would not boot when reinserted into the Pandaboard :(  
...

Your PandaBoard did boot! It is a common misconception that the PB hangs when the terminal stops producing output. You PB may actually be up and running. The solid lights are a bit troubling. To check if your PB is running, try these steps:
1. Press enter a couple times in the minicom window. You might get a login prompt.
2. Attach a monitor to the hdmi port to check if you get a login prompt.

If the PB isn't running, try these steps:
1. Use a different SD card that is 8 GB or less. I have tried about 10 different SD cards with my PB. About half of those don't work with the PB! I recommend 8 GB Transcend LX Series cards; you can get them at Fry's. My next choice would be 8 GB Transcend class 10 cards.
2. Remove the "quiet" option from the kernel bootargs. That should produce a more verbose output in minicom. Remove "quiet" from /boot/boot.script. If the PB is running, run flash-kernel. If the PB is not running, it's a bit more tricky: you will need to run mkimage, something like this:

mkimage -A arm -T script -C none -n "Ubuntu boot script" -d boot.script boot.scr

I'm not positive about the syntax, so check it before making the new image.

Report back how it goes.

--Osman

wally_666

unread,
Nov 8, 2012, 4:24:55 PM11/8/12
to robotrefere...@googlegroups.com
On Thursday, November 8, 2012 2:53:37 PM UTC-6, Osman Eralp wrote:
> steps, as my SD card would not boot when reinserted into the Pandaboard :(  
> ...
>
>
> Your PandaBoard did boot! It is a common misconception that the PB hangs when the terminal stops producing output. You PB may actually be up and running. The solid lights are a bit troubling. To check if your PB is running, try these steps:
> 1. Press enter a couple times in the minicom window. You might get a login prompt.
> 2. Attach a monitor to the hdmi port to check if you get a login prompt.
>
Thanks for the suggestions, I'm stumped.

I hit lots of "enter" keystrokes! and had an hdmi monitor connected, but no luck.

I will give your suggestions a try. The 11.10 server image did not have the /var/lib.oem-config/run bug, the desktop image did. I'm using the desktop image to poke around a bit before I do the uImage copy on my second try.

My 8GB SD card has run several pandaboard images just fine, including the second try desktop image that is updating as I type this. I'm not understanding how the system can work with none of the kernel files or initrd image files in the /boot directory.

I have a Pandaboard ES, perhaps this is an issue? I'll be researching the mkimage and boot.scr stuff next.

wally_666

unread,
Nov 8, 2012, 4:46:03 PM11/8/12
to robotrefere...@googlegroups.com
I got these errors, scrolled by too fast the first time to be sure, on the make uImage step:


wally@Precise:~/Panda_RTlinux/ubuntu-oneiric-7bca30b$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage
scripts/kconfig/conf --silentoldconfig Kconfig
warning: (USB_WUSB) selects UWB which has unmet direct dependencies (EXPERIMENTAL && PCI)
warning: (USB_MUSB_HDRC_HCD && USB_MUSB_OTG && USB_LANGWELL_OTG && FSL_USB2_OTG) selects USB_OTG which has unmet direct dependencies (USB_SUPPORT && USB && EXPERIMENTAL && USB_SUSPEND)
warning: (USB_WUSB) selects UWB which has unmet direct dependencies (EXPERIMENTAL && PCI)
warning: (USB_MUSB_HDRC_HCD && USB_MUSB_OTG && USB_LANGWELL_OTG && FSL_USB2_OTG) selects USB_OTG which has unmet direct dependencies (USB_SUPPORT && USB && EXPERIMENTAL && USB_SUSPEND)


Does this mean I messed something up with the renamed Config.doc .config file and the make menuconfig step?

Kernel Features ---> Preemption Model" to Fully Preemptible Kernel was set

System Type ---> TI OMAP Common Features ---> Use 32KHz timer I had to unset

and I enabled the userspace SPI module and GPIO debugging.

Osman Eralp

unread,
Nov 8, 2012, 5:26:35 PM11/8/12
to robotrefere...@googlegroups.com
Those errors are not normal. I can't say for sure, but I'd guess there is a version conflict between your Ubuntu base image, which should have been 11.10, and the version that the .config file was created for. 

I just noticed that you followed an old version of the instructions. The updated version uses Ubuntu 12.04. Please try the instructions here: http://hbrobotics.org/wiki/index.php?title=Installing_and_Configuring_Ubuntu_on_the_PandaBoard

--Osman

wally_666

unread,
Nov 13, 2012, 6:21:11 PM11/13/12
to robotrefere...@googlegroups.com
Thanks for the update, I'll give it a try tomorrow, but shouldn't Ubuntu 12.04 for the Pandaboard be built with armhf cross-compiler?

Also, I'm still not understanding how simply copying the new uImage file to the SD vfat partition is all that it takes to make it boot, what about uInitrd? and all the files in /boot on SD card partition 2?

--wally.

wally_666

unread,
Nov 14, 2012, 11:40:55 AM11/14/12
to robotrefere...@googlegroups.com
Following the new instructions for 12.04 server image I get the following error:

root@lPandaES:~# add-apt-repository ppa:tiomap-dev/release                    
Traceback (most recent call last):                                            
  File "/usr/bin/add-apt-repository", line 125, in <module>                   
    ppa_info = get_ppa_info_from_lp(user, ppa_name)                           
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 84, 
in get_ppa_info_from_lp                                                       
    curl.perform()                                                            
pycurl.error: (60, 'server certificate verification failed. CAfile: /etc/ssl/c
erts/ca-certificates.crt CRLfile: none')                                      

wally_666

unread,
Nov 14, 2012, 2:19:58 PM11/14/12
to robotrefere...@googlegroups.com
Either the network issue fixed itself while I ate lunch, or somewhere I missed a needed reboot of the Pandabord before doing this as it worked when I restarted my Pandboard after poking around the SD card to see if it would be obvious how to manually add the PPA, it wasn't :(

wally_666

unread,
Nov 14, 2012, 2:37:21 PM11/14/12
to robotrefere...@googlegroups.com
Got past one problem and now another has stopped me dead :(

couldn't download the rt patch:

  1. Download to the current directory the following patches:
    1. File:000-ducati-rt.patch.doc
    2. File:000-eeti ts.patch.doc
    3. File:000-ezx-pcap.patch.doc
    4. File:000-serial.patch.doc
    5. File:Patch-3.4.9-rt17.patch.doc

The link for File:Patch-3.4.9-rt17.patch.doc leads to "Special Page" You are not logged in.
I get the first four just fine.

Wiki issue?

--wally.

wally_666

unread,
Nov 20, 2012, 11:46:34 AM11/20/12
to robotrefere...@googlegroups.com
I managed to download the missing patch file after the wiki problem was fixed and successfully built the real-time kernel and modules.

After copying the uImage to the SD card FAT partition the system booted ad appeared to work fine except I got these error messages during the boot up

FATAL: Could not load /lib/modules/3.4.0-rt17+/modules.dep: No such file or diryfsck from util-linux 2.20.1 

I did some Googling, and this error is because of the missing initrd for the real-time kernel, which remains the "old" version from the previous kernel.
Since the real-time kernel is configured with all drivers required to boot up built in,  its only a cosmetic error, and is only visible when the serial port is "watching" the boot up.


There seems to often be a very long latency when the cyclictest program first starts, here are a couple of examples:
T: 0 (13424) P:99 I:100 C:  10000 Min:      4 Act:  102 Avg:   67 Max:     161  
panda@PandaES:~/rt-tests$ sudo ./cyclictest -t1 -p99 -n -i 100 -l 10000         
# /dev/cpu_dma_latency set to 0us                                               
policy: fifo: loadavg: 0.38 0.55 0.38 1/123 13427                               
                                                                                
T: 0 (13427) P:99 I:100 C:  10000 Min:      4 Act:   19 Avg:   86 Max:    5699  
panda@PandaES:~/rt-tests$ sudo ./cyclictest -t1 -p99 -n -i 100 -l 10000         
# /dev/cpu_dma_latency set to 0us                                               
policy: fifo: loadavg: 0.35 0.54 0.38 1/123 13430                               
                                                                                
 
Further testing has revealed this long max latency only seems to happen if running cyclictest from a serial port login.

From a console login my max has always been less than 40 uS and I've bumped the -l parameter to 1000000.


My next step was to edit:  board-omap4panda.c following these instructions:

As part of the process you have to enable SPIDEV in .config, but there is something not quite right with the build tree
as after doing "make menuconfig"  to set the options, the "make uImage" started prompting me with a lot of configuration questions I could
only guess the answer to by accepting the default.  I quickly grew weary of this and Ctrl-C out of the make.  I then recopied the downloaded
configuration file and renamed it .config again.  I then manually edited .config to set the SPIDEV options.  
Then the  "make uImage" and "make modules" worked a expected and built my spidev.ko module.  

 The /dev/spidev1.[0-2] devices added with my second compile worked fine after updating the uImage and modules on the SD card.

if anyone is interested, let me know and I can either try to put together a pair of patch files (one for the board-omap4panda.c file, the other for the real-time .config) or send you the modified files.  Although the instructions on the omappedia wiki are reasonably clear.


Thanks again for your effort in doing this how to guide!
--wally.

Reply all
Reply to author
Forward
0 new messages