chipKIT PIC32 compiler Q&A

in compilers, interviews, PIC by Ian | 9 comments

You had a lot of unanswered questions about the chipKIT compiler. Here’s some answers from Jason Kajita, a compiler developer. Jason wants to us to emphasize that this is the current plan and subject to change. Thanks for the lengthy answers!

Is there any new open source code in the chipKIT compiler – files that were previously under a restrictive license but are now GPL?

At the moment, the source for the Standard C library is not provided. This is because it contains some code licensed from other companies. We decided to license this code because it had a better performance/size balance than the existing open-source solutions that we evaluated and we need to put our best foot forward for competitive benchmarking purposes. In short, we made the decision to go with the best technical solution, but that meant that we can’t provide source for the library.

My plan is to move the chipKIT compiler over to the Newlib library. This way, everything we need will be under an open-source or public-domain license. We may take a slight performance hit when we move to Newlib, but will be more suitable for chipKIT users. Also, with some new PIC32 devices coming down the pipeline, performance isn’t likely to be an issue.

I understand that the community is skeptical about Microchip’s commitment to the hobbyist community, so I am going to try to get this done sooner rather than later.

Are you familiar with what is restricted on any of the other compilers (C18/24/33)?

The 16-bit compiler (MPLAB C30) is in the same boat. It has library code licensed from another company.

What is the difference between the C32 compiler and the chipKIT compiler for PIC32?

Currently, the chipKIT compiler has features above and beyond the current version of the official MPLAB® C32 compiler. It supports C++ features, but it is not the full C++ solution that we eventually plan to offer with the MPLAB C32 compiler. The chipKIT compiler is based on GCC 4.5.1, while MPLAB C32 v1.12 is based on GCC 3.4.4.

Lots more below…

That being said, the upcoming MPLAB C32 v2.00 release has some additional features that aren’t yet in the chipKIT compiler. It is going to leapfrog the chipKIT compiler. Going forward, I plan to port features back to the chipKIT code base after they are first released in the MPLAB C32 compiler. Of course, there is nothing stopping the community from porting code from the MPLAB C32 source archive to the chipKIT-cxx repository on github. Actually, that would really save me some time!

The main difference between the chipKIT compiler and the MPLAB C32 compiler is support. Microchip’s Field Applications Engineers and corporate tech-support team won’t be able to support chipKIT. In addition, the MPLAB C32 compiler is certified by our compiler validation team before release but they do not formally test the chipKIT compiler.

This means that commercial developers will want to stick with MPLAB C32. Hobbyists have a choice between C32 and the chipKIT compiler. There’s also a number of third-party compilers out there from Microchip’s partners.

Does the chipKIT compiler have the optimizations that expire after 60days in the C32 version?

There are no optimization restrictions in the chipKIT compiler. If I remember correctly, the mpide uses the -O2 optimization level by default. A chipKIT user may choose to modify the platforms.txt file to change the optimization level to -O3 for additional speed or -Os for code-size savings.

I understand chipKIT compiler does C++, is that also coming to other compilers?

C++ support will be coming to MPLAB C32, but we don’t have a date to announce yet. The scope of the solution is still being determined and there is also some work to be done in MPLAB X to support C++.

This entry was posted in compilers, interviews, PIC and tagged , , , .

Comments

  1. Tim says:

    I posted, then read read this post, so, I’m just going to sit back and wait… month or so… ;)

    Posting about using CodeSourcery
    http://dangerousprototypes.com/forum/viewtopic.php?f=2&t=2353&p=22605#p22605

    But, still need an answer on a better open source debugger using PICKit3 ;)

  2. twoerner says:

    There has been lots of encouraging information bouncing around these last few days! It’s nice to hear all this great news with regards to the chipKIT compiler.

    While the chipKIT compiler interests me quite a bit, I have to admit I’m not too interested in the chipKIT hardware. The PIC32 ethernet starter kit from Microchip interests me much more because it already has ethernet and USB on the board and there are already a wide variety of expansion boards available via the expansion header.

    If I’m just using the chipKIT compiler by itself (on the cmdline, without the Arduino IDE, without using the Arduino libraries, without trying to write Arduino code…) can anyone guess whether or not the chipKIT compiler can be used to compile code for the PIC32 ethernet starter kit?

  3. Markus Gritsch says:

    @twoerner: Yes, I have done that. To make this work, you explicitly have to specify a liker script, which places the code at the correct address. The default (built-in) linker script of the chipKIT pic32-ld was modified to generate executables which work with the chipKIT bootloader. IMO this was unfortunate, since the chipKIT IDE explicitly specifies the same linker script on the command line, so there would be no need to change the built-in linker script.

    You can take a look at the built-in linker script by invoking
    > pic32-ld –verbose

    It is also located in the directory “mpide-0022-chipkit-win-20110521\hardware\pic32\compiler\pic32-tools\pic32mx\lib\ldscripts”

    You can specify your own linker script with the -T command line option. An appropriate script is available in the .zip file here: http://dangerousprototypes.com/forum/viewtopic.php?f=2&t=2353&start=45#p22447

  4. Drone says:

    “The main difference between the chipKIT compiler and the MPLAB C32 compiler is support. Microchip’s Field Applications Engineers and corporate tech-support team won’t be able to support chipKIT. In addition, the MPLAB C32 compiler is certified by our compiler validation team before release but they do not formally test the chipKIT compiler.

    This means that commercial developers will want to stick with MPLAB C32. Hobbyists have a choice between C32 and the chipKIT compiler.”

    Exactly the opposite. I have learned that community-based support is far superior than some poor overworked and underpaid technician jammed into a dark cubicle hunched over a keyboard trying answering desperate Emails. Finally, if you rely on certification of a closed-source compiler for the quality of your end-product, you’ve got the cart before the horse.

    • Jason Kajita says:

      “Exactly the opposite.”
      @Drone: Point taken. I do agree that the community-based support is often superior to a tech-support team answering tickets. I’ve been trying to actively participate in both the chipKIT and the Microchip forums and I’m always amazed at the level of support that the community provides.

      I just meant that our internal training material will be focused on the official MPLAB C32 release. I’m hoping that the community will also be involved in the development of the chipKIT compiler, adding new features and improvements for the chipKIT community. A Microchip Field engineer, who often works at customer sites, has no chance of providing support for those changes.

      Certification must focus on our more controlled MPLAB C32 releases because certain appliance and automotive customers have specific requirements.

      I’d also like to clarify that the source code for the MPLAB C32 compiler is posted on the Microchip website. In the past, we’ve made an attempt to make it more developer friendly by posting a fork of the code, including a build script, on SourceForge (http://sourceforge.net/projects/ccompiler4pic32/) in a Subversion repository.

      I’m hoping that by adding a Newlib option to the chipKIT compiler, we will get more momentum this time around.

      I do appreciate the constructive feedback. I’m personally extremely committed to chipKIT, both as a Microchip employee and as an aspiring hobbyist. (The Bay Area Maker Faire was inspiring!) I’m sure the chipKIT compiler development strategy will evolve as the community provides more feedback like yours. Thanks again.

  5. Robert says:

    It is possible to use a Basic language compilator (as mikrobasic four pic32) and a Pickit3 to program Chipkit ?
    It would be a easy way to write code for Chipkit boards, with power of pic32 …
    Robert

  6. Robert says:

    As say the mikrobasic user book, there are lots of libraries for external devices and components. I would be really interested in using mikrobasic with Chipkit uno.
    Do you think it is possible ?
    Robert

    • knchip says:

      I think it is possible, Once the .hex file is generated, you could download to the board using picKit2/3.
      Another method is to use the utility called arvdude. But use the arvdude which comes with pic32 Chipkit.

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.