• AVR Freaks

Hot!Migrating from C30 to XC16, what has changed???

Author
BobAGI
Super Member
  • Total Posts : 1725
  • Reward points : 0
  • Joined: 2011/03/09 00:04:35
  • Location: Texas and Sweden
  • Status: offline
2014/11/05 03:06:48 (permalink)
0

Migrating from C30 to XC16, what has changed???

I have a number of projects developed using C30 but now updates on C30 seem to have stopped so new parts are not covered.
So my question now is if I am to move to XC16 instead, what are the differences between the two tool chains?
Are there any gotchas that will stop me from being able to build without modifications to the project code?
What needs to be done in linker scripts (most of my projects use custom scripts in order to handle boot loader functionality) and in main project files?
Anything else one has to be aware of?
Is there a converter from C30 projects to XC16?
 

--
Bo B
Sweden & Texas
 
#1

12 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 18038
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Migrating from C30 to XC16, what has changed??? 2014/11/05 08:17:13 (permalink)
    +1 (1)
    Build and Try it.
    There is no C30 because they renamed it to XC16.  It is still GCC.  But it is a newer version of GCC.
    #2
    BobAGI
    Super Member
    • Total Posts : 1725
    • Reward points : 0
    • Joined: 2011/03/09 00:04:35
    • Location: Texas and Sweden
    • Status: offline
    Re: Migrating from C30 to XC16, what has changed??? 2014/11/05 08:56:18 (permalink)
    0
    Well build & try means that I must be able to select the XC16 tool chain in my IDE.
    I am not using MPLAB-X and I don't think MPLAB-8 is able to work with XC16. That would be my backup plan for an IDE
    I am an EmBlocks user, but Gerard has not included support for XC16 yet.
     
    If they just renamed it from C30 to XC16 it should be able to use the same makefile and linker scripts etc, right?
    But was it really that simple when they did the change?

    --
    Bo B
    Sweden & Texas
     
    #3
    btbass
    Super Member
    • Total Posts : 360
    • Reward points : 0
    • Joined: 2004/12/10 13:50:32
    • Status: offline
    Re: Migrating from C30 to XC16, what has changed??? 2014/11/05 09:19:47 (permalink)
    +2 (2)
    I have had no trouble switching.
    Mplab8 works fine with XC16.
    You can also use it in EmBlocks. Just go to 'Settings/Tools', then choose PIC30 MPLAB Compiler, (I assume thats what your using), then select the 'Toolchain executables' tab, then simply use the browse buttons to point to the xc16 compiler, linker, assembler, etc.
    #4
    balmerjd
    Super Member
    • Total Posts : 554
    • Reward points : 0
    • Joined: 2011/03/31 09:18:20
    • Location: Urbana, Ohio
    • Status: offline
    Re: Migrating from C30 to XC16, what has changed??? 2014/11/05 10:19:15 (permalink)
    0
    Doesn't the XC16 compiler installation have an option to make it "compatible" with MPLAB 8 as one of the options you pick during the install?
    #5
    NKurzman
    A Guy on the Net
    • Total Posts : 18038
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Migrating from C30 to XC16, what has changed??? 2014/11/05 15:03:11 (permalink)
    0
    I installed XC16 on a PC with only  MPLab 8 I do not remember it asking anything special.
    #6
    DarioG
    Allmächtig.
    • Total Posts : 54081
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: Oesterreich
    • Status: offline
    Re: Migrating from C30 to XC16, what has changed??? 2014/11/05 15:06:15 (permalink)
    0
    Yep, XC16 does work inside MPLAB classic.

    GENOVA :D :D ! GODO
    #7
    drazen
    Super Member
    • Total Posts : 2847
    • Reward points : 0
    • Joined: 2003/11/07 12:43:09
    • Location: Croatia
    • Status: offline
    Re: Migrating from C30 to XC16, what has changed??? 2014/11/05 15:18:47 (permalink)
    +1 (1)
    There are differences between C30 and XC16. XC will warn you when mismatching various pointer types like __prog__.
    For example this code will compile and run without any problems in C30 but will issue an error in XC
     const BYTE __prog__ arrFLASH[] = { 0, 1, 2, .... };
    BYTE arrRAM[];
    memcpy(arrRAM, arrFLASH, 10);

    Question is is this ok or not. memcpy is "atomic" function and if PSV is changed before call and restored after.....
    So, XC will give an error.
     
    There are new features, eg beside __prog__, etc now there is pack_upper_byte option to use all 3 bytes of FLASH.
    #8
    balmerjd
    Super Member
    • Total Posts : 554
    • Reward points : 0
    • Joined: 2011/03/31 09:18:20
    • Location: Urbana, Ohio
    • Status: offline
    Re: Migrating from C30 to XC16, what has changed??? 2014/11/06 06:23:15 (permalink)
    0
    Perhaps I was thinking of the XC8 or XC32 install...  I just did all three on my home desktop about 2 weeks ago and I specifically remember one of them having a check box about compatibility or being able to be used in MPLAB 8.  Thought the weird thing was only one of the three installs had the option...
    #9
    Avana
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2017/04/19 02:14:25
    • Location: 0
    • Status: offline
    Re: Migrating from C30 to XC16, what has changed??? 2019/11/22 05:43:55 (permalink)
    -1 (1)
    need  migration document from xc8 to xc 16. please suggest. thanks
     
    #10
    NKurzman
    A Guy on the Net
    • Total Posts : 18038
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Migrating from C30 to XC16, what has changed??? 2019/11/22 07:14:16 (permalink)
    +1 (1)
    I doubt there is one.
    The hardware differences will be most of the work.
    #11
    Pusb
    Moderator
    • Total Posts : 106
    • Reward points : 0
    • Joined: 2004/02/09 09:47:27
    • Status: offline
    Re: Migrating from C30 to XC16, what has changed??? 2019/11/25 15:21:00 (permalink)
    0
    For 8-bit to 16-bit migration, aside from hardware differences, other common things to watch out for are pointed out in this doc:
    http://ww1.microchip.com/downloads/en/DeviceDoc/PIC18F-to-PIC24F-Software-Migration-Guide-DS00003146A.pdf
     
    other resources:
    https://www.microchip.com/design-centers/8-bit/resources/pic18-to-pic24-migration
    (has link to doc describe hardware differences as well..)
    #12
    ric
    Super Member
    • Total Posts : 24593
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Migrating from C30 to XC16, what has changed??? 2019/11/25 15:28:41 (permalink)
    0
    C30 and XC16 are both 16 bit....
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #13
    Jump to:
    © 2019 APG vNext Commercial Version 4.5