Skip to content

Commit 0689723

Browse files
committed
picorv32 bootloader.S: add "q" option to bypass boot delay
1 parent d8a1d11 commit 0689723

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

soc/picorv32/common/bootloader.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#----------------------------
55
# send: "ok\n"
66
# receive: "g" Wait max. BOOTLOADER_DELAY cycles, then jump into user app
7+
# (or receive "q" and jump without delay to user app)
78
# send: "o\n"
89
# receive: <N[3]><N[2]><N[1]><N[0]> N = number of bytes to write to mem
910
# receive: <D[0]> ... <D[N-1]> Receive data and write it to mem starting at _startup_adr
@@ -39,12 +40,14 @@ start_bootloader:
3940

4041
# Wait for start character
4142
li t0, 'g' # the start char. to wait for
43+
li t4, 'q' # the abort char., also to wait for
4244
li t1, 0 # t1 = 0, timeout counter
4345
li t2, BOOTLOADER_DELAY# t2 max. timeout count
4446
wait_loop:
4547
bgeu t1, t2, finished # if( t1 > max. timeout ) goto finished
4648
addi t1, t1, 1 # t1++
4749
lw t3, 0x08(gp) # Get character from UART into t3
50+
beq t3, t4, finished # skip the timeout
4851
bne t3, t0, wait_loop # check t3 != 'g'
4952

5053
# When we are here, we have received 'g' and not timed out

0 commit comments

Comments
 (0)