Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SDK ISE Microblaze scanf/getchar too big need xilprintf for scanf

Status
Not open for further replies.

at631

Newbie level 3
Newbie level 3
Joined
Feb 4, 2015
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
38
Hi edaboard,

I successfully implemented s Hello world program using Microblaze Microcontroller System (MCS) embedded processor with a simple C program using ISE and SDK. I am trying to implement a menu to give the user the ability to select a value (1-9) which communicates with Microblaze. When I tried to use scanf() in SDK, it appears to be too big (please see error below). I then tried using getc(), which also appears to be too big (please see error below). I did some research and saw that there are several recommendations to use XUartLite_RecvByte(XPAR_RS232_UART_1_BASEADDR); However, when I tried to use I get an error stating that 'XPAR_RS232_UART_1_BASEADDR' is undeclared. When I tried to include "xuartlite.h", or xuartlite_l.h. I get an error saying, “No such file or directory”.
Is xuartlite not compatible with SDK or am I doing something wrong?
Is there a light weight version of scanf I can use if xil_printf is the light version of printf.?

Source of hello world tutorial:
**broken link removed**

char keyboard;
keyboard = scanf("%c",&keyboard);
hello_world.elf section `.text' will not fit in region `ilmb_cntlr_dlmb_cntlr'
make: *** [hello_world.elf] Error 1
region `ilmb_cntlr_dlmb_cntlr' overflowed by 94680 bytes

char keyboard;
keyboard = getchar();
hello_world.elf section `.text' will not fit in region `ilmb_cntlr_dlmb_cntlr'
make: *** [hello_world.elf] Error 1
region `ilmb_cntlr_dlmb_cntlr' overflowed by 6664 bytes
 

hello_world.elf section `.text' will not fit in region `ilmb_cntlr_dlmb_cntlr'
make: *** [hello_world.elf] Error 1
region `ilmb_cntlr_dlmb_cntlr' overflowed by 94680 bytes

This error means that you don't have enough memory to store the data. You must increase you memory in your XPS design. I think default size is around 8kb. Increase it to around 128 kbit if you can.

XUartLite_RecvByte(XPAR_RS232_UART_1_BASEADDR); However, when I tried to use I get an error stating that 'XPAR_RS232_UART_1_BASEADDR' is undeclared.

For your info, XPAR_RS232_UART_1_BASEADDR is declared in xparameters.h

I hope that it helps.
 

This error means that you don't have enough memory to store the data. You must increase you memory in your XPS design. I think default size is around 8kb. Increase it to around 128 kbit if you can.



For your info, XPAR_RS232_UART_1_BASEADDR is declared in xparameters.h

I hope that it helps.

Thank you but this does not help at all.

I am using sdk and ise, in ise I used the most memory allowable 64KB
 

The OP should use the DDR2/3 memory that is on the development board to run code.

Using the MCS (as opposed to an XPS design) you don't want to use any C libraries, The microblaze stand alone is really only good for embedded applications that pretty much never talk to the outside world (e.g. huge FSMs) and or do it through UART so they "byte bang" out the messages without having to link in printf.

If you switch to an XPS design you can leave the internal memory at 8KB, caches at 8KB, and run from DDR2/3 with GB of memory then you can load all those C libraries you love so dearly ;-)
 

The OP should use the DDR2/3 memory that is on the development board to run code.

Using the MCS (as opposed to an XPS design) you don't want to use any C libraries, The microblaze stand alone is really only good for embedded applications that pretty much never talk to the outside world (e.g. huge FSMs) and or do it through UART so they "byte bang" out the messages without having to link in printf.

If you switch to an XPS design you can leave the internal memory at 8KB, caches at 8KB, and run from DDR2/3 with GB of memory then you can load all those C libraries you love so dearly ;-)

Thank you for your prompt response. :)

I am not using a kit, I am using a board that I designed myself with no external memory.

I apologize for not elaborating further In my micro blaze I configured a UART. I loaded a hello world program in SDK and used hyperterminal to read Hello World. The purpose posting to your amazing website is because I need to take input from hyper terminal but cannot do it because scanf is too big.
 

I am not using a kit, I am using a board that I designed myself with no external memory.
I need to take input from hyper terminal but cannot do it because scanf is too big.
Well make this a lesson that you should add at least the pad placement for adding a DDR2/3 memory device on any embedded processor design PCB. If nothing else you can initially develop with the RAM and then start optimizing (i.e. writing assembly or low level driver type code for your embedded processor) to reduce the memory footprint

when I tried to use I get an error stating that 'XPAR_RS232_UART_1_BASEADDR' is undeclared. When I tried to include "xuartlite.h", or xuartlite_l.h. I get an error saying, “No such file or directory”.
Looks like you need to find out why it didn't find the files. This post has some sample code that someone used to get the UART receive working.
 

Well make this a lesson that you should add at least the pad placement for adding a DDR2/3 memory device on any embedded processor design PCB. If nothing else you can initially develop with the RAM and then start optimizing (i.e. writing assembly or low level driver type code for your embedded processor) to reduce the memory footprint


Looks like you need to find out why it didn't find the files. This post has some sample code that someone used to get the UART receive working.

I do not understand why the files are not found and looking for help from someone who is familiar.

In the post the user explicitly states they are using EDK, I am using SDK.

When I try to use XUartLite_RecvByte i get an error: undefined reference to `XUartLite_RecvByte'
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top