CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Works in DEBUG, not in BUILD+RUN (SOLVED: Config Bits)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
allenhuffman



Joined: 17 Jun 2019
Posts: 554
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

Works in DEBUG, not in BUILD+RUN (SOLVED: Config Bits)
PostPosted: Tue Jun 08, 2021 10:16 am     Reply with quote

Has anyone had an issue where something works when in Debug mode, but not in Build+Run?

I pruned down my project until it was just this:

Code:
#include <24FJ256GA106.h>

//#device ICSP=TRUE
#device ICD=3

#use delay(clock=32MHz,crystal=8MHz)

//#use rs232(ICD)

#FUSES NOWDT                     //No Watch Dog Timer
#FUSES CKSFSM                    //Clock Switching is enabled, fail Safe clock monitor is enabled
#FUSES NOPROTECT

//#include <stdio.h>

#define LED_COM     PIN_B10
#define LED_FAULT   PIN_B11

void main(void)
{
   output_high (LED_COM);
   output_high (LED_FAULT);
   
   while (TRUE);
}


On my system, BUILD+RUN never turns on the lights. But DEBUG+RUN does.

We moved the project to a different laptop, and it works there.

Any suggestions on what I might need to clean up that could cause this? All the other projects I work on, as far as I know, are still working as designed.
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?


Last edited by allenhuffman on Tue Jun 08, 2021 12:36 pm; edited 2 times in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jun 08, 2021 11:41 am     Reply with quote

Look at fuses list at the bottom of the .LST file.
Debug mode disables some fuse settings.
Compare the fuses used for Debug and for non-Debug mode.
allenhuffman



Joined: 17 Jun 2019
Posts: 554
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

PostPosted: Tue Jun 08, 2021 12:36 pm     Reply with quote

PCM programmer wrote:
Look at fuses list at the bottom of the .LST file.
Debug mode disables some fuse settings.
Compare the fuses used for Debug and for non-Debug mode.


CCS Support just had me pull the hex file from the working system and compare it to my hex file and I noticed those being different.

"Config Bits" in CCS Load was unchecked. Resetting to defaults got me going again.

I don't recall touching this, but I have been using #HEXCOMMENT entries from support to make my project erase all flash or erase only used flash. Early on, I was just putting in the values they gave me (131, 149, etc.) and I finally decided to decode them a bit:

Code:
// Erase entire flash part before programming Bootload code.
// 131 = 10000011
// 1 - PROG
// 2 - DATA EE
// 4 - CONFIG
// 8 - Erase only blocks
// 16 - Erase chip after write errors
// 32 - Verify ROM protect.
#HEXCOMMENT\SETTINGS OPTIONS=131 VOLTAGE=5.00


Either this line altered the defaults (it should not) or I accidentally clicked that button when i was figure out what each generated for OPTIONS (likely).

Though I'm still not sure what (if anything) the last two bits are used for (high bit always set?).
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group