Shop OBEX P1 Docs P2 Docs Learn Events
Preventing the download of code... on purpose — Parallax Forums

Preventing the download of code... on purpose

Jim McCorisonJim McCorison Posts: 359
edited 2005-01-01 02:59 in BASIC Stamp
The recent tip I got from the BS Editor says "NEVER CONNECT THE RESET PIN DIRECTLY TO 5 VOLTS; DOING SO WILL PREVENT YOU FROM DOWNLOADING TO THE BASIC STAMP."

Interesting. This seems like a nice method for intentionally preventing the download of new code. Can this pin be safely tied to Vdd without a resistor, or should one be used? Or is there a better way of proving a lock off means of preventing a down load?

Jim

Comments

  • BeanBean Posts: 8,129
    edited 2004-12-31 01:46
    Jim,
    I think if you tie reset to Vdd the stamp will not run at all.
    Bean.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-31 02:30
    That pin is pulled-up on the BASIC Stamp, if you connect directly to Vdd you'll never be able to reset the BASIC Stamp. In a word, don't do it. Okay, that's three words....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • BeanBean Posts: 8,129
    edited 2004-12-31 03:11
    Oh, I guess reset should really be /reset.
    Bean.
  • Jim McCorisonJim McCorison Posts: 359
    edited 2004-12-31 03:27
    Ok. Maybe that's a bad idea.

    But if you were to design a product which would allow downloads to update the code via, say a USB port, and you wanted to restrict it to "authorized" uses, how would you go about it? The idea being to allow a user to update the stamp themselves without specialized hardware, but prevent "playing around" which you would then have to support.

    OTH, the target customers aren't typically techies, so maybe it isn't really a worry in the first place.

    Jim
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-31 06:18
    Exactly. I once designed a device for a customer who thought that field upgrades would be useful so we kept the programming port. Though he never actually asked for an update, if he had, I would have used the File\Generate Object Code tools to create a custom downloader -- he would never have seen the source code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-12-31 12:57
    If the user erases his BS2 program, I don't think you have to 'support' that. Have a policy that says 'don't do that', and leave it at that. If they DO manage to erase their BS2 program, then you can easily re-install it. I'd charge them for the privilige, though.
  • Jim McCorisonJim McCorison Posts: 359
    edited 2004-12-31 16:39
    Ok that sounds reasonable.

    That leads to another question. I was looking at the Generate Object dialog boxs and wondering what the different options were. I couldn't find a help file for the actual Editor, just the syntax for the language. Have I overlooked it somewhere?

    Thanks,
    Jim
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-31 18:34
    We really haven't documented that feature because so few people need it ... I'll add that to my "To Do" list.... Here are the basics:

    A) Object Code

    This creates an image of your program and saves the file as MYPROGRAM.OBJ. A "loader" is required to move the OBJ file into a target BASIC Stamp, and that module MUST match the module specified in the orginal source.

    B) Object Code and Stamp Loader

    In addition to the OBJ file, this option creates a small program called STAMPLOADER.EXE. The loader program can be used to open and download an OBJ file to a BASIC Stamp.

    C) Single Executable

    This option binds the OBJ and loader program into a stand-alone executable file. This is probably the best option for protecting a product from a bad update -- send the EXE file to the client and have them run it.

    Note that all options allow for some amount of text customization so that you can provide instructions with the loader. The image below shows what the stand-alone EXE looks like; without any text customization.

    attachment.php?attachmentid=36799

    Here's the same program WITH customization:

    attachment.php?attachmentid=36800

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office


    Post Edited (Jon Williams) : 12/31/2004 6:41:44 PM GMT
    376 x 361 - 24K
    376 x 361 - 24K
  • Jim McCorisonJim McCorison Posts: 359
    edited 2004-12-31 21:11
    Thanks for the help Jon. I had experimented with the object, and object with stamp loader options, but hadn't played with the single executable yet as I had no idea what it did. The single executable looks like just the ticket.

    I appreciate the support.

    And a Happy New Year to all. turn.gif

    Jim
  • NewzedNewzed Posts: 2,503
    edited 2005-01-01 01:40
    What do I have to do to get the screen Jon pictures - Stamp Loader.· I clicked on Generate Oject Code/Single Executable File, and found a
    "dec to hex" file, the name of my program, and a StampLoader file.· If I click on the StampLoader file I get a regular Stamp Editor screen, with the letters MZP and it asks me for a Stamp directive.· Nothing else happens.· What am I missing?

    Sid
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-01 02:59
    When you select "Single Executable" th EXE file will have the same name as your program.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
Sign In or Register to comment.