@@ -51,7 +51,14 @@ def firstboot_completed():
5151 # can only happen if all tests ([run_*] sections)
5252 # run and return True
5353 print ("Done first boot" )
54- say_hello (180 , times = 2 )
54+ tt = get_demoboard ()
55+ if tt .chip_ROM .shuttle == 'tt03p5' :
56+ print ("CHIPROM shuttle is 03p5, saying hello" )
57+ say_hello_03p5 (180 , times = 2 )
58+ else :
59+ print (f"CHIPROM shuttle { tt .chip_ROM .shuttle } , saying hello" )
60+ say_hello (180 , times = 2 )
61+
5562 return True
5663
5764
@@ -68,11 +75,11 @@ def firstboot_failure():
6875 print ()
6976
7077
71- def test_bidirs (max_idx :int , delay_interval_ms :int = 1 ):
78+ def test_bidirs_03p5 (max_idx :int , delay_interval_ms :int = 1 ):
7279 # a test, must return True to consider a pass
7380 tt = get_demoboard ()
7481 print (f'Testing bidirs up to { max_idx } on { tt } ' )
75- err = shut_tests .factory_test_bidirs (tt , max_idx , delay_interval_ms )
82+ err = shut_tests .factory_test_bidirs_03p5 (tt , max_idx , delay_interval_ms )
7683
7784 if err is not None :
7885 log .error (err )
@@ -81,12 +88,21 @@ def test_bidirs(max_idx:int, delay_interval_ms:int=1):
8188 return True
8289
8390
91+ def test_clocking_04 (max_idx :int = 30 , delay_interval_ms :int = 50 ):
92+ tt = get_demoboard ()
93+ print (f'Testing manual clocking up to { max_idx } on { tt } ' )
94+ err = shut_tests .factory_test_clocking_04 (tt , max_idx , delay_interval_ms )
95+ if err is not None :
96+ log .error (err )
97+ return False
98+
99+ return True
84100
85- def test_clocking (max_idx :int = 30 , delay_interval_ms :int = 50 ):
101+ def test_clocking_03p5 (max_idx :int = 30 , delay_interval_ms :int = 50 ):
86102 # a test, must return True to consider a pass
87103 tt = get_demoboard ()
88104 print (f'Testing manual clocking up to { max_idx } on { tt } ' )
89- err = shut_tests .factory_test_clocking (tt , max_idx , delay_interval_ms )
105+ err = shut_tests .factory_test_clocking_03p5 (tt , max_idx , delay_interval_ms )
90106 if err is not None :
91107 log .error (err )
92108 return False
@@ -96,27 +112,70 @@ def test_clocking(max_idx:int=30, delay_interval_ms:int=50):
96112
97113
98114
115+ def say_hello (delay_interval_ms :int = 200 , times :int = 1 ):
116+
117+ hello_values = [0x74 , 0x79 , 0x30 , 0x30 , 0x5c , 0 , 0 ]
118+ tt = get_demoboard ()
119+ try :
120+ tt .shuttle .factory_test .enable ()
121+ except :
122+ print ('Failed to load factory test?' )
123+ return
124+
125+
126+ tt .mode = RPMode .ASIC_RP_CONTROL # make sure we're controlling everything
127+
128+ tt .in0 (0 ) # want this low
129+ tt .clock_project_PWM (1e3 ) # clock it real good
130+
131+ log .info ('First boot: saying hello' )
132+ # for bp in tt.bidirs:
133+ # bp.mode = Pins.OUT
134+ # bp(0) # start low
135+ for _i in range (times ):
136+ for v in hello_values :
137+ tt .input_byte = v
138+ time .sleep_ms (delay_interval_ms )
139+
140+ tt .input_byte = 0
141+ time .sleep_ms (int (delay_interval_ms / 10 ))
142+
143+ tt .input_byte = 0
144+ time .sleep_ms (int (delay_interval_ms / 2 ))
145+
146+ tt .clock_project_stop ()
147+
148+ return True
149+
99150
100- def say_hello (delay_interval_ms :int = 100 , times :int = 1 ):
151+ def say_hello_03p5 (delay_interval_ms :int = 200 , times :int = 1 ):
101152 # a test, must return True to consider a pass
102- print (f'Saying hello' )
103-
104- hello_values = [0x74 , 0x79 , 0x30 , 0x30 , 0x5c , 0 , 0x50 , 0x10 , 0x78 , 0x77 ]
153+ hello_values = [0x74 , 0x79 , 0x30 , 0x30 , 0x5c , 0 , 0 ]
105154 tt = get_demoboard ()
106- tt .shuttle .tt_um_test .enable ()
155+ try :
156+ tt .shuttle .factory_test .enable ()
157+ except :
158+ print ('Failed to load factory test?' )
159+ return
160+
161+
107162 tt .mode = RPMode .ASIC_RP_CONTROL # make sure we're controlling everything
108163
109164 tt .in0 (0 ) # want this low
110165 tt .clock_project_PWM (1e3 ) # clock it real good
111166
112167 log .info ('First boot: saying hello' )
113- for bp in tt .bidirs :
114- bp .mode = Pins .OUT
115- bp (0 ) # start low
168+ # for bp in tt.bidirs:
169+ # bp.mode = Pins.OUT
170+ # bp(0) # start low
171+
172+ tt .bidir_mode = [Pins .OUT ] * 8
173+ tt .bidir_byte = 0
116174
117175 for _i in range (times ):
118176 for v in hello_values :
119177 tt .bidir_byte = v
178+ log .warn (f'Wrote { v } to bidir, waiting { delay_interval_ms } ' )
120179 time .sleep_ms (delay_interval_ms )
121180
122181 tt .bidir_byte = 0
@@ -128,8 +187,7 @@ def say_hello(delay_interval_ms:int=100, times:int=1):
128187
129188
130189 # reset everything
131- for bp in tt .bidirs :
132- bp .mode = Pins .IN
190+ tt .bidir_mode = [Pins .IN ] * 8
133191
134192 tt .clock_project_stop ()
135193
0 commit comments