--upd
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
adapter serial "\x34\x00\x48\x00\x0D\x00\x00\x59\x33\x4A\x53\x4E"
|
||||
adapter serial "48FF71066567495729231187"
|
||||
|
||||
# This is for all ST NUCLEO with any STM32F4. Known boards at the moment:
|
||||
# STM32F401RET6
|
||||
|
||||
@@ -3,10 +3,20 @@ $dir=$PSScriptRoot
|
||||
$MyCommand="$dir"+"\stlink\st-info.exe --probe --hot-plug"
|
||||
Invoke-Expression -Command $MyCommand | Out-String -OutVariable output
|
||||
$DevicesNum=$output.Substring($output.IndexOf("Found") + 7, 1)
|
||||
Write-Host -ForegroundColor Yellow -BackgroundColor Blue 'Do you wanna run the script N/Y'
|
||||
$key=Read-Host
|
||||
if ($key.ToUpper() -notmatch 'Y')
|
||||
{
|
||||
exit
|
||||
}
|
||||
if ($DevicesNum -eq 1)
|
||||
{
|
||||
$serial=$output.Substring($output.Trim().IndexOf("serial") + 12, 24)
|
||||
}
|
||||
elseif ($DevicesNum -eq 0)
|
||||
{
|
||||
exit
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host -ForegroundColor Yellow -BackgroundColor Blue 'Press key which number of debugger you wanna use'
|
||||
@@ -24,7 +34,7 @@ $serial=$serial.ToCharArray()
|
||||
$StringForCompare='adapter serial "'
|
||||
|
||||
for ($i = 0; $i -lt $serial.Count; $i=$i+2) {
|
||||
$StringForCompare=$StringForCompare.Insert($StringForCompare.Length,"\x$($serial.Get($i))$($serial.Get($i+1))")
|
||||
$StringForCompare=$StringForCompare.Insert($StringForCompare.Length,"$($serial.Get($i))$($serial.Get($i+1))")
|
||||
}
|
||||
$StringForCompare=$StringForCompare.Insert($StringForCompare.Length,'"')
|
||||
$Path = "$dir"+"/board.cfg"
|
||||
|
||||
Reference in New Issue
Block a user