Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Patch for stlink issue 65
From 7341a316c38a61cc745ce04e618916677007883b Mon Sep 17 00:00:00 2001
From: Timothy Brom <thb@timbrom.com>
Date: Wed, 29 Feb 2012 11:29:55 -0500
Subject: [PATCH] Fixed error about strexh and strexb using the same register
---
example/libs_stm/inc/core_support/core_cm3.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/example/libs_stm/inc/core_support/core_cm3.c b/example/libs_stm/inc/core_support/core_cm3.c
index 56fddc5..0e8c3c4 100644
--- a/example/libs_stm/inc/core_support/core_cm3.c
+++ b/example/libs_stm/inc/core_support/core_cm3.c
@@ -733,7 +733,7 @@ uint32_t __STREXB(uint8_t value, uint8_t *addr)
{
uint32_t result=0;
- __ASM volatile ("strexb %0, %2, [%1]" : "=r" (result) : "r" (addr), "r" (value) );
+ __ASM volatile ("strexb %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) );
return(result);
}
@@ -750,7 +750,7 @@ uint32_t __STREXH(uint16_t value, uint16_t *addr)
{
uint32_t result=0;
- __ASM volatile ("strexh %0, %2, [%1]" : "=r" (result) : "r" (addr), "r" (value) );
+ __ASM volatile ("strexh %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) );
return(result);
}
--
1.7.5.4
@strain1

This comment has been minimized.

Copy link

commented Nov 4, 2016

thanks works fine

@genzj

This comment has been minimized.

Copy link

commented Aug 25, 2017

It works for me. Thanks a lot 👍

@wajatimur

This comment has been minimized.

Copy link

commented Sep 29, 2017

Big help, Thanks!!

@souravg009

This comment has been minimized.

Copy link

commented Nov 4, 2018

I manually changed the values. Worked like charm. but how to apply the patch?

@WulfricLee

This comment has been minimized.

Copy link

commented Feb 7, 2019

That works!!! 😀 How did you figure out this!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.