{"id":34705145,"url":"https://github.com/anse1/olimex-ice40-notes","last_synced_at":"2025-12-24T23:17:12.758Z","repository":{"id":54676855,"uuid":"84717342","full_name":"anse1/olimex-ice40-notes","owner":"anse1","description":"Notes on flashing the ice40 board(s) by Olimex using a raspberry pi","archived":false,"fork":false,"pushed_at":"2017-03-25T18:41:15.000Z","size":183,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-08-03T13:23:33.354Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anse1.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-12T10:29:01.000Z","updated_at":"2023-08-03T13:23:33.355Z","dependencies_parsed_at":"2022-08-13T23:40:34.643Z","dependency_job_id":null,"html_url":"https://github.com/anse1/olimex-ice40-notes","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/anse1/olimex-ice40-notes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anse1%2Folimex-ice40-notes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anse1%2Folimex-ice40-notes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anse1%2Folimex-ice40-notes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anse1%2Folimex-ice40-notes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anse1","download_url":"https://codeload.github.com/anse1/olimex-ice40-notes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anse1%2Folimex-ice40-notes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28012096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T23:17:12.185Z","updated_at":"2025-12-24T23:17:12.749Z","avatar_url":"https://github.com/anse1.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"** Notes on flashing the ice40 board(s) by Olimex using a raspberry pi\n\nIf you have a raspberry PI around, you can use the flashrom utility\nwith Linux' /dev/spidev to program a bitstream to your ICE40HX1K-EVB.\nThe following table shows the wiring required for the Pi B+ or 2.  I\nused IDC connectors with a rainbow ribbon for convenient wiring (image\nbelow).\n\n| Raspi 2/B+ |          | ICE40-EVB |              | comment  |\n|------------+----------+-----------+--------------+----------|\n|         17 | =3v3=    |         1 | =3v3=        |          |\n|         18 | =gpio24= |         6 | =creset=     |          |\n|         19 | =mosi=   |         8 | =sdo=        |          |\n|         20 | =gnd=    |         2 | =gnd=        |          |\n|         21 | =miso=   |         7 | =sdi=        |          |\n|         22 | =gpio25= |         5 | =cdone=      | optional |\n|         23 | =clk=    |         9 | =sck=        |          |\n|         24 | =ce0=    |        10 | =#cd = ss_b= |          |\n|         25 | =gnd=    |           |              |          |\n|         26 | =ce1=    |           |              |          |\n\nenable SPI device on the Pi (needs reboot)\n: echo dtparam=spi=on \u003e\u003e /boot/config.txt\n\nbuild and install flashrom\n: git clone https://www.flashrom.org/git/flashrom.git\n: cd flashrom\n: make CONFIG_ENABLE_LIBPCI_PROGRAMMERS=no CONFIG_ENABLE_LIBUSB0_PROGRAMMERS=no CONFIG_ENABLE_LIBUSB1_PROGRAMMERS=no install\n\nclaim GPIO24 for sysfs-control\n: echo 24 \u003e /sys/class/gpio/export\n\nPull GPIO24 low to put the ice40 into reset.  The cdone-LED on the board should turn off.\n: echo out \u003e /sys/class/gpio/gpio24/direction\n\nRead the flash chip at 20MHz (for short cabling)\n: flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=20000 -r dump\n\nSimply swap -r for -w to write the dump back\n: flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=20000 -w dump\n\nAs generated bitstreams are smaller than size of the flash chip, you\nneed to add padding for flashrom to accept them as image.  I used the\nfollwing commands to do that:\n\n: tr '\\0' '\\377' \u003c /dev/zero | dd bs=2M count=1 of=image\n: dd if=my_bitstream conv=notrunc of=image\n\nDeassert creset to let the ice40 read the configuration from the bus:\n: echo in \u003e /sys/class/gpio/gpio24/direction\n\n[[wiring.jpg]]\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanse1%2Folimex-ice40-notes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanse1%2Folimex-ice40-notes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanse1%2Folimex-ice40-notes/lists"}