# Generating .mcs file from .bit or .bin file

**URL:** <https://forum.spacecubics.com/t/generating-mcs-file-from-bit-or-bin-file/91>\
**Category:** Community\
**Tags:** lang-en\
**Created:** [April 24, 2023, 4:40pm UTC](https://forum.spacecubics.com/t/generating-mcs-file-from-bit-or-bin-file/91 "2023-04-24T16:40:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yashi](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.spacecubics.com/yashi/32/10_2.png) [@yashi](https://forum.spacecubics.com/u/yashi)\
**Post date:** [April 24, 2023, 4:40pm UTC](https://forum.spacecubics.com/t/generating-mcs-file-from-bit-or-bin-file/91/1 "2023-04-24T16:40:33Z")

</div>

You can use `write_cfgmem` from Vivado tcl command or `srec_cat` from [srecord package](https://tracker.debian.org/pkg/srecord).

**Using `write_cfgmem`**

```auto
vivado -mode tcl
Vivado% write_cfgmem -format MCS -size 16 -interface SPIx4 -loadbit "up 0 /path/to/a.bit" /path/to/output.mcs

```

Or save it in a `.tcl` and run it.

**Using `srec_cat`**

```auto
$ srec_cat -Output_Block_Size=16 /tmp/a.bit -Binary -o /tmp/a.hex -Intel

```
