Jump to content
Sign in to follow this  
Stephen Tarr

Unexpected Compiler (linker) Termination

Recommended Posts

I'm compiling code with an external Makefile (cygwin). The rules are set up to build two programs "Courtesy" and "Verify" using a number of common object modules. "Courtesy" is the larger program (by quite a bit) and works fine.

"Verify" fails during the linking step, with an "Unexpected program termination!"

 

Here's the log from a complete build of both packages, although note that I get the same results if I try to do a clean build of the "Verify" program alone. (In other words, the error isn't caused by some interference between the two builds.) Following that is the source code for the "Verify" module.

 

"/cygdrive/c/Program Files/SourceBoost/boostc.pic16.exe" -O1  -W1 -t 16F688 Courtesy.c
BoostC Optimizing C Compiler Version 6.55 (for PIC16 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2006 Pavel Baranov
Copyright(C) 2004-2006 David Hobday

Licensed to Stephen Tarr under Single user Full License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited, Non commercial use only


Courtesy.c

success
"/cygdrive/c/Program Files/SourceBoost/boostc.pic16.exe" -O1  -W1 -t 16F688 adc.c
BoostC Optimizing C Compiler Version 6.55 (for PIC16 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2006 Pavel Baranov
Copyright(C) 2004-2006 David Hobday

Licensed to Stephen Tarr under Single user Full License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited, Non commercial use only


adc.c

success
"/cygdrive/c/Program Files/SourceBoost/boostc.pic16.exe" -O1  -W1 -t 16F688 ascii.c
BoostC Optimizing C Compiler Version 6.55 (for PIC16 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2006 Pavel Baranov
Copyright(C) 2004-2006 David Hobday

Licensed to Stephen Tarr under Single user Full License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited, Non commercial use only


ascii.c

success
"/cygdrive/c/Program Files/SourceBoost/boostc.pic16.exe" -O1  -W1 -t 16F688 clock.c
BoostC Optimizing C Compiler Version 6.55 (for PIC16 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2006 Pavel Baranov
Copyright(C) 2004-2006 David Hobday

Licensed to Stephen Tarr under Single user Full License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited, Non commercial use only


clock.c

success
"/cygdrive/c/Program Files/SourceBoost/boostc.pic16.exe" -O1  -W1 -t 16F688 config.c
BoostC Optimizing C Compiler Version 6.55 (for PIC16 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2006 Pavel Baranov
Copyright(C) 2004-2006 David Hobday

Licensed to Stephen Tarr under Single user Full License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited, Non commercial use only


config.c

success
"/cygdrive/c/Program Files/SourceBoost/boostc.pic16.exe" -O1  -W1 -t 16F688 serial.c
BoostC Optimizing C Compiler Version 6.55 (for PIC16 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2006 Pavel Baranov
Copyright(C) 2004-2006 David Hobday

Licensed to Stephen Tarr under Single user Full License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited, Non commercial use only


serial.c

success
"/cygdrive/c/Program Files/SourceBoost/boostlink.pic.exe" Courtesy.obj adc.obj ascii.obj clock.obj config.obj serial.obj "C:\Program Files\SourceBoost\Lib\eeprom.pic16.lib" "C:\Program Files\SourceBoost\Lib\libc.pic16.lib" -O1 -t 16F688 -p Courtesy.obj
BoostLink Optimizing Linker Version 6.55
http://www.sourceboost.com
Copyright(C) 2004-2006 Pavel Baranov
Copyright(C) 2004-2006 David Hobday


Optimisation level:1
Warning unreferenced functions removed:
 isspace	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\ascii.c
 msRemaining	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\clock.c
 puts	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\serial.c
 putHex1	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\serial.c
 putHex2	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\serial.c
 putHex4	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\serial.c

Building CASM file

Memory Usage Report
===================
RAM available:256 bytes, used:148 bytes (57.9%), free:108 bytes (42.1%), 
Heap size:108 bytes, Heap max single alloc:79 bytes
ROM available:4096 words, used:4095 words (100.0%), free:1 words (0.0%)


Successful
"/cygdrive/c/Program Files/SourceBoost/boostc.pic16.exe" -O1  -W1 -t 16F688 Verify.c
BoostC Optimizing C Compiler Version 6.55 (for PIC16 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2006 Pavel Baranov
Copyright(C) 2004-2006 David Hobday

Licensed to Stephen Tarr under Single user Full License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited, Non commercial use only


Verify.c

success
"/cygdrive/c/Program Files/SourceBoost/boostlink.pic.exe" Verify.obj ascii.obj clock.obj serial.obj "C:\Program Files\SourceBoost\Lib\eeprom.pic16.lib" "C:\Program Files\SourceBoost\Lib\libc.pic16.lib" -O1 -t 16F688 -p Verify.obj
BoostLink Optimizing Linker Version 6.55
http://www.sourceboost.com
Copyright(C) 2004-2006 Pavel Baranov
Copyright(C) 2004-2006 David Hobday


Optimisation level:1
Warning unreferenced functions removed:
 isspace	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\ascii.c
 msRemaining	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\clock.c
 puts	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\serial.c
 putHex1	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\serial.c
 putHex2	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\serial.c
 putHex4	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\serial.c
 getchar	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\serial.c
 gets	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\serial.c
 tab	 in: C:\Documents and Settings\stevet\My Documents\Electronics\Courtesy\serial.c

Unexpected program termination!


Failure
make: *** [Verify.hex] Error 254

 

#include <system.h>
#include "target.h"
#include "clock.h"
#include "serial.h"

#undef VERBOSE


#pragma DATA _CONFIG, _FCMEN_OFF & _IESO_OFF & _BOD_NSLEEP & \
	      _CPD_OFF & _CP_OFF & _MCLRE_ON & \
	      _PWRTE_ON & _WDT_OFF & _INTOSCIO

volatile uchar dummy;

ushort passCount;

void main()
{
   // reset power-on and brown-out flags
   pcon = 0x03;
   // NOT_POR = 1;
   // NOT_BOR = 1;

   // set up system clock (internal osc, 8MHz)
   clockInit();

   // set up timer0 prescaler for millisecond clock
   // (but don't enable timer0 interrupts until we need the clock)
   msTimeout = 0;
   clear_wdt();
   option_reg = OPTION_REG_INIT;

   // set up peripheral ports
   porta = PORTA_INIT;
   wpu   = WPUA_INIT;
   trisa = TRISA_INIT;

   portc = PORTC_INIT;
   trisc = TRISC_INIT;

   cmcon0 = CMCON0_INIT;
   ansel = ANSEL_INIT;

   // set up serial baud rate generator, enable UART
   // (interrupt will be enabled later)
   serialInit();
   dummy = rcreg;

   // (global) enable interrupts (needed for millisecond clock)
   interrupted = 0;
   intcon.PEIE = 1;
   intcon.GIE = 1;

   // wait a while for the UART output to settle at the
   // idle voltage and for the T1 oscillator to start
   msDelay(100);
   
   // clear any pending PTT transition, then enable interrupt
   pttin = 0;
   dummy = porta;
   ioc.PTT_IN = 1;
   intcon.RAIF = 0;
   intcon.RAIE = 1;

   for (passCount = 0;; passCount++) {

msStart(2200);

while (!interrupted)
   ;

interrupted = 0;

if (pttin) {
    // PTT transition
    pttin = 0;
    if (porta.PTT_IN) {
	ushort tw = 2200 - msRemaining;
	putInt(passCount); space(); putDec2(tw); crlf();
    }
}

if (msTimeout) {
    putInt(passCount); space(); putstr("timeout"); crlf();
    break;
}
   }

   // fatal error
   while(1);
}

Share this post


Link to post
Share on other sites

Stephen,

 

If you can supply all the source files required to build the code then we can investigate further. Please zip up and send to support@sourceboost.com.

Regards

Dave

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×