Jump to content
  • 0

Attempting to Program Nexys Video SPI Flash With Microblaze C Code


bklopp

Question

I have been following this tutorial and have had no luck. I am uncertain about how to configure the QSPI IP, because the tutorial starts assuming that I have done that part successfully, so I am not even sure if this is the root of my problem. I have tried these two configurations of this IP, compiled them, and exported them to the SDK, and none of them solved the problem:

image.thumb.png.aa5e7ea3bf9ff3b3460e9836e9c8e8a7.png

image.thumb.png.781a8a6983e1226faebca4b787f66c91.png

I made sure JP4 is in the QSPI position. On step 3.1 in the tutorial, I can see that the FPGA is programmed successfully and I see the following output (since I chose not comment out the VERBOSE define as suggested in the tutorial):

image.png.676a6730ca2fa44de186fc2e75b1f029.png

While programming the flash on step 4 I notice that my FPGA code is erased from the board (leds I had assigned to outputs turn off). Is that supposed to happen?

At the end of the tutorial I get no "hello world" output on the terminal after resetting the board, though the FPGA does seem to program from the flash successfully, so that portion works, but I can't get the C-code to run from the flash.

Here is the sdk_console_output.txt so you can see the steps I took in the sdk to program the board.

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

On 1/11/2019 at 5:54 PM, jpeyron said:

Hi @bklopp,

1) Does you project run as expected being configured from JTAG using the USB UART J12?

2) Are you using the Digilent Board files(which becomes the default configuration when running Block Automation)?

2) When running block automation on the Microblaze what are you setting the local memory and the cache configuration to? I typically use 32 and 16 respectively. 

I have a working Vivado 2017.4 OLED QSPI project here and a Vivado 2016.4 QSPI project here that might be helpful. 

thank you,

Jon

 

I finally got it working by following instructions from a forum post on xilinx forums: https://forums.xilinx.com/xlnx/board/message?board.id=EMBEDDED&message.id=43256#M43256image.thumb.png.531c454aab5a0b3fc2e10bf8147494bf.png

I'll look at your projects and figure out where I'm going wrong, since the fix recommended by the dude from xilinx only uses single spi mode (X1), so I imagine it loads quite a bit slower than it could. Because of that, I hesitate to mark this post as the solution.

1) Yes

2) Yes

3) Here are my cache settings. I'm  a bit curious why the cache matters. Does the "hello world" application get loaded into it at some point of the programming process?

image.thumb.png.07ced272791456acd1308ac3e97db88f.png

 

Link to comment
Share on other sites

Hi @bklopp,

I would guess that the issue is the settings for the memory of the Microblaze processor or the clock frequency given to the ext_spi_clk pin on the QSPI Flash IP.  Are you programming the Nexys Video through the JTAG using a JTAG HS2 and not through the USB UART?

1) Please share a screen shot of your Vivado block design and SDK.  In the Vivado block design are you giving the EXT_SPI_CLK on the QSPI Flash IP core a 50 Mhz clock? 

2) Are you able to program the hello world application from sdk normally i.e. normal setting for the program fpga operation and right clicking on the hello world application and selecting

run as->launch on Hardware(system debugger)?

3) What are your memory settings for Microblaze?

4) When programming the QSPI current board configuration will be erased. I believe that it resets the processor as part of the process. Looking at the sdk)console_output.txt file you attached the offset is correct as well as the flash type.

thank you,

Jon

Link to comment
Share on other sites

10 minutes ago, jpeyron said:

Hi @bklopp,

I would guess that the issue is the settings for the memory of the Microblaze processor or the clock frequency given to the ext_spi_clk pin on the QSPI Flash IP.  Are you programming the Nexys Video through the JTAG using a JTAG HS2 and not through the USB UART?

1) Please share a screen shot of your Vivado block design and SDK.  In the Vivado block design are you giving the EXT_SPI_CLK on the QSPI Flash IP core a 50 Mhz clock? 

2) Are you able to program the hello world application from sdk normally i.e. normal setting for the program fpga operation and right clicking on the hello world application and selecting

run as->launch on Hardware(system debugger)?

3) What are your memory settings for Microblaze?

4) When programming the QSPI current board configuration will be erased. I believe that it resets the processor as part of the process. Looking at the sdk)console_output.txt file you attached the offset is correct as well as the flash type.

thank you,

Jon

I have been programming the Nexys video through the USB J12 port, I do have a JTAG HS2 on hand that I can use to program the board with. Do I need to use the JTAG HS2 for this to work?

1) Here is the block design, I am using the 100Mhz clock... that might be a problem:

image.thumb.png.b43770ac5825aecd079a0461f0ecad8e.png

2) I am able to run the hello world program by run as->launch on Hardware(system debugger)

3) I'm assuming your asking about the linker script:

image.thumb.png.e7c6ff9648b430f2a3958351c391af4d.png

I'm rebuilding the project with the 50Mhz clock to try that out. 

Thanks.

Link to comment
Share on other sites

I regenerated the  bit stream with the QSPI flash IP connected to 50MHz and set to Quad. Same result, nothing has been printed to the terminal. I notice that when I press the program button on the nexys video board, the done light (LD15) comes on after about 10 seconds .

 

EDIT:

Actually I do get the "SREC SPI Bootloader"  output to the terminal, so that C code must be programmed to the spi because it is executing. I'm guessing the bootloader is supposed to boot the helloworld, but that just isn't happening for whatever reason.

 

EDIT 2:

I dug into the srec bootloader template code and added prints to see where the code fails. I found out that the spansion chip on the nexys video is not supported, at least by the code that was reccomended by the tutorial. The code halts at line 1920 (line numbers may be different since I added print statments) in xilsf.c.

image.thumb.png.a44ddd7e3f61014894ac5c314dc3c8f8.png

Link to comment
Share on other sites

Hi @bklopp,

1) Does you project run as expected being configured from JTAG using the USB UART J12?

2) Are you using the Digilent Board files(which becomes the default configuration when running Block Automation)?

2) When running block automation on the Microblaze what are you setting the local memory and the cache configuration to? I typically use 32 and 16 respectively. 

I have a working Vivado 2017.4 OLED QSPI project here and a Vivado 2016.4 QSPI project here that might be helpful. 

thank you,

Jon

 

Link to comment
Share on other sites

Hi @bklopp,

I believe the cache is used when configuring the FPGA from flash. I do know that if you do not have enough cache memory you will get errors in SDK  dealing with a lack of memory when adding the srec_spi_bootloader application.  You could try to setting the qspi flash to standard in the vivado block design ,compress your project(Inside of the Bitstream settings check the -bin_file box), set the speed to 33  and select spix1. Then comment out the #define VERBOSE in the srec_spi_bootloader application in the bootloader.c. Compressing the bitstream and commenting out Verbose should easily make up for using a slower transfer process.

cheers,

Jon

Link to comment
Share on other sites

On 1/11/2019 at 5:54 PM, jpeyron said:

Hi @bklopp,

1) Does you project run as expected being configured from JTAG using the USB UART J12?

2) Are you using the Digilent Board files(which becomes the default configuration when running Block Automation)?

2) When running block automation on the Microblaze what are you setting the local memory and the cache configuration to? I typically use 32 and 16 respectively. 

I have a working Vivado 2017.4 OLED QSPI project here and a Vivado 2016.4 QSPI project here that might be helpful. 

thank you,

Jon

 

I'm wondering, why do you have micron selected instead of spansion, since it's a spansion chip  on the board?

image.thumb.png.c2acfadbbe69e72429ff9e054b35a63e.png

 

Link to comment
Share on other sites

15 hours ago, jpeyron said:

Hi @bklopp,

Can you be more specific on where micron is selected instead of spansion? If you are talking about this tutorial that is because this tutorial was made to deal with multiple boards that have different flash types and the screen shot it of the Arty A7-35T  board I believe.

thank you,

Jon

 

It was in the working Vivado 2017.4 OLED QSPI project for the nexys video that you gave me a few posts up. I compiled the project and it happens to program the c code from flash much faster than if spansion was selected.

Link to comment
Share on other sites

Hi @bklopp,

I wasn't aware that I had chose the wrong Flash type. I'm surprised that it still works. My guess is that both Flash components have a very similar design and  configuration process. So the xilinx tools are unaware of my mistake.  

Another way to increase load time is to compress the bitstream.

thank you,

Jon

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...