• AVR Freaks

PICC 9.70

Author
dps
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2010/01/11 10:58:06
  • Location: 0
  • Status: offline
2010/01/11 12:38:38 (permalink)
0

PICC 9.70

Does anyone have experience with PICC 9.70?

I just updated PICC to 9.70 when I  updated MPLAB IDE to 8.43.  A previously working project caused cgpic.exe to crash.  The same project builds successfully with 9.65PL1.
#1

7 Replies Related Threads

    art.milburn@plantron
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2010/01/11 15:43:04
    • Location: 0
    • Status: offline
    RE: PICC 9.70 2010/01/11 15:47:50 (permalink)
    0
    I am seeing a similar crash.  Looks like it's associated with fixups.  My inherited codebase has a couple of asm("goto _xxxxxxx"); statements embedded in C modules.  When I get rid of those questionable constructs, linking proceeds.
    #2
    DougL
    New Member
    • Total Posts : 22
    • Reward points : 0
    • Joined: 2004/09/16 16:46:33
    • Status: offline
    RE: PICC 9.70 2010/01/26 18:48:56 (permalink)
    0
    I have encountered the same problem.  My project compiles fine in Standard but gets the cgpic.exe error in PRO mode (v9.70 on WIndows XP SP3).  I am working with a PIC 16F1937.  I tried removing all "goto" commands but that did not help (I only used a couple).
     
    I have submitted a request to Hi-Tech for assistance on this since I just purchased the PRO version.
    #3
    DougL
    New Member
    • Total Posts : 22
    • Reward points : 0
    • Joined: 2004/09/16 16:46:33
    • Status: offline
    RE: PICC 9.70 2010/01/26 21:13:41 (permalink)
    0
    I received a reply from Hi-Tech, they suggested updating to their latest candidate build:
     
    ftp://ftp.htsoft.com/customers/a13930/HCPIC-pro-9.70PL1.5720.exe

    It is 9.70PL1.5720.  This has fixed the crash I was experiencing.  My previous version, that I downloaded today, was 9.70.0.5239
     
    In the release notes they say that one bug fixed was:
     
    Code generator crashes (9.70PL1) The code generator might have crashed when compiling projects that contained an interrupt function.
     
    Good luck!
     
    #4
    parkescape
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2010/01/27 17:08:41
    • Location: 0
    • Status: offline
    RE: PICC 9.70 2010/01/27 17:15:29 (permalink)
    0
    I've been wrestling with the same error - windows message telling me that cgpic.exe has stopped working, and no other information when attempting to compile unchanged code that had previously compiled correctly and is running in chips.
     
    I just got feedback from the Microchip support team that the compiler does not support indirect function calls from both the main code and interrupt code. Sure enough, if I comment out the calls to common functions in the interrupt routine, it compiles correctly.
     
    This seems to be a fairly serious short coming to me - but I'm new to this so would appreciate others' input. The manual explicity states that the compiler will handle this.
     
    I can duplicate all the functions I wrote that I call from the interrupt routine, but one of the primary problem ones is _ms_delay which is supplied with the compiler and is a fundamental routine that I use every where.
     
    Regards, Andy

    Andy
    #5
    DougL
    New Member
    • Total Posts : 22
    • Reward points : 0
    • Joined: 2004/09/16 16:46:33
    • Status: offline
    RE: PICC 9.70 2010/01/27 18:08:00 (permalink)
    0
    Andy,
     
    My crash was not the same as yours because I don't call functions from my interrupt routine.  Plus I am using the PIC 10/12/16 compiler and don't know what PIC you are using.
     
    I believe you can call the same functions from the main code and interupt code.  The problem is when you call them indirectly (i.e. via a pointer).  Hi-Tech automatically duplicates any functions that are called by an interrupt routine, but it can't do that if they are called indirectly because the compiler doesn't know where they will end up.  You can use indirect calls from either the main code or the interrupt code, but not both (based on what I read).
     
    The __delay_ms is actually a macro, so you should be able to use it in the interrupt routine.
     
    These are just some quick thoughts, I only have about 2 months experience with the latest Hi-Tech compiler.  I did use an earlier version several years ago.
     
    Good luck,
     
    Doug
     
     
     
    #6
    parkescape
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2010/01/27 17:08:41
    • Location: 0
    • Status: offline
    RE: PICC 9.70 2010/01/27 18:49:21 (permalink)
    0
    Thanks Doug - I am using the Pic 10/12/16 compiler with a PIC16F886. And the code compiled and ran fine with an older version of the compiler.
     
    Microchip specifically called out _delay_ms as the problem in my code. Here's their note:=
     
    "This is a limitation of the compiler v9.70.
     
    You cannot indirectly call the same functions from both main-line and interrupt code. Indirect calls are possible from either call graph (and direct calls are not affected), but not from both.
     
    We will look for improvements to this situation, but just at the moment the changes introduced into 9.70 have made it extremely difficult to implement this.
     
    Our apologies for this situation.
     
    In the code that you attached the function:
     
          __delay_ms
     
    is called both from the main line and interrupt and this is causing the crash. "
     

    I'm relatively new to C so maybe I'm misunderstanding something re direct and indirect calls. My interrupt routine calls other functions which then call _delay_ms so presume this is what they mean by indirect calls? I'm not (intentionally!) doing anything with pointers!
     
    Regards, Andy

    #7
    DougL
    New Member
    • Total Posts : 22
    • Reward points : 0
    • Joined: 2004/09/16 16:46:33
    • Status: offline
    RE: PICC 9.70 2010/01/27 22:07:11 (permalink)
    0
    Andy,
     
    __delay_ms() is a macro that calls _delay().  I found the macro defined in pic.h.  You might try calling _delay() directly instead of __delay_ms().  It is possible that the latest version of the compiler has redefined how __delay_ms() or _delay is implemented, thus causing the problem that you didn't have with an older version. 
     
    I'd suggest you get the candidate build I mentioned in the earlier post.  If your code generator (cgpic.exe) is crashing that might correct the problem.  My code compiled fine in the Lite version yet the PRO version crashed until I got the update.  My guess is that your code is fine, the compiler is stumbling on something that it shouldn't.
     
    Contacting Hi-Tech directly might be faster also.  I got a very quick response, though I did just pay for a PRO license (ouch).
     
    Good luck,
     
    Doug
     
    #8
    Jump to:
    © 2020 APG vNext Commercial Version 4.5