scanf problem in EDk 9.1i (Microbaze)

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

Reply to
MAx
Loading thread data ...

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

Jan

Reply to
Jan Pech

sing

:08:33 2008

-

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

Reply to
MAx

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

Reply to
Jon Beniston

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; }

Reply to
PFC

re is a huge =A0

imple functions =A0

k at all ;)

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

Reply to
MAx

did it work?

can you post the code please

having the same issue

Reply to
djeasy22

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.