Skip to content

ussserrr/spartan6-mcu-configuration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Proven example showing how to configure (flash the firmware) Xilinx Spartan-6 FPGA (XC6SLX-2FTG256C) using ARM MCU (Texas Instruments Tiva-C TM4C1294NCPDT). The design is not strictly hardware-specific and can be easily ported to another MCU and similar FPGA.

Chosen method - slave serial. It is a basic synchronous, single data-wire interface. The bitstream is stored in MCU Flash memory.

Bitstream

You need to generate the .bin bitstream using Xilinx BitGen utility with following command-line options:

-g Binary:yes

In PlanAhead, for example, it can be done via GUI in the 'Bitstream Settings' section of Flow Navigator: planahead

The bitstream is stored in MCU Flash memory in form of pair of .c/.h files.

  • bitstream.c:
#include <bitstream.h>

const unsigned char bitstream_fw[] = {
    ...
    0x00, 0x93, 0x30, 0xe1, 0xff, 0xcf, 0x30, 0xc1, 0x00, 0x81, 0x31, 0x81,
    ...
};
  • bitstream.h
#ifndef BITSTREAM_H_
#define BITSTREAM_H_

extern const unsigned char bitstream_fw[];

#endif /* BITSTREAM_H_ */
  • main.c
...
#include "bitstream.h"
#define SPARTAN_FW_SIZE 54664  // in bytes
...

It always has the same size no matter what functionality your firmware is providing. To convert .bin file to C header use some sort of converter program (e.g. using Python or C on your PC).

Pinout

General schematic (omit the JTAG part) (see UG380): pinout

Note that some "feedback" pins such as INIT_B can be not routed and their functionality can be replaced by a simple delay.

References

About

Configure Xilinx Spartan-6 FPGA using Texas Instruments ARM MCU

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages