@@ -77,7 +77,7 @@ def get_file_extensions(self):
77
77
def program (self , filename , progress ):
78
78
global max_progress
79
79
80
- with serial .Serial (self .port [0 ], 10000000 , timeout = 0.1 , writeTimeout = 0.1 ) as ser :
80
+ with serial .Serial (self .port [0 ], 115200 , timeout = 2 , writeTimeout = 2 ) as ser :
81
81
fpga = TinyFPGAB (ser , progress )
82
82
83
83
(addr , bitstream ) = fpga .slurp (filename )
@@ -94,19 +94,13 @@ def program(self, filename, progress):
94
94
95
95
def checkPortStatus (self , update_button_state ):
96
96
try :
97
- with serial .Serial (self .port [0 ], 10000000 , timeout = 0.1 , writeTimeout = 0.1 ) as ser :
97
+ with serial .Serial (self .port [0 ], 115200 , timeout = 0.2 , writeTimeout = 0.2 ) as ser :
98
98
fpga = TinyFPGAB (ser )
99
-
100
- fpga .wake ()
101
- fpga .read (0 , 16 )
102
- fpga .wake ()
103
- devid = fpga .read_id ()
104
-
105
- expected_devid = [0x1F , 0x84 , 0x01 ]
106
- if devid == expected_devid :
99
+
100
+ if fpga .is_bootloader_active ():
107
101
com_port_status_sv .set ("Connected to TinyFPGA B2. Ready to program." )
108
102
return True
109
- else :
103
+ else :
110
104
com_port_status_sv .set ("Unable to communicate with TinyFPGA. Reconnect and reset TinyFPGA before programming." )
111
105
return False
112
106
@@ -119,7 +113,7 @@ def checkPortStatus(self, update_button_state):
119
113
return False
120
114
121
115
def exitBootloader (self ):
122
- with serial .Serial (self .port [0 ], 10000000 , timeout = 0.1 , writeTimeout = 0.1 ) as ser :
116
+ with serial .Serial (self .port [0 ], 10000000 , timeout = 0.2 , writeTimeout = 0.2 ) as ser :
123
117
try :
124
118
TinyFPGAB (ser ).boot ()
125
119
@@ -300,7 +294,7 @@ def update_serial_port_list_task():
300
294
tinyfpga_ports = new_tinyfpga_ports
301
295
tinyfpga_adapters = new_tinyfpga_adapters
302
296
303
- r .after (500 , update_serial_port_list_task )
297
+ r .after (100 , update_serial_port_list_task )
304
298
305
299
update_serial_port_list_task ()
306
300
0 commit comments