stm32h7x: Fix reset with non-HLA interfaces on macOS
authorAlberto García Hierro <alberto@garciahierro.com>
Tue, 20 Oct 2020 15:13:17 +0000 (16:13 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 7 Nov 2020 20:52:46 +0000 (20:52 +0000)
commit535f5309ba1277479d44f471655bf722e32fbb6b
tree8e5db5e90841ed6c7f77ac5661ba511474e0208e
parent92ea7e41b9261d4d7a88d96cc3ef0a727d1059f0
stm32h7x: Fix reset with non-HLA interfaces on macOS

regsub doesn't work correctly on macOS Catalina, which results in
an incorrect CHIPNAME derived from the current target. Since regsub
is only used by this target, replace it with a simple string search
for '.' followed by a substring. This is funcionally equivalent to
what the regular expression was doing, but instead relies in simpler
string operations that should have little to no differences
between systems.

Also, refactor CHIPNAME detection into proc stm32h7x_chipname, so
it's always retrieved in the same way without duplicating the code.

Change-Id: Ia9f63f56b508688e74278b022eaec47e503916e7
Signed-off-by: Alberto Garcia Hierro <alberto@garciahierro.com>
Reviewed-on: http://openocd.zylin.com/5872
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Christopher Head <chead@zaber.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
tcl/target/stm32h7x.cfg