Files
BL616-firmware/scripts/make_release.ps1
T
Gromov_IAandClaude Opus 5.5 e736fab46a Прошивка моста BL616 для Tang Primer 25K и программатор TangProgrammer
- src/: прошивка встроенного отладчика BL616 — составное USB-устройство
  1209:C0CA: DirtyJTAG v3 (WinUSB через MS OS 2.0) + CDC-ACM UART к FPGA
  B3/C3; UART до 20 Мбод на DMA, JTAG до 30 МГц через аппаратный SPI;
- bin/: загрузчик Sipeed (0x0) и штатная прошивка 2025030317 для отката;
- gui/: TangProgrammer.exe (C# WinForms, .NET Framework 4) — загрузка FPGA
  в SRAM и во флеш-память, копия и стирание флеш-памяти FPGA, прошивка
  моста; светлая и тёмная тема;
- scripts/: setup, build, flash, build_gui, make_portable, а также
  make_release и publish_release для релизов Gitea;
- fpga_test/, tests/: тестовые проекты Gowin (loopback, stream) и тесты
  UART на Python;
- tools/openFPGALoader/: openFPGALoader 1.1.1 для Windows x64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 14:59:10 +03:00

57 lines
2.8 KiB
PowerShell

# Collect the files of a release into dist\release\v<version>\:
#
# TangProgrammer-v<version>-win64.zip portable programmer (make_portable.ps1)
# TangProgrammer.exe the program alone
# tang25k_debugger_bl616.bin bridge firmware, @0x20000
# bl616_bootloader_0x20000_nano20k_signed.bin Sipeed loader, @0x0
# bl616_fpga_partner_25kDock.bin original Sipeed firmware, @0x0
# fpga_test_bitstreams-GW5A-25.zip fpga_test\*\impl\pnr\*.fs, if built
# SHA256SUMS.txt
#
# .\scripts\build.ps1
# .\scripts\make_release.ps1 version from FW_VERSION_STR in src\sys.h
param([string]$Version)
$ErrorActionPreference = 'Stop'
$root = Split-Path $PSScriptRoot -Parent
if (-not $Version) {
$m = Select-String -Path (Join-Path $root 'src\sys.h') -Pattern '#define\s+FW_VERSION_STR\s+"([^"]+)"'
if (-not $m) { throw 'FW_VERSION_STR not found in src\sys.h' }
$Version = $m.Matches[0].Groups[1].Value
}
$tag = 'v' + $Version.TrimStart('v')
$bridgeFw = Join-Path $root 'build\build_out\tang25k_debugger_bl616.bin'
if (-not (Test-Path $bridgeFw)) { throw 'bridge firmware is not built: run scripts\build.ps1' }
if (-not (Test-Path (Join-Path $root 'third_party\bouffalo_sdk\tools\bflb_tools\bouffalo_flash_cube\BLFlashCommand.exe'))) {
throw 'Bouffalo SDK is not installed (scripts\setup.ps1): the portable copy needs BLFlashCommand'
}
$out = Join-Path $root "dist\release\$tag"
if (Test-Path $out) { Remove-Item -Recurse -Force $out }
New-Item -ItemType Directory -Force $out | Out-Null
& (Join-Path $PSScriptRoot 'make_portable.ps1')
Copy-Item (Join-Path $root 'dist\TangProgrammer.zip') (Join-Path $out "TangProgrammer-$tag-win64.zip")
Copy-Item (Join-Path $root 'dist\TangProgrammer\TangProgrammer.exe') $out
Copy-Item $bridgeFw $out
Copy-Item (Join-Path $root 'bin\bl616_bootloader_0x20000_nano20k_signed.bin') $out
Copy-Item (Join-Path $root 'bin\bl616_fpga_partner_25kDock.bin') $out
$fs = @(Get-ChildItem (Join-Path $root 'fpga_test\*\impl\pnr\*.fs') -ErrorAction SilentlyContinue)
if ($fs.Count) {
Compress-Archive -Path ($fs | ForEach-Object { $_.FullName }) -DestinationPath (Join-Path $out 'fpga_test_bitstreams-GW5A-25.zip')
} else {
Write-Warning 'no test bitstreams: build them with gw_sh build.tcl in fpga_test\loopback and fpga_test\stream'
}
# sha256sum format, so that "sha256sum -c SHA256SUMS.txt" works
$sums = Get-ChildItem $out -File | Sort-Object Name | ForEach-Object {
(Get-FileHash -Algorithm SHA256 $_.FullName).Hash.ToLower() + ' ' + $_.Name
}
[IO.File]::WriteAllText((Join-Path $out 'SHA256SUMS.txt'), ($sums -join "`n") + "`n")
Get-ChildItem $out -File | Sort-Object Name | Format-Table Name, @{ n = 'KB'; e = { [math]::Ceiling($_.Length / 1KB) }; a = 'right' } -AutoSize
Write-Host "OK: $out" -ForegroundColor Green