MPLAB IDE compiling error

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

MPLAB IDE compiling error

Postby TeoYX » Mon Dec 19, 2011 1:00 am

Hi all,


When i debug the program, following errors come out:

Executing: "C:\Program Files\HI-TECH Software\PICC\9.81a\bin\picc.exe" --pass1 "C:\Users\Teo Yu Xiang\VIP\PIC Program Testing\test02.c" -q --chip=16F877A -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"
Executing: "C:\Program Files\HI-TECH Software\PICC\9.81a\bin\picc.exe" -otest02.cof -mtest02.map --summary=default --output=default test02.p1 --chip=16F877A -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"
HI-TECH C Compiler for PIC10/12/16 MCUs (Lite Mode) V9.81a
Copyright (C) 2011 Microchip Technology Inc.
(1273) Omniscient Code Generation not available in Lite mode (warning)
Error [1347] ; 0. can't find 0xCD words (0xcd withtotal) for psect "text572" in segment "CODE" (largest unused contiguous range 0xB3)
Error [1347] ; 0. can't find 0xBD words (0xbd withtotal) for psect "text561" in segment "CODE" (largest unused contiguous range 0xB3)
Error [1347] ; 0. can't find 0x96 words (0x96 withtotal) for psect "strings" in segment "STRING" (largest unused contiguous range 0x82)
Error [1347] ; 0. can't find 0x6E words (0x6e withtotal) for psect "text576" in segment "CODE" (largest unused contiguous range 0x45)
Error [1347] ; 0. can't find 0x5C words (0x5c withtotal) for psect "text577" in segment "CODE" (largest unused contiguous range 0x45)
Error [1347] ; 0. can't find 0x4E words (0x4e withtotal) for psect "text579" in segment "CODE" (largest unused contiguous range 0x45)
Error [1347] ; 0. can't find 0x49 words (0x49 withtotal) for psect "cinit" in segment "CODE" (largest unused contiguous range 0x45)
Error [1347] ; 0. can't find 0x3C words (0x3c withtotal) for psect "text571" in segment "CODE" (largest unused contiguous range 0xE)
Error [1347] ; 0. can't find 0x30 words (0x30 withtotal) for psect "text581" in segment "CODE" (largest unused contiguous range 0xE)
Error [1347] ; 0. can't find 0x27 words (0x27 withtotal) for psect "text565" in segment "CODE" (largest unused contiguous range 0xE)
Error [1347] ; 0. can't find 0x21 words (0x21 withtotal) for psect "text575" in segment "CODE" (largest unused contiguous range 0xE)
Error [1347] ; 0. can't find 0x20 words (0x20 withtotal) for psect "text570" in segment "CODE" (largest unused contiguous range 0xE)
Error [1347] ; 0. can't find 0x1D words (0x1d withtotal) for psect "text567" in segment "CODE" (largest unused contiguous range 0xE)
Error [1347] ; 0. can't find 0x19 words (0x19 withtotal) for psect "text568" in segment "CODE" (largest unused contiguous range 0xE)
Error [1347] ; 0. can't find 0x19 words (0x19 withtotal) for psect "text569" in segment "CODE" (largest unused contiguous range 0xE)
Error [1347] ; 0. can't find 0x14 words (0x14 withtotal) for psect "text566" in segment "CODE" (largest unused contiguous range 0xE)
Error [1347] ; 0. can't find 0x10 words (0x10 withtotal) for psect "text580" in segment "CODE" (largest unused contiguous range 0xE)
Error [500] ; 0. undefined symbols:
_i2c_rtc_set_date(test02.obj) _uc_i2c_rtc_get_day(test02.obj) _uc_i2c_rtc_get_date(test02.obj) _uc_i2c_rtc_get_year(test02.obj) _uc_i2c_rtc_get_month(test02.obj) _uc_i2c_rtc_get_hours(test02.obj) _i2c_rtc_set_hours(test02.obj) _i2c_rtc_set_minutes(test02.obj) _i2c_rtc_set_month(test02.obj) _i2c_rtc_set_seconds(test02.obj) _uc_i2c_rtc_get_seconds(test02.obj) _uc_i2c_rtc_get_minutes(test02.obj) _i2c_rtc_set_day(test02.obj) _i2c_rtc_initialize(test02.obj) _i2c_initialize(test02.obj) _i2c_rtc_set_year(test02.obj)

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




Does anyone encounter this problem before? how to solve it?

I am using PIC16F877A with LM35, temperature sensor, LCD, PIR sensor, 2 PWM outputs, and RFID reader. I tried write the program separately as 1 main program with :
#include "i2c.h"
#include "i2c_rtc.h"
#include "lcd_disp.c"
#include "functions.c"

and put some variables in local functions, but still cannot work.

Please help. Thanks a lot.
TeoYX
Apprentice
 
Posts: 47
Joined: Fri Aug 12, 2011 10:47 pm

Re: MPLAB IDE compiling error

Postby ober » Mon Dec 19, 2011 2:51 pm

It seem to be "over code". The program you tend to compile is too large to be fit inside PIC16F877A. Try to reduce some of the code or functions.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: MPLAB IDE compiling error

Postby TeoYX » Tue Dec 20, 2011 12:19 am

i am combining few DIY projects, i.e PR11, PR12, PR14 and PR25 then add some features. Is that too long to put into a PIC16F877A?
TeoYX
Apprentice
 
Posts: 47
Joined: Fri Aug 12, 2011 10:47 pm

Re: MPLAB IDE compiling error

Postby TeoYX » Tue Dec 20, 2011 1:01 am

Can please help why this error happened?

Error [500] ; 0. undefined symbols:
_i2c_rtc_set_date(test02.obj) _uc_i2c_rtc_get_day(test02.obj) _uc_i2c_rtc_get_date(test02.obj) _uc_i2c_rtc_get_year(test02.obj) _uc_i2c_rtc_get_month(test02.obj) _uc_i2c_rtc_get_hours(test02.obj) _i2c_rtc_set_hours(test02.obj) _i2c_rtc_set_minutes(test02.obj) _i2c_rtc_set_month(test02.obj) _i2c_rtc_set_seconds(test02.obj) _uc_i2c_rtc_get_seconds(test02.obj) _uc_i2c_rtc_get_minutes(test02.obj) _i2c_rtc_set_day(test02.obj) _i2c_rtc_initialize(test02.obj) _i2c_initialize(test02.obj) _i2c_rtc_set_year(test02.obj)

********** Build failed! **********
TeoYX
Apprentice
 
Posts: 47
Joined: Fri Aug 12, 2011 10:47 pm

Re: MPLAB IDE compiling error

Postby TeoYX » Wed Dec 21, 2011 10:38 pm

Please help to explain what should i do to solve this error.

Thanks a lot.
TeoYX
Apprentice
 
Posts: 47
Joined: Fri Aug 12, 2011 10:47 pm

Re: MPLAB IDE compiling error

Postby robosang » Thu Dec 22, 2011 10:55 pm

It seem you din include the library (c file) of I2C.
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: MPLAB IDE compiling error

Postby TeoYX » Thu Dec 22, 2011 11:51 pm

when i write #include "i2c.c" and #include "i2c_rtc.c", below error come out:
Error [192] C:\Users\Teo Yu Xiang\VIP\PIC Program Testing\i2c.c; 116.8 undefined identifier "RW"
Error [192] C:\Users\Teo Yu Xiang\VIP\PIC Program Testing\i2c.c; 235.8 undefined identifier "RW"

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


If i define RW as unsigned char RW, error come out:
Executing: "C:\Program Files\HI-TECH Software\PICC\9.81a\bin\picc.exe" --pass1 "C:\Users\Teo Yu Xiang\VIP\PIC Program Testing\test02.c" -q --chip=16F877A -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"
Executing: "C:\Program Files\HI-TECH Software\PICC\9.81a\bin\picc.exe" -otest02.cof -mtest02.map --summary=default --output=default test02.p1 --chip=16F877A -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"
HI-TECH C Compiler for PIC10/12/16 MCUs (Lite Mode) V9.81a
Copyright (C) 2011 Microchip Technology Inc.
(1273) Omniscient Code Generation not available in Lite mode (warning)
Error [1347] ; 0. can't find 0x58 words (0x58 withtotal) for psect "text854" in segment "CODE" (largest unused contiguous range 0x38)
Error [1347] ; 0. can't find 0x4E words (0x4e withtotal) for psect "text844" in segment "CODE" (largest unused contiguous range 0x38)
Error [1347] ; 0. can't find 0x4E words (0x4e withtotal) for psect "text846" in segment "CODE" (largest unused contiguous range 0x38)
Error [1347] ; 0. can't find 0x4E words (0x4e withtotal) for psect "text862" in segment "CODE" (largest unused contiguous range 0x38)
Error [1347] ; 0. can't find 0x4A words (0x4a withtotal) for psect "text842" in segment "CODE" (largest unused contiguous range 0x38)
Error [1347] ; 0. can't find 0x49 words (0x49 withtotal) for psect "text852" in segment "CODE" (largest unused contiguous range 0x38)
Error [1347] ; 0. can't find 0x46 words (0x46 withtotal) for psect "text839" in segment "CODE" (largest unused contiguous range 0x38)
Error [1347] ; 0. can't find 0x44 words (0x44 withtotal) for psect "text861" in segment "CODE" (largest unused contiguous range 0x38)
Error [1347] ; 0. can't find 0x30 words (0x30 withtotal) for psect "text865" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x28 words (0x28 withtotal) for psect "text851" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x27 words (0x27 withtotal) for psect "text832" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x27 words (0x27 withtotal) for psect "text843" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x27 words (0x27 withtotal) for psect "text845" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x27 words (0x27 withtotal) for psect "text847" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x26 words (0x26 withtotal) for psect "text853" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x25 words (0x25 withtotal) for psect "text855" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x21 words (0x21 withtotal) for psect "text841" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x1D words (0x1d withtotal) for psect "text834" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x1B words (0x1b withtotal) for psect "text837" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x1B words (0x1b withtotal) for psect "text848" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x19 words (0x19 withtotal) for psect "text835" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x19 words (0x19 withtotal) for psect "text836" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x18 words (0x18 withtotal) for psect "text863" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x14 words (0x14 withtotal) for psect "text833" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0x10 words (0x10 withtotal) for psect "text868" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0xF words (0xf withtotal) for psect "text864" in segment "CODE" (largest unused contiguous range 0x8)
Error [1347] ; 0. can't find 0xC words (0xc withtotal) for psect "text849" in segment "CODE" (largest unused contiguous range 0x8)

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




Is that the proper way to use i2c.c instead of i2c.h? Any related post about this error when using real time IC? Please help. Thanks a lot.
TeoYX
Apprentice
 
Posts: 47
Joined: Fri Aug 12, 2011 10:47 pm

Re: MPLAB IDE compiling error

Postby ABSF » Fri Dec 23, 2011 11:15 am

TeoYX WROTE:HI-TECH C Compiler for PIC10/12/16 MCUs (Lite Mode) V9.81a
Copyright (C) 2011 Microchip Technology Inc.
(1273) Omniscient Code Generation not available in Lite mode (warning)
Error [1347] ; 0. can't find 0x58 words (0x58 withtotal) for psect "text854" in segment "CODE" (largest unused contiguous range 0x38)


I am no expert on Hi-Tech C. From what I read from another forum, this is what others said:

Just taking a stab at it without seeing your code I would say that you have an array that is 0x58 words long and the biggest contiguous block you have is 0x38 words long.

A suggestion would be to make some of your global variables in to local ones ( if possible ) that way some of the memory locations can be reused by the compiler and free up space for your array.


If you are in lite mode you may have run out of memory.  The compiler is inefficient on purpose in this mode.  If you are border line, different compiler version may work or not.


So, in conclusion, you should not take what Ober had said lightly. Try to "remark" off some of your codes and recompile again. Or look for another PIC with more memories like 16F1519 (16kW) or 16F1939. They are available in 40P PDIP and PLCC footprint.

OR you may wish to buy the pro version of the Hi-tech C compiler or better still get the mikroC compiler. Look at the website attached and see the limitation of the PICC Lite.

Microchip C Compilers
http://www.microchip.com/stellent/idcpl ... irects=c30

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: MPLAB IDE compiling error

Postby ABSF » Fri Dec 23, 2011 11:29 am

TeoYX WROTE:i am combining few DIY projects, i.e PR11, PR12, PR14 and PR25 then add some features. Is that too long to put into a PIC16F877A?


The 16F877A has only 8KW of memory. If I were you I would have download all the hex files of PR11, PR12, PR14 and PR25 and try to load each of them to the PIC programmer UIC00A/B. Manually select the device as 16F877A. On the programmer's HEX window, you should be able to see the last address loaded into the PIC. For 8K memories, the address range is 0x0000-0x1FFF only.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: MPLAB IDE compiling error

Postby Brian Griffin » Fri Dec 23, 2011 10:59 pm

http://www.htsoft.com/support/faqs.php#faq83 -> That would be the answer to the problem.

You may need to change to another microcontroller which is much bigger in memory.

OR you may wish to buy the pro version of the Hi-tech C compiler or better still get the mikroC compiler. Look at the website attached and see the limitation of the PICC Lite.


The purchased Hi-Tech C is extremely expensive, and you had to pay a lot for yearly upgrades.

I would suggest either the CCS or the MikroC compiler. Both of them are very very good.
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Next

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 3 guests

cron