• 0
bklopp

Attempting to Program Nexys Video SPI Flash With Microblaze C Code

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.

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0
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

 

Edited by bklopp

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0
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.

Share this post


Link to post
Share on other sites
  • 0

Hi @bklopp,

1) You do not need to use the JTAG HS2 to configure the Flash on the Nexys Video. I just saw the HS2 being mentioned in the txt file you attached.

2) I would also suggest leaving the spi mode for the QSPI flash IP set to Quad.

 

thank you,

Jon

Share this post


Link to post
Share on other sites
  • 0

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

Edited by bklopp

Share this post


Link to post
Share on other sites
  • 0

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

 

Share this post


Link to post
Share on other sites
  • 0

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

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