Differences

This shows you the differences between two versions of the page.

Link to this comparison view

learn:programmable-logic:tutorials:htsspisf:start [2020/08/11 08:01] – [Test] Monica Ignatlearn:programmable-logic:tutorials:htsspisf:start [2022/10/04 11:38] (current) – external edit 127.0.0.1
Line 9: Line 9:
  
 This guide requires the existence of a Vivado project containing a Microblaze system built complete with **Quad SPI**, **External Memory**, and **Uart** cores, and that you have the appropriate QSPI mode jumper setting on the board. This guide requires the existence of a Vivado project containing a Microblaze system built complete with **Quad SPI**, **External Memory**, and **Uart** cores, and that you have the appropriate QSPI mode jumper setting on the board.
-You can follow the steps presented in the  [[https://reference.digilentinc.com/learn/programmable-logic/tutorials/nexys-4-ddr-getting-started-with-microblaze/start#prerequisites|Microblaze tutorial]], and see below the missing steps for adding QSPI Flash and perform all the connections.+You can follow the steps presented in the  [[/learn/programmable-logic/tutorials/nexys-4-ddr-getting-started-with-microblaze/start#prerequisites|Microblaze tutorial]], and see below the missing steps for adding QSPI Flash and perform all the connections.
 Since there are slight differences in the Vivado 2019.1 and the version in which the Microblaze tutorial was created, the user needs to check all the connections in the block design to make sure that are correctly made or present. Since there are slight differences in the Vivado 2019.1 and the version in which the Microblaze tutorial was created, the user needs to check all the connections in the block design to make sure that are correctly made or present.
 === Hardware === === Hardware ===
Line 116: Line 116:
  
 === 6. Add AXI Quad SPI IP === === 6. Add AXI Quad SPI IP ===
-From the Add IP option, select AXI Quad SPI IP with the following customization: Mode - Quad, slave device - Spansion:+From the Add IP option, select AXI Quad SPI IP with the following customization: Mode - Quad, slave device - Spansion (or Macronix for boards with Macronix flash) 
  
 {{:learn:programmable-logic:tutorials:htsspisf:axiquadipsettings.png?nolink&400|}} {{:learn:programmable-logic:tutorials:htsspisf:axiquadipsettings.png?nolink&400|}}
Line 304: Line 304:
 === 2. Configure Bootloader BSP === === 2. Configure Bootloader BSP ===
  * Open the BSP project and open system.mss. Click "Modify this BSP's Settings". The memory device info needs to be passed to the xilifs library (//Overview > standalone > xilifs//).  * Open the BSP project and open system.mss. Click "Modify this BSP's Settings". The memory device info needs to be passed to the xilifs library (//Overview > standalone > xilifs//).
-  * //serial_flash_family = 5(Spansion/Micron)//+  * //serial_flash_family = 5(Spansion/Micron/Macronix)//
   * serial_flash_interface = 1(AXI SPI)   * serial_flash_interface = 1(AXI SPI)
 Click "Regenerate BSP sources". Click "Regenerate BSP sources".
Line 316: Line 316:
   * In your newly created bootloader application, open **blconfig.h** located in bootloader/src/blconfig.h and change **FLASH_IMAGE_BASEADDR** to suit your needs. Save the file in order to rebuild the bootloader project to contain the latest updates.   * In your newly created bootloader application, open **blconfig.h** located in bootloader/src/blconfig.h and change **FLASH_IMAGE_BASEADDR** to suit your needs. Save the file in order to rebuild the bootloader project to contain the latest updates.
 It is important to note that this value is the offset that the image will have in Flash. \\ It is important to note that this value is the offset that the image will have in Flash. \\
 +
 NOTE: If you are using the Cmod-A7 try the offset: 0x00300000. NOTE: If you are using the Cmod-A7 try the offset: 0x00300000.
  
Line 328: Line 329:
 {{:learn:programmable-logic:tutorials:htsspisf:verbose.png?nolink&800|}} {{:learn:programmable-logic:tutorials:htsspisf:verbose.png?nolink&800|}}
  
-Make sure to re-build the application after making these changes.+NOTE: If you are using a board with Macronix flash follow the additional steps: 
 + 
 +  * Open **bootloader.c** from the sources and scroll down until you find the call to **XIsf_Initialize**. Double click the function name to highlight it, right click and select "Open Declaration". This will open **xilisf.c**. 
 +  * Add the following line somewhere near the top of **xilisf.c** 
 +<code>#define XISF_MACRONIX_DEV_MX25L3233F 0x2016  /**< Device ID for MX25L3233F */ </code> 
 +  * In **xilisf.c** find the definition for IntelStmDevices[] and add the following: 
 +<code>{XISF_MANUFACTURER_ID_MACRONIX, XISF_MACRONIX_DEV_MX25L3233F, 
 +XISF_BYTES256_PER_PAGE, XISF_PAGES256_PER_SECTOR, 
 +XISF_NUM_OF_SECTORS64}</code> 
 +  * Save **xilisf.c** 
 +<WRAP round important 1000px> 
 +===Important if you are using a board with Macronix flash.=== 
 +The source files that need editing are part of a library (https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841939/xilisf) compiled into a bsp/domain. By navigating to the source files in SDK/Vitis, the local copy of the library's source files are opened. Any modification is done on this local copy and build into the static library (and application) upon build. However, when the source files of the bsp/domain are re-generated (context menu, Regenerate BSP sources), the changes made as explained above are overwritten from the originals in the Xilinx install directory. Take care this does not happen. 
 + 
 +A more permanent solution is forking the library repository (https://github.com/Xilinx/embeddedsw) editing the sources there and including a path to the modified repository in SDK/Vitis Xilinx->Repositories->Global.  
 +</WRAP> 
 + 
 +  * Make sure to re-build the application after making these changes.
  
 === 3. Program FPGA with bootloader === === 3. Program FPGA with bootloader ===