[Release] My custom GUI for pk2cmd and OSX/Linux

Page: 12 > Showing page 1 of 2
Author
Frankynov
Starting Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2013/02/12 03:05:36
  • Location: 0
  • Status: offline
2013/02/12 15:45:49 (permalink)
5 (1)

[Release] My custom GUI for pk2cmd and OSX/Linux

Hello everyone !
 
I've spent the afternoon in making a custom GUI for OSX and pk2cmd.
[EDIT] Now also for linux :)
It's very basic, there is no hex editor but you can program, erase, check, run and stop a .hex with a nice auto pic detection.
You can also check the firmware version of your pickit 2.
 
I don't know the rules very well here, but is it okay if I attach the file on this board or is it better to make a link to my personnal ftp ?
I'll post a screenshot under this post.
[EDIT2]
Ok, here are the binaries !
I've included a Readme for both Linux and OSX.
Please read it, the installation requires that you copy pk2cmd and PK2DeviceFile.dat into the /bin folder !
Any feedback is highly appreciated Smile
 
Changelog : 
 

1.0 
Initial release
1.1
- Linux release !
- Info tooltips
- Progress bar working !
- Bug fix : Run option was not working properly
- Bundled into a native OSX .app (still need Java)
1.2
- Bug fix at startup when checking files
- Progress bar working now with realtime % (for write and test)
 

post edited by Frankynov - 2013/02/16 16:24:50
#1

27 Replies Related Threads

    Frankynov
    Starting Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2013/02/12 03:05:36
    • Location: 0
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/12 15:47:06 (permalink)
    5 (1)



    Here is the screenshot !
    post edited by Frankynov - 2013/02/15 03:29:29
    #2
    Frankynov
    Starting Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2013/02/12 03:05:36
    • Location: 0
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/14 12:55:48 (permalink)
    5 (1)
    Nobody interested ? sad
    #3
    DarioG
    Allmächtig.
    • Total Posts : 54081
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: Oesterreich
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/15 03:24:07 (permalink)
    0
    almost never used MACs and not interested into them grin
    but thanks!

    GENOVA :D :D ! GODO
    #4
    Frankynov
    Starting Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2013/02/12 03:05:36
    • Location: 0
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/15 03:31:14 (permalink)
    0
    If you want, I've managed to build a linux port too ! grin
    #5
    DarioG
    Allmächtig.
    • Total Posts : 54081
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: Oesterreich
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/15 04:13:49 (permalink)
    0
    Oh well, this can be more interesting indeed!
    Not using it much so far, but maybe

    GENOVA :D :D ! GODO
    #6
    recursos
    Super Member
    • Total Posts : 674
    • Reward points : 0
    • Joined: 2006/01/20 03:50:18
    • Location: Portugal\Carcavelos
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/15 10:36:33 (permalink)
    5 (1)
    Hi Frankynov,
    Nice! Smile
    Linux better yet.
    Rec
    #7
    Frankynov
    Starting Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2013/02/12 03:05:36
    • Location: 0
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/15 10:41:44 (permalink)
    5 (1)
    Thank you :)
    Is it ok if I attach the my archive in the first post so that anyone can test it ?
    #8
    recursos
    Super Member
    • Total Posts : 674
    • Reward points : 0
    • Joined: 2006/01/20 03:50:18
    • Location: Portugal\Carcavelos
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/15 10:45:14 (permalink)
    0
    Hi Frankynov,
    I don't use MAC too, so I can not test it.
    Linux better!
    Rec
    #9
    Frankynov
    Starting Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2013/02/12 03:05:36
    • Location: 0
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/15 10:52:19 (permalink)
    0
    Of course, I can attach the linux version too ! Smile
    #10
    Frankynov
    Starting Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2013/02/12 03:05:36
    • Location: 0
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/16 03:41:11 (permalink)
    5 (1)
    First post edited, both OSX and Linux version are included !
    #11
    recursos
    Super Member
    • Total Posts : 674
    • Reward points : 0
    • Joined: 2006/01/20 03:50:18
    • Location: Portugal\Carcavelos
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/16 04:41:51 (permalink)
    5 (1)
    OK, thanks.
    #12
    Frankynov
    Starting Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2013/02/12 03:05:36
    • Location: 0
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/16 16:29:25 (permalink)
    0
    New release ! Smile
    1.2
    - Bug fix at startup when checking files
    - Progress bar working now with realtime % (for write and test)
    This version also makes some cleanup in the log area. Since I'm now using the progress bar to show the % of a command, there is no longer need to show the % in the log too.
    No need to reinstall pk2cmd and PK2DeviceFile.dat if you've already done that with v1.1
     
    I guess my next step will be to try and avoid user to install the files in /bin folder. But for now, I'm quite happy with the design and features
    #13
    enixma
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2013/02/07 02:39:54
    • Location: Turkey - Izmir
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/20 02:46:45 (permalink)
    0
    Thanks Frankynov for that work. Too bad MPLabX IPE doesn't have Pk2 support.
    ........
    Please read it, the installation requires that you copy pk2cmd and PK2DeviceFile.dat into the /bin folder !
    ........
    I had compiled pk2cmd and installed from source. Compared to my files of pk2cmd and PK2DeviceFile.dat files sizes are different.
     
    From your README-LINUX.rtf
    ........
    This software uses a recompiled version of pk2cmd from Microchip and a custom PK2DeviceFile.dat from from the Microchip's forums.
    ........
    Does this mean you've changed pk2cmd source and recompiled? Also did you apply any change to PK2DeviceFile.dat?
     
     
     
     
    #14
    Frankynov
    Starting Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2013/02/12 03:05:36
    • Location: 0
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/20 04:01:40 (permalink)
    0
    Hey enixma, 
     
    Yes, PK2DeviceFile.dat is from the forums here, I don't remember the one I had downloaded but it includes new devices (it's a version from 2009 I think), so it's a custom one, different from the official page of Pickit2.
    I've also recompiled pk2cmd but I *think* that it doesn't matter. If you've a runnable pk2cmd binary, it might work with the custom PK2DeviceFile.dat, but you'll still need to copy it into the /bin folder
    #15
    enixma
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2013/02/07 02:39:54
    • Location: Turkey - Izmir
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/20 08:31:56 (permalink)
    0
    Instead of copying pk2cmd and PK2DeviceFile.dat files into /bin I created symlinks.
     
    ln -s /usr/local/bin/pk2cmd /bin/pk2cmd
    ln -s /usr/share/pk2/PK2DeviceFile.dat /bin/PK2DeviceFile.dat
     
    but I couldn't run your program.
     
    $ java ./PickIt2-Programmer-1.2.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: //PickIt2-Programmer-1/2/jar
    Caused by: java.lang.ClassNotFoundException: ..PickIt2-Programmer-1.2.jar
            at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    Could not find the main class: ./PickIt2-Programmer-1.2.jar. Program will exit.
     
    $ java -version
    java version "1.6.0_24"
    OpenJDK Runtime Environment (IcedTea6 1.11.5) (mandriva-35.b24.1-i386)
    OpenJDK Server VM (build 20.0-b12, mixed mode)
     
    Does it require Sun's java to run?
     
     
     
    post edited by enixma - 2013/02/20 08:34:12
    #16
    Frankynov
    Starting Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2013/02/12 03:05:36
    • Location: 0
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/20 08:37:15 (permalink)
    0
    Maybe try :
    • java -jar Pickit2-Programmer-1.2.jar
    And if not done before, you have to set the .jar the executable bit :
    • chmod +x Pickit2-Programmer-1.2.jar
    I've compiled my software on my MacBook with Sun's Java but I got it working with Open JDK on my Linux Mint desktop
    #17
    enixma
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2013/02/07 02:39:54
    • Location: Turkey - Izmir
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/20 08:55:41 (permalink)
    0
    Ok! grin
    Applied both of your suggestions and run was successful. Thanks for your effort! Tried to find an PIC16F628A and program it with success. I'll play with it more tomorrow.
     
    I need a feature if possible. We can define configuration in code now. A button with a function to code protect only would be great for me. As a solution to my need I can define configuration word with code protected always though.
     
     
     
     
     
    #18
    Frankynov
    Starting Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2013/02/12 03:05:36
    • Location: 0
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/20 09:24:46 (permalink)
    0
    Ok, I'm not familiar with code protection (after all, I got my Pickit only a week ago wink )
    But after searching on the forum, do you know if running this command :
     pk2cmd -P -Z -JN -F/your/path/to/hex -M
    Or 
     pk2cmd -P -Z -JN -F/your/path/to/hex -MP -MI -MC
    might work for your case ? If yes, which one is the best ?
    If you have already tried a custom command with pk2cmd that enables code protection, don't hesitate to give it here : if I can see the command, it will be very easy to implement and I'll build a beta for you so you can try it.
    But if it's not natively supported by pk2cmd, I'm afraid there is nothing I can do for it sad
     
    #19
    enixma
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2013/02/07 02:39:54
    • Location: Turkey - Izmir
    • Status: offline
    Re:My custom GUI for pk2cmd and OSX 2013/02/21 03:30:51 (permalink)
    0
    Ok, I'm not familiar with code protection (after all, I got my Pickit only a week ago wink )

    Code protection is represented by some bits in Configuration Word of the Pic. According to these bits, all or some parts of the pic code protected against reads by programming process, so that no one can extract programmed code from Pic. Every Pic type has different number and positions for code protection bit(s). To achieve the goal of my request Configuration Word record in the .hex file have to be manipulated and pk2cmd of only write configuration word must be applied. This means program can handle this manipulation of code protect bits in the configuration word by knowing the type of the pic. I know this is a cumbersome process. Like you I bought my pickit2 (clone) recently, but since many years I've been using my own pic programmer. 
     
    http://www.elektronist.co.programmers/picprg2.html
     
    http://www.elektronist.co...cprg2/pprg2-041106.png
     
    Sorry, in Turkish only but the image of interface application may give some idea about it. This is a very old version's image. If you want to try I can send you latest Linux program. Interface application can be run without programmer circuit.
     
    If you have already tried a custom command with pk2cmd that enables code protection, don't hesitate to give it here : if I can see the command, it will be very easy to implement and I'll build a beta for you so you can try it.

     
    There is no command to code protect only with pk2cmd. As far as I know, currently the only way to code protect is to define code protection in the source code by using __CONFIG and such as _CP_ON.
     
      __CONFIG _INTRC_OSC_NOCLKOUT&_WDT_ON&_CP_ON&_PWRTE_ON&_LVP_OFF&_MCLRE_OFF  

     or
    #pragma config CP = ON         // Code Protection bit (Program memory code protection is enabled)  
    #pragma config CPD = ON        // Data Code Protection bit (Data memory code protection is enabled)

     
    To write only configuration word following cli entry may be used. 
     
    pk2cmd -PPIC16F628A -F/your/path/to/hex -MC

     
    This can be applied after changing code protection bits in the configuration word, as I said in my comment above.
     
    Before the implementation of a code protection button, your program in my humble opinion needs to handle selective targets of programming.
     
    BTW some small bits ;) Your .jar file name has a capital "I" in it: PickIt2-Programmer-1.2.jar . Why not PicKit2? ;) Also the directory name is still PicKit2-Programmer-GUI-1.1-Linux.
     
    And thanks for your efforts.
     
    Edit:   http://www.elektronist.co...s/picprg2/lpprg.tar.gz is latest application.
     
     
     
     
    post edited by enixma - 2013/02/21 04:10:21
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2018 APG vNext Commercial Version 4.5