ASCIInaut Posted October 29, 2015 Share Posted October 29, 2015 (edited) Hi all, thank you for creating and maintaining Armbian. Makes live much more easier. I installed Armbian 4.5 (Cubietruck Jessie 4.2.3) via UART0. I'm now trying to access at least two further UART Devices (I need serial to an Arduino and to a GPS shield). I understood as Armbian uses the mainline Kernel script.bin is now obsolete and no longer used. Thus I don't know the pinouts for the other UARTs. Is there any documentation? Furthermore I'm not sure if the other UARTs are properly enabled in the Kernel configuration. Linux serial console seem to be on ttyS0 which is working fine: [ 0.000893] console [tty1] enabled Furthermore dmesg shows ttyS0: [ 1.901838] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 41, base_baud = 1500000) is a U6_16550A Additionally the Kernel seem to find more serials on the SoC: /proc/device-tree/soc@01c00000/serial@01c28000 /proc/device-tree/soc@01c00000/serial@01c28400 /proc/device-tree/soc@01c00000/serial@01c28800 /proc/device-tree/soc@01c00000/serial@01c28c00 /proc/device-tree/soc@01c00000/serial@01c29000 /proc/device-tree/soc@01c00000/serial@01c29400 /proc/device-tree/soc@01c00000/serial@01c29800 /proc/device-tree/soc@01c00000/serial@01c29c00 Which probably result in the devices /dev/ttyS0 to /dev/ttyS7? Which steps are nessecary to configure this devices in Linux and how can I find out the pinouts for each device. Any hints or pointers are welcome. Thank you very much for your help in advance. Edited October 31, 2015 by ASCIInaut Link to comment Share on other sites More sharing options...
zador.blood.stained Posted October 30, 2015 Share Posted October 30, 2015 Other serial devices are not enabled in Device Tree by default, you need to modify Device Tree files and compile new dtb file to enable them. Starting from here https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun7i-a20.dtsi#L1205 are sections for serial devices, common for all A20 devices, here https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun7i-a20-cubietruck.dts#L300 uart0 is enabled. You need to add similar sections for serial devices that you want, using pinctrl parameters from here https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun7i-a20.dtsi#L858 (which also answers your questions for pin numbers, you can check pin mappings in cubietruck schematics pdf). Use build script to recompile kernel (you only need new sun7i-a20-cubietruck.dtb file), adding, for example, this section to sun7i-a20-cubietruck.dts to activate uart2 &uart2 { pinctrl-names = "default"; pinctrl-0 = <&uart2_pins_a>; status = "okay"; }; Some uarts have different pinout variants, check schematic or maybe script.fex to find correct one. If pinctrl section lists 4 pins instead of 2, two other pins are RTS and CTS signals, you probably won't use them. 1 Link to comment Share on other sites More sharing options...
ASCIInaut Posted October 31, 2015 Author Share Posted October 31, 2015 Thank you very much indeed. I was able to enable two other UARTs. After adding them to sun7i-a20-cubietruck.dts I recompiled the Kernel as suggested in http://www.armbian.com/github/. I copied the created debian packages to the Cubietruck and installed them all. This updated the Kernel to 4.2.5. UARTs are now working like a charm. 1 Link to comment Share on other sites More sharing options...
Arcticfox Posted January 7, 2017 Share Posted January 7, 2017 Other serial devices are not enabled in Device Tree by default, you need to modify Device Tree files and compile new dtb file to enable them. Starting from here https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun7i-a20.dtsi#L1205 are sections for serial devices, common for all A20 devices, here https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun7i-a20-cubietruck.dts#L300 uart0 is enabled. You need to add similar sections for serial devices that you want, using pinctrl parameters from here https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun7i-a20.dtsi#L858 (which also answers your questions for pin numbers, you can check pin mappings in cubietruck schematics pdf). Use build script to recompile kernel (you only need new sun7i-a20-cubietruck.dtb file), adding, for example, this section to sun7i-a20-cubietruck.dts to activate uart2 &uart2 { pinctrl-names = "default"; pinctrl-0 = <&uart2_pins_a>; status = "okay"; }; Some uarts have different pinout variants, check schematic or maybe script.fex to find correct one. If pinctrl section lists 4 pins instead of 2, two other pins are RTS and CTS signals, you probably won't use them. Hello, could you write some kind of tutorial? I can't find "build script" and dunno where it is. Used 'compile.sh' from 'Building Armbian' section, but could not find moment where to place changes. added few hours after: There was few issues with adding architecture armhf and some packages (building script not checking dependencies on start, would be great to add it to beginning of script). Currently built 1st image (kernel+uboot), now trying to mod files. http://www.armbian.com/github/ link is dead. Some found answers: Build script: https://docs.armbian.com/Developer-Guide_Build-Preparation/ Path to modding files: ./sources/*/*/arch/arm/boot/dts , you can find it inside github link. To keep any patches need to use: CREATE_PATCHES. Link to comment Share on other sites More sharing options...
Recommended Posts