0
\$\begingroup\$

I was previously compiling my C and C++ PIC32 mcu project in Microchip's MPLAB X IDE v6.15 with a paid Pro XC32 compiler license. My license has expired and no amount of buying a new one will fix it, so meanwhile I'd like to compile with the free license.

On Linux Ubuntu 22.04, I reinstalled the license, but this time chose the "Free" option at the end of the installer process, and yet the compiler is still complaining about the license being gone.

Everything on the Microchip website indicates that the free compiler should work just fine: https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers# (emphasis added):

Are you looking for code optimizations? Our free MPLAB XC C Compiler comes with the majority of the optimizations you need to reduce your code size and increase its efficiency. If you're unsure which optimizations are best for your design, our free MPLAB XC Compiler Advisor can help you find the best optimizations for your project. Specifically, the free compiler contains these optimizations:

  • O0 - Ensures that your code is in its pristine state
  • O1 - Invokes all optimizations that won't affect debugging
  • O2 - Invokes a balanced set of speed and size optimizations

When you purchase one of our PRO licenses, you also get the following optimizations:

  • Os - Gives maximum code size reductions
  • O3 - Gives the best speed optimizations
  • mpa (Procedural Abstraction) - Reduces code size even further

My gcc optimization level is set to 1:

enter image description here

And my g++ optimization level is also 1:

enter image description here

Yet, I still get this error when building:

Subscription License has not been renewed - the activation server "http://keyverify.microchip.com" gave the unexpected result -160

License has expired

So, what project settings do I need to change to make it build with the free compiler?

Note that at one point I also tried deleting my license file at /opt/microchip/xclm/license/microchip-1.lic, but I got the same result. (Though maybe I needed to close and reopen the project, not just the IDE?)

It's possible I'm misunderstanding the license. Is it free only for C, not C++ projects? I can't find that documented anywhere though.


Note: If anyone in the community wants to work on using a free, GPL, non-paid XC32 compiler, join me here: https://github.com/ElectricRCAircraftGuy/Microchip_XC32_Compiler

\$\endgroup\$
9
  • \$\begingroup\$ Per your linked post from your other question, I offer the same advice: contact Microchip. What is the hesitancy? I used to work with Microchip on a regular basis. They provide excellent support. \$\endgroup\$
    – Colin
    Dec 29, 2023 at 17:42
  • \$\begingroup\$ @C__, as I mentioned at the bottom of my other answer: I've opened a support ticket, emailed, posted on the forum, and called, for three days now, and have reached nobody. This is blocking my professional work so I'm looking at all options. \$\endgroup\$ Dec 29, 2023 at 18:32
  • 1
    \$\begingroup\$ Truthfully this sounds like a software issue. My best recommendation is to backup your projects, uninstall and reinstall the software with the free usage license, and make sure you don't have any configuration files that the software claims that you once had the premium license. I'm sure there's a file somewhere that says that you once had a premium license. \$\endgroup\$
    – Colin
    Dec 29, 2023 at 18:37
  • 1
    \$\begingroup\$ View Compiler FAQs contains The license file will allow compiling with your chosen optimization options from -O1 -O2 -O3 or -Os.. Does that mean with the free compiler the optimization level must be set to O0 (i.e. no optimization)? \$\endgroup\$ Dec 29, 2023 at 18:47
  • 1
    \$\begingroup\$ Have you tried this link: microchip.com/xcdemo/xcpluspromo2.aspx?id=step2 \$\endgroup\$
    – Rodo
    Jan 1 at 3:01

1 Answer 1

4
\$\begingroup\$

@Rodo's link works!--so long as the Microchip license server is up (it's been down the last two weeks or so at the end of 2023, but is up as of 2 Jan. 2024).

Setup notes:

Tested in Linux Ubuntu 22.04 with MPLAB X IDE v6.15 and XC32 compiler v1.42 (very old) and v4.35 (the latest version).

How to install the free XC32++ compiler license (including .gitignore setup and refreshing the project)

Shorter summary

  1. Download and install the latest MPLAB X IDE: https://www.microchip.com/en-us/tools-resources/develop/mplab-x-ide

    The latest at the time of this writing is v6.15.

    The latest IDEs work with even the oldest XC32 compilers and do not affect compilation output.

  2. Download and install the XC32 compiler of your choice: https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers/xc32

    Use whatever your project or company requires. Even old compilers such as v1.42 work fine with the latest IDEs and the free license below.

    The latest XC32 compiler at the time of this writing is v4.35.

  3. Download and install a free XC32 compiler license: https://www.microchip.com/xcdemo/xcpluspromo2.aspx?id=step2

    For the "Your MAC Address" box, enter the "Host id" as shown in the output of xclm -hostinfo. On Linux and Mac, run that in the terminal. On Windows, run that in the Command Prompt (cmd.exe) or in the Git Bash terminal. This xclm XC32 Compiler License Manager command-line tool was installed for you when you installed the XC32 compiler above.

    The "Host id" shown by that command is the same as:

    1. On Linux: the first MAC address (without any colons) shown in the output of ip link show | grep ether.
    2. On Windows: one of the MAC addresses (it seems to change on me) shown in the output of ipconfig /all | findstr "Physical Address", when run in the Command Prompt (cmd.exe).

    If you use the wrong host ID, the license will fail to work in the end and you'll get this error when you try to build:

    error: MPLAB XC32 C++ license not activated
    
  4. With the MPLAB X IDE, XC32 compiler, and a free compiler license all installed, you can now compile C or C++ in the IDE up to optimization level -O1 without any warnings or issues.

    There are no program size constraints with the free compiler license.

    For full support of optimization levels > -O1, you'll need to buy a pro license or compile a license-free version of the XC32 compiler from source yourself.

    1. Pro licenses are here; there are various options: https://www.microchip.com/en-us/tools-resources/develop/mplab-xc-compilers/licenses.
      1. The subscription license is probably the cheapest, at < $50/month, and is what I use. But, if the license renewal server is down and it's time for your license to auto-renew, you may lose your ability to compile for days or weeks, which has happened to me. Get it here: https://www.microchip.com/en-us/development-tool/SW006023-SUB.

More details, and screenshots

  1. Ensure you have downloaded and installed the MPLAB X IDE and an XC32 compiler. Once you have extracted the compiler down to a .run file, such as xc32-v4.35-full-install-linux-x64-installer.run, the installation command in Linux looks like this:

    chmod +x xc32-v4.35-full-install-linux-x64-installer.run
    sudo ./xc32-v4.35-full-install-linux-x64-installer.run
    

    During the install, you'll see this window where you get to choose the "Free" license option. In my experience (perhaps just with their older XC32 compilers, since I'm using an older version actually), this selection does absolutely nothing and means absolutely nothing:

    enter image description here

    When the installer completes, you can confirm you have no free license whatsoever by looking in the /opt/microchip/xclm/license dir. A free license would be here: /opt/microchip/xclm/license/xc32fpp-1.lic.

    Note: here are the license directory paths for all three main OSs:

    • Windows - %SystemDrive%\ProgramData\Microchip\xclm\license
    • Mac - /Library/Application\ Support/microchip/xclm/license
    • Linux - /opt/microchip/xclm/license

    You can also find the license path by running this command:

    xclm -licensepath
    

    The generic help menu can be shown like this, but I don't know how to use the other commands nor what they're useful for, yet:

    xclm
    

    If you try to build, you may see this:

    main.cpp:1:0: note: Visit http://www.microchip.com/MPLABXCcompilers to acquire a free C++ license
    make[0]: *** [nbproject/Makefile-MY_PROJECT.mk:3943: build/MY_PROJECT/production/_ext/935690222/my_file.o] Error 255
    another_file.cpp:1:0: error: MPLAB XC32 C++ license not activated
    

    You have no "activated" free license!

  2. So, as @Rodo said, go here to download a free license!: https://www.microchip.com/xcdemo/xcpluspromo2.aspx?id=step2. Use that link exactly. The ?id=step2 part at the end is required.

    You'll see this: enter image description here.

    In the "Your MAC Address" box, enter the MAC address (without any colons) shown in the first line of the output of this command:

    ip link show | grep ether
    

    So, if your output looks like this:

    $ ip link show | grep ether
    link/ether 01:02:03:04:05:06 brd ff:ff:ff:ff:ff:ff
    link/ether 0c:0b:0a:09:08:07 brd ff:ff:ff:ff:ff:ff
    link/ether 0d:0e:0f:1a:1b:1c brd ff:ff:ff:ff:ff:ff
    

    ...then the MAC address you should enter is: 010203040506.

    You can confirm this by running this command:

    xclm -hostinfo
    

    where xclm is the XC32 License Manager executable that is now installed on your system since you ran the XC32 compiler installer above. which xclm shows that it is located in /opt/microchip/xc32/v4.35/bin/xclm, for instance.

    The output of xclm -hostinfo looks like this. Notice that the "host id" is the same as the MAC address we entered above:

    Host id is:
    010203040506
    Host name is:
    gabriel-my-computer
    

    Then, choose your OS from the dropdown and click the Get free XC32++ license button.

    Microchip's license server will make a custom free license for you, so long as it is working. I has been down for several weeks at the end of 2023/beginning of 2024, hence my question here. I don't know if this https://www.microchip.com/xcdemo/xcpluspromo2.aspx?id=step2 link worked during that time.

    You'll now get to download a file called cpluslic.sh, for instance.

  3. Install the license.

    On Linux, the commands are:

    chmod +x cpluslic.sh
    ./cpluslic.sh
    

    You'll see this output:

    Detected operating system: Linux
    
    Creating license file /opt/microchip/xclm/license/xc32fpp-1.lic
    

    You'll now see a license file at /opt/microchip/xclm/license/xc32fpp-1.lic.

    Notes:

    1. Running this .sh license installer will fail if you haven't installed an XC32 compiler yet. The license installer looks for the existence of the /opt/microchip/xclm/license dir to see if you have the compiler installed, and fails if that directory doesn't exist.

    2. If you open your installed license file in a text editor (ex: run code /opt/microchip/xclm/license/xc32fpp-1.lic to open it in MS VSCode), you'll see the words permanent uncounted in it, which means that this free license never expires! That's great! If it expires, you'll see an expiration date there instead, such as this: 27-dec-2023 uncounted. In my paid, monthly-subscription Pro licenses, they expire every month. That full line in the license file looks like this (expires 27 Dec. 2023 in this case):

      LICENSE microchip swxc32-cpp 1.0 27-dec-2023 uncounted
      

      or this (never expires):

      LICENSE microchip swxc32-fpp 1.1 permanent uncounted
      
    3. My experimentation shows that:

      1. The name of the license file doesn't really matter, so you can rename them to help you keep track of your licenses. Ex: here I have added _free and _pro to the end of my default license file names so I can remember which is which: all inside the /opt/microchip/xclm/license dir:

        microchip-1_pro.lic  # my old, expired XC32 Pro license
        microchip-2_pro.lic  # my new, valid XC32 Pro license I just installed!
        xc32fpp-1_free.lic   # my FREE XC32 license I installed as a work-around
        
      2. You can have multiple licenses installed at once, but if a pro license exists, the IDE will try to use the latest pro license even if it is expired. So, to force your free license to be used instead, move all pro licenses out of the license directory.

      3. If multiple pro licenses are installed, the latest one will be used, so there is no need to delete old pro licenses as you renew and install new pro licenses. For more on this, see my answer here: How to renew your paid Microchip XC32 Compiler Pro license when it has expired or is about to expire.

  4. Refresh the project in the IDE, and delete auto-generated content that should be ignored.

    Note: I don't know if this part is strictly required here, but I've found that in git checkouts the MPLAB X IDE and the configuration files frequently get out of sync, as the IDE only reads the project config files at certain times, and it uses and writes back old/stale/wrong data if you don't do this. So, it's not a bad idea to do this after any git checkout which modifies the project configuration file, or whenever making big settings changes such as to license files.

    Close your project in the IDE (right-click it --> Close), then close the IDE.

    Manually delete all auto-generated content and build files, and commit the change to git:

    cd MyProject.X
    rm -r \
        .generated_files/ \
        build/ \
        dist/ \
        nbproject/Makefile-* \
        nbproject/Package-* \
        nbproject/private/ \
        private/ \
        debug/
    git add -A
    git commit -m "Remove auto-generated files"
    

    Run prjMakefilesGenerator MyProject.X to regenerate the build files. I have prjMakefilesGenerator as a symlink (in my PATH) pointing to /opt/microchip/mplabx/v6.15/mplab_platform/bin/prjMakefilesGenerator.sh. If you don't, run it explicitly instead:

    /opt/microchip/mplabx/v6.15/mplab_platform/bin/prjMakefilesGenerator.sh path/to/MyProject.X
    

    Then, re-open the IDE, and reopen the MyProject.X project directory.

    Additional notes:

    1. To properly ignore the auto-generated files, add this to your .gitignore file too. From my .gitignore file for MPLAB X IDE projects here:

      # MPLAB X Generated Project Files
      .generated_files/
      build/
      dist/
      **/nbproject/Makefile-*
      **/nbproject/Package-*
      **/nbproject/private/
      private/
      
    2. Once you've manually deleted the above files once and committed this change to git, and you have created the .gitignore file with the contents above, you can forcefully remove all ignored files next time with my git-rm_ignored_files.sh script from my eRCaGuy_dotfiles repo. It calls git clean -Xdn and git clean -Xdf which do this.

  5. (Optional) View your license in the MPLAB X IDE via Tools --> Licenses --> Change Licensing Type.

  6. Voilà! You can now compile!

    Click the little arrow to the right of this button here:

    enter image description here

    And select "Clean and Build", as shown here:

    enter image description here

    In the build output window at the bottom-right of the IDE, you'll see CLEAN SUCCESSFUL (total time: 51ms) in green at the top of the build output. Several seconds (or dozens of seconds for large projects) later, you'll see this at the bottom of the build output, with the BUILD SUCCESSFUL (total time: 9s) part in green:

    BUILD SUCCESSFUL (total time: 9s)
    Loading code from /home/gabriel/GS/dev/my_repo/MyProject.X/dist/default/production/MyProject.X.production.hex...
    Program loaded with pack,PIC32MZ-EF_DFP,1.3.58,Microchip
    Loading completed
    

    The build was successful!

    This free license file appears to work on any version of the XC32 compiler, including very old versions such as XC32 v1.42, as well as the newest versions such as v4.35, which is currently the latest.

    The free license works perfectly fine, for both C and C++, even with optimization level -O1 set for both of them. Using higher optimization levels than that will still build successfully, but will produce a warning that "Optimization level > 1" is ignored and not supported by the free license version of the compiler. See my test results below. Therefore, for full support of optimization levels > -O1, you'll need to buy a pro license or compile a license-free version of the XC32 compiler from source yourself.

You can stop reading here if that's all you needed.


Testing compiler optimization levels with the free compiler license

My microcontroller has:

  • RAM: 512 KiB
  • Flash: 2 MiB

I tested all optimization levels with the free compiler, using XC32 version 1.42 (I know, very old), setting the optimization level in both the xc32-gcc and xc32-g++ settings at the same time. See screenshots in the question for these settings. Get my size_mcu script to run on the .elf firmware files from my eRCaGuy_dotfiles repo.

The xc32-size executable is located at /opt/microchip/xc32/v1.42/bin/xc32-size.

Here are the results with the free compiler, to see which optimization levels it accepts and how this affects the build size:

  1. -O0 - builds successfully

    1. Size reported in the bottom-left GUI window in the IDE:
      1. Data Used: 480190 bytes (92%)
      2. Program Used: 1739476 bytes (83%)
    2. Size reported by my size_mcu script:
      $ size_mcu xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf --flash 2097152 --ram 524288
      size_info = 'xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf' = 
      
      text     rodata    data     bss     dec     hex filename
      1242536  496964   16789  464225 2220514  21e1e2 MyProject.X/dist/default/production/MyProject.X.production.elf
      
      FLASH used . . . . . . . . .  = 1756289 bytes ( 83.746%). Remaining is  340863 bytes ( 16.254%). . . . . . . . . . . . . . . . . . . . . . . . .  Max is 2097152 bytes.
      SRAM used by global variables =   16789 bytes (  3.202%). Remaining is  507499 bytes ( 96.798%) for local (stack) variables or RTOS stack & heap. Max is  524288 bytes.
      
  2. -O1 - builds successfully

    1. Size reported in the bottom-left GUI window in the IDE:
      1. Data Used: 478878 bytes (91%)
      2. Program Used: 1283428 bytes (61%)
    2. Size reported by my size_mcu script:
      $ size_mcu xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf --flash 2097152 --ram 524288
      size_info = 'xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf' = 
      
      text     rodata    data     bss     dec     hex filename
      789524   493928   15709  463993 1763154  1ae752 MyProject.X/dist/default/production/MyProject.X.production.elf
      
      FLASH used . . . . . . . . .  = 1299161 bytes ( 61.949%). Remaining is  797991 bytes ( 38.051%). . . . . . . . . . . . . . . . . . . . . . . . .  Max is 2097152 bytes.
      SRAM used by global variables =   15709 bytes (  2.996%). Remaining is  508579 bytes ( 97.004%) for local (stack) variables or RTOS stack & heap. Max is  524288 bytes.
      
  3. -O2 - ignores the option and builds successfully at approximately the O1 level; produces the following warning while compiling:

    main.c:1:0: warning: Compiler option (Optimization level > 1) ignored 
    because the free XC32 C compiler does not support this feature. 
    [enabled by default]
    //
    ^
    cc1: note: Disable the option or visit 
    http://www.microchip.com/MPLABXCcompilers to purchase a new MPLAB XC 
    compiler license.
    

    Notice that in the size results below, the "Data Used" is exactly identical to the O1 results above, but the "Program Used" is slightly larger. Also, comparing the O1 and O2 hex files using meld shows that they differ significantly. So, I don't know what the compiler is doing here, but it's definitely not O2, and is not quite the same thing as O1!

    1. Size reported in the bottom-left GUI window in the IDE:
      1. Data Used: 478878 bytes (91%)
      2. Program Used: 1288296 bytes (61%)
    2. Size reported by my size_mcu script:
      $ size_mcu xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf --flash 2097152 --ram 524288
      size_info = 'xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf' = 
      
      text     rodata    data     bss     dec     hex filename
      794372   493948   15709  463993 1768022  1afa56 MyProject.X/dist/default/production/MyProject.X.production.elf
      
      FLASH used . . . . . . . . .  = 1304029 bytes ( 62.181%). Remaining is  793123 bytes ( 37.819%). . . . . . . . . . . . . . . . . . . . . . . . .  Max is 2097152 bytes.
      SRAM used by global variables =   15709 bytes (  2.996%). Remaining is  508579 bytes ( 97.004%) for local (stack) variables or RTOS stack & heap. Max is  524288 bytes.
      
  4. -O3 - ignores the option and builds successfully at approximately the O1 level. It produces the same warning as the -O2 option above, and its size results differ slightly from both the -O1 and -O2 options above.

    Same type of warning:

    main.c:1:0: warning: Compiler option (Optimization level > 1) ignored 
    because the free XC32 C compiler does not support this feature. 
    [enabled by default]
    //
    ^
    cc1: note: Disable the option or visit 
    http://www.microchip.com/MPLABXCcompilers to purchase a new MPLAB XC 
    compiler license.
    
    1. Size reported in the bottom-left GUI window in the IDE:
      1. Data Used: 478874 bytes (91%)
      2. Program Used: 1288072 bytes (61%)
    2. Size reported by my size_mcu script:
      $ size_mcu xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf --flash 2097152 --ram 524288
      size_info = 'xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf' = 
      
      text     rodata    data     bss     dec     hex filename
      794148   493948   15709  463989 1767794  1af972 MyProject.X/dist/default/production/MyProject.X.production.elf
      
      FLASH used . . . . . . . . .  = 1303805 bytes ( 62.170%). Remaining is  793347 bytes ( 37.830%). . . . . . . . . . . . . . . . . . . . . . . . .  Max is 2097152 bytes.
      SRAM used by global variables =   15709 bytes (  2.996%). Remaining is  508579 bytes ( 97.004%) for local (stack) variables or RTOS stack & heap. Max is  524288 bytes.
      
  5. -Os - ignores the option and builds successfully at approximately the O1 level, but a tiny bit smaller in program space. It produces the same warning as the -O2 and -O3 options above, and its size results differ slightly from both the -O1 and -O2 options above.

    Same type of warning:

    main.c:1:0: warning: Compiler option (Optimization level > 1) ignored 
    because the free XC32 C compiler does not support this feature. 
    [enabled by default]
    //
    ^
    cc1: note: Disable the option or visit 
    http://www.microchip.com/MPLABXCcompilers to purchase a new MPLAB XC 
    compiler license.
    
    1. Size reported in the bottom-left GUI window in the IDE:
      1. Data Used: 478878 bytes (91%)
      2. Program Used: 1244452 bytes (59%)
    2. Size reported by my size_mcu script:
      $ size_mcu xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf --flash 2097152 --ram 524288
      size_info = 'xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf' = 
      
      text     rodata    data     bss     dec     hex filename
      750360   494116   15709  463993 1724178  1a4f12 MyProject.X/dist/default/production/MyProject.X.production.elf
      
      FLASH used . . . . . . . . .  = 1260185 bytes ( 60.090%). Remaining is  836967 bytes ( 39.910%). . . . . . . . . . . . . . . . . . . . . . . . .  Max is 2097152 bytes.
      SRAM used by global variables =   15709 bytes (  2.996%). Remaining is  508579 bytes ( 97.004%) for local (stack) variables or RTOS stack & heap. Max is  524288 bytes.
      
  6. [Several days later, once my Pro license was active again] As a comparison to the real -Os optimization level with a functional Pro license, here is the output. You can see that the size program size shrunk another 2~3%, so -Os is fully functioning now with the Pro license:

    No warnings.

    1. Size reported in the bottom-left GUI window in the IDE:
      1. Data Used: 478886 bytes (91%)
      2. Program Used: 1184936 bytes (57%)
    2. Size reported by my size_mcu script:
      $ size_mcu xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf --flash 2097152 --ram 524288
      size_info = 'xc32-size MyProject.X/dist/default/production/MyProject.X.production.elf' = 
      
      text     rodata    data     bss     dec     hex filename
      690048   494912   15709  464001 1664670  19669e MyProject.X/dist/default/production/MyProject.X.production.elf
      
      FLASH used . . . . . . . . .  = 1200669 bytes ( 57.252%). Remaining is  896483 bytes ( 42.748%). . . . . . . . . . . . . . . . . . . . . . . . .  Max is 2097152 bytes.
      SRAM used by global variables =   15709 bytes (  2.996%). Remaining is  508579 bytes ( 97.004%) for local (stack) variables or RTOS stack & heap. Max is  524288 bytes.
      

Final comments: PIC32 vs STM32 tools

I've found Microchip's IDE, software, configurations, compiler, licenses, support libraries and packages, and GUI configuration tools for microcontroller peripherals to be more irritating, difficult to use, and buggy than ST's comparable tools. Part of that is probably because Microchip's MPLAB X IDE is based on Netbeans instead of Eclipse.

Microchip's MPLAB X IDE is cross-platform (Windows, Mac, and Linux), and Netbeans-based. It feels a bit outdated. Their compiler is GCC-based, but locked out with paid licenses which have been integrated into the GPL source code (which is 100% legal and fine in that regard, but irritating). Their license fees are onerous and their license server flaky, costing me days of paid development time. I have built the full XC32 compiler suite royalty-free from source on both Windows and Linux, but have not integrated it for use yet. Feel free to compile it yourself and join the effort to have a royalty-free open source XC32 compiler for PIC32 mcus. Here's my repo: https://github.com/ElectricRCAircraftGuy/Microchip_XC32_Compiler. See the open issues.

I still have much to learn about PIC32, but after my many trials with the MPLAB X IDE glitches and quirks, and with my extensive problems with the XC32 compiler licenses, my recommendation is currently this: for anyone looking for a general-purpose high-end microcontroller, I therefore definitely recommend STM32 ARM-core over PIC32. ST's tools are much better and easier to use. STM32CubeIDE is better, their STM32CubeMX code generator is better, and their support libraries are easier to find and use. Also, all STM32Cube libraries are on GitHub too! See here for the STM32F* chips: https://github.com/orgs/STMicroelectronics/repositories?q=stm32cubeF&type=all&language=&sort=name, and here for the STM32H* chips: https://github.com/orgs/STMicroelectronics/repositories?q=stm32cubeh&type=all&language=&sort=name.

ST's STM32CubeIDE is also cross-platform (Windows, Mac, Linux), and is Eclipse-based, which is better I think. Last I checked, all of ST's software and compiler tools are also royalty-free (no cost) and open source, which is great. No license server problems and lost development time when they are down, and no extra costs.

Having said all that, Arduino is amazing, and I love the simplicity and power of Atmel AVR chips. And, Microchip now makes them all. :) When it comes to PIC32 vs STM32, however, I'm currently leaning towards STM32, but I still have much to learn about both.

See also

  1. My Q&A: How to renew your paid Microchip XC32 Compiler Pro license when it has expired or is about to expire
  2. My question: How do I find out at compile time how much of an STM32's Flash memory and dynamic memory (SRAM) is used up?
    1. My long answer
    2. My Script/command to auto-calculate Flash and SRAM usage for you
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Totally agree with the final comments and I've came to the same conclusions over the years of sometimes very painful experience. \$\endgroup\$ Jan 4 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.