• 0

NEXYS4 ARTIX -7 FPGA WITH PMOD WIFI


Go to solution Solved by artvvb,

Question

Hi,

I am using nexys 4  Artix 7 fpga. I want to access sensor data connected at JXADC Pmod port and the sensor output data I want to display on HTTP Server or in a web page.I already able to access GPIO pin through HTTPServer and turning on off fpga board  leds.I added PmodACL2 code but it's showing error "invalid conversion from 'u32* {aka long unsigned int*}' to 'u32 {aka long unsigned int}' [-fpermissive]    xspi_l.h    /PmodWifiACL/src    line 122    C/C++ Problem"

I am facing problem in interfacing PmodACL2 with HTTPServer code for displaying sensor output at HTTPServer page or web page.

Please help regarding that and if possible suggest needful resources because I have not prior experience with SDK and c++.

Thanks,

Dewang Shukla
 

error on xspi_I.h file.png

error message in sdk.png

 

 

vivado design diagram.png

Edited by DEWANG SHUKLA
Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0
  • Solution

@DEWANG SHUKLA

The platform.h header is a file that shows up in your project's source if you use a template when creating your new application project, by clicking Next instead of Finish at the screen that prompts you to name your project. You can get rid of the include just fine as long as you replace the init_platform() and cleanup_platform() calls. All that these functions do is handle setup and cleanup of the instruction and data caches for the microblaze system, as well as UART initialization if a nonstandard setup is used. The simple solution is to just add the platform.h functions to your main file. If adding this to the project causes an include problem with xil_cache.h, then this code would not have done anything anyway, and the init and cleanup calls can just be removed - at least for my test project, the uart_init function's ifdef block is skipped.

#include "xparameters.h"
#include "xil_cache.h"

#ifdef STDOUT_IS_16550
 	#include "xuartns550_l.h"
 	#define UART_BAUD 9600
#endif

void enable_caches()
{
#ifdef __PPC__
    Xil_ICacheEnableRegion(CACHEABLE_REGION_MASK);
    Xil_DCacheEnableRegion(CACHEABLE_REGION_MASK);
#elif __MICROBLAZE__
	#ifdef XPAR_MICROBLAZE_USE_ICACHE
    	Xil_ICacheEnable();
	#endif
	#ifdef XPAR_MICROBLAZE_USE_DCACHE
    	Xil_DCacheEnable();
	#endif
#endif
}

void disable_caches()
{
    Xil_DCacheDisable();
    Xil_ICacheDisable();
}

void init_uart()
{
#ifdef STDOUT_IS_16550
    XUartNs550_SetBaud(STDOUT_BASEADDR, XPAR_XUARTNS550_CLOCK_HZ, UART_BAUD);
    XUartNs550_SetLineControlReg(STDOUT_BASEADDR, XUN_LCR_8_DATA_BITS);
#endif
    /* Bootrom/BSP configures PS7/PSU UART to 115200 bps */
}
void init_platform()
{
    enable_caches();
    init_uart();
}

void cleanup_platform()
{
    disable_caches();
}

Alternatively, you could probably replace init_platform() and cleanup_platform() with:

//init calls become:
Xil_ICacheEnable();
Xil_DCacheEnable();

//cleanup calls become:
Xil_DCacheDisable();
Xil_ICacheDisable();

Hope this helps,

Arthur

Link to post
Share on other sites
  • 0

Hi @DEWANG SHUKLA,

Are you using the XSpi_WriteReg macro in any code you have written for this project? If not, this will be a bug in the PmodACL2 drivers, I'll look into it and get back to you.

Because #define macros essentially do a find and replace before the code is compiled, the actual error will be somewhere else in the code where the XSpi_WriteReg macro is being called. The error here is that a pointer is being used as an integer without an explicit conversion, so I'd be on the lookout for an array being passed without an index, or pointer that hasn't been dereferenced. An example of what to look for is below:

//where some_function takes a u32
#define do_stuff(a, b) some_function(a+b)

//in a function somewhere:
u32 *foo, bar;
do_stuff(foo, bar);//this will potentially cause issues as foo and bar are not the same type, and pointer to integer conversion needs to be explicit.

//a fix if you want some_function to operate on an offset version of the address stored in foo:
do_stuff((u32)foo, bar);

//a fix if you want some_function to operate on the contents of the memory location foo:
do_stuff(*foo, bar);

 

Hope this helps,

Arthur

Link to post
Share on other sites
  • 0

It looks like there is an issue in the PmodACL2.c file, two Xpi_SetSlaveSelectReg macro calls look like they have additional '&'s.

I'll test out the following fix first thing tomorrow:

//Original:
...
		XSpi_SetSlaveSelectReg(&InstancePtr->ACL2Spi,			//line 740
						&InstancePtr->ACL2Spi.SlaveSelectReg);  //line 741
...
		XSpi_SetSlaveSelectReg(&InstancePtr->ACL2Spi,					//line 798
								&InstancePtr->ACL2Spi.SlaveSelectMask); //line 799
...
//Fix:
...
		XSpi_SetSlaveSelectReg(&InstancePtr->ACL2Spi,			//line 740
						InstancePtr->ACL2Spi.SlaveSelectReg);  //line 741 - removed "address of" operator
...
		XSpi_SetSlaveSelectReg(&InstancePtr->ACL2Spi,					//line 798
								InstancePtr->ACL2Spi.SlaveSelectMask); //line 799 - removed "address of" operator
...

 

Hope this helps,

Arthur

Link to post
Share on other sites
  • 0

[email protected],

Now the previous error is solved thanks for that but I am getting difficulty while showing PmodACL2 output at web server or HTTP Server page.

I am getting errors which shown in attached pictures.

What are the procedures for showing PmodACL2 sensor data at HTTP server web page? 

If you have related information or resources please share with me.

Thanks,

DEWANG SHUKLA 

 

 

 

error_20_3.png

error_20_1.png

error_20_2.png

Link to post
Share on other sites
  • 0

@DEWANG SHUKLA

I'm not really familiar with using HTTP, but these resources look like they may be helpful.

The first is a thread on this forum talking about how to set up a ethernet echo server on a Zybo to send sensor data to a host computer. Even if the hardware details aren't the same, it should still illustrate some of the process. The second is a Xilinx pdf describing a project they provide to set up an HTTP server on one of their dev kits. Same deal here, implementation will be different, but the process should be similar. The third is a Xilinx tutorial for using LWIP, a TCP network stack.

My main takeaways from these are that there are now three major parts to the project. The first will be testing out serving data from the microblaze to the PC, I'd recommend trying to do this with an ethernet cable - tutorial here. The second will be producing HTTP formatted packets, this I'm less familiar with, but hopefully the second link above will help. The third part will be getting all of this tied to the Pmod WiFi, again I'm less familiar here.

As for the current error, it looks like main() is defined twice, once in your main and once in the WebIO demo? If so, you will need to merge the two and run a project with a single main, C/C++ use main as the entrance point for the program, so the compiler gets super confused if it sees more than one.

Hope this helps,

Arthur

 

Link to post
Share on other sites
  • 0

Hi,

In my Microblaze design I am using PmodWifi and Pmod ACL2.I want to send PmodACL2 data connected at JXADC port via Pmod Wifi and want to display sensor data at web server page for that I combined deWebIOServerSrc and PmodACL2 main code.It is not showing any error.

Problem is that,

1) In Tera Term serial terminal some FIFO data=2047 is showing with status=FF which is continuously updating.Previously IP status was showing.

How to identify is data transmitting over wifi or not?

2) It is taking some predefined data at the place of connected sensor data at JXADC pmod port. 

What thing will need to change in my project code to show sensor data in web page instead of GPIO pins?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now