]> git.sur5r.net Git - openocd/commitdiff
SYS_WRITE0 fix
authorJohn and Tina Peterson <jpfp@byu.edu>
Thu, 17 Mar 2011 06:34:44 +0000 (07:34 +0100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Thu, 17 Mar 2011 06:34:44 +0000 (07:34 +0100)
Problem is, trying to print "Hello, world!\n" just prints endless H's, because r1 is never incremented.

One way to fix it would be to add a "++" after "r1".

src/target/arm_semihosting.c

index a247cc88839a4671f7e8bf0eb0d3b6273eed83af..903145c52adc29b402e4edbb4c5d1c01cef76ce7 100644 (file)
@@ -139,7 +139,7 @@ static int do_semihosting(struct target *target)
        case 0x04:      /* SYS_WRITE0 */
                do {
                        unsigned char c;
-                       retval = target_read_memory(target, r1, 1, 1, &c);
+                       retval = target_read_memory(target, r1++, 1, 1, &c);
                        if (retval != ERROR_OK)
                                return retval;
                        if (!c)