Page 1 of 1

Using serial on VoCore

Posted: Mon Jun 01, 2015 1:17 pm
by DuckerDuck
Hi,

Sorry for this seemingly simple question, but I'm quite the n00b.

I've bought a mini thermal printer which I want to control using the VoCore (v1.0).
The printer interfaces using a simple serial connection (TTL).
Using an arduino I've already been able to print all sorts of stuff, but I don't know how to do the same on vocore.
Can I connect the tx/rx pins on the printer to the G#16/RXD2 and G#15/TXD2 pins on vocore?
How do I setup the serial connection in code?
Here is an example on arduino of what I want to accomplish on vocore:
http://pastebin.com/YJ1NpyFg

Re: Using serial on VoCore

Posted: Tue Jun 02, 2015 1:14 am
by Vonger
Please check my blog about using second UART, you have to update openwrt code to make the driver support second UART. http://vonger.cn/?p=1409. Once the driver works, linux UART interface /dev/ttyS1 should work, and then you can use linux uart api to control it, such as termios.h(standard UART library).

My blog has some note that I write for my develop, it might help you.
And I am interesting on your project, could you put it to project page after it is done? :D

Re: Using serial on VoCore

Posted: Tue Jun 02, 2015 9:38 am
by DuckerDuck
Thanks for the reply vonger!

I had not seen this blog post, now I have a place to start.
If I ever finish this thing I'll post it to the projects page :)

Re: Using serial on VoCore

Posted: Tue Jun 02, 2015 3:08 pm
by DuckerDuck
Succes!

Image

Thanks for the help!

If anyone is interested here is the simple example that printed this:
http://pastebin.com/Gdw42CEU

Re: Using serial on VoCore

Posted: Fri Jan 15, 2016 10:42 am
by maurymaury
Hi Vonger,
I need to conserve the serial console on TX2,RXD2 pin (I have no LAN connection so I need it) and I want to use the other uart (RXD,TXD) to talk with a serial device.

I followed your instrution to enable the second serial port but afterthat It seems that booting console is lost when switching form "bootconsole" to "console"

[ 0.460000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 0.470000] console [ttyS0] disabled
[ 0.480000] 10000500.uart: ttyS0 at MMIO 0x10000500 (irq = 13, base_baud = 25
00000) is a 16550A
[ 0.500000] console [ttyS0] enabled
[ 0.510000] bootconsole [early0] disabled

After this message I have no more control over the booting process though my serial terminal (original firmware upgrade in KERMIT mode is needed to restore the board). Is there a way to conserve the serial console while using the second serial port?

maurizo




Vonger wrote:Please check my blog about using second UART, you have to update openwrt code to make the driver support second UART. http://vonger.cn/?p=1409. Once the driver works, linux UART interface /dev/ttyS1 should work, and then you can use linux uart api to control it, such as termios.h(standard UART library).

My blog has some note that I write for my develop, it might help you.
And I am interesting on your project, could you put it to project page after it is done? :D

Re: Using serial on VoCore

Posted: Sun Jan 17, 2016 8:26 am
by Vonger
maurymaury wrote:Hi Vonger,
I need to conserve the serial console on TX2,RXD2 pin (I have no LAN connection so I need it) and I want to use the other uart (RXD,TXD) to talk with a serial device.

I followed your instrution to enable the second serial port but afterthat It seems that booting console is lost when switching form "bootconsole" to "console"

[ 0.460000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 0.470000] console [ttyS0] disabled
[ 0.480000] 10000500.uart: ttyS0 at MMIO 0x10000500 (irq = 13, base_baud = 25
00000) is a 16550A
[ 0.500000] console [ttyS0] enabled
[ 0.510000] bootconsole [early0] disabled

After this message I have no more control over the booting process though my serial terminal (original firmware upgrade in KERMIT mode is needed to restore the board). Is there a way to conserve the serial console while using the second serial port?

maurizo




Vonger wrote:Please check my blog about using second UART, you have to update openwrt code to make the driver support second UART. http://vonger.cn/?p=1409. Once the driver works, linux UART interface /dev/ttyS1 should work, and then you can use linux uart api to control it, such as termios.h(standard UART library).

My blog has some note that I write for my develop, it might help you.
And I am interesting on your project, could you put it to project page after it is done? :D


I guess that the console is change to ttyS1 after you update the driver, so maybe you can continue get the console output by changing your uart port to RXD2 and TXD2.
Another way, I think modify boot up parameters might fix such issue, I did not try yet. it should be linux system config in device tree or uboot, or somewhere. :)

Re: Using serial on VoCore

Posted: Sun Jan 17, 2016 5:28 pm
by noblepepper
I think this is due to the way the linux kernel parses the device tree (dts and dtsi files) when booting.

I make the beginning of my VOCORE-16M.dts file look like this and the console stays on the uartlite:

Code: Select all
/dts-v1/;

/ {
        palmbus@10000000 {
                uartlite@c00 {
                        status = "okay";
                };
        };
};                             
/include/ "VOCORE.dtsi"

/ {


This way the kernel finds uartlite before uart and uses it for console output.

Re: Using serial on VoCore

Posted: Thu Jan 21, 2016 4:43 am
by Vonger
Haha, good solution!