cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f030 usrt surprissing issue

sanjib
Associate III
Posted on January 12, 2015 at 19:05

I have written  two pieces of code for usart half duplex for the two f030 evaluation board respectively

The code workss as follows

In the first piece of code (named as board 1) the usart1 sendinng the data waitinng for the tc bit to sset an ddisable the traansmiitter and enablinng as receivver....waiting for the data from the board 2 to received when received interrupt happenss and again transmittinng the data and the loop continues...

In the second piece of code (named as seconnd board) waiting for the data in the while for the data to be received .after recceivving senddingg the data to thee firsst board and the loop ccontinnuues

Half duplex works fine n number of times   ....the problem is but if I swap the code if I make the board 2 to board 1 andd board 1 to 2 it doessnn't work....the sscenerio is board2 now (first piece of code practically saying now board 1) sends the data but board1 now(second piece of code practically saying board 2 doesn't sendds any ack.  I have debug the board 1 now board 2 it always goess to aa received interrupt even board 1 is not connnected....whaat may be the issue...

I am us ing PB6 in both the cases remember I am doing hhalf dupplex

Note ...I m havinng diifferent workksspace for ddifferent codes.   What may be the issue ...Please help
6 REPLIES 6
sanjib
Associate III
Posted on January 13, 2015 at 06:52

PLease any body give suggestion

Posted on January 13, 2015 at 14:51

Trying to decide if you're typing on a phone, or drunk....

These types of problems are really hard to debug without hardware or software.

You're going to want to carefully analyze your software, and attach to a scope or logic analyzer to the signal and get a clear understanding of what is going on over the wire, and any timing differences/requirements.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sanjib
Associate III
Posted on January 13, 2015 at 18:34

ha ha ...I typed bit fast so double words....

Yes it was a timing issue...I solved it....

 I am communicating  stm32f407 with one f030 as usart full duplex and this f030 communicates with other f030 as usart halfduplex.... 407 and f030 working fine as full duplex and f030 is working fine with other f030 as half duplex. but all three together runs for some time and then stops....I am powering on the three at onne time. how to debug it as all are mounted in same pcb .....I am really not able to undderstand it.Any suggestion
Posted on January 13, 2015 at 18:48

Well you're going to want a strong and robust communication protocol with the half-duplex nodes so they don't interfere or talk over each other, and can resynchronize themselves if the link gets garbled at some point. You'd want to test your code, and output telemetry so you can understand what it's doing, and why it might have stopped.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sanjib
Associate III
Posted on January 13, 2015 at 19:00

I didn''t understand can you explain by an example ...what I think is three are not getting cordinate wih each other ..after pressing three to four times reset then it works for sometimes....tming issue may be a problem?

Posted on January 13, 2015 at 19:55

I didn''t understand can you explain by an example ...what I think is three are not getting cordinate wih each other ..after pressing three to four times reset then it works for sometimes....tming issue may be a problem?

No I really don't have the resources to work on your project. Sounds like a ''robustness'' issue. You should design your protocol so it can work when things do not start and operate perfectly. This means error handling, and recovery, designed in rather than assuming everything works, and crashing when it doesn't. This might mean you have to bring up the nodes in a controlled and ordered fashion.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..