MrUnreliable wrote:
You can try running sudo npi-config.
In that program you will find Advanced Options -> Serial -> serial2 Enable/Disable
By default it is disabled, so this may be causing your error.
Thanks!, I tried it but it did not work (for testing i downloaded minicom, did a shortcut between TX and RX of UART 2 to get an echo but it did not work.
Analyzing the npi-config program i ended up in this file: /boot/sun8i-h3-nanopi-neo-air.dtb, that is the one that define if a module is on or off (and some other black magic).
The thing i found curious is that when i read the whole file
Code: Select all
fdtdump /boot/sun8i-h3-nanopi-neo-air.dtb
i found some differences between the other serials (0, 1 and 3) and the Serial2:
Code: Select all
...
uart0@0 {
pins = "PA4", "PA5";
function = "uart0";
linux,phandle = <0x00000017>;
phandle = <0x00000017>;
};
uart1 {
pins = "PG6", "PG7";
function = "uart1";
linux,phandle = <0x00000018>;
phandle = <0x00000018>;
};
uart1_rts_cts {
pins = "PG8", "PG9";
function = "uart1";
};
uart2 {
pins = "PA0", "PA1";
function = "uart2";
};
uart3 {
pins = "PA13", "PA14";
function = "uart3";
linux,phandle = <0x00000019>;
phandle = <0x00000019>;
};
uart3_rts_cts {
pins = "PA15", "PA16";
function = "uart3";
linux,phandle = <0x0000001a>;
phandle = <0x0000001a>;
};
...
the serial 2 doesn't have the linux phandle parameter. Also in other part of the file, this appear:
Code: Select all
...
serial@01c28000 {
compatible = "snps,dw-apb-uart";
reg = <0x01c28000 0x000000b7>;
interrupts = <0x00000000 0x00000004 0x00000004>;
reg-shift = <0x00000002>;
reg-io-width = <0x00000004>;
clocks = <0x00000006 0x000000c2>;
resets = <0x00000006 0x00000290>;
dmas = <0x00000012 0x00000003 0x78000000 0x6f6b6179>;
dma-names = "rx", "tx";
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <0x00000017>;
};
serial@01c28400 {
compatible = "snps,dw-apb-uart";
reg = <0x01c28400 0x000000b7>;
interrupts = <0x00000000 0x00000004 0x00000004>;
reg-shift = <0x00000002>;
reg-io-width = <0x00000004>;
clocks = <0x00000006 0x000000c2>;
resets = <0x00000006 0x00000290>;
dmas = <0x00000012 0x00000003 0x78000000 0x6f6b6179>;
dma-names = "rx", "tx";
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <0x00000018>;
};
serial@01c28800 {
compatible = "snps,dw-apb-uart";
reg = <0x01c28800 0x000000b7>;
interrupts = <0x00000000 0x00000004 0x00000004>;
reg-shift = <0x00000002>;
reg-io-width = <0x00000004>;
clocks = <0x00000006 0x000000c2>;
resets = <0x00000006 0x00000290>;
dmas = <0x00000012 0x00000003 0x78000000 0x6f6b6179>;
dma-names = "rx", "tx";
status = "okay";
};
serial@01c28c00 {
compatible = "snps,dw-apb-uart";
reg = <0x01c28c00 0x000000b7>;
interrupts = <0x00000000 0x00000004 0x00000004>;
reg-shift = <0x00000002>;
reg-io-width = <0x00000004>;
clocks = <0x00000006 0x000000c2>;
resets = <0x00000006 0x00000290>;
dmas = <0x00000012 0x00000003 0x78000000 0x6f6b6179>;
dma-names = "rx", "tx";
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <0x00000019 0x69326340>;
};
...
Assuming that serial@01c28800 is the serial 2, it lacks some of the parameters the other one does have.
Tried to add it myself with fdtput, but returned that it was a bad path
Code: Select all
fdtput --type s /boot/sun8i-h3-nanopi-neo-air.dtb serial@01c28800 pinctrl-names "default"
Error at 'serial@01c28800': FDT_ERR_BADPATH