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.

problem R_UART

Featured Replies

                 Hello to all!

I have banana pi m2+ with Allwinner H3.

OS: ARMBIAN Debian GNU/Linux 8 (jessie) 3.4.112-sun8i

I program linux kernel driver.

And I am can't run R_UART.

I write to register any value, and read value alway zero.

It seems that APB0 bus is not cloked. Or device R_UART reset asserted.

 

What I do wrong?

 

Sincerely, Dmitriy.

What are you trying to do? R_UART is only meant to be used by ARISC coprocessor. You can first enable R_UART in script.bin, then connect it to PC and while booting or suspend/resume procedure you can observe output from ARISC. It will be mostly about current RAM settings, etc. Basically, it is just for debugging.

  • Author

R_UART is only meant to be used by ARISC coprocessor. Basically, it is just for debugging.

Why do you think so?

R_UART connected to pins PL2 and PL 3.

It has address 0X01F0 2800 and interrupt vector.

And from datasheet: There are 5 UART controllers. All UART controllers can be configured as Serial IrDA.

UART0, UART1, UART2, UART3,R_UART?

Where do you find this information?

Well, for one, I already connected R_UART port for debugging sleep/resume and I received output. Secondly, all things in script.bin which starts with "s_" are meant for ARISC. Check those comments here: https://github.com/igorpecovnik/lib/blob/master/config/fex/bananapim2plus.fex#L1187Why they are here named "s_" instead of "r_" I don't know, but if you check pins, it's the same. Third, I checked kernel source code, s_uart is referenced in arisc.c as ARISC resource:

https://github.com/igorpecovnik/linux/blob/sun8i/drivers/arisc/arisc.c#L483

 

And while it is true that s_uart port is referenced in sunxi-uart.c:

https://github.com/igorpecovnik/linux/blob/sun8i/drivers/tty/serial/sunxi-uart.c#L787

 

It is dependent on SUNXI_S_UART macro, which is defined here:

https://github.com/igorpecovnik/linux/blob/sun8i/drivers/tty/serial/sunxi-uart.h#L202

 

but only for sun8iw5 platform. H3 is sun8iw7.

 

Hope this answers all your questions.

  • Author

Thank you for detailed answer.

Do I right understand, what in banana pi m2+ not possible to use R_UART for general purposes such as UART1-UART3?

Maybe is possible change some config for it? Or any other solution?

  • Author

Yes, I need for 4 UARTs in my development.

The one UART using for BT.

Thereby, I need for this R_UART.

  • Author

BT I need also in my development.

Using of external USB to UART bridge is impossible due to other reasons.

  • Author

martinayotte, thank you for advice.

jernej

I have resolved my problem.

I chenged

[s_uart0]
s_uart_used       = 0
s_uart_tx         = port:PL02<2><default><default><default>
s_uart_rx         = port:PL03<2><default><default><default>

to s_uart_used =1

and re-compile kernel.

After it, the registers R_UART write correct.

And I am using R_UART as general UART.

Thank you for hint.

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.