Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

how to enable UART on Nano Pi K2?

Featured Replies

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.

Basically the UART needs enabled in the device tree.  I haven't checked it, but

 

image.png.d9b32157513fc55f4271384dd5113617.png

 

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.  :huh:

  • Author

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.:(

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.

 

 

 

  • Author

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.

  • Author

@TonyMac32. Have you been able to apply Neil's patch?  If so, what do I need to do to start using it?

@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 ! :rolleyes:

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.

Just now, martinayotte said:

Especially when driving ... :lol:

 

:lol: 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...

  • Author

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. 

  • Author

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!

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.