• 0
Mahdi

PmodGPS is not working when QSPI flash memory is programmed

Question

Hi,

I have a project that uses Arty Z7-10 with pmodgps to receive the NMEA sentences every few seconds (I am using the GPS_getSentence function directly, rather than the sample code on github). The problem I am facing is whenever I program Arty via JTAG with a USB cable, my pmodgps is working correctly, but If I program the QSPI flash memory and use FSBL to boot it up, it seems to stop working. I have other pmods that are working fine in both cases, and only gps is not working as I am expecting. This seems like a weird bug to me. Does anybody have any idea what could be wrong?

 

Thanks,

Mahdi

Share this post


Link to post
Share on other sites

13 answers to this question

Recommended Posts

  • 0

Hi @Mahdi,

I talked with another co-worker about this issue. They suggested to add a delay in the beginning of the application in case the board needs a few seconds to fully setup before running the application.

thank you,

Jon

Share this post


Link to post
Share on other sites
  • 1

Hi @Mahdi,

Could you describe how the Pmod GPS is not working correctly. Also could you attach a screen shot of you SDK Applications and the sdk log. Did you select anything extra when creating the FSBL? Here is a good reference for using SDK with a ZYNQ processor. 

thank you,

Jon

Share this post


Link to post
Share on other sites
  • 0

Hi @jpeyron

I have read all of those tutorial about using FSBL, and I can guarantee that I am doing it correct. I verified that under several tests. If you still doubt that, you can make your own project and use my SDK code to see if there is any difference.

I tried to summarize my SDK code as much as possible which is attached, but still the problem is there. As I said earlier if I program Arty via USB port, and look at the terminal, I am seeing the correct NMEA sentence format, but whenever I am uploading the code to QSPI flash memory, the only thing I see in terminal is this:

GPS data = <GPS did not get a ping...>

which is basically what I initialized my GPS char array with. It seems to me whenever there is a UART connection to the ZYNQ board, GPS is operating fine, but as soon as I unplug the USB from board, and power it via regulator, it stops updating my char array. Does GPS use a USB UART during its operation? I have no idea why this is happening.

Thanks,

Mahdi

main.c

Edited by Mahdi

Share this post


Link to post
Share on other sites
  • 0

@Mahdi,

A couple questions.  For example, is the voltage dropping at all when you pull off the USB?

Also, are you powering the board from a switching regulator?  Do you have any switching noise on the power line to the GPS?

Dan

Share this post


Link to post
Share on other sites
  • 0

@D@n

I am not sure what voltage you are referring to, but I am only using either USB or REG to power the board.

In case of USB, I am connecting it to my laptop, and look at the terminal output in the SDK software, and in case of REG, I am using power jack port and connect it to a power supply which has a very low noise (Circuit Specialists CSI3005X5 ).

Arty board has already a built-in switching regulator in it, I guess. When the board is powered via REG, USB cable is not plugged in. Also, PmodGPS is plugged into one of j-ports on the Arty, so I do not know if there is a switching noise on that power line.

This issue does not seems to be due to noise on power line. I guess it has something to do with the fact that GPS library is using a UART connection, and somehow that requires the board to be plugged in via a USB cable. I know this sounds silly, but it is what it is.

 

Thanks,

Mahdi

Share this post


Link to post
Share on other sites
  • 0

Hi @Mahdi,

I duplicated your project on the Arty-Z7-10. When programmed from the JTAG I get GPS data on the SD card and on the serial terminal. I then added the bootloader/boot image and programmed the flash. Now if I run the program from flash with either the external or through usb i get the same result on the sd card "GPS data = <GPS did not get a ping...>". I will need to do some more testing and research to hopefully figure this issue out.

thank you,

Jon

Share this post


Link to post
Share on other sites
  • 0

Hi @jpeyron

I did some follow up tests with the above configuration, but did not see any difference, though it is worth it to mention them.

I commented out all of xil_printf statements and removed the inlcude xil_printf.h from the c code, hoping that printing the data to UART terminal was the problem, but it was not.

I also tried to boot from SD card instead of QSPI flash memory, but even with that the problem is still there.

I am almost running out of ideas and thinking maybe the FSBL is causing the issue, because every other time that FPGA is programmed via USB and there is no boot up, it seems to be working. It is a very strange bug.

Thanks,

Mahdi

Share this post


Link to post
Share on other sites
  • 0

Hi @Mahdi,

Unfortunately, I havent had time to run any tests today. I would suggest to try programming the flash while using external power. Also try using the flash project in an outside location. I would also try loading the flash with only using the standard Pmod GPs IP Core code and not the SD card.

thank you,

Jon

 

Share this post


Link to post
Share on other sites
  • 0

Hi @jpeyron

I tested your ideas, but apparently none of them were able to fix this problem. I used the Pmod GPS example code with FSBL, but I do not see any GPS data on terminal. I also tested it outside, but did not make a difference. In addition, I added a couple of seconds delay at beginning of my C code, which also did not help.

I should mention I had a few Pmod GPS devices, and tested all of them individually with the same code I sent you. it seems some of them are working and getting the correct GPS data after boot up with FSBL, but as soon as I try another Pmod GPS device, it stops working. All of those GPS devices are purchased recently, so I do not know where this inconsistency issue is coming from. It seems some of them have difficulties working correctly with FSBL, but the others are fine. Have you ever had such issues before?

I am assuming the PmodGPS you had is also part of the ones that have this problem, but why should it be like this?

Thanks,

Mahdi

Edited by Mahdi

Share this post


Link to post
Share on other sites
  • 0

Hi @Mahdi,

Could you attach the code you used with the delay added. Just to clarify, are you powering down the board and then switching the Pmod GPS's or are you hot swapping them after the QSPI has loaded the program?

Share this post


Link to post
Share on other sites
  • 0

Hi @jpeyron

I have good news. Since you insisted on having the delay, I went ahead and re-tested my code again. I filled up my code with delay functions and started to remove them one by one to see where it breaks, and eventually was able to figure out how much delay is needed and where it should be placed. I had several Pmods in my design, so I added 1 second of delay to the beginning and the end of their initialization like below:

int main()
{
    init_platform();

    sleep(1);
    RTCC_Initialize();
    sleep(1);
    NAV_Initialize ();
    sleep(1);
    GPS_Initialize ();
    sleep(1);

    ..........

    //call get functions here.

    cleanup_platform();
    return 0;
}


It turns out that with at least 1 second of delay, GPS is functioning normally now. I had tested this with 100 ms or 500 ms delay before, but that did not work out. So, I guess a few seconds of delay seems necessary at the beginning, when we are using FSBL with Pmods. It just seems weird that some of the Arty boards do not need that delay at all, as I explained earlier. Anyway, my problem is solved, so let's just call this the final solution.

Thanks again to you and your co-worker,

-Mahdi

 

Share this post


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