2008-01-29 05:33:25     Serial communication question

Document created by Aaronwu Employee on Aug 5, 2013
Version 1Show Document
  • View in full screen mode

2008-01-29 05:33:25     Serial communication question

Janiek Buysrogge (BELGIUM)

Message: 50269    Hello,

 

I'm not sure if this is the right place to ask, in case it isn't please send me directions.

 

I was wondering what's the preferred way to do the following:

 

I have a BF561-board running uClinux and it runs an application. This application has

a local configuration file which can be read and written from local menu (OSD) or

built-in webserver. Now, we will use neither one of them to do configurations on

the device. Instead, we will connect a serial cable to the UART-interface, and run

an application on laptop which will communicate with the board via a serial protocol,

to manipulate the configuration file.

 

What are the best steps to take ? I know I have to write a PC application and design

some kind of serial protocol. But I'm not sure what I have to do on the uClinux side.

Do I have to write a tty driver ? Can it be accomplished with pppd ? I'm really just

looking for a way to remotely manipulate a binary file over de serial interface.

 

Thanks & best regards,

Janiek

TranslateQuoteReplyEditDelete

 

 

2008-01-29 08:18:58     Re: Serial communication question

Robin Getz (UNITED STATES)

Message: 50300    Janiek:

 

You want just some way to load/store the file? you could you zmodem - sz/rz

 

-Robin

QuoteReplyEditDelete

 

 

2008-01-29 10:54:56     Re: Serial communication question

Janiek Buysrogge (BELGIUM)

Message: 50316    Hi Robin,

 

Thanks for the pointer, it got me on track.

 

I found that a newer version of sz / rz is available in the uClinux distribution, called lsz / lrz, and it works beautifully.

 

Here's what I'll do:

 

    Trigger lsz config on uClinux board

    Do ZMODEM receive from code in configuration tool on PC

    Edit file accordingly and save as config.new

    Trigger lrz config.new on uClinux board

    Do ZMODEM send from code in configuration tool on PC

    uClinux board reads new config file and performs necessary actions

 

The tricky part still is the triggering. I'm still trying to figure out how to initiate ZMODEM transfer without executing the send / receive command on the uClinux prompt. This is an attempt to create a config tool that does not require a terminal application.

 

Any thoughts on this ?

 

Best regards,

Janiek

TranslateQuoteReplyEditDelete

 

 

2008-01-29 16:52:01     Re: Serial communication question

Robin Getz (UNITED STATES)

Message: 50336    Janiek:

 

On the Blackfin receive side - if you make a link from lrz to rz, whenever the shell sees a incoming zmodem stream, it should capture the file.

 

As for something that automatically sends something - I'm not sure - I don't think you can execute shell commands over zmodem.

 

You should be able to write some  c or shell app that looks for a trigger file - if it sees the trigger file, it waits one second, sends a file, then removes the trigger. That way when your host wanted the file, it burps down the trigger file, and then waits in recieve mode.

 

The other way to do it is write your own serial app.

 

I'm not sure if Mike has any better ideas.

 

-Robin

QuoteReplyEditDelete

 

 

2008-01-31 05:43:41     Re: Serial communication question

Janiek Buysrogge (BELGIUM)

Message: 50422    Hi Robin,

 

Very nifty mechanism indeed, making a symlink to lrz did the trick.

 

In the mean time, I'm having a look at http://www.faqs.org/docs/Linux-HOWTO/Serial-Programming-HOWTO.html.

 

Thanks again for your input.

 

Best regards,

Janiek

TranslateQuoteReplyEditDelete

 

 

2008-01-31 09:15:52     Re: Serial communication question

Mike Frysinger (UNITED STATES)

Message: 50468    2008R1+ will auto-create the symlinks for you

Attachments

    Outcomes