diff options
author | Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> | 2015-11-30 12:21:12 +0100 |
---|---|---|
committer | Freddie Chopin <freddie.chopin@gmail.com> | 2016-05-04 22:55:22 +0100 |
commit | 934ed07b0d05448a553d19daa14ad6196fc0c0fe (patch) | |
tree | 69330feb9edce4a32d4bdb4f9c37890baded77aa /contrib | |
parent | a28b94e9ab00c63951f68ac44833e9d51200f7db (diff) | |
download | riscv-openocd-934ed07b0d05448a553d19daa14ad6196fc0c0fe.zip riscv-openocd-934ed07b0d05448a553d19daa14ad6196fc0c0fe.tar.gz riscv-openocd-934ed07b0d05448a553d19daa14ad6196fc0c0fe.tar.bz2 |
stm32l4x.c: Correct waiting for data.
Old code waited only for 7 bytes and didn't handle buffer wrap-around, but
was functional despite.
Change-Id: Iceaf7be1e51368b2ec0a8722cc9ac16d12f9aa63
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3140
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/loaders/flash/stm32l4x.S | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/loaders/flash/stm32l4x.S b/contrib/loaders/flash/stm32l4x.S index 045f9d0..799dec5 100644 --- a/contrib/loaders/flash/stm32l4x.S +++ b/contrib/loaders/flash/stm32l4x.S @@ -65,7 +65,10 @@ wait_fifo: beq exit ldr r5, [r0, #4] /* read rp */ subs r6, r8, r5 /* number of bytes available for read in r6*/ - cmp r6, #7 /* wait until 8 bytes are available */ + itt mi /* if wrapped around*/ + addmi r6, r1 /* add size of buffer */ + submi r6, r0 + cmp r6, #8 /* wait until 8 bytes are available */ bcc wait_fifo ldr r6, STM32_PROG |