scanf problem in EDk 9.1i (Microbaze)

On Feb 20, 3:40 pm, Jan Pech <inva...@void.domain> wrote:
On Wed, 2008-02-20 at 01:45 -0800, MAx wrote:
Hi,
      How to read an integer from hyperterminal onto a microbaze using
EDK 9.1i.
Im trying it using scanf but its giving me errors.

      here are the lines of code im trying to achieve the read.

                scanf("%d",&var);
   xil_print("\r\n Entered %d \r\n",var);

      I get the following errors,

                 At Local date and time: Wed Feb 20 15:08:33 2008
 xbash -q -c "cd /cygdrive/d/SCANF/; /usr/bin/make -f system.make
TestApp_Memory_program; exit;" started...
mb-gcc -O2 TestApp_Memory/src/TestApp_Memory.c  -o TestApp_Memory/
executable.elf \
    -mno-xl-soft-mul -mxl-pattern-compare -mcpu=v6.00.a  -Wl,-T -
Wl,TestApp_Memory/src/TestApp_Memory_LinkScr.ld  -g    -I./
microblaze_0/include/  -L./microblaze_0/lib/  \

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: region ilmb_cntlr_dlmb_cntlr
is full (TestApp_Memory/executable.elf section .text)

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: region ilmb_cntlr_dlmb_cntlr
is full (TestApp_Memory/executable.elf section .text)

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .init [00000050 -
00000077] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .fini [00000078 -
00000093] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .rodata [00000094 -
00000cdf] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .data [00000ce0 -
000013ff] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .ctors [00001400 -
00001407] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .dtors [00001408 -
0000140f] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .jcr [00001410 -
00001413] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccGEcfLD.o: In function
`main':

/cygdrive/d/SCANF/TestApp_Memory/src/TestApp_Memory.c:85: undefined
reference to `xil_print'
collect2: ld returned 1 exit status

make: *** [TestApp_Memory/executable.elf] Error 1

Done!

Expecting a quick response

Thanks in advance

You do not have enough code space to use scanf()...

Jan- Hide quoted text -

- Show quoted text -
Hi ,
I have assigned 64k of local memory.
Is there an alternative to this problem im facing.

I want to be able to read intergers from the hyper terminal.

Thanks
 
On Wed, 2008-02-20 at 01:45 -0800, MAx wrote:
Hi,
How to read an integer from hyperterminal onto a microbaze using
EDK 9.1i.
Im trying it using scanf but its giving me errors.

here are the lines of code im trying to achieve the read.

scanf("%d",&var);
xil_print("\r\n Entered %d \r\n",var);

I get the following errors,

At Local date and time: Wed Feb 20 15:08:33 2008
xbash -q -c "cd /cygdrive/d/SCANF/; /usr/bin/make -f system.make
TestApp_Memory_program; exit;" started...
mb-gcc -O2 TestApp_Memory/src/TestApp_Memory.c -o TestApp_Memory/
executable.elf \
-mno-xl-soft-mul -mxl-pattern-compare -mcpu=v6.00.a -Wl,-T -
Wl,TestApp_Memory/src/TestApp_Memory_LinkScr.ld -g -I./
microblaze_0/include/ -L./microblaze_0/lib/ \


/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: region ilmb_cntlr_dlmb_cntlr
is full (TestApp_Memory/executable.elf section .text)

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: region ilmb_cntlr_dlmb_cntlr
is full (TestApp_Memory/executable.elf section .text)

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .init [00000050 -
00000077] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .fini [00000078 -
00000093] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .rodata [00000094 -
00000cdf] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .data [00000ce0 -
000013ff] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .ctors [00001400 -
00001407] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .dtors [00001408 -
0000140f] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .jcr [00001410 -
00001413] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccGEcfLD.o: In function
`main':

/cygdrive/d/SCANF/TestApp_Memory/src/TestApp_Memory.c:85: undefined
reference to `xil_print'
collect2: ld returned 1 exit status

make: *** [TestApp_Memory/executable.elf] Error 1

Done!

Expecting a quick response

Thanks in advance
You do not have enough code space to use scanf()...

Jan
 
M

MAx

Guest
Hi,
How to read an integer from hyperterminal onto a microbaze using
EDK 9.1i.
Im trying it using scanf but its giving me errors.

here are the lines of code im trying to achieve the read.

scanf("%d",&var);
xil_print("\r\n Entered %d \r\n",var);

I get the following errors,

At Local date and time: Wed Feb 20 15:08:33 2008
xbash -q -c "cd /cygdrive/d/SCANF/; /usr/bin/make -f system.make
TestApp_Memory_program; exit;" started...
mb-gcc -O2 TestApp_Memory/src/TestApp_Memory.c -o TestApp_Memory/
executable.elf \
-mno-xl-soft-mul -mxl-pattern-compare -mcpu=v6.00.a -Wl,-T -
Wl,TestApp_Memory/src/TestApp_Memory_LinkScr.ld -g -I./
microblaze_0/include/ -L./microblaze_0/lib/ \


/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: region ilmb_cntlr_dlmb_cntlr
is full (TestApp_Memory/executable.elf section .text)

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: region ilmb_cntlr_dlmb_cntlr
is full (TestApp_Memory/executable.elf section .text)

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .init [00000050 ->
00000077] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .fini [00000078 ->
00000093] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .rodata [00000094 ->
00000cdf] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .data [00000ce0 ->
000013ff] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .ctors [00001400 ->
00001407] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .dtors [00001408 ->
0000140f] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/
3.4.1/../../../../microblaze/bin/ld.real: section .jcr [00001410 ->
00001413] overlaps section .text [00000050 -> 00010293]

/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccGEcfLD.o: In function
`main':

/cygdrive/d/SCANF/TestApp_Memory/src/TestApp_Memory.c:85: undefined
reference to `xil_print'
collect2: ld returned 1 exit status

make: *** [TestApp_Memory/executable.elf] Error 1

Done!

Expecting a quick response

Thanks in advance
 
Hi ,
      I have assigned 64k of local memory.
Is there an alternative to this problem im facing.
Allocate more memory or try iscanf, which is an integer only version
of scanf, that should require less code space. (There should be
iprintf too).

Cheers,
Jon
 
Hi ,
      I have assigned 64k of local memory.
Is there an alternative to this problem im facing.

Allocate more memory or try iscanf, which is an integer only version
of scanf, that should require less code space. (There should be
iprintf too).

Cheers,
Jon
scanf and printf are monsters - they do everything but there is a huge
amount of code.
also, the Microblaze code is not very compact.

I needed to print and read some integers, so I just used simple functions
that do just that. It should not take more than a couple hundred bytes...
Something like this 1 minute example not guaranteed to work at all ;)

int fake_atoi( const char *c )
{
int n = 0;
while( isdigit( *c ))
n = n*10 + (*c++ - '0');
return n;
}
 
On Feb 24, 2:47 am, PFC <li...@peufeu.com> wrote:
Hi ,
      I have assigned 64k of local memory.
Is there an alternative to this problem im facing.

Allocate more memory or try iscanf, which is an integer only version
of scanf, that should require less code space. (There should be
iprintf too).

Cheers,
Jon

        scanf and printf are monsters - they do everything but there is a huge  
amount of code.
        also, the Microblaze code is not very compact.

        I needed to print and read some integers, so I just used simple functions  
that do just that. It should not take more than a couple hundred bytes...
        Something like this 1 minute example not guaranteed to work at all ;)

int fake_atoi( const char *c )
{
        int n = 0;
        while( isdigit( *c ))
                n = n*10 + (*c++ - '0');
        return n;



}- Hide quoted text -

- Show quoted text -
Hi,
Didnt find iscanf in the library. very reluctatntly chose reading
in the number a digit at a time using
XUartLite_RecvByte into an array and then converted that array to a
number...

hope it holds well during the demo

Thanks guys
MAx
 

Welcome to EDABoard.com

Sponsor

Back
Top