10-26-2008 07:20 AM
I am trying to build a webserver in ML403 Evaluation board (Xilinx Vertix 4 F12).
and I'm trying to start using xilinx example which is XAPP1026 (webserver part).
----> in http_rsponse.c file.
what is the functionalty of the following code block:
for(n=0; n< n_swithches ; n++; p++)
*p = '0' + (s & 0x1);
- This is the first time that i see this statment in c code which is (#if #else #endif) , what is the functionalty of this statment.
if it is like normal if, then i think it 's trivial to put a condition with (1) and write else statment?
- what is the functionalty of
*p = '0' + (s & 0x1);
--------------> i have a problem in building a new project and copy XAPP1026 code, as it is.
then generate the bit stream file and elf file.
then i program my kit with generated bit file.
when i dow/run my elf file, nothing occure , and web browser give can't find server.
when i dow/run XAPP1026 elf file in my bit file, web brewser find the website and show it, but it can't use any kit resouces such as toggle leds, or get switch states.
There is different that i see in XMD window which is varing in addresses of section form my elf, and xapp elf.
such as section fini, got, got1, got2 as shown in attached picture.
Hoping to hear from you soon, Thank you in advanced.
10-27-2008 09:51 AM
>> This is the first time that i see this statment in c code which is (#if #else #endif) , what is the functionalty of this statment.
>> if it is like normal if, then i think it 's trivial to put a condition with (1) and write else statment?
It looks like I didn't fully clean up the code before releasing it. Sorry about that. Also, this code is only there in the RAW mode example, and since you are a beginner, I'd advise you to look at the socket mode example.
The #if #else #endif are just C preprocessor macros.
It is a trivial #if 1 condition, so you can just ignore the else part.
>> - what is the functionalty of
>> *p = '0' + (s & 0x1);
>> s>>= ;
Bad naming of variables, but you should be able to see that s is just a integer that needs to be converted into a binary string.
There is a section at the end of the appnote that discusses common mistakes. That might be of help to you. I'm not sure how you compiled your ELF, but you should check if you have a linker script specified.
10-29-2008 01:37 AM
>> since you are a beginner, I'd advise you to look at the socket mode example.
I think the differenance between Socket and RAW mode is in the processing methodology of sending and receiving data, which is not problem with me.
but i am using RAW mode because i want to get the best data rate in transfering data, Is it true?
concerning with linker script, I just click in generate linker script, and then click OK -because all fields aren't writable except chosing memory in the poped-up window - but no change in behavior.
The only different between my project and XAPP1026 that i use xps_bram_if_cntlr_1 as 32K instead of 8k, but have the same base address.
and PPC clock is 200MHz instead of 300MHz. and i think it is not critical different.
and if i have problem in linker script. why your ELF file can't access board IO, that when press in toggle led the button will be inactive and no change occure?
The problem may be in addresses of IO, but i sure that it 's same from system assbley view.
12-04-2008 11:59 PM
Based on the coding below , I can not receive anything from the hyperterminal. How can I rectify the problem , so that I can receive data from the hyperterminal and display it back to the hyperterminal? I tried to debug , but there is no value assign to t . If the coding is wrong, should I use array.
#define UART_BASEADDR XPAR_UARTLITE_0_BASEADDR
#define ESCAPE 0x1b
static void myprintf (char *s)
XUartLite_SendByte (UART_BASEADDR ,*s ); // Able to send to Hyperterminal
/*Problem is here. It should receive data from hyperterminal and display it back.
But it does not work.How should I rectify it? */
t = XUartLite_RecvByte(UART_BASEADDR); //Receive
XUartLite_SendByte (UART_BASEADDR , t ); //Send
} while (t != ESCAPE);
This is the UCF , which automatically generated by using XPS 9.2
Net sys_clk_pin LOC=AE14;
Net sys_clk_pin IOSTANDARD = LVCMOS33;
Net sys_rst_pin LOC=D6;
Net sys_rst_pin PULLUP;
## System level constraints
Net sys_clk_pin TNM_NET = sys_clk_pin;
TIMESPEC TS_sys_clk_pin = PERIOD sys_clk_pin 10000 ps;
Net sys_rst_pin TIG;
## IO Devices constraints
#### Module RS232_Uart constraints
Net fpga_0_RS232_Uart_RX_pin LOC=W2;
Net fpga_0_RS232_Uart_RX_pin IOSTANDARD = LVCMOS33;
Net fpga_0_RS232_Uart_TX_pin LOC=W1;
Net fpga_0_RS232_Uart_TX_pin IOSTANDARD = LVCMOS33;
09-13-2012 08:35 AM
HI. I READ YOUR POST AND I AM USING VERTIX 4 FOR MY FINAL YEAR PROJECT BUT THE PROBLEM IS THAT I COULDN'T FIND WHAT PROGRAMMING TOOL IS USED. IF YOU KINDLY TELL ME WHAT PROGRAMMING TOOL SHOUL I USE???
09-13-2012 05:43 PM
Oh this is an old project.
Anyway, what type of project are you working in? I mean, you may not need to use a programming language if you intend to build a pure hardware project. In this case, you just need Xilinx ISE software and you can use HDL language such as VHDL, or Verilog to build your system.
However, if you planning to build an embedded system in the vertix 4, so you may use ISE or EDK. All of them are part of Xiiinx ISE suite. in EDK, you can use C++ to program your embedded software in PowerPC or softcore processor inside the FPGA.
09-14-2012 10:11 AM
Do u want to build an embedded system?
just you want to describe your hardware with c++ instead of VHDL? In this case you will need a high level synthesis tool that synthesize your c++ to VHDLHowever your project will still be merely hardware not embedded system.