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

Serial data problem with upgrade 4.099 to 4.124
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jan 13, 2012 10:54 am     Reply with quote

In a previous post you've got what appears to be a 32bit math operation that will disable interrupts.....that takes a LOT of time and I can see the UART buffer being overrun unless coding that we haven't seen takes care of that situation.
cassioriguela



Joined: 25 Oct 2011
Posts: 27

View user's profile Send private message

PostPosted: Fri Jan 13, 2012 11:36 am     Reply with quote

temtronic wrote:
In a previous post you've got what appears to be a 32bit math operation that will disable interrupts.....that takes a LOT of time and I can see the UART buffer being overrun unless coding that we haven't seen takes care of that situation.


Thanks for response, temtronic.
As Dennis said, For disabling interrupt it's need call a function in ISR that is called in the main code, right ? But, my code doesn't do it.


Thanks...
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Sat Jan 14, 2012 4:26 am     Reply with quote

in your ISR you have
pRxInicio = (pRxInicio + 1) % ZIGBEE_BUFFER_RX_SIZE;

looks like modulo math to me.
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Jan 14, 2012 6:36 am     Reply with quote

and if

.. ZIGBEE_BUFFER_RX_SIZE is NOT a nice binary number (8,16,32)

then the code for the % code gets real messy and TIME consuming !
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Sat Jan 14, 2012 3:10 pm     Reply with quote

>>> Warning 216 "main.c" Line 5396(0,1): Interrupts disabled during call to prevent re-entrancy: (@PUTCHAR_3_)
>>> Warning 216 "main.c" Line 5396(0,1): Interrupts disabled during call to prevent re-entrancy: (@DIVS3232A)

Looks like a clue ... the compiler using internal functions with putchar and with divs 232 maybe a software uart with calls both in main and in an ISR.
Both pins have to be hardware uart pins for the hardware uart to be active.
If you don't want to specify the pins use UART1..UART2 etc.
cassioriguela



Joined: 25 Oct 2011
Posts: 27

View user's profile Send private message

PostPosted: Sun Jan 15, 2012 6:24 pm     Reply with quote

Hello my friends,

It's working now. I was looking for instruction that was generating warnings, so I found a fprintf statement that i was using for debug. The warning disappeared when i commented this statement and It starts to work perfectly. I don't know the relationship with fprintf instruction and my ISR function. If some CCS guru, like PcmProgrammer or Ttelmah, could explain to me, I will be glad.

Thank you all !!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19496

View user's profile Send private message

PostPosted: Mon Jan 16, 2012 2:39 am     Reply with quote

The hint has to be in the putchar_3 warning. Somewhere in an ISR (possibly not one you have posted), there must be another putc/printf, that is using the same port used for the debug.

Best Wishes
cassioriguela



Joined: 25 Oct 2011
Posts: 27

View user's profile Send private message

PostPosted: Mon Jan 23, 2012 4:52 am     Reply with quote

Thanks for response, Ttelmah

You were right. I was using a fprintf instruction for debugging trap conflicts interrupts so it was causing the problem.

Thank you !!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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