2009-04-30 05:32:56 SPORT emulated UART sending problem
Claudio Cunha (SWITZERLAND)
Message: 73481
Hi All,
I'm using a BF533-Ezkit board and Linux blackfin 2.6.28.6-ADI-2009R1 release with a SPORT0 emulated UART for transmiting and receiving hex values to a computer...
But the problem is that the last hex value received by the computer is always FE (1111 1110) with any value sent.
Let me know your suggestions how can I resolve this bug.
Thanks a lot.
With Regards,
Claudio Cunha
TranslateQuoteReplyEditDelete
2009-04-30 11:18:00 Re: SPORT emulated UART sending problem
Mike Frysinger (UNITED STATES)
Message: 73486
where exactly did you get your hardware ?
QuoteReplyEditDelete
2009-05-04 04:31:43 Re: SPORT emulated UART sending problem
Claudio Cunha (SWITZERLAND)
Message: 73547
Hello Mike.
Thanks for responding me.
It's a board very similar to the Blackfin BF533 Ez-Kit, the problem is when I send hexadecimal values, the last value received by the computer is always FE.
I've observed the frames in a osilloscope.
You can see, in the attached file, I've send 03 00 00 00 00 hex values. We clearly see that the last rising edge rise slowly and is not completed.
Let me know your suggestions how can I resolve this bug.
With Regards,
Claudio Cunha
scope_2.png
TranslateQuoteReplyEditDelete
2009-05-04 04:34:09 Re: SPORT emulated UART sending problem
Claudio Cunha (SWITZERLAND)
Message: 73548
Scope resend.
scope_2.png
scope_0.png
TranslateQuoteReplyEditDelete
2009-05-04 04:45:31 Re: SPORT emulated UART sending problem
Michael Hennerich (GERMANY)
Message: 73550 You need a PULL-Up Resistor on the SPORT DTxPRI line.
-Michael
QuoteReplyEditDelete
2009-05-04 07:20:20 Re: SPORT emulated UART sending problem
Claudio Cunha (SWITZERLAND)
Message: 73558
I've put a pull-up resistor of 1k ,between DT0PRI and the 3.3 V but the same thing appears.
Let me know your suggestions how can I resolve that.
Thanks,
Best regards,
Claudio Cunha
TranslateQuoteReplyEditDelete
2009-05-05 02:36:59 Re: SPORT emulated UART sending problem
Claudio Cunha (SWITZERLAND)
Message: 73613
The last rising edge of the last frame is always rising slowly...
TranslateQuoteReplyEditDelete
2009-05-05 02:50:51 Re: SPORT emulated UART sending problem
Mike Frysinger (UNITED STATES)
Message: 73614
"slowly" is a qualitative word, not quantitative. you need to use real quantitative values when posting details and/or asking questions as qualitative information is largely useless.
how long did it take for the edge to rise without the 1k pull up ? how long with the 1k pull up ? perhaps you simply need a stronger pull up. doing *real measurements* of course would tell you this -- the pull up probably has to be strong enough for the edge to rise to a logical 1 compared to the sampling speed you're running the SPORT at.
QuoteReplyEditDelete
2009-05-05 05:06:31 Re: SPORT emulated UART sending problem
Claudio Cunha (SWITZERLAND)
Message: 73640
Hello Mike,
Thanks for responding me, and excuse me for the lack of details.
You've right.. With a pull-up of 1k the rising edge is more fast. It takes 240nS for rising and without the pull-up resistor it takes 28uS. Now I've put a resisitor of 100R and the last rising edge of the last frame rise good. But unfortunately the problem not comes from there...
In the attached file (pullup_100R.png), I've send 0x03 0x00 0x00 0x00 0x00, but the last frame seems not completed, and the received frames are 0x03 0x00 0x00 0x00 0xFE...
Let me know your suggestions how can I resolve that..
Thanks
Claudio Cunha
pullup_100R.png
TranslateQuoteReplyEditDelete
2009-05-05 05:16:09 Re: SPORT emulated UART sending problem
Mike Frysinger (UNITED STATES)
Message: 73643
the driver might be waiting long enough on the last byte ... the next step would be to enable debugging in the driver and see where things go wrong
QuoteReplyEditDelete
2009-05-05 05:31:16 Re: SPORT emulated UART sending problem
Michael Hennerich (GERMANY)
Message: 73644 Sorry but I don't see such things happening.
What version release version are you using?
Blackfin SPORT UART connects to ttyS0 on my Host PC.
On Blackfin:
BusyBox v1.13.4 (2009-04-30 10:17:40 CEST) built-in shell (msh)
Enter 'help' for a list of built-in commands.
root:/> PHY: 0:01 - Link is Up - 100/Full
root:/> cat /etc/rc > /dev/ttySS0
root:/
On my host PC:
root:/> version
kernel: Linux release 2.6.28.9-ADI-2009R1-pre-svn6311, build #1789
Tue May 5 11:16:54 CEST 2009
toolchain: bfin-uclinux-gcc release gcc version 4.1.2 (ADI svn)
user-dist: release svn-8022, build #3025 Tue May 5 11:16:29 CEST 2009
mhenneri-D02:/home/michael/devel # cat /dev/ttyS0 > test.capture.txt
mhenneri-D02:/home/michael/devel # hexdump -C test.capture.txt
00000000 23 20 54 68 69 73 20 66 69 6c 65 20 74 61 72 67 |# This file
targ|
00000010 65 74 73 20 61 20 2a 64 65 76 65 6c 6f 70 6d 65 |ets a
*developme|
00000020 6e 74 2a 20 73 79 73 74 65 6d 2e 20 20 4d 61 6e |nt* system.
Man|
00000030 79 20 74 68 69 6e 67 73 20 61 72 65 20 6e 6f 74 |y things
are not|
00000040 0d 0a 23 20 6e 65 65 64 65 64 20 66 6f 72 20 2a |..# needed
for *|
00000050 70 72 6f 64 75 63 74 69 6f 6e 2a 20 73 79 73 74 |production*
syst|
00000060 65 6d 73 2e 20 20 43 6f 6d 6d 65 6e 74 20 6f 75 |ems.
Comment ou|
00000070 74 20 77 68 61 74 20 79 6f 75 20 64 6f 20 6e 6f |t what you
do no|
00000080 74 20 6e 65 65 64 2e 0d 0a 0d 0a 68 6f 73 74 6e |t
need.....hostn|
--snip--
mhenneri-D02:/home/michael/devel # hexdump -C test.capture.txt | grep fe
-Michael
QuoteReplyEditDelete
2009-05-05 07:21:48 Re: SPORT emulated UART sending problem
Claudio Cunha (SWITZERLAND)
Message: 73653
I'm using this version :
root:/> version
kernel: Linux release 2.6.28.6-ADI-2009R1-pre-gefb6a5d-dirty, build #2 Thu Apr 30 17:09:549
toolchain: bfin-linux-uclibc-gcc release gcc version 4.1.2 (ADI svn)
user-dist: release 2008R1, build #8 Tue May 5 09:19:03 CEST 2009
And my values are sent in /dev/ttySS0.
TranslateQuoteReplyEditDelete
2009-05-05 07:30:36 Re: SPORT emulated UART sending problem
Michael Hennerich (GERMANY)
Message: 73654 Can you update your tree - just to see if it makes a difference?
And by the way - I assume you use a RS232 transceiver in between the SPORT and the UART of your desktop PC?
-Michael
QuoteReplyEditDelete
2009-05-05 08:17:37 Re: SPORT emulated UART sending problem
Claudio Cunha (SWITZERLAND)
Message: 73657
I've downloaded the last version:
root:/> version
kernel: Linux release 2.6.28.9-ADI-2009R1-pre-ga7a14f0-dirty, build #4 Tue May 5 14:02:02 C9
toolchain: bfin-linux-uclibc-gcc release gcc version 4.1.2 (ADI svn)
user-dist: release 2008R1, build #8 Tue May 5 09:19:03 CEST 2009
And the same problem appears..
TranslateQuoteReplyEditDelete
2009-05-05 08:21:46 Re: SPORT emulated UART sending problem
Claudio Cunha (SWITZERLAND)
Message: 73658
Yes I use a transceiver, but we have used this transeiver in a lot of projects and he always worked fine.
Claudio
TranslateQuoteReplyEditDelete
2009-05-05 09:41:24 Re: SPORT emulated UART sending problem
Claudio Cunha (SWITZERLAND)
Message: 73663
I've resolved the problem in modifing the udelay of the sport_stop_tx function in the bfin_sport_uart.c driver...
@@ -373,7 +373,7 @@ static void sport_stop_tx(struct uart_port *port)
* register and not sent out yet. If baud rate is lower than default,
* delay should be longer. For example, if the baud rate is 9600,
* the delay must be at least 2ms by experience */
- udelay(500);
+ udelay(2000);
SPORT_PUT_TCR1(up, (SPORT_GET_TCR1(up) & ~TSPEN));
SSYNC();
Thanks for your help !
Claudio Cunha
TranslateQuoteReplyEditDelete
2009-05-05 14:34:46 Re: SPORT emulated UART sending problem
Robin Getz (UNITED STATES)
Message: 73689
Claudio:
Thanks for tracking this down - we need to look into this. (setting a big delay seems to be a bad idea, since it will kill the responsiveness of the system). - we will try to follow up.
-Robin
QuoteReplyEditDelete
2009-05-05 16:25:32 Re: SPORT emulated UART sending problem
Mike Frysinger (UNITED STATES)
Message: 73700
currently tracked here:
blackfin.uclinux.org/gf/tracker/4271
QuoteReplyEditDelete