@@ -78,30 +78,48 @@ Connected to 'SPI Flash programmer v1.0'
78
78
Connected to ' SPI Flash programmer v1.0'
79
79
[# ########## ] 383/1024 - 00:01:13
80
80
81
+ # Set IO Pin value
82
+ # Example: IO pin 0x2, set to LOW
83
+ > python3 spi_flash_programmer_client.py \
84
+ > -d COM1 --io 0x2 --value 0x0 set-output
85
+
86
+ # Override ChipSelect pin
87
+ # Example: use IO pin 13/0xd
88
+ > python3 spi_flash_programmer_client.py \
89
+ > -d COM1 --io 0xd set-cs-io
90
+
81
91
# Help text
82
92
> python3 spi_flash_programmer_client.py -h
83
93
usage: spi_flash_programmer_client.py [-h] [-d DEVICE] [-f FILENAME]
84
94
[-l LENGTH] [--rate BAUD_RATE]
85
95
[--flash-offset FLASH_OFFSET]
86
- [--file-offset FILE_OFFSET]
87
- {ports,write,read,verify,erase}
96
+ [--file-offset FILE_OFFSET] [--pad PAD]
97
+ [--debug {off,normal,verbose}] [--io IO]
98
+ [--value VALUE]
99
+ {ports,write,read,verify,erase,enable-protection,disable-protection,check-protection,status-register,id-register,set-cs-io,set-output}
88
100
89
101
Interface with an Arduino-based SPI flash programmer
90
102
91
103
positional arguments:
92
- {ports,write,read,verify,erase}
104
+ {ports,write,read,verify,erase,enable-protection,disable-protection,check-protection,status-register,id-register,set-cs-io,set-output }
93
105
command to execute
94
106
95
107
optional arguments:
96
108
-h , --help show this help message and exit
97
109
-d DEVICE serial port to communicate with
98
110
-f FILENAME file to read from / write to
99
- -l LENGTH length to read/write in kibi bytes (factor 1024)
111
+ -l LENGTH length to read/write in bytes, use -1 to write entire
112
+ file
100
113
--rate BAUD_RATE baud-rate of serial connection
101
114
--flash-offset FLASH_OFFSET
102
115
offset for flash read/write in bytes
103
116
--file-offset FILE_OFFSET
104
117
offset for file read/write in bytes
118
+ --pad PAD pad value if file is not algined with SECTOR_SIZE
119
+ --debug {off,normal,verbose}
120
+ enable debug output
121
+ --io IO IO pin used for set-cs-io and set-output
122
+ --value VALUE value used for set-output
105
123
` ` `
106
124
107
125
Troubleshooting
@@ -150,3 +168,18 @@ I guess if you do a system upgrade which puts the kernel image somewhere after t
150
168
151
169
If you try this, let me know!
152
170
171
+ Flashing iCE40HX8K-EVB from Olimex
172
+ ==================================
173
+ This example uses the OLIMEXINO-32U4 to flash a Olimex iCE40HX8K-EVB. The steps should also work with a iCE40HX1K-EVB.
174
+
175
+ The board is connected using the UEXT connector.
176
+ ```bash
177
+ # Set iCE40-CRESET LOW - PIN 0x2
178
+ > python3 spi_flash_programmer_client.py -d COM1 --io 0x2 --value 0x0 set-output
179
+ # Set CS/SS to PIN 13/0xd
180
+ > python3 spi_flash_programmer_client.py -d COM1 --io 0xd set-cs-io
181
+ # power cycle the EVB, check if ID register is readable
182
+ > python3 spi_flash_programmer_client.py -d COM1 id-register
183
+ # program the bitmap
184
+ > python3 spi_flash_programmer_client.py -d COM1 -l -1 --pad 0xff -f toplevel_bitmap.bin write
185
+ ```
0 commit comments