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 support@ccsinfo.com

ICD problem with PRINTF function

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



Joined: 21 Feb 2004
Posts: 20

View user's profile Send private message

ICD problem with PRINTF function
PostPosted: Sat Feb 21, 2004 4:30 pm     Reply with quote

hi friends,
i have a little problem with CCS debugger:

PCWH 3.184
PIC18F252
ICD-U40

i try with this trivial code:

#nclude <18F252.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP,WDT128,BROWNOUT,NOCPD
#device *=16 ADC=10 CCSICD=true
#opt 9
#IGNORE_WARNINGS 203
#use delay(clock=10000000,RESTART_WDT)
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7,errors, restart_wdt)

int8 counter1=0;

void main(void)
{

disable_interrupts(global);
SET_UART_SPEED(9600);

while (true) // trivial loop
{
restart_wdt();
counter1++;
printf("hello %u \n\r",counter1);
delay_ms(1000);
}
}

if i execute "single step (f7)" or "step over (f8)" the target execution hang when executing the "PRINTF" instruction... i must stop the debugger execution and restart it.

I DONT USE THE TERMINAL WINDOWS OF THE DEBUGGER, BUT
A TERMINAL PROGRAM CONNECTED VIA SERIAL PORT TO MY BREADBOARD SERIAL OUTPUT.

note please what if i move the printf in a separate function the "step over" work Ok, but the "single step" hang again on the printf instruction.. this is the modified code:


void f1(void)
{
printf("hello %u \n\r",counter1);
}


void main(void)
{

disable_interrupts(global);
SET_UART_SPEED(9600);

while (true) // trivial loop
{
restart_wdt();
counter1++;
f1();
delay_ms(1000);
}
}


anyone know this problem and (possibly) a solution ???
sorry for my bad english !
thanks and regards

Mauro
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Sun Feb 22, 2004 11:24 am     Reply with quote

This is a recurring issue. Any printf lines in the code make it basically unsteppable and therefore not easily debugable. A year or so back there was a brief versioning window when it would step over both print and delayus delayms but it regressed back to not working. I wrap all printf's with a compile time test #if.... #endif it helps but it really needs to be handled with special handling in the debug compile and debug firmware
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