2010-09-18 03:56:58     Problem Regarding the Aplication

Document created by Aaronwu Employee on Aug 22, 2013
Version 1Show Document
  • View in full screen mode

2010-09-18 03:56:58     Problem Regarding the Aplication

Usama Shakeel (PAKISTAN)

Message: 93597   

 

Hello,

 

I am trying to port an application to uclinux which is compiled through toolchain. This is the error which I receive.

 

root:/> ./post                                                                

ELF: not found 

 

I have compiled and tried both the options for binary. i.e.

 

[Blackfin Build Options] → [Binary Format] : FDPIC and FLAT.

 

I am using matrix.h and multiplying function in the code. It compiles with no error, the code of the aplication is given below. Kindly let me know the cause of this error.?

 

 

 

#include <stdio.h>

#include <stdlib.h>

#include <fcntl.h>        /* open */

#include <unistd.h>        /* exit */

#include <sys/ioctl.h>  

#include <errno.h>

/* ioctl */

#include <sys/types.h>

#include <string.h>

#include <matrix.h>

main()

{

    double temp1 [9];

    double temp2 [9];

    double ans [9];

 

    int i =0;

    for(i =0; i<3; i++)

    {

        temp1[0+i] = i+1;

        temp1[3+i] = i+1;

        temp1[6+i] = i+1;

        temp2[(3*i)+0] = i+4;

        temp2[(3*i)+1] = i+4;

        temp2[(3*i)+2] = i+4;

    }

    printf("before Multiplication\n");

    matmmlt((const double *)temp1,3,3,(const double *)temp2, 3,(double *)ans);

    for ( i=0 ; i<9; i++)

        printf(" ANS : %d, %d, %d \n",ans[i],ans[i],ans[i] );  

}

QuoteReplyEditDelete

 

 

2010-09-18 03:58:44     Re: Problem Regarding the Aplication

Mike Frysinger (UNITED STATES)

Message: 93598   

 

how exactly did you compile the code and how exactly did you transfer it to the board ?

QuoteReplyEditDelete

 

 

2010-09-18 04:15:19     Re: Problem Regarding the Aplication

Usama Shakeel (PAKISTAN)

Message: 93600   

 

Thanx mike for the quick response...

 

 

 

I compiled it with the following command on my host PC ..

 

bfin-uclinux-gcc post.c -o post -c

 

as when I dont place -c it gives an unrefernce error for this function..

 

I transferred post file through UART. lrz and using z-modem..

 

 

 

Waiting for your response..

 

 

 

Regards

 

Usama Bin Shakeel

QuoteReplyEditDelete

 

 

2010-09-18 04:19:13     Re: Problem Regarding the Aplication

Mike Frysinger (UNITED STATES)

Message: 93602   

 

"-c" means compile.  you cannot execute random compiled objects, you must link them first.

 

QuoteReplyEditDelete

 

 

2010-09-18 05:01:06     Re: Problem Regarding the Aplication

Usama Shakeel (PAKISTAN)

Message: 93605   

 

Mike can you do a favour to elaborate. By linking you mean giving reference of library like -lm for math.h.. If so then what will be library for matrix.h as I was unable to find one..

 

 

 

Regards

 

Usama Bin Shakeel

QuoteReplyEditDelete

 

 

2010-09-18 05:06:19     Re: Problem Regarding the Aplication

Mike Frysinger (UNITED STATES)

Message: 93606   

 

if you're going to use funcs from the blackfin dsp library, you must link it in yourself

QuoteReplyEditDelete

 

 

2010-09-18 05:22:32     Re: Problem Regarding the Aplication

Usama Shakeel (PAKISTAN)

Message: 93607   

 

By this you mean I need to compile toolchain with libbfdsp support..?

 

If I am getting you right..??

 

If so how much difference would it make on performance if I write the same functionality in user level..?

 

 

 

Regards

 

Usama

QuoteReplyEditDelete

 

 

2010-09-18 05:30:52     Re: Problem Regarding the Aplication

Mike Frysinger (UNITED STATES)

Message: 93609   

 

the toolchain already includes libbfdsp.  please read the documentation:

https://docs.blackfin.uclinux.org/doku.php?id=toolchain:libbfdsp

 

i have no idea what you're talking about with respect to "user level"

QuoteReplyEditDelete

 

 

2010-09-18 05:59:12     Re: Problem Regarding the Aplication

Usama Shakeel (PAKISTAN)

Message: 93610   

 

Thanx Mike it is always helpful to talk to you. The ELF error is gone it was my bad I was not including -lbfdsp while compiling. Kindly resolve the sdram issue as well on my other thread.. :D.

 

 

 

Regrads

 

Usama

Attachments

    Outcomes