Skip to content

Commit 6ab78bc

Browse files
committed
usb: fix most/all dfu-util related problems
1 parent 0ccc070 commit 6ab78bc

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

Docs/programming_the_fpga.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ You can skip step 1 if this is the case.
4949
This should list the pico-ice as a DFU device:
5050

5151
```
52-
Found DFU: [1209:b1c0] ver=0100, devnum=105, cfg=1, intf=0, path="1-4.4", alt=1, name="iCE40 DFU (flash)", serial="DE62A435436F5939"
53-
Found DFU: [1209:b1c0] ver=0100, devnum=105, cfg=1, intf=0, path="1-4.4", alt=0, name="iCE40 DFU (CRAM)", serial="DE62A435436F5939"
52+
Found DFU: [1209:b1c0] ver=0100, devnum=105, cfg=1, intf=0, path="1-4.4", alt=0, name="iCE40 DFU (flash)", serial="DE62A435436F5939"
53+
Found DFU: [1209:b1c0] ver=0100, devnum=105, cfg=1, intf=0, path="1-4.4", alt=1, name="iCE40 DFU (CRAM)", serial="DE62A435436F5939"
5454
```
5555

5656
4. Download the FPGA bin file to the pico-ice.
5757
The Pico can be rebooted as soon as the download succeeds with the `-R` flag.
5858

5959
```
60-
$ dfu-util -a 1 -D rgb_blink.bin
60+
$ dfu-util -R -a 0 -D rgb_blink.bin
6161
```
6262

6363
## Using APIO

Firmware/pico-ice-default/main.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ static int repl_getchar(void)
5858
// busy-wait with a slow delay: this is for interactive I/O, no need to be fast
5959
while ((c = getchar_timeout_us(10000)) == PICO_ERROR_TIMEOUT) {
6060
// call tud_task() since we are blocking
61-
ice_led_blue(1);
6261
tud_task();
63-
ice_led_blue(0);
6462
}
6563

6664
if (c == '\r' || c == '\n') {
@@ -131,9 +129,7 @@ int main(void)
131129
ice_led_init();
132130

133131
while (true) {
134-
ice_led_green(1);
135132
tud_task();
136-
ice_led_green(0);
137133

138134
printf("\x1b[1mpico-ice>\x1b[m ");
139135

Firmware/pico-ice-default/usb_descriptors.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ char const *tud_string_desc[STRID_NUM_TOTAL] = {
5353
[STRID_CDC+1] = "iCE40 UART",
5454
[STRID_CDC+2] = "SPI",
5555
[STRID_MSC+0] = "iCE40 MSC (Flash)",
56-
[STRID_DFU+0] = "iCE40 DFU (CRAM)",
57-
[STRID_DFU+1] = "iCE40 DFU (Flash)",
56+
[STRID_DFU+0] = "iCE40 DFU (Flash)",
57+
[STRID_DFU+1] = "iCE40 DFU (CRAM)",
5858
};

0 commit comments

Comments
 (0)