Shop OBEX P1 Docs P2 Docs Learn Events
Need Guidance.... I want to create a USB port Propeller updater — Parallax Forums

Need Guidance.... I want to create a USB port Propeller updater

Hello Everyone

I am sure that many of you along the way have wanted an easy way to allow your customers to update their Propeller firmware. At this point in time, I have such a need myself, so I want to attempt to create a firmware updater.

My old version of Visual C++ has this function:
BOOL UpdateResource( HANDLE hUpdate, // update-file handle LPCTSTR lpType, // address of resource type to update LPCTSTR lpName, // address of resource name to update WORD wLanguage, // language identifier of resource LPVOID lpData, // address of resource data DWORD cbData // length of resource data, in bytes );
The UpdateResource function adds, deletes, or replaces a resource in an executable file.

My scheme is this....

I want to create two executables
(1.) The first executable would contain the actual updated firmware, as a resource of the executable. This program would be able to find a Propeller on a USB port and when a Propeller is found, the program would update the firmware, with the local resource.

(2.) The second executable would contain the Visual C++function "UpdateResource". This program would would be responsible for changing the firmware resource in the first executable.

Basically. anyone that had both executables could create firmware updates for the Propeller. After the second executable alters the resource of the first executable, the user could rename the first executable file to anything he wanted.

If I am not mistaken, I have already written the software necessary for finding and communicating with the Propeller on a USB port, which I could just copy. What I need is a basic understanding of updating the EEPROM.

Comments

  • This is done both on the P1 and the P2.

    What you do is write a small stub program that is sent to the P1 or P2 that is then rebooted.

    Once this small stub program starts running it tells you this through the serial port and you then stream the new EEPROM program to it.

    The stub program reads this data from the serial port and writes it to the EEPROM.

    Mike

  • evanhevanh Posts: 15,755
    edited 2023-05-27 12:36

    Chip has a straightforward EEPROM programmer included with Pnut, called flash_loader.spin2

    EDIT: That's for the Prop2 obviously. Dunno about Prop1.
    EDIT2: Link https://forums.parallax.com/discussion/171196/pnut-spin2-latest-version-v39-parameterization-bug-fixed-no-more-automatic-file-spewing/p1

  • And there is the propellent(?) Software from Parallax, a cmdline version to program P1.

    Mike

  • idbruceidbruce Posts: 6,197
    edited 2023-05-27 22:58

    Thanks Guys

    @msrobots said:
    And there is the propellent(?) Software from Parallax, a cmdline version to program P1.

    Mike

    I forgot all about Propellent :) Never used it, but I was aware of it, but forgot it.

    I found both the latest versions of Propellent.exe and Propellent.dll, however I found very little documentation pertaining to the functions within the DLL. Is this open source?

  • it is from Parallax so I guess MIT, not sure about the source but you might be able to just use the DLL from your program.

    Mike

  • @msrobots said:
    it is from Parallax so I guess MIT, not sure about the source but you might be able to just use the DLL from your program.

    Mike

    Mike :)

    The DLL has 21 functions, many of which I am sure that have returns and expect parameters :) Unless I know the returns, the parameters, and their purpose, the DLL is useless to me :)

  • After a Google search :) I found this web page which contains all the source code and information :)

    https://parallax.com/package/propellent-library-and-executable-source-code/

Sign In or Register to comment.