> For the complete documentation index, see [llms.txt](https://tk233.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tk233.gitbook.io/notes/risc-v-soc/vivado-stuff/vivado-generate-flash-config-.mcs-file-from-bitstream.md).

# Vivado Generate Flash Config .mcs File From Bitstream

## 1.

Connect the FPGA device, open vivado

## 2.

In hardware manager, right-click the connected device ("xc7a35t" in this case), select "Add Configuration Memory Device..."

<figure><img src="/files/hdW79QPNjCcuft6RpGsv" alt=""><figcaption></figcaption></figure>

## 3.

Select the correct Flash device mounted on the FPGA board.

For Arty board bought from Amazon recently, the Flash chip should be "s25fl128xxxxxx0"

<figure><img src="/files/sdRdymuNfkG1aYGbRgEr" alt=""><figcaption></figcaption></figure>

The exact chip can be found using this method from Arty's [User Manual](https://digilent.com/reference/programmable-logic/arty-a7/reference-manual?redirect=1#quad-spi_flash).

<figure><img src="/files/pETbIc00qNre0VddKiQ9" alt=""><figcaption></figcaption></figure>

Click OK.

If it asks if you want to program the device now, click No.

## 4.

Go to top tool bar, select Tools-> Generate Memory Configuration File...

<figure><img src="/files/rWTosFMHrkh0e4BZBTee" alt=""><figcaption></figcaption></figure>

In the pop-up window, put the desired output filename in the "Filename" section.

For Chipyard generated bitstreams, we need to select "SPIx4" as the interface width.

Then, specify the bitstream we want to load to the Flash and click "Ok".

<figure><img src="/files/O4KsLV76mBRCfHbdnwOl" alt=""><figcaption></figcaption></figure>

## 5.

Go back to Hardware Manager, right-click the memory device, and then select "Program Configuration Memory Device..."

<figure><img src="/files/z5Ncy2meoBlCXA3zXa3b" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/fC4WTALEjl1567h9AaNS" alt=""><figcaption></figcaption></figure>

The flashing progress will take about 1 minute to complete.

After flashing, the FPGA will automatically load the bitstream stored in the Flash on power-up, or every time the PROG button is pressed. The DONE LED will show if the bitstream has finished loading.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://tk233.gitbook.io/notes/risc-v-soc/vivado-stuff/vivado-generate-flash-config-.mcs-file-from-bitstream.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
