Cannot set serial baud rate lower than 2400

Post Reply
meammeiam
Posts: 18
Joined: Fri Mar 04, 2016 11:47 pm
languages_spoken: english
ODROIDs: C1+, C2, C4, M1, XU4
Has thanked: 2 times
Been thanked: 0
Contact:

Cannot set serial baud rate lower than 2400

Post by meammeiam »

Using the C4, trying to set serial baud rate to anything lower than 2400 on ttyS0 or ttyS1 fails.

This works.
$ sudo stty -F /dev/ttyS1 2400
This fails.
$ sudo stty -F /dev/ttyS0 1800
stty: /dev/ttyS0: unable to perform all requested operations
This fails.
$ sudo stty -F /dev/ttyS1 1200
stty: /dev/ttyS1: unable to perform all requested operations

I have also tried this in c++, but can only get it down to 2400.

Could this be a problem in the kernel or something else?

With the C2, I can get the baud all the way down to 100 baud rate, but on the C4, it will not go lower than 2400?

User avatar
odroid
Site Admin
Posts: 40074
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2841 times
Been thanked: 1602 times
Contact:

Re: Cannot set serial baud rate lower than 2400

Post by odroid »

We will look into the UART device driver to check whether it is a SoC limitation or a software issue.
Can you make a list of baud rate settings what you need?
Which Kernel version do you use?

meammeiam
Posts: 18
Joined: Fri Mar 04, 2016 11:47 pm
languages_spoken: english
ODROIDs: C1+, C2, C4, M1, XU4
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Cannot set serial baud rate lower than 2400

Post by meammeiam »

I need to use a baud rate of 1200 and 1300.
I also use a non-standard baud for midi at 31250, which works fine.

I compiled the kernel using the wiki link.

git clone --depth 1 https://github.com/hardkernel/linux.git -b odroidg12-4.9.y
The last time I compiled, it was 4.9.277+ which is what I'm currently running.
I have to compile it with these extra modules.
CONFIG_SND_SEQ_DUMMY=m
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_VIRMIDI=m
CONFIG_RTC_DRV_DS1307=m

And I also added a patch for pwm.

drivers/pwm/sysfs.c
310 + //added patch
311 + //https://www.spinics.net/lists/linux-pwm/msg06081.html
312 + export->child.class = parent->class;

cap00k
Posts: 128
Joined: Tue May 21, 2013 10:46 am
languages_spoken: english
ODROIDs: ODROID
Has thanked: 0
Been thanked: 22 times
Contact:

Re: Cannot set serial baud rate lower than 2400

Post by cap00k »

Hi meammeiam,
I found some code with a limit on the minimum baud rate in the UART driver.
Can you apply the attached patch and test it out?
g12a_uart_min_baud.zip
(592 Bytes) Downloaded 12 times
These users thanked the author cap00k for the post:
meammeiam (Thu Jun 16, 2022 4:41 am)

meammeiam
Posts: 18
Joined: Fri Mar 04, 2016 11:47 pm
languages_spoken: english
ODROIDs: C1+, C2, C4, M1, XU4
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Cannot set serial baud rate lower than 2400

Post by meammeiam »

That worked! Thanks!

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 1 guest