File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 4
4
#----------------------------
5
5
# send: "ok\n"
6
6
# receive: "g" Wait max. BOOTLOADER_DELAY cycles, then jump into user app
7
+ # (or receive "q" and jump without delay to user app)
7
8
# send: "o\n"
8
9
# receive: <N[3 ]><N[2 ]><N[1 ]><N[0 ]> N = number of bytes to write to mem
9
10
# receive: <D[0 ]> ... <D[N-1 ]> Receive data and write it to mem starting at _startup_adr
@@ -39,12 +40,14 @@ start_bootloader:
39
40
40
41
# Wait for start character
41
42
li t0, 'g' # the start char. to wait for
43
+ li t4, 'q' # the abort char., also to wait for
42
44
li t1, 0 # t1 = 0 , timeout counter
43
45
li t2, BOOTLOADER_DELAY# t2 max. timeout count
44
46
wait_loop:
45
47
bgeu t1, t2, finished # if( t1 > max. timeout ) goto finished
46
48
addi t1, t1, 1 # t1++
47
49
lw t3, 0x08(gp) # Get character from UART into t3
50
+ beq t3 , t4, finished # skip the timeout
48
51
bne t3 , t0, wait_loop # check t3 != 'g'
49
52
50
53
# When we are here, we have received 'g' and not timed out
You can’t perform that action at this time.
0 commit comments