Author Topic: Reseach on adding Hi-Tech C Compiler for Microchips PIC MCUs  (Read 8713 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Code: [Select]
CompilerMINGW       GNU GCC Compiler                    http://www.mingw.org/
                    GNU GCC Compiler                    http://developer.apple.com/tools/
                    GNU GCC Compiler                    http://gcc.gnu.org/
CompilerTcc         Tiny C Compiler                     http://bellard.org/tcc/
CompilerSDCC        SDCC Compiler                       http://sdcc.sourceforge.net/
CompilerOW          OpenWatcom (W32) Compiler           http://openwatcom.org/index.php/Main_Page
CompilerMSVC10      Microsoft Visual C++ 2010
CompilerMSVC8       Microsoft Visual C++ 2005/2008      http://msdn.microsoft.com/vstudio/express/visualc/download/
CompilerMSVC        Microsoft Visual C++ Toolkit 2003   http://xona.com/2004/06/29.html
CompilerLDC         LLVM D Compiler                     http://dsource.org/projects/ldc/
CompilerLCC         LCC Compiler                        http://www.cs.virginia.edu/~lcc-win32/
CompilerICC         Intel C/C++ Compiler                http://www.intel.com/cd/software/products/asmo-na/eng/compilers/219754.htm
CompilerGNUTRICORE  GNU GCC Compiler for TriCore        http://www.hightec-rt.com/
CompilerGNUPOWERPC  GNU GCC Compiler for PowerPC        http://www.hightec-rt.com/
CompilerGNUMSP430   GNU GCC Compiler for MSP430         http://mspgcc.sourceforge.net/
CompilerGNUAVR      GNU AVR GCC Compiler                http://winavr.sourceforge.net/
CompilerGNUARM      GNU ARM GCC Compiler                http://www.gnuarm.com/
CompilerGDC         GDC D Compiler                      http://dgcc.sourceforge.net/
CompilerDMD         Digital Mars D Compiler             http://www.digitalmars.com/d/dcompiler.html
CompilerDMC         Digital Mars Compiler               http://www.digitalmars.com/
CompilerCYGWIN      Cygwin GCC                          http://www.cygwin.com/
CompilerBCC         Borland C++ Compiler (5.5, 5.82)    http://www.borland.com/products/downloads/download_cbuilder.html

Created list of current Compilers in Trunk SVN 67735

Decided to use compilerMINGW.cpp, compilerGNUMSP430.cpp, compilerTcc.cpp, compilerOW.cpp, and compilerSDCC.cpp as starting point.


Code: [Select]
Hi-Tech Options to add at first are
    -C                             Compile to object file
    -G<argument>                   Generate symbolic debug information
    -Iargument                     Specify include path
    -Oargument                     Output file
    -X                             Strip local symbols
    --chip=argument                Select processor
    --opt<=argument>               Optimization options
    --output<=argument>            Output formats
    --strict                       Strict ANSI keywords
    --warn<=argument>              Warning level

Special Options likely to be needed; but not listed in GUI list
    --ide=argument                 Set development environment
    --objdir=argument              Object files directory
    --errformat<=argument>         Error format
    --lang<=argument>              Specify Language
    --msgformat<=argument>         Message format
    --summary<=argument>           Summary options
    --time                         Report compilation times
    --warnformat<=argument>        Warning format
    --outdir=argument              Output directory
    --errors=number                Maximum number of errors
    -Q                             Quiet mode
    -Dargument                     Define preprocessor symbol
    

Code: [Select]
Option categories
    _("Warnings");
    _("General Options");
    _("Optimization");
    _("Miscellaneous");
    _("Linker output format (choose none, or only one of these)");
    _("PIC MCU specification (choose none, or only one of these)");

Important enums are TargetType, CompilerLineType, CommandType, CompilerLoggingType, and AutoDetectResult.
from compiletargetbase.h and compiler.h

Tim S.
« Last Edit: May 14, 2011, 03:26:50 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: Reseach on adding Hi-Tech C Compiler for Microchips PIC MCUs
« Reply #1 on: May 14, 2011, 07:39:53 pm »
Assembler Related Options (User extra Compiler Options)
Code: [Select]
-P
--asmlist

Compiler Related Options
Code: [Select]
--chip=18F452 (User extra Compiler Options)
--pass1 (Set by CB Internal Command)
--runtime=default (Choices Listed in CB Compiler Options)
--opt=default (Choices Listed in CB Compiler Options)

Linker Related Options
Code: [Select]
-oncfes.cof (Set by CB Internal Command)
-mncfes.map (Choices Listed in CB Compiler Options)
--summary=default (Set by CB Internal Command)
--output=default (Choices Listed in CB Compiler Options)

Output Format Options (Set by CB Internal Command)
Code: [Select]
"--errformat=Error   [%n] %f; %l.%c %s"
"--msgformat=Advisory[%n] %s"        
"--warnformat=Warning [%n] %f; %l.%c %s"

Compiler Command as run under MPLAB; note, it is just a single line broken up into separate parts.

Code: [Select]
picc18.exe
--pass1
icmp.c
-q
--chip=18F452
-P
--runtime=default
--opt=default
-D__DEBUG=1
-g
--asmlist
"--errformat=Error   [%n] %f; %l.%c %s"
"--msgformat=Advisory[%n] %s"
"--warnformat=Warning [%n] %f; %l.%c %s"

Link Command as run under MPLAB; note, it is just a single line broken up into separate parts.

Code: [Select]
picc18.exe
-oncfes.cof
-mncfes.map
--summary=default
--output=default
icmp.p1
ip.p1
main.p1
slip.p1
tcp.p1
udp.p1
--chip=18F452
-P
--runtime=default
--opt=default
-D__DEBUG=1
-g
--asmlist
"--errformat=Error   [%n] %f; %l.%c %s"
"--msgformat=Advisory[%n] %s"
"--warnformat=Warning [%n] %f; %l.%c %s"
« Last Edit: May 15, 2011, 12:52:45 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline mojo-chan

  • Single posting newcomer
  • *
  • Posts: 2
Re: Reseach on adding Hi-Tech C Compiler for Microchips PIC MCUs
« Reply #2 on: August 05, 2011, 09:47:10 am »
I am also very interested in getting Code::Blocks to work with Hi-Tech C for PICs. Did you make any progress on this? I can help beta test, I have some fairly large projects to test with.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: Reseach on adding Hi-Tech C Compiler for Microchips PIC MCUs
« Reply #3 on: August 07, 2011, 06:43:01 pm »
@mojo-chan:

I have only made a little progress; if you build Code::Blocks from SVN,I can attach the patch files for you to try. I have not worked on the patch in over a month. I am not really sure if I remember its status.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline mojo-chan

  • Single posting newcomer
  • *
  • Posts: 2
Re: Reseach on adding Hi-Tech C Compiler for Microchips PIC MCUs
« Reply #4 on: August 07, 2011, 07:39:12 pm »
Okay, thanks Tim. I'll pass on the patches for now, I am too busy to work on it myself. The MPLab editor is dire, so bad in fact that we use Visual Studio along side it just to do initial development and validate the code. AVR Studio now uses the Visual Studio editor, although the old one wasn't bad. Hi-Tech should seriously consider Code::Blocks support.