Searching \ for '[PIC] HI-TECH C 12F675 undefined symbol btemp' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/languages.htm?key=c
Search entire site for: 'HI-TECH C 12F675 undefined symbol btemp'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] HI-TECH C 12F675 undefined symbol btemp'
2010\11\14@023848 by James Newton

face picon face
Another frustrating day...

Very simple little program in HITECH C for the 12F675, randomly produces
this very strange error:

aspic "\"--edf=D:\Program Files\HI-TECH Software\
Error   [800] C:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3h4.; 353. undefined
symbol "btemp"

Strange because no where in the program do my friend and I use the
identifier "btemp"... searching for btemp in the compiler manual finds:
"1. The BTEMP register is a memory location allocated by the compiler, but
which is treated like a register for code generation purposes."

Google for "undefined symbol btemp" finds:
<forum.htsoft.com/all/showflat.php?Cat=0&Number=1284&page=0&fpart=1&v
c=1>

In which the cryptic reply...

       Add the following bit of assembly:

       psect   temp,ovrld,class=BANK0,space=1
       global btemp
       btemp
               ds      2
       
       You could put #asm/#endasm around it and add it to the C file.

....provides us with a solution. Apparently, it needs to be at the end of the
C file? Anyway, adding that code allows for a successful compile, and
destroys my confidence in the compiler...
I mean... really? Are you kidding? The compiler is using an identifier that
is isn't bothering to define space for? And one that (although we didn't)
has a name any one could /easily/ crash on?

Just for fairness, here is the program, so you can see how simple it is and
maybe find something in it that could cause an issue. Actually, if someone
could try compiling this on their PC I would appreciate it; just to see if
it does the same thing to you with out the #asm block at the end.
BTW: the offending line seems to be the        for (;speed < MID_SPEED;speed++) if you comment out that one line, it compiles without the asm block.
Also had to change
       return (int)(ADRESH << 8 | ADRESL);

(which seems more intuitive to me) into

       return (int)(ADRESH << 8 + ADRESL);

or the same error appears.

Here is the complete program (bugs, I'm sure, and all)

#include <htc.h>

__CONFIG (UNPROTECT
//        & BORDIS        //brown out reset disabled (default enabled)
       & MCLRDIS        //master clear reset on pin 3 disabled (default
enabled)
//        & PWRTEN        //power up timer enabled (default disabled)
       & WDTDIS        //watch dog timer disabled (default enabled)
       & INTIO        //internal osc, GP4,5 are IO (default RCCLK)
       );
#define _XTAL_FREQ 4000000        //required for __delay_ms macro

#define AINbit        0
volatile bit        AIN        @ (unsigned)&GPIO*8+AINbit;
#define STEPX        GPIO1
#define STEPY        GPIO2
#define STEPZ        GPIO4
#define DIR        GPIO5

void init() {
       TRISIO = 1<<AINbit;        //only the A2D is an input
       ANSEL = 1<<AINbit;        //the A2D pin is analog
       ADCS0 = ADCS1 = 1;        //RC clock
       }

typedef enum {cw=0,ccw=1} direction;
typedef enum {xaxis,yaxis,zaxis,aaxis} axis;

#define MID_SPEED ((1<<10)/2)
#define DEAD_BAND 32

void step(axis anaxis, direction adir) {
       DIR = 0;
       STEPX = STEPY = STEPZ = 0;
       DIR = adir;
       switch(anaxis) {
               case xaxis: STEPX = 1; break;
               case yaxis: STEPY = 1; break;
               case zaxis: STEPZ = 1; break;
               }
       }        

int adc_read(unsigned char channel)
{
       ADCON0 = (channel << 3);//0xC1;                // enable ADC, RC osc.
       ADON = 1;
       VCFG = 0;        //Vcc is our reference
       ADFM = 1;        //0=Top 8 bits of result in ADRESH,1=10bits in
ADRESH/ADRESL
       GODONE = 1;
       while(GODONE)
               continue;        // wait for conversion complete
       return (int)(ADRESH << 8 + ADRESL);
}


void main() {
int speed;
direction dir;
       init();
       while(1) {
               speed = adc_read(0);
               speed = MID_SPEED-speed;
               dir = cw;
               if (speed<0) {dir = ccw; speed = -speed;};
               speed -= DEAD_BAND;
               if (speed < 0)                        continue;        //no movement in dead band
               for (;speed < MID_SPEED;speed++)                        __delay_ms(1);
               step(xaxis,dir);
//                step(yaxis,dir);
//                step(zaxis,dir);
               }        
       }
       
#asm
psect   temp,ovrld,class=BANK0,space=1
global btemp
btemp
       ds      2
#endasm

--
James Newton
1-970-462-7764

2010\11\14@030307 by John Temples

flavicon
face
On Sat, 13 Nov 2010, James Newton wrote:

> Very simple little program in HITECH C for the 12F675, randomly produces
> this very strange error:

Your code compiles fine without the #asm block using the 9.80
compiler.

> aspic "\"--edf=D:\Program Files\HI-TECH Software\

Where are you seeing this?  Are you invoking the assembler?

--
John W. Temples, II

2010\11\14@061306 by CDB

flavicon
face
As John found, compiles with 9.80 as is without the asm.

Colin
--
CDB, spam_OUTcolinTakeThisOuTspambtech-online.co.uk on 14/11/2010
Web presence: http://www.btech-online.co.uk   Hosted by:  http://www.justhost.com.au
 

2010\11\14@080234 by Isaac Marino Bavaresco

flavicon
face
'btemp' is the name of a data 'psect' used to store temporary data
everywhere in the program, library, etc.

Any module that needs temporary storage just declares a 'btemp' 'psect'
and use it. The linker joins all the 'btemp' 'psects' (overlaid, that is
the resulting psect length is not the sum of the length of all of its
component psects, but rather the length of the largest one).

In C you should not need and even would not know about it, the compiler
creates and uses it transparently to hold temporaries and return values.

When writing assembly routines you may need to declare it yourself.

Please note that you may declare any other temporary variable you want,
but 'btemp' is convenient because it won't waste RAM as it will be
joined with other 'btemps', while your other temporary variable will be
allocated and used only by your routine.


It seems that you hit a compiler's bug.


Best regards,

Isaac



Em 14/11/2010 05:38, James Newton escreveu:
{Quote hidden}

__________________________________________________
Fale com seus amigos  de graça com o novo Yahoo! Messenger http://br.messenger.yahoo.com

2010\11\14@082754 by Olin Lathrop

face picon face
James Newton wrote:
> Error   [800] C:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3h4.; 353.
> undefined symbol "btemp"
>
> ...
>
> Add the following bit of assembly:
>
> psect   temp,ovrld,class=BANK0,space=1
> global btemp
> btemp
>         ds      2

I know nothing particular about HiTech C, but this really looks like BTEMP
is intended to be externally defined.  The reason this module didn't define
BTEMP is that it's intended to be shared by multiple modules and therefore
should be defined only once system-wide.  Just from what you have said, I'm
99% certain BTEMP is defined in a C runtime library somewhere.  That way it
only gets linked in when actually used.

I'm guessing you forgot to link in a particular library supplied with the
compiler.  With a larger program it would probably be more obvious because
various implicit subroutine names would be missing.  In this case the
program was so simple that it needed little from the runtime libraries and
you got only the cryptic BTEMP missing.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2010\11\14@084924 by Gerhard Fiedler

picon face
James Newton wrote:

> Very simple little program in HITECH C for the 12F675, randomly produces
> this very strange error:
>
>  aspic "\"--edf=D:\Program Files\HI-TECH Software\
> Error   [800] C:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3h4.; 353. undefined
> symbol "btemp"

The first question is why you're using aspic.exe and not picc.exe. I'm
not sure what difference this makes, but it is definitely not the
documented way of running a compilation. Check out the manual for "PICC
Comand-line Driver" or something similar.

If you're using picc.exe and this is an intermediate output, the
original picc.exe command line probably would help.

> I mean... really? Are you kidding? The compiler is using an identifier
> that is isn't bothering to define space for? And one that (although
> we didn't) has a name any one could /easily/ crash on?

You can't "crash" on this name. (User) C symbols are typically known to
the assembler with a prepended underscore, so you can't crash with C on
a compiler-generated symbol that doesn't start with an underscore.

In my compiler manual (9.60), btemp is a temporary area with 12 bytes.
If it isn't properly declared by your compiler, you either haven't
invoked it properly and maybe left out some startup/standard code (see
the question about aspic vs picc above) or you've hit a compiler bug.

> Just for fairness, here is the program, so you can see how simple it
> is and maybe find something in it that could cause an issue.
> Actually, if someone could try compiling this on their PC I would
> appreciate it; just to see if it does the same thing to you with out
> the #asm block at the end.
Compiles here with PICC 9.60 (leave out the -V to see less output):

[D:\Projects\Gerhard\test]picc --CHIP=12F675 -V James.c
clist.exe "--edf=C:\Program Files (x86)\HI-TECH
Software\PICC\STD\9.60\dat\en_msgs.txt" James.c James.lst
cpp.exe "--edf=C:\Program Files (x86)\HI-TECH
Software\PICC\STD\9.60\dat\en_msgs.txt" -DHI_TECH_C -D__PICC__
-SP1,1,1,1,1,1,1 "-IC:\Program Files (x86)\HI-TECH
Software\PICC\STD\9.60\include" -D_HTC_VER_MAJOR_=9 -D_HTC_VER_MINOR_=60
-D_HTC_VER_PATCH_=2 -D_12F675 -D_MPC_ -D_PIC14 -S1,2,2,4,3,3
-D_COMMON_=1 -D_BANKCOUNT_=2 -D_BANKBITS_=1 -D_GPRBITS_=0 -D__DATABANK=1
-D_ROMSIZE=1023 -D_EEPROMSIZE=128 -DEEPROM_SIZE=128
-D_FLASH_ERASE_SIZE=0 -D_FLASH_WRITE_SIZE=0 James.c F:\Temp\s2l8.
p1.exe "--edf=C:\Program Files (x86)\HI-TECH
Software\PICC\STD\9.60\dat\en_msgs.txt" -u -Gstrings,const -M -B -Y -r
-QX,bank1 -QY,bank2 -QZ,bank3 -QF,far -QN,near -QI,interrupt
-QS,persistent -QT,eeprom F:\Temp\s2l8. James.p1 F:\Temp\s2l8.2
cgpic.exe "--edf=C:\Program Files (x86)\HI-TECH
Software\PICC\STD\9.60\dat\en_msgs.txt" -Og9s -DJames.sdb
-PPICC12F675,2,1023,2,0,1,0,0,1,32-95,1 James.p1 F:\Temp\s2l8.
aspic.exe "--edf=C:\Program Files (x86)\HI-TECH
Software\PICC\STD\9.60\dat\en_msgs.txt" -o "-CC:\Program Files
(x86)\HI-TECH Software\PICC\STD\9.60\dat\picc.ini" -ver=V9.60PL2
--chip=12F675 -R3FF -oJames.obj F:\Temp\s2l8.
aspic.exe "--edf=C:\Program Files (x86)\HI-TECH
Software\PICC\STD\9.60\dat\en_msgs.txt" -o "-CC:\Program Files
(x86)\HI-TECH Software\PICC\STD\9.60\dat\picc.ini" -ver=V9.60PL2
--chip=12F675 -R3FF -oF:\Temp\s2l8.obj F:\Temp\s2l8.as
hlink.exe "--edf=C:\Program Files (x86)\HI-TECH
Software\PICC\STD\9.60\dat\en_msgs.txt" -h+James.sym -z -Q12F675
-MF:\Temp\s2l8.map -ACODE=00h-03FEh -ACONST=00h-0FFhx3,0300h-03FEh
-AENTRY=00h-0FFhx3,0300h-03FEh -ASTRING=00h-0FFhx3,0300h-03FEh
-ABANK0=020h-05Fh -ACOMBANK=020h-05Fh
-preset_vec=00h,intentry,intcode,intret,init,init23,end_init,clrtext,maintext,stringtable,pstrings,strings
-ppowerup=CODE -pintsave_0=020h -ptemp=-COMBANK
-prbit_0=BANK0,rbss_0=BANK0,rdata_0=BANK0,idata_0=CODE -pnvram=BANK0
-ACONFIG=02007h-02007h -pconfig=CONFIG -AIDLOC=02000h-02003h
-pidloc=IDLOC -AEEDATA=00h-07Fh/02100h -peeprom_data=EEDATA
-posccal=03FFh -pfloat_text0=CODE,float_text1=CODE,float_text2=CODE
-pfloat_text3=CODE,float_text4=CODE F:\Temp\s2l8.obj James.obj
"C:\Program Files (x86)\HI-TECH Software\PICC\STD\9.60\lib\pic21--u.lib"
"C:\Program Files (x86)\HI-TECH Software\PICC\STD\9.60\lib\pic40b-c.lib"
"C:\Program Files (x86)\HI-TECH Software\PICC\STD\9.60\lib\pic21--u.lib"
aspic.exe "--edf=C:\Program Files (x86)\HI-TECH
Software\PICC\STD\9.60\dat\en_msgs.txt" -o "-CC:\Program Files
(x86)\HI-TECH Software\PICC\STD\9.60\dat\picc.ini" -ver=V9.60PL2
--chip=12F675 -R3FF -oF:\Temp\s2l8.obj F:\Temp\s2l8.as
hlink.exe "--edf=C:\Program Files (x86)\HI-TECH
Software\PICC\STD\9.60\dat\en_msgs.txt" -h+James.sym -z -Q12F675 -ol.obj
-MF:\Temp\s2l8.map -ACODE=00h-03FEh -ACONST=00h-0FFhx3,0300h-03FEh
-AENTRY=00h-0FFhx3,0300h-03FEh -ASTRING=00h-0FFhx3,0300h-03FEh
-ABANK0=020h-05Fh -ACOMBANK=020h-05Fh
-preset_vec=00h,intentry,intcode,intret,init,init23,end_init,clrtext,maintext,stringtable,pstrings,strings
-ppowerup=CODE -pintsave_0=020h -ptemp=-COMBANK
-prbit_0=BANK0,rbss_0=BANK0,rdata_0=BANK0,idata_0=CODE -pnvram=BANK0
-ACONFIG=02007h-02007h -pconfig=CONFIG -AIDLOC=02000h-02003h
-pidloc=IDLOC -AEEDATA=00h-07Fh/02100h -peeprom_data=EEDATA
-posccal=03FFh -pfloat_text0=CODE,float_text1=CODE,float_text2=CODE
-pfloat_text3=CODE,float_text4=CODE F:\Temp\s2l8.obj James.obj
"C:\Program Files (x86)\HI-TECH Software\PICC\STD\9.60\lib\pic21--u.lib"
"C:\Program Files (x86)\HI-TECH Software\PICC\STD\9.60\lib\pic40b-c.lib"
"C:\Program Files (x86)\HI-TECH Software\PICC\STD\9.60\lib\pic21--u.lib"
objtohex.exe "--edf=C:\Program Files (x86)\HI-TECH
Software\PICC\STD\9.60\dat\en_msgs.txt" -i -16,2 l.obj James.hex
hexmate.exe "--edf=C:\Program Files (x86)\HI-TECH
Software\PICC\STD\9.60\dat\en_msgs.txt" James.hex -OJames.hex
-logfile=James.hxl -addressing=2
cromwell.exe "--edf=C:\Program Files (x86)\HI-TECH
Software\PICC\STD\9.60\dat\en_msgs.txt" -k -m -P12F675,2675,PIC14
-NCODE,CONST,ENTRY,STRING James.hex James.sym -omcof
del James.obj
del l.obj

Memory Summary:
   Program space        used    95h (   149) of   3FFh words   ( 14.6%)
   Data space           used     8h (     8) of    40h bytes   ( 12.5%)
   EEPROM space         used     0h (     0) of    80h bytes   (  0.0%)
   Configuration bits   used     1h (     1) of     1h word    (100.0%)
   ID Location space    used     0h (     0) of     4h bytes   (  0.0%)

del F:\Temp\s2l8.
del F:\Temp\s2l8.1
del F:\Temp\s2l8.2
del F:\Temp\s2l8.map
del F:\Temp\s2l8.as
del F:\Temp\s2l8.ob

2010\11\14@161953 by William \Chops\ Westfield

face picon face

On Nov 13, 2010, at 11:38 PM, James Newton wrote:

>        return (int)(ADRESH << 8 + ADRESL);

Be careful of your order of operations.  I don't think that this does  what you think it does...

BillW

2010\11\14@165638 by John Temples

flavicon
face
On Sun, 14 Nov 2010, William \"Chops\" Westfield wrote:

> On Nov 13, 2010, at 11:38 PM, James Newton wrote:
>
>>        return (int)(ADRESH << 8 + ADRESL);
>
> Be careful of your order of operations.  I don't think that this does
> what you think it does...

Nor should it have a cast.

--
John W. Temples, II

2010\11\15@231529 by James Newton

face picon face
Thanks, I'm sure there are other bugs as well... The question was directed
at the weird compiler error, but I do appreciate the free debugging.

--
James Newton
1-970-462-7764
{Original Message removed}

2010\11\15@231817 by James Newton

face picon face
Thanks John. I'm also using the 9.8 compiler. I had just installed the
latest version of MPLAB, including the C compiler, then used the project
wizard to set up a minimal C project and started writing code. Could you
possibly post the build output so I can try to find the difference? Here is
the complete build output, using the program as before but without the asm
block.

Executing: "D:\Program Files\HI-TECH Software\PICC\9.80\bin\picc.exe"
-opulsegen.cof -mpulsegen.map --summary=default,-psect,-class,+mem,-hex
--output=default,-inhx032 pulsegen.p1 --chip=12F675 -P
--runtime=default,+clear,+init,-keep,+osccal,-download,-resetbits,-stackcall
,+clib --opt=default,+asm,+debug,-speed,+space,9 -v --warn=0 -D__DEBUG=1
--debugger=pickit2 --double=24 --float=24 --addrqual=ignore -g --asmlist
"--errformat=Error   [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s"
"--warnformat=Warning [%n] %f; %l.%c %s" (1273) Omniscient Code Generation not available in Lite mode (warning)
HI-TECH C Compiler for PIC10/12/16 MCUs (Lite Mode)  V9.80
Copyright (C) 2010 Microchip Technology Inc.
cgpic "\"--edf=D:\Program Files\HI-TECH
Software\PICC\9.80\dat\en_msgs.txt\"" -Og9s -q -E1 -w9
-PMS0:code@CONST=00h-0FFhx3 -PMS0:code@CODE=00h-02FFh
-PMS0:code@STRCODE=00h-02FFh -PMS0:code@ENTRY=00h-0FFhx3
-PMS0:code@STRING=00h-0FFhx3 -PMS1:data@BANK0=020h-053h
-PMS1:data@RAM=020h-053h -PMS1:data@ABS1=020h-05Fh -PMS1:data@SFR0=00h-01Fh
-PMS1:data@SFR1=080h-0FFh -PMS2:eedata@EEDATA=00h-07Fh/02100h
-PMS3:config@CONFIG=02007h-02007h -PMS4:idloc@IDLOC=02000h-02003h
-PPICCP12F675,2,1023,2,8,0,0,0 -fp
-AC:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3m0. --addrqual=ignore
--runtime=init --runtime=clear pulsegen.p1 "\"D:\Program Files\HI-TECH
Software\PICC\9.80\lib\piceep-p.lpp\"" "\"D:\Program Files\HI-TECH
Software\PICC\9.80\lib\htpic--c.lpp\""
cgpic "\"--edf=D:\Program Files\HI-TECH
Software\PICC\9.80\dat\en_msgs.txt\"" -q -E1 -Dpulsegen.sdb
-PMS0:code@CONST=00h-0FFhx3 -PMS0:code@CODE=00h-02FFh
-PMS0:code@STRCODE=00h-02FFh -PMS0:code@ENTRY=00h-0FFhx3
-PMS0:code@STRING=00h-0FFhx3 -PMS1:data@BANK0=020h-053h
-PMS1:data@RAM=020h-053h -PMS1:data@ABS1=020h-05Fh -PMS1:data@SFR0=00h-01Fh
-PMS1:data@SFR1=080h-0FFh -PMS2:eedata@EEDATA=00h-07Fh/02100h
-PMS3:config@CONFIG=02007h-02007h -PMS4:idloc@IDLOC=02000h-02003h
-PPICCP12F675,2,1023,2,8,0,0,0
-AC:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3m0. --addrqual=ignore
--runtime=init --runtime=clear pulsegen.p1 "\"D:\Program Files\HI-TECH
Software\PICC\9.80\lib\piceep-p.lpp\"" "\"D:\Program Files\HI-TECH
Software\PICC\9.80\lib\htpic--c.lpp\""
aspic "\"--edf=D:\Program Files\HI-TECH Software\Error   [800]
C:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3m0.; 353. undefined symbol "btemp"
PICC\9.80\dat\en_msgs.txt\"" -E1 "\"-CD:\Program Files\HI-TECH
Software\PICC\9.80\dat\picc.ini\"" -ver=V9.80 -lpulsegen.lst --opt=
--chip=12F675 -R3FF -icd -I -no_bankop -no_pa --prog=00h-02FFh
-opulsegen.obj C:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3m0.
del pulsegen.obj
del C:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3m0.
del C:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3m0.1
del C:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3m0.2

********** Build failed! **********

--
James Newton
1-970-462-7764
{Original Message removed}

2010\11\15@231916 by James Newton

face picon face
If this is a compiler bug, may I ask what the standard path is for reporting
the problem or is there no point? E.g. is this compiler being maintained?

--
James Newton
1-970-462-7764
{Original Message removed}

2010\11\15@233508 by James Newton

face picon face
Thanks Gerhard, how are you invoking the compiler? I'm just pressing the
rebuild button or selecting "Project / Rebuild" in MPLAB...

I'm not using aspic, that line just shows up with the error...,

but my output looks quite different:

Executing: "D:\Program Files\HI-TECH Software\PICC\9.80\bin\picc.exe"
-opulsegen.cof -mpulsegen.map --summary=default,-psect,-class,+mem,-hex
--output=default,-inhx032 pulsegen.p1 --chip=12F675 -P
--runtime=default,+clear,+init,-keep,+osccal,-download,-resetbits,-stackcall
,+clib --opt=default,+asm,+debug,-speed,+space,9 -v --warn=0 -D__DEBUG=1
--debugger=pickit2 --double=24 --float=24 --addrqual=ignore -g --asmlist
"--errformat=Error   [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s"
"--warnformat=Warning [%n] %f; %l.%c %s"
(1273) Omniscient Code Generation not available in Lite mode (warning)
HI-TECH C Compiler for PIC10/12/16 MCUs (Lite Mode)  V9.80
Copyright (C) 2010 Microchip Technology Inc.
cgpic "\"--edf=D:\Program Files\HI-TECH
Software\PICC\9.80\dat\en_msgs.txt\"" -Og9s -q -E1 -w9
-PMS0:code@CONST=00h-0FFhx3 -PMS0:code@CODE=00h-02FFh
-PMS0:code@STRCODE=00h-02FFh -PMS0:code@ENTRY=00h-0FFhx3
-PMS0:code@STRING=00h-0FFhx3 -PMS1:data@BANK0=020h-053h
-PMS1:data@RAM=020h-053h -PMS1:data@ABS1=020h-05Fh -PMS1:data@SFR0=00h-01Fh
-PMS1:data@SFR1=080h-0FFh -PMS2:eedata@EEDATA=00h-07Fh/02100h
-PMS3:config@CONFIG=02007h-02007h -PMS4:idloc@IDLOC=02000h-02003h
-PPICCP12F675,2,1023,2,8,0,0,0 -fp
-AC:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3m0. --addrqual=ignore
--runtime=init --runtime=clear pulsegen.p1 "\"D:\Program Files\HI-TECH
Software\PICC\9.80\lib\piceep-p.lpp\"" "\"D:\Program Files\HI-TECH
Software\PICC\9.80\lib\htpic--c.lpp\""
cgpic "\"--edf=D:\Program Files\HI-TECH
Software\PICC\9.80\dat\en_msgs.txt\"" -q -E1 -Dpulsegen.sdb
-PMS0:code@CONST=00h-0FFhx3 -PMS0:code@CODE=00h-02FFh
-PMS0:code@STRCODE=00h-02FFh -PMS0:code@ENTRY=00h-0FFhx3
-PMS0:code@STRING=00h-0FFhx3 -PMS1:data@BANK0=020h-053h
-PMS1:data@RAM=020h-053h -PMS1:data@ABS1=020h-05Fh -PMS1:data@SFR0=00h-01Fh
-PMS1:data@SFR1=080h-0FFh -PMS2:eedata@EEDATA=00h-07Fh/02100h
-PMS3:config@CONFIG=02007h-02007h -PMS4:idloc@IDLOC=02000h-02003h
-PPICCP12F675,2,1023,2,8,0,0,0
-AC:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3m0. --addrqual=ignore
--runtime=init --runtime=clear pulsegen.p1 "\"D:\Program Files\HI-TECH
Software\PICC\9.80\lib\piceep-p.lpp\"" "\"D:\Program Files\HI-TECH
Software\PICC\9.80\lib\htpic--c.lpp\""
aspic "\"--edf=D:\Program Files\HI-TECH Software\Error   [800]
C:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3m0.; 353. undefined symbol "btemp"
PICC\9.80\dat\en_msgs.txt\"" -E1 "\"-CD:\Program Files\HI-TECH
Software\PICC\9.80\dat\picc.ini\"" -ver=V9.80 -lpulsegen.lst --opt=
--chip=12F675 -R3FF -icd -I -no_bankop -no_pa --prog=00h-02FFh
-opulsegen.obj C:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3m0.
del pulsegen.obj
del C:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3m0.
del C:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3m0.1
del C:\DOCUME~1\JAMESN~1.EFP\LOCALS~1\Temp\s3m0.2



--
James Newton
1-970-462-7764

{Original Message removed}

2010\11\15@234526 by John Temples

flavicon
face
On Mon, 15 Nov 2010, James Newton wrote:

> Thanks John. I'm also using the 9.8 compiler. I had just installed the
> latest version of MPLAB, including the C compiler, then used the project
> wizard to set up a minimal C project and started writing code. Could you
> possibly post the build output so I can try to find the difference? Here is
> the complete build output, using the program as before but without the asm
> block.

Here's the verbose output I'm getting.  I don't use MPLAB IDE for
building projects; this is run from the command line with these
options:

picc --asmlist --chip=12f675 --mode=lite --summary=mem,class -g --ide=mplab
-L-N -mtt.map tt.c

cpp --edf=/usr/hitech/picc/9.80/dat/en_msgs.txt -DHI_TECH_C -D__PICC__ -D__PICCPRO__ -SP1,1,1,1,1,1,1,1 -I/usr/hitech/picc/9.80/include -E1 -D_OMNI_CODE_ -D_HTC_VER_MAJOR_=9 -D_HTC_VER_MINOR_=80 -D_HTC_VER_PATCH_=0 -D_HTC_EDITION_=0 -D_12F675 -D_MPC_ -D_PIC14 -S1,2,2,3,4,3,3 -D_COMMON_=0 -D_BANKCOUNT_=2 -D_BANKBITS_=1 -D_GPRBITS_=0 -D__DATABANK=1 -D_ROMSIZE=1023 -D_EEPROMSIZE=128 -DEEPROM_SIZE=128 -D_FLASH_ERASE_SIZE=0 -D_FLASH_WRITE_SIZE=0 /home/john/tt.c tt.pre
p1 --edf=/usr/hitech/picc/9.80/dat/en_msgs.txt -v -E1 -S -u -fp -Gstrings,const -M -B -J -Y -r -QP,bank0 -QX,bank1 -QY,bank2 -QZ,bank3 -QF,far -QN,near -QI,interrupt -QS,persistent -QCu,const tt.pre tt.p1 /tmp/cgtI9PKEc
cgpic --edf=/usr/hitech/picc/9.80/dat/en_msgs.txt -Og9s -q -E1 -w9 -PMS0:code@CONST=00h-0FFhx3,0300h-03FEh -PMS0:code@CODE=00h-03FEh -PMS0:code@STRCODE=00h-03FEh -PMS0:code@ENTRY=00h-0FFhx3,0300h-03FEh -PMS0:code@STRING=00h-0FFhx3,0300h-03FEh -PMS1:data@BANK0=020h-05Dh -PMS1:data@RAM=020h-05Dh -PMS1:data@ABS1=020h-05Fh -PMS1:data@COMMON=05Eh-05Fh -PMS1:data@SFR0=00h-01Fh -PMS1:data@SFR1=080h-0DDh -PMS2:eedata@EEDATA=00h-07Fh/02100h -PMS3:config@CONFIG=02007h-02007h -PMS4:idloc@IDLOC=02000h-02003h -PPICCP12F675,2,1023,2,8,0,0,0 -fp -A/tmp/cgtiUKDZa --addrqual=ignore --runtime=keep --runtime=init --runtime=clear tt.p1 /usr/hitech/picc/9.80/lib/piceep-p.lpp /usr/hitech/picc/9.80/lib/htpic--c.lpp
cgpic --edf=/usr/hitech/picc/9.80/dat/en_msgs.txt -q -E1 -Dtt.sdb -PMS0:code@CONST=00h-0FFhx3,0300h-03FEh -PMS0:code@CODE=00h-03FEh -PMS0:code@STRCODE=00h-03FEh -PMS0:code@ENTRY=00h-0FFhx3,0300h-03FEh -PMS0:code@STRING=00h-0FFhx3,0300h-03FEh -PMS1:data@BANK0=020h-05Dh -PMS1:data@RAM=020h-05Dh -PMS1:data@ABS1=020h-05Fh -PMS1:data@COMMON=05Eh-05Fh -PMS1:data@SFR0=00h-01Fh -PMS1:data@SFR1=080h-0DDh -PMS2:eedata@EEDATA=00h-07Fh/02100h -PMS3:config@CONFIG=02007h-02007h -PMS4:idloc@IDLOC=02000h-02003h -PPICCP12F675,2,1023,2,8,0,0,0 -Att.as --addrqual=ignore --runtime=keep --runtime=init --runtime=clear tt.p1 /usr/hitech/picc/9.80/lib/piceep-p.lpp /usr/hitech/picc/9.80/lib/htpic--c.lpp
aspic --edf=/usr/hitech/picc/9.80/dat/en_msgs.txt -E1 -C/usr/hitech/picc/9.80/dat/picc.ini -ver=V9.80 -ltt.lst --opt= --chip=12F675 -R3FF -I -no_bankop -no_pa --prog=00h-03FEh -ott.obj tt.as
aspic --edf=/usr/hitech/picc/9.80/dat/en_msgs.txt -v -E1 -C/usr/hitech/picc/9.80/dat/picc.ini -ver=V9.80 -lstartup.lst --opt= --chip=12F675 -R3FF -I -no_bankop -no_pa --prog=00h-03FEh -ostartup.obj startup.as
hlink --edf=/usr/hitech/picc/9.80/dat/en_msgs.txt -cs -h+tt.sym -z -w9 --norlf -Q12F675 -N -Mt.map -E1 -ACONST=00h-0FFhx3,0300h-03FEh -ACODE=00h-03FEh -ASTRCODE=00h-03FEh -AENTRY=00h-0FFhx3,0300h-03FEh -ASTRING=00h-0FFhx3,0300h-03FEh -ABANK0=020h-05Dh -ARAM=020h-05Dh -AABS1=020h-05Fh -ACOMMON=05Eh-05Fh -ASFR0=00h-01Fh -ASFR1=080h-0DDh -preset_vec=00h,intentry,init,end_init -ppowerup=CODE -pfunctab=CODE -ACONFIG=02007h-02007h -pconfig=CONFIG -DCONFIG=2 -AIDLOC=02000h-02003h -pidloc=IDLOC -DIDLOC=2 -AEEDATA=00h-07Fh/02100h -peeprom_data=EEDATA -DEEDATA=2 -posccal=03FFh -DCODE=2 -DSTRCODE=2 -DSTRING=2 -DCONST=2 -DENTRY=2 -k startup.obj tt.obj
aspic --edf=/usr/hitech/picc/9.80/dat/en_msgs.txt -v -E1 -C/usr/hitech/picc/9.80/dat/picc.ini -ver=V9.80 -lstartup.lst --opt= --chip=12F675 -R3FF -I -no_bankop -no_pa --prog=00h-03FEh -ostartup.obj startup.as
hlink --edf=/usr/hitech/picc/9.80/dat/en_msgs.txt -cs -h+tt.sym -z -Q12F675 -ol.obj -N -Mt.map -E1 -ACONST=00h-0FFhx3,0300h-03FEh -ACODE=00h-03FEh -ASTRCODE=00h-03FEh -AENTRY=00h-0FFhx3,0300h-03FEh -ASTRING=00h-0FFhx3,0300h-03FEh -ABANK0=020h-05Dh -ARAM=020h-05Dh -AABS1=020h-05Fh -ACOMMON=05Eh-05Fh -ASFR0=00h-01Fh -ASFR1=080h-0DDh -preset_vec=00h,intentry,init,end_init -ppowerup=CODE -pfunctab=CODE -ACONFIG=02007h-02007h -pconfig=CONFIG -DCONFIG=2 -AIDLOC=02000h-02003h -pidloc=IDLOC -DIDLOC=2 -AEEDATA=00h-07Fh/02100h -peeprom_data=EEDATA -DEEDATA=2 -posccal=03FFh -DCODE=2 -DSTRCODE=2 -DSTRING=2 -DCONST=2 -DENTRY=2 -k startup.obj tt.obj
objtohex --edf=/usr/hitech/picc/9.80/dat/en_msgs.txt -i -16,2 l.obj tt.hex
hexmate --edf=/usr/hitech/picc/9.80/dat/en_msgs.txt tt.hex -E1 -Ott.hex -logfile=tt.hxl -addressing=2 -break=2000 -break=2007
cromwell --edf=/usr/hitech/picc/9.80/dat/en_msgs.txt -k -m -P12F675,2675,PIC14 -NCONST,CODE,STRCODE,ENTRY,STRING tt.hex tt.sym -omcof -E1
rm tt.obj
rm l.obj

Memory Class Usage:

Program space:
    CONST                used     0h (     0) of   3FFh words   (  0.0%)
    CODE                 used    D1h (   209) of   3FFh words   ( 20.4%)
    STRCODE              used     0h (     0) of   3FFh words   (  0.0%)
    ENTRY                used     0h (     0) of   3FFh words   (  0.0%)
    STRING               used     0h (     0) of   3FFh words   (  0.0%)

Data space:
    BANK0                used     Bh (    11) of    3Eh bytes   ( 17.7%)
    ABS1                 used     2h (     2) of    40h bytes   (  3.1%)
    COMMON               used     0h (     0) of     2h bytes   (  0.0%)

EEPROM space:
    EEDATA               used     0h (     0) of    80h bytes   (  0.0%)

Configuration bits:
    CONFIG               used     1h (     1) of     1h word    (100.0%)

ID Location space:
    IDLOC                used     0h (     0) of     4h bytes   (  0.0%)


Memory Summary:
    Program space        used    D1h (   209) of   3FFh words   ( 20.4%)
    Data space           used     Dh (    13) of    40h bytes   ( 20.3%)
    EEPROM space         used     0h (     0) of    80h bytes   (  0.0%)
    Configuration bits   used     1h (     1) of     1h word    (100.0%)
    ID Location space    used     0h (     0) of     4h bytes   (  0.0%)

rm /tmp/cgtiUKDZa
rm /tmp/cgtYt1bPb
rm /tmp/cgtI9PKEc
Running this compiler in PRO mode, with Omniscient Code Generation enabled,
produces code which is typically 40% smaller than in Lite mode.
The HI-TECH C PRO compiler output for this code could be 83 words smaller.
See http://microchip.htsoft.com/portal/pic_pro for more information.

--
John W. Temples, II

2010\11\15@234721 by John Temples

flavicon
face
On Mon, 15 Nov 2010, James Newton wrote:

> If this is a compiler bug, may I ask what the standard path is for reporting
> the problem or is there no point? E.g. is this compiler being maintained?

It is being maintained (9.80 was released in the last few weeks).
Send an email to support at htsoft.com.  Include your complete
project.

--
John W. Temples, II

2010\11\16@005605 by James Newton

face picon face
Solved... apparently.
Although I could see no differences, I simply used the project setup wizard
again and choose the option to re-setup the current project. Suddenly it
worked without the asm.
Now if the pickit2 would reliably debug the 12F675....
--
James Newton
1-970-462-7764
{Original Message removed}

2010\11\16@010738 by CDB

flavicon
face
This is the output I get using 9.80 with a successful compile.

Build H:\Projects Code\hitech\newton_test for device 12F675
Using driver H:\hitech\PICC\9.80\bin\picc.exe

Make: The target "H:\Projects Code\hitech\newton.p1" is out of date.
Executing: "H:\hitech\PICC\9.80\bin\picc.exe" --pass1 "H:\Projects Code\hitech\newton.c" -q --chip=12F675 -P --runtime=default,+oscval:0 --opt=default,+asm,-debug,-speed,+space,9 --warn=0 -D__DEBUG=1 --double=24 --float=24 --addrqual=ignore -g --asmlist "--errformat=Error   [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s" Executing: "H:\hitech\PICC\9.80\bin\picc.exe" -onewton_test.cof -mnewton_test.map --summary=default --output=default newton.p1 --chip=12F675 -P --runtime=default,+oscval:0 --opt=default,+asm,-debug,-speed,+space,9 --warn=0 -D__DEBUG=1 --double=24 --float=24 --addrqual=ignore -g --asmlist "--errformat=Error   [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s" Licensed for evaluation purposes only.
This licence will expire on Fri, 24 Dec 2010.
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode)  V9.80
Copyright (C) 2010 Microchip Technology Inc.

Memory Summary:
   Program space        used    93h (   147) of   3FFh words   ( 14.4%)
   Data space           used     Bh (    11) of    40h bytes   ( 17.2%)
   EEPROM space         used     0h (     0) of    80h bytes   (  0.0%)
   Configuration bits   used     1h (     1) of     1h word    (100.0%)
   ID Location space    used     0h (     0) of     4h bytes   (  0.0%)

Loaded H:\Projects Code\hitech\newton_test.cof.

********** Build successful! **********

--
CDB, .....colinKILLspamspam@spam@btech-online.co.uk on 16/11/2010
Web presence: http://www.btech-online.co.uk   Hosted by:  http://www.justhost.com.au
 

2010\11\16@091242 by Olin Lathrop

face picon face
James Newton wrote:
> Solved... apparently.
>
> Although I could see no differences, I simply used the project setup
> wizard again and choose the option to re-setup the current project.
> Suddenly it worked without the asm.

Compare the two linker maps and see where BTEMP got placed and what module
it was defined in.  I suspect it will be defined inside a C library routine..
Your new setup probably fixed something so that the right libraries now got
presented to the linker.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2010\11\16@092901 by Gerhard Fiedler

picon face
James Newton wrote:

> Thanks Gerhard, how are you invoking the compiler? I'm just pressing
> the rebuild button or selecting "Project / Rebuild" in MPLAB...

Command line, and the command line was included with my output:

>> Compiles here with PICC 9.60 (leave out the -V to see less output):
>>
>> [D:\Projects\Gerhard\test]picc --CHIP=12F675 -V James.c
>> [...]

> but my output looks quite different:

Probably mostly due to you using a different version. Also there are
many more command line arguments:

> Executing: "D:\Program Files\HI-TECH Software\PICC\9.80\bin\picc.exe"
> -opulsegen.cof -mpulsegen.map --summary=default,-psect,-class,+mem,-hex
> --output=default,-inhx032 pulsegen.p1 --chip=12F675 -P
> --runtime=default,+clear,+init,-keep,+osccal,-download,-resetbits,-stackcall
> ,+clib --opt=default,+asm,+debug,-speed,+space,9 -v --warn=0 -D__DEBUG=1
> --debugger=pickit2 --double=24 --float=24 --addrqual=ignore -g --asmlist
> "--errformat=Error   [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s"
> "--warnformat=Warning [%n] %f; %l.%c %s"
Rather than diving into such a command line and trying to fully
understand all consequences of every last bit of it, in such a case I
tend to try the raw command line with minimal options to see whether the
problem is with the GUI integration or the code/compiler.

Gerhar

More... (looser matching)
- Last day of these posts
- In 2010 , 2011 only
- Today
- New search...