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

Trouble with recent USB CDC library

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



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

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

Trouble with recent USB CDC library
PostPosted: Sun May 10, 2009 3:45 am     Reply with quote

Is anyone else using and having trouble with the CCS USB CDC library? The version history in "usb_cdc.h" is 7 April 2009 in the one I have.

My problem is that only the first character of each packet of data I transmit is being sent. Very, very occasionally, the whole packet will be correctly sent.

I've reverted to the next most recent copy of the library I have, which is dated 27 October 2005, and everything is working fine.

If nobody else is having problems, then I guess I should take a closer look at my code, otherwise I'll add it to my rapidly growing list of tech support issues to raise with CCS.

Thanks.
_________________
Andrew
gnaur
Guest







re:Trouble with recent USB CDC library
PostPosted: Sun May 10, 2009 7:39 pm     Reply with quote

Yes, I have a similar problem, I do get more data sent, it will send for a few seconds ok but eventually will lock up and not send any more. It is still receiving data ok.
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

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

PostPosted: Sun May 10, 2009 9:24 pm     Reply with quote

Thanks for reminding me that receiving works fine - at least I'm not having any problems there. What is the most recent date in your usb_cdc.h file?
_________________
Andrew
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon May 11, 2009 12:26 am     Reply with quote

As reported earlier in the forum, I had some problems with interrupt handling in my implementation, of the CDC example.
http://www.ccsinfo.com/forum/viewtopic.php?t=36100

Although the issue couldn't be completely clarified, it was solved for my application by adding a reenable global interrupts after USB processing in the main loop.

I started application development with PCH V4.079, my most recent (production stable) version is based on V4.081, I didn't recompile it with newer PCD versions, so I can't say, if new problems adds since then.

I don't plan an update right now, but if I'm aware of any new issues in the PCH versions since V4.082, I'll report it in the forum.
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

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

PostPosted: Mon May 11, 2009 1:06 am     Reply with quote

That's interesting because, due to timing issues elsewhere in my project, I've been forced to use USB polling and have followed the instructions in the USB CDC source to do so. It means that my project doesn't have any of those "interrupts disabled" messages anywhere. I'm pretty sure it's a logic problem somewhere in the CDC support code.
_________________
Andrew
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon May 11, 2009 1:33 am     Reply with quote

It may be also the case, that the poll USB solution doesn't work correctly.
The existence of an option doesn't necessarily mean, that it has been ever used or tested.

I wasn't referring to those "interrupt diasbled" messages, rather than global interrupts actually staying disabled after calling CDC functions to send data in some cases.
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

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

PostPosted: Mon May 11, 2009 6:27 am     Reply with quote

I thought your problem was the CCS-generated code related to those "interrupt disabled" messages that disables and re-enables global interrupts. That that code wasn't correctly re-enabling global interrupts. Given that my code doesn't have any re-entrant code issues, I was trying to say that the issues you're having with the CDC code probably aren't the same as the issues I'm having.

Now polling could very well be the problem in my case. The fact that the old 2005 code is working fine doesn't mean that the new 2009 code will! Smile

I'm debating whether to spend a bit more time analyzing the CDC code, or just email CCS with a "doesn't work" message. I'd much rather have something a bit more substantial before reporting it.
_________________
Andrew
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