Executing a function on 4200L involving USBUART causes the code to hang?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello,

   

I am trying to monitor some sensor data detecting X and Y position input using USBUART. However, if I execute the function sending the data, the code will break and stop functioning. If I remove the line that executes the function, the code will run normally. I am not sure if I violated any rules using USBFS?

   

I have provided the main.c file as attachment below, please help!

   
    

 

   
0 Likes
5 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Here it is attached.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Increase the heap size (Workspace explorer -> Design wide resources -> System) to 0x0200.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Unfortunately this does not fix the issue... The code will execute for one iteration and stop after that. Putting it in debug mode with a line break at line 205 (count++) shows that the variable count does not increment.

0 Likes
Anonymous
Not applicable

Actually I figured out. I changed the statement for USBUART_CDCIsReady from while loop to a if statement and it worked. Thanks!

0 Likes