propellent tricks

Tracy AllenTracy Allen Posts: 6,317
edited 2012-09-17 - 17:37:18 in Propeller 1
I hadn't realized until recently that you can drag a .binary or .eeprom file icon on top of the Propellent icon, and it will find and run the firmware into an attached Prop. You can also drag a .spin file on top and it will both compile and run it, provided it can find all the necessary files.

The caveat is that it programs it to RAM, not to EEPROM. I was wondering if there is a trick such as holding down a certain key combination that will force it to EEPROM?

The next best thing is that it also works with a BATch file. Put propellent along with the .EEPROM or the .BINARY application image in a folder, and the .BAT file.
The contents of the batch file are simply,
propellent /eeprom myProgram.eeprom
That makes a fairly easy way to distribute firmware updates to customers, provided they have the serial port drivers installed.

There is also proploader, but I've run into boxes where it loaded the file but didn't send the file. Here is another recent thread on topic.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 22,260
    edited 2012-09-14 - 16:19:57
    Tracy,

    Here's a VBScript file you can use to do what you want:
    Dim x
    Dim WShell, FSO, FileData, cFSO, cwd
    Set cFSO = CreateObject("Scripting.FileSystemObject")
    Set WShell = CreateObject("WScript.Shell")
    Set FSO = CreateObject("Scripting.FileSystemObject")
    FileData = FSO.GetFile(wscript.arguments.item(0))
    FilePath = (FileData)
    If FSO.FileExists(FilePath) Then
      x = MsgBox("Save " & FileData & " to EEPROM?", vbYesNoCancel)
      If (x = 6) Then 
        WShell.Run cFSO.GetParentFolderName(Wscript.ScriptFullName) & "\Propellent.exe /EEPROM " & FileData
      ElseIf (x = 7) Then
        WShell.Run cFSO.GetParentFolderName(Wscript.ScriptFullName) & "\Propellent.exe " & FileData
      End If
    End If
    wscript.quit 
    

    Just save it as LoadProp.vbs to the same folder as Propellent, and drag your files into it instead of into Propellent.

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • Tracy AllenTracy Allen Posts: 6,317
    edited 2012-09-14 - 17:40:19
    Thanks much Phil. Once I got all the ducks in a row, it worked great on a Win7 machine.

    Not on a WinXP machine though. After asking if I wanted load the named file to EEPROM, it flaked out with a message pointing to line 11, char 5, "the system cannot find the file specified", 8007002 (null). It was in the same folder with propellent and the application image. Maybe a script attribute not supported in XP?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 22,260
    edited 2012-09-14 - 18:21:42
    That's weird. I developed it on WinXP! Did the directory you put it in have spaces in its pathname, by any chance? I may have overlooked some "quoted quotes", which I sometimes do in Perl scripts, too.

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 22,260
    edited 2012-09-14 - 18:30:33
    Tracy,

    Now that I've tested it, I'm sure the space thing is the problem. Here's a corrected script:
    Dim x
    Dim WShell, FSO, FileData, cFSO, cwd
    Set cFSO = CreateObject("Scripting.FileSystemObject")
    Set WShell = CreateObject("WScript.Shell")
    Set FSO = CreateObject("Scripting.FileSystemObject")
    FileData = FSO.GetFile(wscript.arguments.item(0))
    FilePath = (FileData)
    If FSO.FileExists(FilePath) Then
      x = MsgBox("Save " & FileData & " to EEPROM?", vbYesNoCancel)
      If (x = 6) Then 
        WShell.Run chr(34) & cFSO.GetParentFolderName(Wscript.ScriptFullName) & "\Propellent.exe" & chr(34) & " /EEPROM " & FileData
      ElseIf (x = 7) Then
        WShell.Run chr(34) & cFSO.GetParentFolderName(Wscript.ScriptFullName) & "\Propellent.exe" & chr(34) & " " & FileData
      End If
    End If
    wscript.quit 
    

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • Tracy AllenTracy Allen Posts: 6,317
    edited 2012-09-14 - 20:58:28
    Tried it again on XP, but the message that came up after clicking OK to the Propellent prompt was, "Too many command line options. Only one file name allowed". I tried it with several different .binary and .eeprom images, the same. But I had to run TGIF before I had a chance to dig into it more.

    I see the version difference is the char(34)'s. I don't think spaces were the issue. I was running it right from the original "propellent" folder.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 22,260
    edited 2012-09-14 - 21:05:43
    I'll bet FileData needs to be surrounded by chr(34)'s, too. I've closed up shop for the evening, but I'll try that fix tomorrow.
    I was running it right from the original "propellent" folder.

    "Program Files" has a space in it. That's all it takes to throw off a command-line file reference that's not surrounded by quotes.

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • Tracy AllenTracy Allen Posts: 6,317
    edited 2012-09-15 - 10:40:01
    I see, yes, in this case both the program "propellent" and the application image were located within the "program files" directory. The application image itself was named with underscores instead of spaces. In practice when emailing a file to a customer, there is no telling where it is going to end up, but probably not too hard to insist on a space-free path! In general, they would move the application image into the same folder with propellent and the script, so full path names should not be necessary.

    I'm at home and have the Mac only here, but will be back by the windows machine sometime this weekend. On the Mac I'm using bstl and the applescript suggested by dgately in this thread.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 22,260
    edited 2012-09-15 - 11:10:21
    Tracy,

    I think this will fix the problem with spaces in the .spin/.bin/.eeprom file's path\file name:
    Dim x
    Dim WShell, FSO, FileData, cFSO, cwd
    Set cFSO = CreateObject("Scripting.FileSystemObject")
    Set WShell = CreateObject("WScript.Shell")
    Set FSO = CreateObject("Scripting.FileSystemObject")
    FileData = FSO.GetFile(wscript.arguments.item(0))
    FilePath = (FileData)
    If FSO.FileExists(FilePath) Then
      x = MsgBox("Save " & FileData & " to EEPROM?", vbYesNoCancel)
      If (x = 6) Then 
        WShell.Run chr(34) & cFSO.GetParentFolderName(Wscript.ScriptFullName) & "\Propellent.exe" & chr(34) & " /EEPROM " & chr(34) & FileData & chr(34)
      ElseIf (x = 7) Then
        WShell.Run chr(34) & cFSO.GetParentFolderName(Wscript.ScriptFullName) & "\Propellent.exe" & chr(34) & " " & chr(34) & FileData & chr(34)
      End If
    Else
      MsgBox("File " & FileData & " does not exist.")
    End If
    wscript.quit 
    

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • Tracy AllenTracy Allen Posts: 6,317
    edited 2012-09-17 - 17:37:18
    Phil,
    Third time, works like a charm! Verified different paths on both WinXP and Win7.
Sign In or Register to comment.