Menu

Programming and Programmers: Patch build to preview new capability

Anobium
2017-12-18
2017-12-25
  • Anobium

    Anobium - 2017-12-18

    What is new?

    We are improving the method used to handle the programming of PIC and AVR microcontrolllers.

    The changes we are making is to improve the Great Cow BASIC user experience.

    We want to make is easier to setup & control programmers and improve support for multiple programmers with Great Cow BASIC.

    We want to remove the complex batch files and replace with a specific user interface that support the setup and management of programmers and the programmer interface.

    What is included in the patch build?

    This patch build is the latest build, but, focusing on the programming and programmers the patch build will show the following:

    • The ease of use to program using different methods
    • The removal of the highly complex programming batch files
    • Speed of programming
    • The ini file in terms of structure and usage

    This patch build will NOT include the following:

    • The application to control the INI file. You WILL have to edit the ini file at the moment.

    What is the purpose of the patch build?

    This patch build is gather feedback on usability.

    We may have missed something and we need your feedback.

    How do I get the patch build?

    1. Watch this video! It is 13 minutes long -watch it all the way through. I will be asking questions. If you feel comfortable and you have the time then goto to step two. If you are NOT able to spend some time testing and assessing the build then please do not ask. https://www.dropbox.com/s/0yjd99uuxspabd6/Intro%20to%20Programmer%20Changes.avi?dl=0
    2. Send me a personal message. I will send you the link
    3. You post to this topic your feedback

    Limited offer!

    This is limited to the first 10. Just cannot cope with more requests. So, I will close the offer when I have 10 folks signed up.

    I have one already!! :-)

     
    • Anobium

      Anobium - 2017-12-18

      Overview of the capability

      The attachment is the PDF used in the video.

       
  • Randall Young

    Randall Young - 2017-12-18

    Hi!,

    There's a lot of information, embedded in this posting, considering best practices, and the evolution of GCB into the more modern PIC chips. Put more simply I'm really interested in which PIC chips you are using and how you're using them! (Besides being a great idea in itself, regarding standardizing and simplfying programming)

    R.

     
    • Anobium

      Anobium - 2017-12-18

      @Randall. Open up another thread on this - this is going of ssubject.

      Thanks

       
  • Frank Steinberg

    Frank Steinberg - 2017-12-19

    Hi Evan,

    I like the new capabilities to automate the use of different programmers. This is a great improvement for advanced users.

    But we also should discuss how to make the operation as easy as possible for new users to understand and apply. IMO for a beginner it is better to understand, that he (she ?) has to choose a programmer and possibly a port than doing it due to a "black box".
    I know, that a GUI for configuring the programmer is planned. Some thoughts about it:

    • Maybe this thing can pop up at first compile (until the programmer is configured properly),
    • User can select standard settings (beginner) and advanced settings (freaks).

    .
    Frank

    P.S.
    I'm still playing with version "0.98.<<>> 2017-12-11" so I definitely want the new stuff.

     

    Last edit: Frank Steinberg 2017-12-19
    • Anobium

      Anobium - 2017-12-19

      You will get a build today! This new build has the new UI!

      I like the idea of the installer ensuring the user sets up the programmer. When you get the build I am sure you will see how to make the installation process easy.

       
  • Anobium

    Anobium - 2017-12-20

    Patch Build 19122017 was released to about 15 folks.

    Changes reported so far.

    Improve handling when no programmer matches USEIF selection. As follows.

    When you a chip that is not a match then you get shown the ‘programmer =’ entry. This make no sense and the message should be ‘No programmer matches USEIF statements’

    Example.... The items in bold should not appear.

    Loading source files ...
    Reading compiler directives ...
    Reading chip data ...
    C:\TEMP\GCB@Syn\GreatCowBasic\chipdata\16F19156.dat
    Choosing programmer ...
    Microchip PICKit 2 with PICCheck skipped
    avrdude (UNO) - Default AVR skipped
    Output file appears up to date, skipping compilation

    Downloading program ...
    ** Calling C:\TEMP\GCB@Syn\GreatCowBasic\pickit2cmdlinewithcheck, arduinocomnn**
    An error occured - exit code: -1

    Should be as follows. Where the compiler can program so exit gracefully.

    Loading source files ...
    Reading compiler directives ...
    Reading chip data ...
    C:\TEMP\GCB@Syn\GreatCowBasic\chipdata\16F19156.dat
    Choosing programmer ...
    Microchip PICKit 2 with PICCheck skipped
    avrdude (UNO) - Default AVR skipped
    No programmer matches USEIF statements’
    An error occured - exit code: -1

    Resolved as follows:

    C:\TEMP\GCB@Syn\GreatCowBasic\chipdata\16F18326.dat
    Choosing programmer ...
    Microchip PICKit 2 with PICCheck skipped
    avrdude (UNO) - Default AVR skipped
    Output file appears up to date, skipping compilation

    Downloading program ...
    Calling C:\TEMP\GCB@Syn\GreatCowBasic\none

    An error has been found:

    Warning: None of the chosen programmers were suitable for the current program
    Error: Warnings generated and treated as errors

    The message has been logged to the file Errors.txt.

    An error occured - exit code: -559038737

    Resolved: Compiler built after 20th Dec 2017 now has graceful message.

     

    Last edit: Anobium 2017-12-20
  • Anobium

    Anobium - 2017-12-20

    Recommend changing the Default PK3-IPE programmer as follows as the default currently using Boost.
    So, remove the Boost entry and replace with the following:

    [tool = pk3cmd_ipe]
    type = programmer
    progconfig = LVP = On
    desc = Microchip PICKit 3 - IPE Mode
    command = %instdir%..\mplab_ipe\ipecmd.exe
    params = -TPPK3 -P%chipmodel% -M -F"%filename%" -OL -Z
    workingdir = %instdir%..\mplab_ipe
    ** useif = Programmerpk3cmd_ipe**

    Resolved. Gold build now has this as the programmer definition

    Should we add operating voltage as the default?

     

    Last edit: Anobium 2017-12-20
  • Anobium

    Anobium - 2017-12-20

    Lots of email this morning!

    Change TinyBootloader+ to the following removing the USEIF test as any specified USEIF will ony confuse the user.

    [tool=tinybootloader]
    desc = TinyBootloader
    type = programmer
    command = %instdir%..\TinyBootLoader\TinyMultiBootloader+.exe
    params = "%FileName%" exit
    useif =

    Not resolved

     

    Last edit: Anobium 2017-12-20
  • Anobium

    Anobium - 2017-12-20

    **One thing I noticed while testing: There is no errormessage if an programmer.exe is not present (or misspelled). **

    Resolved Use Verbose mode and the error will be revealed.

     
  • Anobium

    Anobium - 2017-12-20

    Improve the PicKit2 programmer. There is an option, shown in the list default programmers, for PicKit2 with PIC check.

    Shown below is an enhanced batch file that handles 1) the Pk2 not being plugged in 2) wrong PIC atttached to PK2.

    @ECHO Off
    REM 1.02
    set prompt=
    SET FileToDelete="%temp%\PICTEST.TXT"
    IF EXIST %FileToDelete% del /F %FileToDelete%
    
    "..\PicKit2\pk2cmd.exe" -I -b"..\PicKit2" -pPIC%1 > %FileToDelete%
    IF ERRORLEVEL 10 goto NoPK2
    findstr PIC%1 %FileToDelete%
    
    IF ERRORLEVEL 1 goto incorrectChip
    goto GoodChip
    
    echo what!
    
    :incorrectChip
    echo Incorrect PIC%1 microcontroller attached to PicKit2
    echo Found
    type %FileToDelete%
    type %FileToDelete% >> errors.txt
    goto fin
    
    :NoPK2
    echo Programmer Error no PicKit2.
    echo Programmer Error. >> errors.txt
    type %FileToDelete% >> errors.txt
    
    type %FileToDelete%
    GOTO FIN
    
    :GoodChip
    
    REM  Call PicKit2 command-line programming Software leaving power on the chip
    "..\PicKit2\pk2cmd.exe" -b"..\PicKit2" -pPIC%1 -f%2 %3 %4 %5 %6 %7
    
    :fin
    IF EXIST %FileToDelete% del /F %FileToDelete%
    exit /b %ERRORLEVEL%
    

    *** Updated the master build with this batch file. Done***

     
  • Frank Steinberg

    Frank Steinberg - 2017-12-20

    How can we distinguish if an errorlevel/return code was caused by the compiler or the programmer? This is important for G+Stool to display different messages to SynWrites output panel (as the actual version does).

    Frank

     
    • Anobium

      Anobium - 2017-12-20

      How can we distinguish if an errorlevel/return code was caused by the compiler or the programmer? This is important for G+Stool to display different messages to SynWrites output panel (as the actual version does).

      See item #457in the release note. Compiler Compiler improvements: [667]. Compiler now returns exit code. Exit code will be 0xdeadbeef if errors found during compilation, exit code from programmer if programmer was run, or 0 otherwise.

      So, if the compiler exits with an error the erorlevel will be a huge number which is -559038737
      (0xdeadbeef). The compiler will pass back errorvlevels from the programmer. We have found during development that there is no consistency with respect to the error level passed back from the different programmers.

       
      • Hugh Considine

        Hugh Considine - 2017-12-21

        Sorry all, I broke this in r678! Fixed again, the compiler was returning 0xdeadbeef for all issues but now is correctly returning the programmer exit code again. Fixed files are in the usual places.

        Should the compiler also be able to test the exit code and return a more detailed error? We could define some generic errors in messages.dat - programmer not found, programmer couldn't talk to chip, chip model was wrong, verify failed, etc. The programmer definitions in the ini file could then link exit codes with message IDs. That would make it easier to provide translations, and would give consistent behaviour in GCB@Syn and GCGB.

         
        • Anobium

          Anobium - 2017-12-21

          Thanks!

          I did think it was odd when I responded to Frank!

          Re detailed errors - not sure how this work. Too many variants for error
          messages. How do we handle the many different returned messages from many
          different programmers?

           

          Last edit: Anobium 2017-12-21
          • Hugh Considine

            Hugh Considine - 2017-12-21

            The idea would be to sum up the errors that can occur with a set of standard error messages, and we could of course always add more messages if needed. Similar idea to the handling of On Interrupt, where we map basically equivalent events on different chips to the same interrrupt event wherever possible.

            If we provide the appropriate standard error message and the raw exit value from the programmer, that should be enough help for the user to work out that they've forgotten to plug something in.

            I propose these as standard errors that can be shown to the user when relevant:
            * Programmer not connected to PC
            * Programmer is not on the selected serial port
            * Programmer couldn't communicate with chip (chip not connected)
            * Programmer is incompatible with the chip used in the program
            * Chip model attached to programmer does not match that in the program
            * Chip was programmed, but communication errors occurred (verify failure)
            * Error in voltage levels, chip may not be powered correctly
            * Error in voltage levels, there may be an error in the circuit

            How many more would we need? It's the same basic process regardless of chip and programmer, so there should only be so many ways to make a mistake.

             
  • William Roth

    William Roth - 2017-12-21

    Build 1300-21122017

    Flash time reported is incorrect. Alwasy same as compile time.

     
    • Frank Steinberg

      Frank Steinberg - 2017-12-21

      In the old version of the ide, the times are measures by G+Stool.exe. Now both, compiling and flashing is done by the compiler. G+Stool cannot differentiate the processes.

      If we want these to be displayed, the compiler has to do it (i.e. by report-file).

      Frank

       
  • Frank Steinberg

    Frank Steinberg - 2017-12-21

    In my opinion, the following process would be sufficient:

    Compiling-errors:

    • The compiler reports the compile error.
    • The compiler generates a Érror.txt with all errors.
    • The G+Stool window stays open and the user can investgate the errors.
    • The content of Error.txt is displayed in SynWrites Output panel and the user can click on it to get to the relevant line.

    Programmer-errors:

    • The compiler reports a general error of the programmer.
    • The compiler generates a FlashÉrror.txt with that general errormessage.
    • The G+Stool window stays open and the user can investgate output of the programmer software.
    • The content of FlashError.txt is displayed in SynWrites Output panel.

    Programmer errors should also include:
    "no programmer matches criteria in use.ini",
    "file programmer.exe not found".

    Frank

     
  • Anobium

    Anobium - 2017-12-22

    Summary of change to address the points above from Hugh, Frank and Wiliam. The others have come to me via email.

    Item Description Action Owner
    1 We need [tool] INI section programmer standardisation William to update and test [tool] masters and Evan to collate and create a master [tool] INI file. William then to Evan
    2 Error messages from Flash process are incorrect We need ensure the compiler creates and updates the appropiate files, error.txt and flasherror.txt as appropiate Hugh
    3 Loss of the flash timing in the IDE When item #2 is completed then Frank can review to assess gaps to complete solution to enable timing to provided Frank
    4 Links for long file names verses symbolic links to MPLAB IPE This is a complex issue but the UI , the INI file and the compiler all need to be able to support symbolic links and the use %exampleLink% in [tool] sections. Hugh to revise compiler to support symbolic links Hugh
    5 Errors during extensive test of demonstration files New compiler, and the improving quality of the compiler has identified errors in demonstration programs. (thanks Pete for testing this!). Evan to revise demos to resolve issues. Evan
    6 No ICON in the UI application Hugh to add ICON Hugh
    7 UI application does not get called to front of user environment when a selection is made. Hugh to update UI application to bring to front when selected Hugh
    8 Standardisation of programmer error messages/errorlevels. On hold. This may be too difficult. Evan to assess challenges with respect to standardisation of programmer error messages/errorlevels. Evan

    Summary.

    INI fiile [tool] will be standardised to aid support.
    INI file will have another revision in terms of the structure.
    UI tool will get another tab to support symbolic links
    Compiler be updated to handle these changes.

    Evan

     

    Last edit: Anobium 2017-12-22
  • Anobium

    Anobium - 2017-12-23
    Item Description Action Owner
    1 We need [tool] INI section programmer standardisation William to update and test [tool] masters and Evan to collate and create a master [tool] INI file. William then to Evan
    2 Error messages from Flash process are incorrect We need ensure the compiler creates and updates the appropiate files, error.txt and flasherror.txt as appropiate Hugh
    3 Loss of the flash timing in the IDE When item #2 is completed then Frank can review to assess gaps to complete solution to enable timing to provided Frank
    4 Links for long file names verses symbolic links to MPLAB IPE This is a complex issue but the UI , the INI file and the compiler all need to be able to support symbolic links and the use %exampleLink% in [tool] sections. Hugh to revise compiler to support symbolic links Hugh
    5 Errors during extensive test of demonstration files New compiler, and the improving quality of the compiler has identified errors in demonstration programs. (thanks Pete for testing this!). Evan to revise demos to resolve issues. Evan
    6 No ICON in the UI application Hugh to add ICON Hugh
    7 UI application does not get called to front of user environment when a selection is made. Hugh to update UI application to bring to front when selected Hugh
    8 Standardisation of programmer error messages/errorlevels. On hold. This may be too difficult. Evan to assess challenges with respect to standardisation of programmer error messages/errorlevels. Evan
    9 It is easy to drag and drop in error in the UI. Add a line above 'Other Available Programmers' as those with shaky hands will find the UI hard to use. Hugh
    10 The UI is not clear with respect to edit and drag&drop Hover in UI should state 'Click to select then use 'Edit', or use Drag and Drop to move a programmer. Hugh
    11 When using HEX&Flash. No programmer selected in UI..... no message If there is no programmer in default listing the source is compiled and output reports "flashing OK." There is no user message. Can we issue a message when /F or /FO is passed to compiler and no programmer is set. Hugh
     
  • Anobium

    Anobium - 2017-12-24

    Latest status report

    Item Description Action Owner
    1 We need [tool] INI section programmer standardisation William to update and test [tool] masters and Evan to collate and create a master [tool] INI file. William then to Evan
    2 Error messages from Flash process are incorrect We need ensure the compiler creates and updates the appropiate files, error.txt and flasherror.txt as appropiate Initial support added to compiler. Compiler now issues message to compilation report. @231217 the compilation report is incorrect on second run of the same source file.
    3 Loss of the flash timing in the IDE When item #2 is completed then Frank can review to assess gaps to complete solution to enable timing to provided Frank
    4 Links for long file names verses symbolic links to MPLAB IPE This is a complex issue but the UI , the INI file and the compiler all need to be able to support symbolic links and the use %exampleLink% in [tool] sections. Hugh to revise compiler to support symbolic links Implemented in the comppiler Evan to test and document. What is the support strategy for UI?
    5 Errors during extensive test of demonstration files New compiler, and the improving quality of the compiler has identified errors in demonstration programs. (thanks Pete for testing this!). Evan to revise demos to resolve issues. Evan
    6 No ICON in the UI application Hugh to add ICON Hugh
    7 UI application does not get called to front of user environment when a selection is made. Hugh to update UI application to bring to front when selected Hugh
    8 Standardisation of programmer error messages/errorlevels. On hold. This may be too difficult. Evan to assess challenges with respect to standardisation of programmer error messages/errorlevels. Evan
    9 It is easy to drag and drop in error in the UI. Add a line above 'Other Available Programmers' as those with shaky hands will find the UI hard to use. Hugh
    10 The UI is not clear with respect to edit and drag&drop Hover in UI should state 'Click to select then use 'Edit', or use Drag and Drop to move a programmer. Hugh
    11 When using HEX&Flash. No programmer selected in UI..... no message If there is no programmer in default listing the source is compiled and output reports "flashing OK." There is no user message. Can we issue a message when /F or /FO is passed to compiler and no programmer is set. Hugh
    12 Need to be able to produce Clean Build Add option in UI to always clean build when making HEX file and make appropiate changes to compiler Hugh
     
  • Anobium

    Anobium - 2017-12-25

    Latest status report

    Item Description Action Owner
    1 Open We need [tool] INI section programmer standardisation William to update and test [tool] masters and Evan to collate and create a master [tool] INI file. William then to Evan
    2 Closed Error messages from Flash process are incorrect We need ensure the compiler creates and updates the appropiate files, error.txt and flasherror.txt as appropiate Initial support added to compiler. Compiler now issues message to compilation report. @231217 the compilation report is incorrect on second run of the same source file. @24122017 Compilation Report now correct.
    3 Open Loss of the flash timing in the IDE When item #2 is completed then Frank can review to assess gaps to complete solution to enable timing to provided Frank
    4 WIP Links for long file names verses symbolic links to MPLAB IPE This is a complex issue but the UI , the INI file and the compiler all need to be able to support symbolic links and the use %exampleLink% in [tool] sections. Hugh to revise compiler to support symbolic links Implemented in the compiler Evan to test and document. UI update required
    5 Open Errors during extensive test of demonstration files New compiler, and the improving quality of the compiler has identified errors in demonstration programs. (thanks Pete for testing this!). Evan to revise demos to resolve issues. Evan
    6 Open No ICON in the UI application Hugh to add ICON Hugh
    7 UI application does not get called to front of user environment when a selection is made. Hugh to update UI application to bring to front when selected Hugh
    8 On Hold Standardisation of programmer error messages/errorlevels. On hold. This may be too difficult. Evan to assess challenges with respect to standardisation of programmer error messages/errorlevels. Evan
    9 Open It is easy to drag and drop in error in the UI. Add a line above 'Other Available Programmers' as those with shaky hands will find the UI hard to use. Hugh
    10 Open The UI is not clear with respect to edit and drag&drop Hover in UI should state 'Click to select then use 'Edit', or use Drag and Drop to move a programmer. Hugh
    11 Closed When using HEX&Flash. No programmer selected in UI..... no message If there is no programmer in default listing the source is compiled and output reports "flashing OK." There is no user message. A message is issued when /F or /FO is passed to compiler and no programmer is set. Hugh
    12 Closed Need to be able to produce Clean Build Add option in UI to always clean build when making HEX file and make appropiate changes to compiler. Closed. Compiler now supports cleam build - the IDE batch files have been updated
     

Log in to post a comment.