I recently purchased a PC Weasel PCI card off eBay. While I’m having trouble getting the thing to run as I wish in my fileserver it does indeed work fine on my bare-metal test computer. One thing that bugged me a lot was the process of flashing firmware onto the PC Weasel. It supports up to 7 different firmware partitions but flashing them from command line is a real pain and with my limited knowledge of kermit and minicom I was totally dumbfounded.
Thankfully SecureCRT is always a viable option for one’s console needs (when using Windows, that is). PuTTY is cool but SecureCRT is great – it allows for massive scripting and is even recommended in the PC Weasel manual. So I did some scripting and this is the result:
[code language=”vb”]
# $language = "VBScript"
# $interface = "1.0"
‘ ****************************************************
‘ * *
‘ * PC WEASEL PCI FLASH HELPER FOR SECURECRT *
‘ * *
‘ * written by Tsukasa *
‘ * for SecureCRT 6.6.0 *
‘ * *
‘ * INSTRUCTIONS: Set the jumper for safeboot, open *
‘ * a serial connection through SCRT, *
‘ * run the script and power on the *
‘ * target machine. *
‘ * Cancel the script as soon as the *
‘ * S19-line input is done and set the *
‘ * remaining options manually. *
‘ * *
‘ ****************************************************
‘ ##### Edit the 3 values below ##### ‘
Const FirmwareFile = "PCIweasel_2.07_s19"
Const FirmwareName = "PC Weasel v2.07"
Const FirmwareSlot = "2"
‘ ##### DO NOT EDIT ANYTHING FROM HERE ON #####
Const ForReading = 1
Const ForWriting = 2
Sub Main
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.OpenTextFile(FirmwareFile, ForReading, False)
‘ Wait for boot menu input
crt.Screen.WaitForString "[x]–>"
‘ Enter flasher…
crt.Screen.Send "l"
‘ Select partition to flash…
crt.Screen.WaitForString "Partition number for image [1-7]:"
crt.Screen.Send FirmwareSlot
‘ Give the new firmware a name…
crt.Screen.WaitForString "Image name"
crt.Screen.Send FirmwareName & Chr(13)
‘ Erase partition…
crt.Screen.WaitForString "Erase this flash partition?"
crt.Screen.Send "Y"
‘ Wait until PC Weasel is ready to receive the S19 lines…
crt.Screen.WaitForString vbNewLine & ">"
‘ Send the S19 lines until finished
Do While file.AtEndOfStream <> True
str = file.Readline
crt.Screen.Send str & Chr(13)
crt.Screen.WaitForString ">"
Loop
End Sub
[/code]
This simple script will do most of the handiwork for you. It works well for me so I’m fine with it being somewhat incomplete ๐ .