• Before reporting problems with your board running Armbian, check the following:

    • 1. Check power supply, check SD card and check other people experiences

      Power supply issues are one of the three biggest issues you'll face when starting with Single Board Computers (SBCs). SD card issues, whether fake or faulty, are another and issues resulting from poor board design is the other common issues you can encounter.   Power supply issues can be tricky. You might have a noisy power supply that works with one board because it has extra filtering, but won't work with another. Or you're using that cheap phone charger because your board has a microUSB connector, and it is either erratic, or doesn't start up, or even becomes the cause of some SD card issues.    Some tips to avoid the most common causes of problems reported:   Don't power via micro USB  - unless you have optimised your setup for low power requirements. Micro USB is great for mobile phones because they are simply charging a battery. It's bad for SBCs. Yes, it does work for a lot of people, but it also causes more problems and headaches over time than it is worth, unless you know exactly what you are doing. If you have a barrel jack power connector on your SBC, use it instead! If there is an option for powering via header connections, use that option!
        Don't use mobile phone chargers. They might be convenient and cheap, but this is because they are meant for charging phones, not powering your SBC which has particular power requirements.
        When you are evaluating a power supply, make sure you run some stress tests on your system to ensure that it will not cause issues down the path.   (Micro) SD card issues can be sneaky. They might appear right at the start causing strange boot and login errors, or they might cause problems over time. It is best to run a test on any new SD card you use, to ensure that it really is what it is, and to ensure that isn't faulty. Armbian provides you a simple way to do this   --   armbianmonitor -c /path/to/device/to/test  

    • 2. Make sure to collect and provide all necessary information

      We can only help if you provide quality information for us to work with. All stable images from the download section are tested, most stable upgrades are tested and we have tens of thousands of users. Even with regular and extensive testings, bugs sometimes do slip through. This is a voluntary support service and is unrelated to board makers, and is not obligated to provide you any answers. Repeated asking the same questions because you're not happy with the answers will result in you being ignored.

      Before you post a question, use the forum search as someone else might have already had the same problem and resolved it. And make sure you've read the Armbian documentation. If you still haven't found an answer, make sure you include the following in your post:   1. Logs when you can boot the board: armbianmonitor -u (paste URL to your forum post)   2. If your board does not boot, provide a log from serial console or at least make a picture, where it stops.   3. Describe the problem the best you can and provide all necessary info that we can reproduce the problem. We are not clairvoyant or mind readers. Please describe your setup as best as possible so we know what your operating environment is like.     We will not help in cases you are not using stable official Armbian builds, you have a problem with 3rd party hardware or reported problem would not be able to reproduced.

high speed problem using uarts
1 1

11 posts in this topic

Hi all..

 

I can't solve one issue with nanopiair h3. 

 

I was tried to set the speed of ttyS1 using

 

  stty -F /dev/ttyS1 230400 min 0 time 5 -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke -opost -onlcr

 

that works no err messages..but my data at port is like garbage... 

 

I see this err under dmesg 

 

 21 03:10:02 2017] sw_uart_check_baudset()429 - uart1, select set 1, baud 230400, uartclk 24000000 beyond rance[30000000, 120000000]

 

on the other hand when I check the status of uart 

 

root@FriendlyARM:/boot# cat /sys/class/tty/ttyS1/device/status 
uartclk = 24000000 
The Uart controller register[base: 0xf1c28400]: 
[RTX] 0x00 = 0x00000000, [iER] 0x04 = 0x00000000, [FCR] 0x08 = 0x00000000 
[LCR] 0x0c = 0x00000000, [MCR] 0x10 = 0x00000000, [LSR] 0x14 = 0x00000000 
[MSR] 0x18 = 0x00000000, [sCH] 0x1c = 0x00000000, [uSR] 0x7c = 0x00000000 
[TFL] 0x80 = 0x00000000, [RFL] 0x84 = 0x00000000, [HALT] 0xa4 = 0x00000000 
root@FriendlyARM:/boot# 
 
So..there's any way to change uarclk from   24000000 to 30000000? 
 
How can we solve the sw_uart_check_baudset()429 - uart1, select set 1, baud 230400, uartclk 24000000 beyond rance[30000000, 120000000] message?
 
Thanks a lot for your help

Share this post


Link to post
Share on other sites

Thanks a lot for your help..

 

yes..it's a bummer I think it's not possible to change apb clock from 24Mhz to 48Mhz due to hardware limitations..or maybe I'm wrong.

 

In a common raspberry pi the uart clock is better I think..I was tried to change the speed and it works with no issues at 230400 baud rate. 

 

 

Thanks again

Share this post


Link to post
Share on other sites

It is possible, but for that you have to hack the kernel a bit... If you also use I2C and don't do this clock change right, you can disrupt communication on it.

Share this post


Link to post
Share on other sites

@jernej Can you give me a small hint for changing uart clock so that I can use 460800 baud rate?

Share this post


Link to post
Share on other sites

Sorry, no. I was never curious enough to try to change the parent clock and now I lost interest in 3.4 kernel. Maybe you can achieve something by changing drivers/clk/sunxi/clk-sun8iw7.c

Share this post


Link to post
Share on other sites

Not sure. As I said already, I wanted just understand the procedure, not change it. I remember that there was already a discussion about this on linux-sunxi google group, but I don't remember the conclusion. On the other hand, clock drivers on mainline kernel still evolve. It might even work automatically with upcoming 4.13, but please don't rely on that.

Share this post


Link to post
Share on other sites

I'm trying to use baud rate 460800bps on Orange Pi Zero.

Baud rate 115200bps is working well, but above baud rate has problems, data corrupted.

 

I found the reason that UART clock is not enough.

https://forum.armbian.com/index.php?/topic/3508-higher-uart-baud-rates-h3-nanopi-neo-air/

 

Default uart clock is 24MHz. So I want to increase the uart clock.

 

My OPI kernel version is v4.11.3.

 

Current clock source seems to come from ccu.

serial@01c28400 {
                        compatible = "snps,dw-apb-uart";
                        reg = <0x1c28400 0x400>;
                        interrupts = <0x0 0x1 0x4>;
                        reg-shift = <0x2>;
                        reg-io-width = <0x4>;
                        clocks = <0x2 0x3f>;
                        resets = <0x2 0x32>;
                        dmas = <0x12 0x7 0x12 0x7>;
                        dma-names = "rx", "tx";
                        status = "okay";
                        pinctrl-names = "default";
                        pinctrl-0 = <0x17>;
                        linux,phandle = <0x49>;
                        phandle = <0x49>;
                };

On clocks, 0x2 looks like phandle. I don't know what is clock specifier 0x3f. Is it just sequence number?

 

Now current clock source is like below.

clock@01c20000 {
                        reg = <0x1c20000 0x400>;
                        clocks = <0x3 0x5>;
                        clock-names = "hosc", "losc";
                        #clock-cells = <0x1>;
                        #reset-cells = <0x1>;
                        assigned-clocks = <0x2 0xd 0x2 0x65>;
                        assigned-clock-rates = <0x23c34600 0x11e1a300>;
                        compatible = "allwinner,sun8i-h3-ccu";
                        linux,phandle = <0x2>;
                        phandle = <0x2>;
                };



clocks {
                #address-cells = <0x1>;
                #size-cells = <0x1>;
                ranges;

                osc24M_clk {
                        #clock-cells = <0x0>;
                        compatible = "fixed-clock";
                        clock-frequency = <0x16e3600>;
                        clock-output-names = "osc24M";
                        linux,phandle = <0x3>;
                        phandle = <0x3>;
                };

                osc32k_clk {
                        #clock-cells = <0x0>;
                        compatible = "fixed-clock";
                        clock-frequency = <0x8000>;
                        clock-output-names = "osc32k";
                        linux,phandle = <0x5>;
                        phandle = <0x5>;
                };

I think I have to declare new clock under clocks node.

How can I declare apb2 or pll6 30MHz for uart?

 

Please help me.

Thank you very much.

Share this post


Link to post
Share on other sites

I tried to make apb2 clock to 30MHz like below.

 

                apb2_clk {
                        compatible = "fixed-factor-clock";
                        #clock-cells = <0x0>;
                        clock-div = <0x8>;
                        clock-mult = <0xA>;
                        clocks = <0x3>;
                        clock-output-names = "apb2";
                        linux,phandle = <0x71>;
                        phandle = <0x71>;
                };

But it didn't work and OPI doesn't boot.

Share this post


Link to post
Share on other sites

I tried another.

I declared new clock like below, and set serial clock to this.

                osc30M_clk {
                        #clock-cells = <0x0>;
                        compatible = "fixed-factor-clock";
                        clock-div = <0x8>; /* 24M/8 = 3M */
                        clock-mult = <0xa>; /* 3M * 10 = 30M */
                        clocks = <0x3>;
                        clock-output-names = "osc30M";
                        linux,phandle = <0x71>;
                        phandle = <0x71>;
                };

                serial@01c28400 {
                        compatible = "snps,dw-apb-uart";
                        reg = <0x1c28400 0x400>;
                        interrupts = <0x0 0x1 0x4>;
                        reg-shift = <0x2>;
                        reg-io-width = <0x4>;
                        clocks = <0x71>;//<0x2 0x3f>;
                        resets = <0x2 0x32>;
                        dmas = <0x12 0x7 0x12 0x7>;
                        dma-names = "rx", "tx";
                        status = "okay";
                        pinctrl-names = "default";
                        pinctrl-0 = <0x17>;
                        linux,phandle = <0x49>;
                        phandle = <0x49>;
                };

 

Now the command "cat /sys/class/tty/ttyS1/uartclk" says 30MHz. But UART does not work.

Could you give me any hint?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
1 1

  • Support the project

    We need your help to stay focused on the project.

    Choose the amount and currency you would like to donate in below.