Author Topic: Serial communication  (Read 2128 times)

Andre

  • Guest
Serial communication
« on: June 18, 2010, 11:21:26 pm »
Hello,

I'm currently porting an application that monitors an ECU (engine control unit) of a car to Dingux. The ECU has a serial port and I'm looking for the different options to connect it to the Dingoo.

a) Adding a serial port to the Dingoo. Is the baudrate set in stone in the bootloader or can it be changed later? Can all debug outputs be disabled? Is the serial port available for user applications or occupied by the kernel? Can I use it just like any other serial port under Linux (terminal device, write, select,...)? Any sample code available?

b) USB/Serial converter doesn't seem to be an option because the Dingoo doesn't have an USB host. So I was looking for microcontrollers with USB host functionality and found the AT90USBKey (Atmel). A USB stack is available from Atmel with support for CDC devices. So with Dingux having the Ethernet Gadget driver it should be possible to connect to the Atmel. How do I access the USB driver from my app under Dingux? Has anyone done communication over USB to a PC under Dingux?

Thanks Andre

Stephanie

  • Guest
Re: Serial communication
« Reply #1 on: June 19, 2010, 12:27:52 am »
a) Once the dingoo is booted, the serial port should work like any other serial port on linux. It is registered as /dev/ttyS0 and you should be able to change the baud rate etc. Most (if not all) of the filesystems have inittab respawning a logon to the serial port but you can make your own rootfs easily enough that does whatever you want with the serial port.

b) The USB ethernet gadget is seen by Dingux as an ethernet port. inetd is running with telnetd and ftpd servers, so if you want your app to use / be accessed via ethernet, the easiest thing might be to make the app accessable / run through telnet. Or you could add your app to inetd to bypass logging in through telnet, or replace inetd entirely, depending on how complicated you wanted to make it.

For the application you mentioned, I'd think the easiest route would be to just use the dingoo's serial port. If you modify the rootfs so that the serial port isn't configured as a terminal line, then you can do what you want with it. There will be debug info on there only during the boot process, after that it would be quiet.

Andre

  • Guest
Re: Serial communication
« Reply #2 on: June 21, 2010, 03:48:29 pm »
Thanks for your reply Stephanie.
Would it be possible to use a Serial Gadget driver and a converter/adapter?

Stephanie

  • Guest
Re: Serial communication
« Reply #3 on: June 21, 2010, 04:37:14 pm »
I don't have any experience with serial gadget drivers, but anything you can do with /dev/ttyS0 should work fine.

 

Post a new topic