Skip to content

sync with nfd/spi-flash-programmer #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 additions & 4 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -78,30 +78,48 @@ Connected to 'SPI Flash programmer v1.0'
Connected to 'SPI Flash programmer v1.0'
[########### ] 383/1024 - 00:01:13

# Set IO Pin value
# Example: IO pin 0x2, set to LOW
> python3 spi_flash_programmer_client.py \
> -d COM1 --io 0x2 --value 0x0 set-output

# Override ChipSelect pin
# Example: use IO pin 13/0xd
> python3 spi_flash_programmer_client.py \
> -d COM1 --io 0xd set-cs-io

# Help text
> python3 spi_flash_programmer_client.py -h
usage: spi_flash_programmer_client.py [-h] [-d DEVICE] [-f FILENAME]
[-l LENGTH] [--rate BAUD_RATE]
[--flash-offset FLASH_OFFSET]
[--file-offset FILE_OFFSET]
{ports,write,read,verify,erase}
[--file-offset FILE_OFFSET] [--pad PAD]
[--debug {off,normal,verbose}] [--io IO]
[--value VALUE]
{ports,write,read,verify,erase,enable-protection,disable-protection,check-protection,status-register,id-register,set-cs-io,set-output}

Interface with an Arduino-based SPI flash programmer

positional arguments:
{ports,write,read,verify,erase}
{ports,write,read,verify,erase,enable-protection,disable-protection,check-protection,status-register,id-register,set-cs-io,set-output}
command to execute

optional arguments:
-h, --help show this help message and exit
-d DEVICE serial port to communicate with
-f FILENAME file to read from / write to
-l LENGTH length to read/write in kibi bytes (factor 1024)
-l LENGTH length to read/write in bytes, use -1 to write entire
file
--rate BAUD_RATE baud-rate of serial connection
--flash-offset FLASH_OFFSET
offset for flash read/write in bytes
--file-offset FILE_OFFSET
offset for file read/write in bytes
--pad PAD pad value if file is not algined with SECTOR_SIZE
--debug {off,normal,verbose}
enable debug output
--io IO IO pin used for set-cs-io and set-output
--value VALUE value used for set-output
```

Troubleshooting
Expand Down Expand Up @@ -150,3 +168,18 @@ I guess if you do a system upgrade which puts the kernel image somewhere after t

If you try this, let me know!

Flashing iCE40HX8K-EVB from Olimex
==================================
This example uses the OLIMEXINO-32U4 to flash a Olimex iCE40HX8K-EVB. The steps should also work with a iCE40HX1K-EVB.

The board is connected using the UEXT connector.
```bash
# Set iCE40-CRESET LOW - PIN 0x2
> python3 spi_flash_programmer_client.py -d COM1 --io 0x2 --value 0x0 set-output
# Set CS/SS to PIN 13/0xd
> python3 spi_flash_programmer_client.py -d COM1 --io 0xd set-cs-io
# power cycle the EVB, check if ID register is readable
> python3 spi_flash_programmer_client.py -d COM1 id-register
# program the bitmap
> python3 spi_flash_programmer_client.py -d COM1 -l -1 --pad 0xff -f toplevel_bitmap.bin write
```
Loading