| 144 | ---- |
| 145 | == Cygwin == |
| 146 | |
| 147 | [https://www.cygwin.com/ Cygwin] is a set of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows. |
| 148 | |
| 149 | Install your preferred set of tools from the Cygwin distribution using the installer on the site above. By default, the two commands you need: {{{fdisk}}} and {{{dd}}} are part of the default installation in /usr/sbin and /usr/bin, respectively. |
| 150 | |
| 151 | '''Finding the SD card descriptor:'''[[BR]] |
| 152 | 1. Insert the SD card |
| 153 | 1. Open the Cygwin Terminal '''as Administrator'''. In that terminal run {{{/usr/sbin/fdisk -l}}}. |
| 154 | 1. Find the SD card in the list of disks. The descriptor will have the form {{{/dev/<something>}}} |
| 155 | 1. On our test system (Windows 7 64-bit, PC with one internal hard drive; one external hard drive), the output is: |
| 156 | {{{ |
| 157 | $ /usr/sbin/fdisk -l |
| 158 | |
| 159 | Disk /dev/sda: 500.1 GB, 500107862016 bytes |
| 160 | 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors |
| 161 | Units = sectors of 1 * 512 = 512 bytes |
| 162 | Sector size (logical/physical): 512 bytes / 512 bytes |
| 163 | I/O size (minimum/optimal): 512 bytes / 512 bytes |
| 164 | Disk identifier: 0xad574c68 |
| 165 | |
| 166 | Device Boot Start End Blocks Id System |
| 167 | /dev/sda1 63 80324 40131 de Dell Utility |
| 168 | /dev/sda2 * 81920 27967487 13942784 7 HPFS/NTFS/exFAT |
| 169 | /dev/sda3 27967488 502366207 237199360 7 HPFS/NTFS/exFAT |
| 170 | /dev/sda4 502368254 976771071 237201409 5 Extended |
| 171 | /dev/sda5 502368256 972666879 235149312 83 Linux |
| 172 | /dev/sda6 972668928 976771071 2051072 82 Linux swap / Solaris |
| 173 | |
| 174 | Disk /dev/sdb: 1000.2 GB, 1000204885504 bytes |
| 175 | 255 heads, 63 sectors/track, 121601 cylinders, total 1953525167 sectors |
| 176 | Units = sectors of 1 * 512 = 512 bytes |
| 177 | Sector size (logical/physical): 512 bytes / 512 bytes |
| 178 | I/O size (minimum/optimal): 512 bytes / 512 bytes |
| 179 | Disk identifier: 0xdd8826a4 |
| 180 | |
| 181 | Device Boot Start End Blocks Id System |
| 182 | /dev/sdb1 2048 1953521663 976759808 7 HPFS/NTFS/exFAT |
| 183 | |
| 184 | Disk /dev/sdc: 1977 MB, 1977614336 bytes |
| 185 | 255 heads, 63 sectors/track, 240 cylinders, total 3862528 sectors |
| 186 | Units = sectors of 1 * 512 = 512 bytes |
| 187 | Sector size (logical/physical): 512 bytes / 512 bytes |
| 188 | I/O size (minimum/optimal): 512 bytes / 512 bytes |
| 189 | Disk identifier: 0x00000000 |
| 190 | |
| 191 | Device Boot Start End Blocks Id System |
| 192 | /dev/sdc1 2 62505 31252 b W95 FAT32 |
| 193 | }}} |
| 194 | 2. In this output, the first disk is the computer's internal hard drive. The second disk is the computer's external hard drive. The third disk is the SD card (notice the capacity of approx 2GB, with 1 32MB FAT partition). |
| 195 | 2. In this example, the SD card device descriptor to use with dd is {{{/dev/sdc}}}. |
| 196 | |
| 197 | '''Copying the .bin file:'''[[BR]] |
| 198 | 1. Run this command, replacing the last three arguments with the correct values: |
| 199 | {{{ |
| 200 | /usr/bin/dd bs=512 seek=<N> if=<yourFile.bin> of=</dev/someDevice> |
| 201 | }}} |
| 202 | 1. ''<N>'': depends on the target slot number; use (131072 + slotNum*32768). More details [wiki:..#Copying.binFilesSDCards here]. |
| 203 | 1. ''<yourFile.bin>'': the binary FPGA configuration file |
| 204 | 1. ''</dev/someDevice>'': device descriptor for the SD card |
| 205 | 1. If successful, dd should report the following (the time/throughput values will differ): |
| 206 | {{{ |
| 207 | 18032+1 records in |
| 208 | 18032+1 records out |
| 209 | 9232444 bytes (9.2 MB) copied, 7.50747 s, 1.2 MB/s |
| 210 | }}} |
| 211 | 1. Repeat for additional .bin config files in additional slots if needed. |
| 212 | |
| 213 | '''Error Messages:''' |
| 214 | 1. If when you run {{{/usr/sbin/fdisk -l}}}, you get the following output: |
| 215 | {{{ |
| 216 | Cannot open /dev/sda |
| 217 | Cannot open /dev/sdb |
| 218 | Cannot open /dev/sdc |
| 219 | }}} |
| 220 | then you are not running the Cygwin terminal as Administrator. |
| 221 | 1. If when you run {{{/usr/bin/dd bs=512 seek=<N> if=<yourFile.bin> of=</dev/someDevice>}}}, you get the following output: |
| 222 | {{{ |
| 223 | /usr/bin/dd: opening `/dev/someDevice': Permission denied |
| 224 | }}} |
| 225 | then you are not running the Cygwin terminal as Administrator. |
| 226 | |