Jump to content
Responses from Digilent staff may be delayed during the USA Thanksgiving holiday ×
  • 0

Petalinux and Pmod


Sandokan

Question

Hi, I'm using petalinux with zedboard and I would like to use a pmod to measure the pressure and send the data to the cloud using Paho MQTT.
I have problems inside the SDK xilinx: after creating a new application project in OS Linux Platform and loaded the pmod program that I have to program its libraries give me error, specifically the infinite dependencies of the libraries. What mistake do I commit?
Can you suggest a tutorial in which step by step indicates how to use Pmod in Petalinux?
I followed http://www.zedboard.org/support/trainings-and-videos  but when I try to model it on the zedboard with the Pmod DPG1 it does not work because of the libraries of the same Pmod.

thank you.

Cattura4.PNG

Cattura2.PNG

Cattura1.PNG

Cattura.PNG

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

If you don't want to use linux, you could start by checking this out: https://www.eclipse.org/paho/clients/c/embedded/ . If you can find a port of those libraries that runs on FreeRTOS, then I would recommend running FreeRTOS on your ZedBoard and using those libraries. If you can't find libraries that work with FreeRTOS, you could try porting the paho libraries to use the sockets provided by the lwip libraries in the standalone BSP.

Both of those approaches will also take some effort, just like putting together an embedded linux system. So the question is what do you want to learn more about: Bare-metal socket development (standalone), FreeRTOS development, or embedded Linux development. It's hard for me to predict which approach will be quickest and easiest, but if I had to guess I would say the standalone or FreeRTOS approach. That said, I'd still recommend the petalinux approach because I think it will give you a more versatile solution in the end, and also teach you a very valuable skill-set.

If you decide to go the petalinux route, make sure you are using the latest version of Petalinux and the ZedBoard BSP, (available from Xilinx.com). Then follow UG1144 (Petalinux Reference Guide) from Xilinx to add the paho libraries and dependencies to your system.

Link to comment
Share on other sites

My only need is to use the libraries paho (or similar if you suggest me other compatible) to send data to the cloud using the MQTT protocol. Is it possible to do all this without Petalinux? Returning maybe to use Windows as done until now? In case it is possible to load the paho libraries in the SDK which libraries  do I use?
In the tutorial I indicated in the previous post, it was enough to load a folder inside the project in the src folder by choosing OS platform Linux first.
I also tried to do the same thing using standalone but in this case the libraries with dependencies become those of paho.

I'm sorry but i'm new in Petalinux.

Thank you.

Link to comment
Share on other sites

The demos included with the Pmod IP cores are written to work on bare-metal (no OS) systems, with the Xilinx standalone libraries. They won't work in embedded Linux.

If I were you, I would:

  1.  modify the block diagram to remove the Pmod DPG1 IP core and replace it with an AXI Quad SPI core
  2.  configure the SPI core the same as done inside the Pmod DPG1 IP core, except with the interrupt enabled and connected (interrupt is required for Linux)
  3. attach the pins of the SPI controller to the pmod by modifying the XDC
  4.  export the hdf and import it into your petalinux project
  5. modify the device tree so that it loads the ADI driver for the AD7476A ADC (which is used on the Pmod DPG1)

This will allow you to read the voltage of the ADC easily from the command line (or from a program using simple file I/O). Then you will just need to convert the ADC voltage to a pressure value (see the other Pmod DPG1 examples and/or reference manual).

For an example of what the device tree should look like, see here: https://wiki.analog.com/resources/tools-software/linux-drivers/iio-adc/ad7476a . You will just need to modify system-user.dtsi by adding the ADC node as a child of the SPI bus using "&axi_quad_spi0" (assuming you left the IP name default, check components/.../pl.dtsi after first petalinux-build). You will also need to add a node to system-user.dtsi for the fixed-regulator as seen in the ADI example, but the voltage should be 3V.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...