31 lines
760 B
PowerShell
31 lines
760 B
PowerShell
param(
|
|
[Parameter(Mandatory = $true, Position = 0)]
|
|
[string]$Port
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$FirmwareDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
|
|
Write-Host "Keep the RD-03D external 5 V supply OFF while flashing."
|
|
|
|
$EsptoolArgs = @(
|
|
"-m", "esptool",
|
|
"--chip", "esp32s3",
|
|
"--port", $Port,
|
|
"--baud", "460800",
|
|
"--before", "default_reset",
|
|
"--after", "hard_reset",
|
|
"write_flash",
|
|
"--flash_mode", "dio",
|
|
"--flash_freq", "80m",
|
|
"--flash_size", "4MB",
|
|
"0x0", (Join-Path $FirmwareDir "bootloader.bin"),
|
|
"0x8000", (Join-Path $FirmwareDir "partition-table.bin"),
|
|
"0x10000", (Join-Path $FirmwareDir "radick.bin")
|
|
)
|
|
|
|
& python @EsptoolArgs
|
|
if ($LASTEXITCODE -ne 0) {
|
|
exit $LASTEXITCODE
|
|
}
|