jimg Posted September 23, 2018 Posted September 23, 2018 How do you enable the UART GPIO serial port (i.e., the one on pins 8 & 10) on a Nano Pi K2? The only active serial port I see from `dmesg | grep serial` is ttyAML0, which I'm assuming is the serial port on the debugging pins. FWIW, I'm using the 4.14.69-meson64 kernel on a Nano Pi K2.
TonyMac32 Posted September 24, 2018 Posted September 24, 2018 Basically the UART needs enabled in the device tree. I haven't checked it, but UART C, it looks like. Since this is a Pi-factor board, I'll look into enabling that. [edit] I also see the bluetooth uart is disabled, it's in the device tree but not enabled by default.
jimg Posted September 25, 2018 Author Posted September 25, 2018 Thanks! Would it have been possible to resolve this as a DT overlay? I found an overlay that enabled UART_C on the nano pi k2, so I tried: armbian-add-overlay uart_c_on.dts I first got the error"Overlays are supported only on A10, A20, H3, H5 and A64 based boards", so I commented out the test for the sunxi boards in the scirpt. I then got the error "Overlays are supported only on mainline kernel based images". I thought I had a mainline kernel, so I commenented that test out, too. The final error was "Error: dtc does not support compiling overlays". I don't know how to get an overlay-compatible device tree compiler, so I gave up.
TonyMac32 Posted September 25, 2018 Posted September 25, 2018 Overlays are not on enabled on these boards yet, it's quite a bit of work that I haven't gotten into. I have tried to enable it (and the bluetooth uart) the most straightforward way on a fresh build, however it only added an error about the bluetooth uart, it is not working yet. I'm not deep enough to see what's going on, so the probing failed, but nothing else showed up. I don't know if @Neil Armstrong has any input on why the uart C isn't coming up, in the meantime I'll take another look.
jimg Posted September 25, 2018 Author Posted September 25, 2018 Thanks for all your work. I really appreciate it. FWIW, I need uart C more than I need BT. I don't suppose using the newer 4.17 kernel instead of 4.14 would help, would it? I'm currently using the UART on an Odroid C2 (different board but same SoC), but that's using the legacy kernel. I really like the features and performance (and cost!) of the Nano Pi K2 better.
Neil Armstrong Posted September 25, 2018 Posted September 25, 2018 @TonyMac32 Here is a fix : https://lore.kernel.org/patchwork/patch/949665/ 1
jimg Posted October 20, 2018 Author Posted October 20, 2018 @TonyMac32. Have you been able to apply Neil's patch? If so, what do I need to do to start using it?
martinayotte Posted December 6, 2018 Posted December 6, 2018 @TonyMac32 If you remember, I was working on UARTC overlay 2 days ago, I figured out why the overlay wasn't loading : simply that Main DT didn't have an alias predefined for it. But, although the overlay was then loading fine, the UART loopback test didn't work ... Trying to dig the issue, I've discovered this thread ... @Neil Armstrong Seeing this patch, I gave it a try, it worked ! Do you know why this patch isn't in Mainline yet, although this patch exist since June, and those previous faulty pins exist since more than 2 years ? @jimg If you build you own image for DEV NanoPi-K2, you will get it working ... Otherwise, wait any offical DEV build.
TonyMac32 Posted December 6, 2018 Posted December 6, 2018 @martinayotte I need to stop checking the forum on my phone, I forget when things like this one come up... Thank you for digging this up!
martinayotte Posted December 6, 2018 Posted December 6, 2018 1 minute ago, TonyMac32 said: I need to stop checking the forum on my phone Especially when driving ...
TonyMac32 Posted December 6, 2018 Posted December 6, 2018 Just now, martinayotte said: Especially when driving ... I get yelled at by my wife because I don't answer the phone when driving unless my car is sync'd over Bluetooth... In reality though I should set up some kind of task list, @jimg isn't the first person who's issue went unresolved for way longer than it should have...
jimg Posted December 7, 2018 Author Posted December 7, 2018 Thanks for following up on this! Glad to hear it's finally going to be fixed. I'm excited to see work going forward on the 4.19 kernel, too.
Neil Armstrong Posted December 7, 2018 Posted December 7, 2018 @martinayotte well the person who posted the patch didn’t answer back to repost it in a correct way and we have very few users of s905 using this port...
jimg Posted December 10, 2018 Author Posted December 10, 2018 Thanks, everyone, for all your work. I installed the 4.19 Beta image, added the following line to /boot/armbianEnv.txt: overlays=uartC rebooted, and now the UART works! 1
Recommended Posts