Cart New Account Login

HomeAbout usProductsSupportForumsBlogCustomer Service

Please accept the use of cookies on our site

At PEmicro we use web browser cookies in order to provide you with an enhanced experience and in order to be able to do things like shopping cart processing and identify you when you login to our website.

Click here to accept

search inside this forum
search inside all forums
Considering CPROGACMP, have questions
Paul D. Jun 4, 2015 at 10:42 PM (22:42 hours)
Staff: Takao Y.

  • I need to write a Windows command line tool that can read a particular 4K block of flash from a K64 via a Multilink Universal FX, modify it, and then write it back. A wrapper program that calls CPROGACMP seems like a way to do it. But before I spend a couple hundred bucks and hours of time, I have a couple of questions:

    1) How long does CPROGACMP take to start up before it can do something useful? When I use the FX to debug under KDS, via PEGDBSERVER, it seems to take several seconds, doing "Loading programming algorithm" twice, once to erase the flash and again to program and verify it. Is CPROGACMP this slow?

    2) Can CPROGACMP be run interactively, so that commands can be given to it via stdin and the results captured via stdout, or do commands have to be contained in a script? It would seem that the former would be necessary if I want to read some data out of the target, modify it, and then write it back in a single invocation. Otherwise, I'd have to write two scripts, and launch CPROGACMP twice, suffering twice the overhead.

    Or should I use PEGDBSERVER and issue GDB packets to it?


  • To answer your questions: 

    1. CPROGACMP will be much faster than KDS because it does not need to launch the server etc., but the actual programming time will be similar. The algorithm will be loaded twice, once for erase, once for program.

    2. CPROGACMP works using .cfg files to specify programming sequences such as erase module or program module.

    Can you tell me a little more about your use case? As far as reading from the part, CPROGACMP can only upload an .s19.

    • I'm using a page of flash for parameter storage, and I'd like to be able to set those parameters on a per-unit basis, without having to add code to my target application that receives those parameters via some comm link and writes them to flash. (The application may not yet be in the target, or it may rely on some parameter to start correctly.) So I guess the sequence would be to read back the contents of that page via CPROGACMP, decode the .s19 data, make any necessary changes to it, and then if there actually were any changes, erase that page and then write the modified data back into it.

      So the remaining question is: can CPROGACMP accept commands interactively via stdin and produce results via stdout (other than the .s19 file containing the data, that is)? If so, then I could write my own command line program that launches CPROGACMP and redirects its stdin and stdout to pipes. I could then issue the commands to dump the contents of the page into a .s19 file, read and process that file, decide what changes need to be made to it, and issue the necessary erase and program commands, all in a single CPROGACMP invocation.

      If CPROGACMP can only accept commands from an actual script file, then I'd have to invoke it twice, first with one script to read the data, and then with a different script to erase and program the new data.

  • The latter option is how CPROG works. You will need to pass two configuration scripts, one to read the data, one to write back the modified data.

    You may also want to look into our Cyclone line of products and the accompanying automated control package. This suite of products may better suite your needs.

  • Greetings,

    Is this issue resolved?

    Takao Yamada

  • Yes, in the sense that I know that I can only do what I want the hard way, not the easy way I was hoping for.

  • Greetings,

    What you want is a non-scripted but commandline flash programmer, which we do not have. So unfortunately, you will have to create 2 scripts if you wish to use command-line. Otherwise, try using our PROG (non-command-line) flash programming that uses a UI. With a UI you can select the commands you wish to use, be able to upload the module, then flash program within one session without any kind of overhead.

    PROG and CPROG are purchased together so there is no extra software to get.

    Takao Yamada

Add comment

   Want to comment? Please login or create a new PEMicro account.

© 2018 P&E Microcomputer Systems Inc.
Website Terms of Use and Sales Agreement