Shop OBEX P1 Docs P2 Docs Learn Events
I need a firmware updater. — Parallax Forums

I need a firmware updater.

MarkSMarkS Posts: 342
edited 2008-02-16 11:03 in Propeller 1
I'm making a product that will be upgradeable by the user through added hardware. What I'd like to do is include a firmware update to access the new hardware. The only problem is that the user would need PropTool and I don't want them changing the code. Is there any sort of tool that will create a Windows executable that will look for a Prop on a USB port and then upload a stored SPIN program? I'm assuming that there is not, but how hard would this be to create?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-02-11 20:16
    You don't have to provide the source code. The Propeller Tool can also upload binary files.

    -Phil
  • parts-man73parts-man73 Posts: 830
    edited 2008-02-11 20:31
    There have been examples of a Propeller programming a second Propeller. Perhaps design a small plug in board to quickly and efficiently program your embedded processor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Brian

    uController.com - home of SpinStudio - the modular Development system for the Propeller

    PropNIC - Add ethernet ability to your Propeller! PropJoy - Plug in a joystick and play some games!

    SD card Adapter - mass storage for the masses Audio/Video adapter add composite video and sound to your Proto Board
  • AribaAriba Posts: 2,687
    edited 2008-02-11 21:55
    PropTerminal has extra features for acting as an Update Tool.

    http://forums.parallax.com/showthread.php?p=649540

    You can configure the .ini file so, that all goes automatic, when the user click on the PropTerminal Icon.
    Or you can first start a Diagnose Spin programm in the Propeller RAM that decides interactiv with the User what Update File want be uploaded in the EEPROM.

    If this is a bigger commercial Application, you can get an adapted version of PropTerminal, with your Logo, Website and so on for little money.

    Andy
  • simonlsimonl Posts: 866
    edited 2008-02-12 10:11
    Try PropLoader at http://forums.parallax.com/showthread.php?p=611536 - it's a little Windows app' by 'Filip S' that works great for me.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,

    Simon
    www.norfolkhelicopterclub.co.uk
    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
    BTW: I type as I'm thinking, so please don't take any offense at my writing style smile.gif
  • AnubisbotAnubisbot Posts: 112
    edited 2008-02-13 00:16
    Hi Marks,

    I have the same problem or better say needs for a Firmware updater.
    Thats why , i work on one right now, it will be ( hopfully ) a .dll i started to write the code an a sample ap in VB Express 2008.
    I want to make a .dll so everybody could use it in there own little program with out fidiling with bits and bytes and a funny encoding.

    May be we both can work on that if you want, or maybe there are more out there how would like to have a .dll for prp loading and communication.

    So far my VBXLoader so i called it , i was able to load a bin file to a byte array, but i am not sure if that is so good and i should try to get it in a string.
    And i got the part with check comports and open the port and send.

    So now i am stuck in the bits and bytes with 1t and 2t what i almost got in my mind.

    So you see i have made a little step in the right direction.

    If you don't mind i will post here in your thread the files form VB what i have so far.

    Best regards
    Anubisbot
  • sharpiesharpie Posts: 150
    edited 2008-02-14 05:53
    I had the same need ages ago and parallax said it was on the back burner..· My product never saw the light of day, and I'm still a little annoyed.
  • ColeyColey Posts: 1,110
    edited 2008-02-14 09:19
    This is what I have built to upload the firmware into PropGFX Lite pcb's
    Presently it just programs the default image file into them but my ultimate aim is to have many configurations held in the Protoboard EEPROM and use the VGA to display a menu to choose the file to load.
    I just used Chip's Propeller Loader spin file, it works well enough just a little on the slow side.
    The best thing about it is that it is portable!

    PropGFXLiteProgrammerSide.jpg

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PropGFX Forums - The home of the Hybrid Development System and PropGFX Lite

    Title_Logo_Small.jpg
  • hippyhippy Posts: 1,981
    edited 2008-02-14 12:45
    Anubisbot said...
    I want to make a .dll so everybody could use it in there own little program with out fidiling with bits and bytes and a funny encoding.

    So far my VBXLoader so i called it , i was able to load a bin file to a byte array, but i am not sure if that is so good and i should try to get it in a string.

    An Active-X (.OCX) component may be better than a .DLL, but I'm from a VB6 rather than VB.Net background so I don't really know what's most appropriate for dotNet.

    Unless you need to pass the entire image to or from the program which uses your .DLL/.OCX it doesn't really matter to anyone else how you implement it. A string could perhaps be less efficient than a byte array, and don't forget you need to be able to hold up to a 32KB image, up to 128KB image for the proposed Prop II.

    In my VB6 implementations of compilers, assemblers and loaders I have used an array of strings, each of which can hold 256 32 bytes with another array to indicate which held data or not. That keeps strings at an efficient to use size and makes it fairly easy to increase the maximum size of the image without hitting 'string too long' or 'array to large' errors. Simple PutByte(adr,n) and GetByte(adr) methods hide the actual implementation. GetByte returns 0..255, -1 if not used.

    Edit : Just checked, and I now use strings of 32 bytes, and an array of longs (32-bit) for efficiency. The beauty of hiding implementation is it doesn't matter how it works or changes.

    There are quite a few examples of Propeller Bootloaders on this forum, including my own in VB6. It's well worth seeking out and looking at those examples.

    Post Edited (hippy) : 2/14/2008 1:40:52 PM GMT
  • AnubisbotAnubisbot Posts: 112
    edited 2008-02-14 14:45
    hippy said...
    Anubisbot said...
    I want to make a .dll so everybody could use it in there own little program with out fidiling with bits and bytes and a funny encoding.

    So far my VBXLoader so i called it , i was able to load a bin file to a byte array, but i am not sure if that is so good and i should try to get it in a string.

    An Active-X (.OCX) component may be better than a .DLL, but I'm from a VB6 rather than VB.Net background so I don't really know what's most appropriate for dotNet.

    Unless you need to pass the entire image to or from the program which uses your .DLL/.OCX it doesn't really matter to anyone else how you implement it. A string could perhaps be less efficient than a byte array, and don't forget you need to be able to hold up to a 32KB image, up to 128KB image for the proposed Prop II.

    In my VB6 implementations of compilers, assemblers and loaders I have used an array of strings, each of which can hold 256 32 bytes with another array to indicate which held data or not. That keeps strings at an efficient to use size and makes it fairly easy to increase the maximum size of the image without hitting 'string too long' or 'array to large' errors. Simple PutByte(adr,n) and GetByte(adr) methods hide the actual implementation. GetByte returns 0..255, -1 if not used.

    Edit : Just checked, and I now use strings of 32 bytes, and an array of longs (32-bit) for efficiency. The beauty of hiding implementation is it doesn't matter how it works or changes.

    There are quite a few examples of Propeller Bootloaders on this forum, including my own in VB6. It's well worth seeking out and looking at those examples.

    I think i will go with the .dll first, since i have some good tutorials to do that, i hope...
    The byte array i use in .net is a system byte array, and i loaded a 500+ kb file in it and it works no complain about to long. I think thats good..
    So now the fun parts starts, and thats what i still don't get. what do i do now with my bytes in the array,
    Ok i start with DTR high wait and then dtr low wait 100ms and then i have to send$F9 what is 249 what i send out via serial byte. or is that wrong.
    Then it comes to the part with the LFSR what is a array of 250 ?? bytes?
    I have a lot more questions but right now its better for me to figure it out how the version check works, before i get more info in my head,
    Since i have read all infos here on the forum, but i got more confused as more i have read.


    I will post my code later today, after i have cleaned it a bit and have tested a new idea.
  • hippyhippy Posts: 1,981
    edited 2008-02-14 14:55
    The example code provided by Chip ( a Propeller to Propeller loader and a Delphi version ) were what I used as my primary references and then it's a case of reading all that's been written on the protocol in forums until it all falls into place.

    Getting the loader downloading is the 'fun part'. Implementing step-by-step is the way I did it, get one part working then move on to the next. There should be enough information which explains what needs to be sent and what is expected back.

    The initial LFSR handshaking is bit oriented but wrapped as bytes. It probably is possible to send multiple bits in a single byte as can be done later in the download process for the actual image but I never got that working and it isn't really important to.
  • MarkSMarkS Posts: 342
    edited 2008-02-14 19:57
    hippy said...
    The example code provided by Chip ( a Propeller to Propeller loader and a Delphi version ) were what I used as my primary references and then it's a case of reading all that's been written on the protocol in forums until it all falls into place.

    Getting the loader downloading is the 'fun part'. Implementing step-by-step is the way I did it, get one part working then move on to the next. There should be enough information which explains what needs to be sent and what is expected back.

    The initial LFSR handshaking is bit oriented but wrapped as bytes. It probably is possible to send multiple bits in a single byte as can be done later in the download process for the actual image but I never got that working and it isn't really important to.

    Parallax really needs to get this done. Firmware updating is a common practice in commercial/industrial applications. A developer has to feel secure that they can provide updates without someone hacking their code in the process. A binary loader solves this to some extent and I'm greatly surprised that one hasn't been written yet. It has been a very long time since I've done any Windows programming and I really don't know where to begin. Heck, I don't even have an IDE anymore.
  • AnubisbotAnubisbot Posts: 112
    edited 2008-02-14 22:02
    MarkS said...
    hippy said...
    The example code provided by Chip ( a Propeller to Propeller loader and a Delphi version ) were what I used as my primary references and then it's a case of reading all that's been written on the protocol in forums until it all falls into place.

    Getting the loader downloading is the 'fun part'. Implementing step-by-step is the way I did it, get one part working then move on to the next. There should be enough information which explains what needs to be sent and what is expected back.

    The initial LFSR handshaking is bit oriented but wrapped as bytes. It probably is possible to send multiple bits in a single byte as can be done later in the download process for the actual image but I never got that working and it isn't really important to.

    Parallax really needs to get this done. Firmware updating is a common practice in commercial/industrial applications. A developer has to feel secure that they can provide updates without someone hacking their code in the process. A binary loader solves this to some extent and I'm greatly surprised that one hasn't been written yet. It has been a very long time since I've done any Windows programming and I really don't know where to begin. Heck, I don't even have an IDE anymore.


    Just get Vb Express 2008 its a free ide and a lot of fun to learn [noparse]:)[/noparse] Just kidding.Oh there is a loder written in Vb here in the forum ,
    and i use it for now, to update the firmware for my projects. But i want to have all in one software like the update of firmware and a controll software for my application.
    So i am happy writing away, and already get headaches. But it will be worth it.
  • AribaAriba Posts: 2,687
    edited 2008-02-15 02:46
    MarkS said...
    ... A binary loader solves this to some extent and I'm greatly surprised that one hasn't been written yet. ....

    Have you read all the postings above?
    I count 2..3 ready to use solutions. Have you tried one of them? Can you say what is wrong with it?

    Andy
  • MarkSMarkS Posts: 342
    edited 2008-02-15 02:52
    Ariba said...
    MarkS said...
    ... A binary loader solves this to some extent and I'm greatly surprised that one hasn't been written yet. ....

    Have you read all the postings above?
    I count 2..3 ready to use solutions. Have you tried one of them? Can you say what is wrong with it?

    Andy

    Like I said, I don't have an IDE. I'm surprised that this hasn't already been done, as in a finished application with documentation on Parallax' site. Sure, I could do it, but I don't quite know how.
  • AnubisbotAnubisbot Posts: 112
    edited 2008-02-15 03:33
    MarkS said...
    Ariba said...
    MarkS said...
    ... A binary loader solves this to some extent and I'm greatly surprised that one hasn't been written yet. ....

    Have you read all the postings above?
    I count 2..3 ready to use solutions. Have you tried one of them? Can you say what is wrong with it?

    Andy

    Like I said, I don't have an IDE. I'm surprised that this hasn't already been done, as in a finished application with documentation on Parallax' site. Sure, I could do it, but I don't quite know how.

    VB Express 2008 is a free IDE ..

    You can download it free, and use it free.... and did i mentioned it's free..... freaked.gif i didn't had a clue how it works, before i started to read and try.


    Anubisbot
  • AribaAriba Posts: 2,687
    edited 2008-02-15 07:06
    PropTerminal (link above) is a little Windows EXE that needs no IDE, no Installation, no Runtime library. It runs also from a CD-Rom or a USB-Stick. You simply start the PropTerminal.exe choose "Upload File" in the Menu and select the Binary (or *.EEPROM) to upload.
    A description is included, and the 0.3-ZIP has an Example that shows how you can upload files triggered by a Spin application. This allows User Interaction programmed in Spin (no PC programming).

    Andy
  • deSilvadeSilva Posts: 2,967
    edited 2008-02-15 09:46
    Mark, you are not a troll, are you???
  • simonlsimonl Posts: 866
    edited 2008-02-15 11:34
    Mark - please read the above posts carefully. You have been given TWO examples of standalone Propeller 'firmware updaters' - both allow the end user (with a Windows PC) to update the 'firmware' of a Propeller without the need of any IDE. They will load binary / EEPROM files into the Propeller.

    I happen to use PropLoader (Downloadable from: http://forums.parallax.com/showthread.php?p=611536).

    Sure, neither are from Parallax, but that doesn't matter does it?!

    The only improvement I would like to see is a cross-platform version, and one that can be controlled from command-line and/or a supplier's application.

    Try them both, and let us know what you think.

    Hope that helps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,

    Simon
    www.norfolkhelicopterclub.co.uk
    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
    BTW: I type as I'm thinking, so please don't take any offense at my writing style smile.gif
  • MarkSMarkS Posts: 342
    edited 2008-02-15 14:39
    deSilva said...
    Mark, you are not a troll, are you???

    Who me? What?

    No, I'm not just didn't read all of the replies fully. PropLoader looks good.

    Post Edited (MarkS) : 2/15/2008 2:45:39 PM GMT
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-16 07:19
    There is also a python script that works on macs and linux.
  • simonlsimonl Posts: 866
    edited 2008-02-16 11:03
    Hey Mark, Filip has now updated his PropLoader to accept command-line input (WHAT A STAR!) so - in theory (I've not tried it) - it should be possible to call it from your own application smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,

    Simon
    www.norfolkhelicopterclub.co.uk
    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
    BTW: I type as I'm thinking, so please don't take any offense at my writing style smile.gif
Sign In or Register to comment.