[Tinyos-help] printf help for exp430f5438

Eric Decker cire831 at gmail.com
Sun Aug 12 04:05:39 PDT 2012


on the Linux side, do a lsusb and look for where the device (the TI serial
port from the expr board) shows up.  Also look at /var/log/syslog (or
possibly messages) as you plug the serial port into the usb connection and
make sure that it is indeed connecting to /dev/ttyUSB<n>  where n is some
number.

The TI EXP5438a serial USB shows up on my system as 0451:f500 and my Linux
box doesn't have any drivers for it.   I don't use the serial port.   I use
a JTAG for debugging.   Printf while it does work is not a very good tools
for debugging embedded systems.


Write a very simple program that sets that USCI into UART mode and simply
sends a well known character.  Like 'U' which I beleive is 0x55.   But the
character doesn't matter.

If you can observe the output with a scope or a logic analyzer on JP5 that
will tell you that your program is spitting out the correct stuff.

There is also a nice little gizmo that would let you connect a FTDI or
other usb serial port directly to the output of the 5438a uart port.   And
I do know drivers for that are already built into the Linux kernel.   The
gizmo I use is a PL2303 USB2.0 to RS232
TTL<http://www.geeetech.com/pl2303-usb20-to-rs232-ttl-p-158.html?zenid=ijma27dcmlum392tonl52bde71>
 ($7USD).


On Sun, Aug 12, 2012 at 1:04 AM, Shalabh Jain <shalabh.jain at gmail.com>wrote:

> Hi Eric,
>
> I am using your tp-freeforall repository for running some code on the
> 5438a experimenter board. I wanted to debug my code using printf
> statements. I'm using an almost new version of the int branch
> (612dc52906c).
>
> The printf examnple in the TOS tutorials seems to compile and run properly
> (I've added a blinking LED to the loop to ensure it runs periodically).
> However, I observe no ouputs on any serial terminal. It might be the case
> that this can be a linux driver problem for the USB,


Most likely a driver problem.   But you also need to make sure that you can
configure the UART/USCI on the 5438a properly.   See above.

Like I said above my Linux kernel/usb stack doesn't recognize the ti usb
serial.  You might check out this
link<http://www.google.com/url?sa=t&rct=j&q=linux%20usb%20serial%20ti%200451%20f500&source=web&cd=1&ved=0CEkQFjAA&url=http%3A%2F%2Fe2e.ti.com%2Fsupport%2Fmicrocontrollers%2Fmsp43016-bit_ultra-low_power_mcus%2Ff%2F166%2Ft%2F90578.aspx&ei=p4snULOlHKnoiwKu6YHgCQ&usg=AFQjCNFbAXDjThLVtRD3csZciH3EqKC2oA&sig2=P5U2_Bi8VJtLeLBnVoYczA&cad=rja>.
  I wasn't able to right now because the service is currently down.


> but I've exhausted my possible options
> 1. Tried using java net.tinyos.tools.Listen. I get an error
> java.io.IOException: Could not open /dev/ttyUSB0: TOSComm JNI library
> runtime error: get_modem_status: Invalid argument
>

There are reasons I don't use Java.  Mostly because when something goes
wrong I find it overly complex and difficult to figure out where things
broke.


>
> This is strange since the /dev/ttyUSB0 exists and other terminals are able
> to connect to it
>
> 2. Tried using support/python/misc/serlook.py. It connects to the port but
> produces no output.
>

Stick with serlook.   Once you get the basic driver problem sorted it
should work.   serlook is pretty basic and simple.


>
> 3. Tried cutecom to observe raw serial packets. Connects but produces no
> output
>
> 4. Tried windows based putty to observe raw packets. No output!
>
> I tried the default experimenter board program (user experience) from TI
> which has the usb-uart test option. That works fine with putty, however no
> output in linux.
>

Which points at a linux side problem.   I'm pretty sure it is the driver.


>
> It seems that the printf is not working (since I should have observed
> something in putty atleast) and there's something wrong with the linux
> driver.
>
> It would be ok if I have to use putty, as long as I am able to observe
> some output to printf calls.
>

Stop flailing.   you've pretty much narrowed it down to a driver problem.
Keep things simple and fix one things at a time.


>
> The USB connection on linux seems fine as well. The dmesg produces
> [58050.708145] usb 1-2: new full speed USB device number 46 using ohci_hcd
> [58051.214958] usbserial_generic 1-2:2.0: generic converter detected
> [58051.215193] usb 1-2: generic converter now attached to ttyUSB0
>
> This was not auto detected. Had to manually load the usbserial driver
> using the product and vender flags.
>

That doesn't mean the driver is working or that the usb connection on linux
is fine.

It is actually two parts.   There is the low level usb driver which talks
to usbserial if the end point is a serial port.

All you did was force the usbserial module to load if it sees the vid:pid
combination.


>
> It doesn't use the ti_3410 kernel driver even after manually loading it
> (despite it having 3410 chip for the USB interface).
>

I remember there is something strange about the way TI did things but don't
remember the details.  Poke around on the net looking for
linux driver for ti 0451 f500.

Or the easiest thing to do is probably get one of the usb-serial modules I
talked about above for $7 and bypass the TI usb module.  That is what I
would do.


>
> Can you help?
>
> I should mention that my code is not based in TinyOS yet. I'm in the
> process to port it to TinyOS. If you are aware of printf support for this
> board in raw C that compiles with msp-gcc , then that would work for me as
> well.


And how would that help you if it is a driver problem between the TI USB
serial and Linux.   Use your critical thinking skills.


> I did see the TI standard examples ported to freeRTOS by Peter Bigot.
> However, since I am finally going to be using TOS, I would prefer to not to
> use freeRTOS for temporary debugging.
>
> Thanks
> Shalabh
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20120812/c8516a7e/attachment.htm 


More information about the Tinyos-help mailing list