• AVR Freaks

Hot!MPLABX XC32 v2.40 Released

Page: 12 > Showing page 1 of 2
Author
mpgmike
Super Member
  • Total Posts : 421
  • Reward points : 0
  • Joined: 2014/01/23 17:27:06
  • Location: NJ
  • Status: offline
2020/02/25 13:16:42 (permalink)
0

MPLABX XC32 v2.40 Released

https://www.microchip.com/mplab/compilers

I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.
#1

23 Replies Related Threads

    al_bin
    Super Member
    • Total Posts : 196
    • Reward points : 0
    • Joined: 2011/02/11 06:28:47
    • Location: 0
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/02/25 17:05:44 (permalink)
    +1 (1)
    Yes, free version generated code (O1) is about 5% larger then from 2.30
    Sample disassembly:
     
     
    30:                             led->R = _myMath(cTime, ch->bright, R_OMEGA);
    9D0040D6  41A29D00   LUI V0, 0x9D00
    9D0040D8  9D00FE82   LWC1 F8, -382(ZERO)
    9D0040DA  FE825EA0   LW S4, 24224(V0)
    9D0040DE  FEA25EA4   LW S5, 24228(V0)
    9D004102  FC560010   LW V0, 16(S6)
    9D004104  00106A20   MUL   T5, S0, ZERO                        !!!!!  New line  in 2.40 version  !!!!!
    9D004106      6A20   LW A0, 0(V0)
    9D004108  14B60004   LBU A1, 4(S6)
    9D00410C      0CD4   MOVE A2, S4
    9D00410E  768025C8   JALS .LFB11, _myMath, .LVL0
    9D004110      25C8   SLL V1, A0, 4
    9D004112      0CF5   MOVE A3, S5
    9D004114  18570001   SB V0, 1(S7)


     
    Albert 
    post edited by al_bin - 2020/02/25 17:12:20
    #2
    JasonK
    Moderator
    • Total Posts : 3406
    • Reward points : 0
    • Joined: 2003/11/14 09:49:40
    • Location: Microchip Technology in Arizona, USA
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/02/26 07:11:02 (permalink)
    +2 (2)
    I can't recall any changes or bug fixes that would cause a code-size increase. Can you enter a support ticket with the source file as described here? https://www.microchip.com/forums/m734086.aspx We will have someone take a look at it.
     
    I should also note that the -O2 optimization level is also now available for free.
     

    Jason Kajita
     Follow me on Twitter
    http://support.microchip.com for urgent questions
    #3
    JasonK
    Moderator
    • Total Posts : 3406
    • Reward points : 0
    • Joined: 2003/11/14 09:49:40
    • Location: Microchip Technology in Arizona, USA
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/02/26 07:13:07 (permalink)
    +4 (4)
    Someone just reminded me that the 'double' type is now 64 bits wide by default instead of 32 bits wide. Use the 'float' type for a 32-bit floating-point type. This makes the types more consistent between the ARM targets and the MIPS targets and also sets us up for some future improvements.

    Jason Kajita
     Follow me on Twitter
    http://support.microchip.com for urgent questions
    #4
    al_bin
    Super Member
    • Total Posts : 196
    • Reward points : 0
    • Joined: 2011/02/11 06:28:47
    • Location: 0
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/02/26 11:05:18 (permalink)
    0
    JasonK
    Someone just reminded me that the 'double' type is now 64 bits wide by default instead of 32 bits wide. Use the 'float' type for a 32-bit floating-point type.

    This is my case. After change double to float my code compiles as previous version.
    But total code size grow next 5% because linker add sections:
     
    text.dp32mul
    text.dp32subadd
    text.dptoul
     
    from libm.a
    (even with -O2 and -ffunction-sections -fdata-sections + --gc-sections)
    It is not problem for big members of PIC32 family, but for small   MM is.
     
    Albert
     
    #5
    JasonK
    Moderator
    • Total Posts : 3406
    • Reward points : 0
    • Joined: 2003/11/14 09:49:40
    • Location: Microchip Technology in Arizona, USA
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/02/26 12:40:30 (permalink)
    +1 (1)
    For now, you should be able to use the -fshort-double option, but that option will go away in a release (likely) later this year. You will want to convert your code to use a float instead of a double.

    Jason Kajita
     Follow me on Twitter
    http://support.microchip.com for urgent questions
    #6
    al_bin
    Super Member
    • Total Posts : 196
    • Reward points : 0
    • Joined: 2011/02/11 06:28:47
    • Location: 0
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/02/26 14:11:33 (permalink)
    +2 (2)
    I converted the code before, but forgot to change sin() to sinf().
    Everything works now. Thank you.
     
    Albert
    #7
    simong123
    Lab Member No. 003
    • Total Posts : 1391
    • Reward points : 0
    • Joined: 2012/02/07 18:21:03
    • Location: Future Gadget Lab (UK Branch)
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/02/26 16:11:28 (permalink)
    +1 (1)
    JasonK
    I should also note that the -O2 optimization level is also now available for free.

    That is a *big* improvement :-D
    Didn't see that in the release notes!
    #8
    lcitos
    New Member
    • Total Posts : 24
    • Reward points : 0
    • Joined: 2019/07/01 10:58:01
    • Location: 0
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/02/27 13:27:31 (permalink)
    0
    My data memory was reduced froom 80K to 51K from 2.30 to 2.40. Is this normal?
    BTW, I2C harmony library stops working with 2.40 O2
    #9
    MarkD
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2003/11/07 12:43:55
    • Location: Toronto, Canada
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/03/02 12:23:40 (permalink)
    +1 (1)
    Did anyone find that they get some build errors when using this compiler version?   My project uses the legacy peripheral library, and builds perfectly with XC32 v2.30 but not with this version.
     
    Here is what happens if I select the v2.40 compiler:
     
     
    make -f nbproject/Makefile-XC32_PIC32MX130F256D.mk dist/XC32_PIC32MX130F256D/production/2Mar_BootLoaded_App.X.production.hex
    make[2]: Entering directory 'C:/Users/markd/Documents/projects/XYZ/PIC32/UBI/MAR2020/2Mar/2Mar_BootLoaded_App.X'
    DRIVERS/HAL_uart.c:13:18: fatal error: plib.h: No such file or directory
    #include <plib.h>
    ^
    compilation terminated.
    APP/gestures.c:12:18: fatal error: plib.h: No such file or directory
    #include <plib.h>
    ^
    compilation terminated.
    DRIVERS/at25sf041.c:26:18: fatal error: plib.h: No such file or directory
    #include <plib.h>
     
     
     
     
    #10
    Jim Nickerson
    User 452
    • Total Posts : 6659
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: MPLABX XC32 v2.40 Released 2020/03/02 13:09:05 (permalink)
    -1 (1)
    install the plib library in the new location Smile: Smile
    #11
    steverap
    Super Member
    • Total Posts : 162
    • Reward points : 0
    • Joined: 2003/11/07 12:38:54
    • Location: San Jose, CA, USA
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/03/02 13:09:37 (permalink)
    0
    MarkD
    Did anyone find that they get some build errors when using this compiler version?   My project uses the legacy peripheral library, and builds perfectly with XC32 v2.30 but not with this version.
     
    Here is what happens if I select the v2.40 compiler:
     
     
    make -f nbproject/Makefile-XC32_PIC32MX130F256D.mk dist/XC32_PIC32MX130F256D/production/2Mar_BootLoaded_App.X.production.hex
    make[2]: Entering directory 'C:/Users/markd/Documents/projects/XYZ/PIC32/UBI/MAR2020/2Mar/2Mar_BootLoaded_App.X'
    DRIVERS/HAL_uart.c:13:18: fatal error: plib.h: No such file or directory
    #include <plib.h>
    ^
    compilation terminated.
    APP/gestures.c:12:18: fatal error: plib.h: No such file or directory
    #include <plib.h>
    ^
    compilation terminated.
    DRIVERS/at25sf041.c:26:18: fatal error: plib.h: No such file or directory
    #include <plib.h>



    The "PIC32 Peripheral Library" (includes plib.h) is no longer included in the compiler installation. If you wish to use it, you must install it for every new XC32 compiler version you install.
     
    https://www.microchip.com/SWLibraryWeb/product.aspx?product=PIC32%20Peripheral%20Library
    #12
    NKurzman
    A Guy on the Net
    • Total Posts : 18678
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: MPLABX XC32 v2.40 Released 2020/03/02 14:29:49 (permalink)
    0
    LuisCarlos
    My data memory was reduced froom 80K to 51K from 2.30 to 2.40. Is this normal?
    BTW, I2C harmony library stops working with 2.40 O2



    Which Version of Harmony?
    Historically Harmony has often failed if newer compiler versions than the one it was tested with are used.
    #13
    MarkD
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2003/11/07 12:43:55
    • Location: Toronto, Canada
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/03/02 15:36:58 (permalink)
    0
    Yes I am aware of that and have installed it for all the other XC32 versions, and installed for v2.40 also.  After I got this error, I installed it again but same problem!   I know it's trivial to install it so not sure what the problem is.   I checked in the v2.40 install folder and it appears that the PLIB was installed.
     
    Edit:  I installed the legacy PLIB again and that really screwed things up.   I got a message saying that the BUILD was successful, but then another message saying a project file was missing.    I uninstalled v2.40 and everything is back to normal now.   Maybe in a few days I'll install v2.40 and the PLIB library again.
     
     
    post edited by MarkD - 2020/03/02 16:22:20
    #14
    Jim Nickerson
    User 452
    • Total Posts : 6659
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: MPLABX XC32 v2.40 Released 2020/03/02 16:59:59 (permalink)
    0
    After installing plib it works for me ( though I do not have your sources ).
    Attachments are not available: Download requirements not met
     

    Attachment(s)

    Attachments are not available: Download requirements not met
    #15
    Jim Nickerson
    User 452
    • Total Posts : 6659
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: MPLABX XC32 v2.40 Released 2020/03/02 18:13:04 (permalink)
    0
    I did notice when I copied a source and config from a previous version of MpLab X 5.30 to 5.35 It would not generate a hex file
    The previous configuration had the Debug tool as ICD 4, but was not plugged in.
    I specifically changed the tool to "No Tool", it built as expected
    I plugged in the ICD 4 and it built ok
    I unplugged the ICD 4 and again it built ok.
    #16
    lcitos
    New Member
    • Total Posts : 24
    • Reward points : 0
    • Joined: 2019/07/01 10:58:01
    • Location: 0
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/03/03 02:37:35 (permalink)
    0
    NKurzman
    LuisCarlos
    My data memory was reduced froom 80K to 51K from 2.30 to 2.40. Is this normal?
    BTW, I2C harmony library stops working with 2.40 O2



    Which Version of Harmony?
    Historically Harmony has often failed if newer compiler versions than the one it was tested with are used.


    Last harmony 3. It also breaks with O0..
    #17
    MarkD
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2003/11/07 12:43:55
    • Location: Toronto, Canada
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/03/03 11:32:50 (permalink)
    +1 (1)
    Yes I had it installed.  And when I installed it a second time, it totally screwed up the build environment to that even v2.30 would not build projects from last week!    The solution was to completely remove v2.40 from my PC.
     
    Someone else mentioned some similar problems and also went back to V2.30, but he's posted in a different section of the forum.
    #18
    firstcolle
    New Member
    • Total Posts : 20
    • Reward points : 0
    • Joined: 2013/04/20 00:22:09
    • Location: 0
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/05/03 09:23:57 (permalink)
    -1 (1)
    I noticed that the Data memory usage is always 0%.. even if I use a large memory buffer for images (400KB). 
    I have a program that uses 78% of data memory with XC32 2.30 and 0% with 2.40.
    no matter the optimization level.
    but if I increase the buffer (600kB for example) I get the error "Could not allocate data memory" that is correct...
     
    it seems that the memory counter in MPLAB x doesn't work (mpblab x 5.35)
     
    thanks
    #19
    firstcolle
    New Member
    • Total Posts : 20
    • Reward points : 0
    • Joined: 2013/04/20 00:22:09
    • Location: 0
    • Status: offline
    Re: MPLABX XC32 v2.40 Released 2020/05/04 23:37:26 (permalink)
    +1 (1)
    it seems that XC32 2.40 doesn't take in count the coherent attribute of a variable.. here the map file for the same project compiled with 2.30 and 2.40
     

    XC32 2.40:
    kseg0 Data-Memory Usage
    section                    address  length [bytes]      (dec)  Description
    -------                 ----------  -------------------------  -----------
    .sdata                  0x80000000           0x28          40  Small init data
    .sbss                   0x80000028           0x28          40  Small uninit data
    .bss                    0x80000050          0x488        1160  Uninitialized data
             Total kseg0_data_mem used  :       0x4d8        1240  0.2% of 0x80000
            --------------------------------------------------------------------------
                Total Data Memory used  :       0x4d8        1240  0.2% of 0x80000
            --------------------------------------------------------------------------


    Dynamic Data-Memory Reservation
    section                    address  length [bytes]      (dec)  Description
    -------                 ----------  -------------------------  -----------
    heap                    0x8007c628           0x10          16  Reserved for heap
    stack                   0x8007c650         0x39a8       14760  Reserved for stack 
     
     
    XC32 2.30:
    kseg0 Data-Memory Usage
    section                    address  length [bytes]      (dec)  Description
    -------                 ----------  -------------------------  -----------
    .sdata                  0x80000000           0x28          40  Small init data
    .sbss                   0x80000028           0x28          40  Small uninit data
    .bss                    0x80000050          0x488        1160  Uninitialized data
    .COHERENTBSS$           0x800004e0        0x7c140      508224  
             Total kseg0_data_mem used  :     0x7c618      509464  97.2% of 0x80000
            --------------------------------------------------------------------------
                Total Data Memory used  :     0x7c618      509464  97.2% of 0x80000
            --------------------------------------------------------------------------


    Dynamic Data-Memory Reservation
    section                    address  length [bytes]      (dec)  Description
    -------                 ----------  -------------------------  -----------
    heap                    0x8007c628           0x10          16  Reserved for heap
    stack                   0x8007c650         0x39a8       14760  Reserved for stack 
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5