pmeerw's blog

Apr 2011

Sat, 30 Apr 2011

pandaboard X-Loader boot issue with SD card

I had an issue to boot an A2 pandaboard from a Kingston 512MB SD card, I got the following output from X-Loader:
** Can't read from device 0 **
another Kingston 2GB SD card worked fine

it turned out that the problem is some missing delay in the MMC configuration code of X-loader, i.e. git://git.omapzoom.org/repo/x-loader.git, omap4_dev branch (the problem also exists with MLO from the minimal fs)

below patch fixes the issue for me:

diff --git a/cpu/omap4/mmc.c b/cpu/omap4/mmc.c
index efd7860..280e75b 100644
--- a/cpu/omap4/mmc.c
+++ b/cpu/omap4/mmc.c
@@ -547,6 +547,7 @@ unsigned char configure_mmc(mmc_card_data
*mmc_card_cur,
        if (dsor == 3)
                dsor = 4;
                        
+       printf("delaying\n");
        ret_val = mmc_clock_config(mmc_cont_cur, CLK_MISC, dsor);
        if (ret_val != 1)
                return ret_val;

posted at: 21:57 | path: /projects/PandaBoard | permanent link

Thu, 28 Apr 2011

pandaboard

Just got my pandaboard, a dual-core ARM Cortex A9 development board with WLAN, LAN, bluetooth, DVI/HDMI and OpenGL/ES.

posted at: 18:03 | path: /projects/PandaBoard | permanent link

Implementing Convolutional Codes

A good online tutorial is Charan Langton's Coding and decoding with Convolutional Codes. (Fig. 10 seems incorrect, however, as three arrows go into one state.)

To visualize a Trellis on paper, I found the following useful:

Available as: .pdf and .svg

Some code (test.cpp) using the it++ library for C++ which illustrates the decoding example given in the tutotial:

// compile with 
//   g++ -Wall -o test test.cpp -litpp
// run with
//   ./test

#include <cstdio>
#include <cassert>

#include <itpp/itbase.h>
#include <itpp/itcomm.h>

// example program, following http://www.complextoreal.com/convo.htm

int main() {
    unsigned int invR = 2; // inverse rate
    unsigned int m = 4; // memory
            
    itpp::bvec u = "1 0 1 1 "; // input bits
                
    std::cout << "uncoded: " << u << "\n";
                    
    itpp::Convolutional_Code cc;
    itpp::BPSK bpsk;
                            
    itpp::ivec generators;
    generators.set_size(invR, false);
    generators(0) = 15; // polynomials
    generators(1) = 13; 
                                            
    printf("constraint length %u\n", m-1);
                                                
    cc.set_generator_polynomials(generators, m);
    itpp::bvec coded_bits = cc.encode_tail(u);
    std::cout << "coded: " << coded_bits << "\n";
                                                                
    itpp::vec symbols = bpsk.modulate_bits(coded_bits);
    printf("symbols %d\n", symbols.size());
                                                                            
    // channel here
    itpp::vec received_symbols = symbols + 0.3*itpp::randn(symbols.size());
                                   
    itpp::bvec decoded_bits = cc.decode_tail(received_symbols);
    std::cout << "decoded: " << decoded_bits << "\n";
}

posted at: 17:59 | path: /academic | permanent link

Change Gnuplot's line type style

I find Gnuplot's default line type styles (solid, dashed, dotted) quite hard to distinguish on small figures:

On the left Gnuplot's default line type 2 and 3, on the right the improved version (much better :-))!

My solution is to patch the Postscript code produced by Gnuplot; first the original Postscript code:

/LT1 {PL [4 dl1 2 dl2] LC1 DL} def
/LT2 {PL [2 dl1 3 dl2] LC2 DL} def
and here the patched lines:
/LT1 {PL [12 dl1 6 dl2] LC1 DL} def
/LT2 {PL [2 dl1 2 dl2] LC2 DL} def

Here is the .plot file and the original and patched .eps file.

posted at: 17:30 | path: /academic | permanent link

Sat, 02 Apr 2011

Sharing photos on facebook...

... without shoving your copyright into Zuckerberg'ass; I prefer to host my content on my server and rather just post a link.

According to stackoverflow , use

<head>
<link rel="image_src" href="http://stackoverflow.com/images/logo.gif" />
</head>
to indicate the image which should appear as a thumbnail.

The facebook URL linter (http://developers.facebook.com/tools/lint/) allows to preview how your link is rendered.

posted at: 20:15 | path: / | permanent link

Made with PyBlosxom