Configure the UART 1 for connecting Bluetooth module
#1
Hi,

I would like to use the uart 1 for connecting the BT module. The UART 2 is used for debug or console logs. 
What steps should I follow to configure the UART 1 in rock64 ? I am using linux image Jessie. 

Do I need to configure both uboot and kernel with GPIO3_A4 as Tx and GPIO3_A6 as Rx pin?.
If it is already configured then which tty port should I connect to?
Can someone please give details for the same?

Is there any documentation for using the GPIO, configuring peripheral drivers?

Regards,
Ankit Channa
  Reply
#2
(10-05-2017, 05:39 AM)channaankit25 Wrote: Hi,

I would like to use the uart 1 for connecting the BT module. The UART 2 is used for debug or console logs. 
What steps should I follow to configure the UART 1 in rock64 ? I am using linux image Jessie. 

Do I need to configure both uboot and kernel with GPIO3_A4 as Tx and GPIO3_A6 as Rx pin?.
If it is already configured then which tty port should I connect to?
Can someone please give details for the same?

Is there any documentation for using the GPIO, configuring peripheral drivers?

Regards,
Ankit Channa

Someone please reply.. how to configure the UART 1?. If it is already enabled then let us know which port should be used for sending & receiving data?
  Reply
#3
(10-11-2017, 08:37 AM)channaankit25 Wrote: Someone please reply.. how to configure the UART 1?. If it is already enabled then let us know which port should be used for sending & receiving data?


hi, this might be more difficult than its worth; frankly.

...  many of the gpio(s) have multiple functions;  there are register(s) in the SoC that control which function a given pad has ( its just a number, 0, 1, 2, )  and the default settings for the pad(s) is controlled by the dts|dtb ( device tree ) and whatever drivers are loaded often expecting a specific hardware configuration in dts|dtb.

So, you have to know what you're doing ( datasheet and user's manual for the RK3328 SoC ) and you have to know what drivers are being loaded now, and you have to understand your current dts|dtb...  and frankly, its not trivial ( I don't know what your skill level is ).  Also, you need to know how to disable certain drivers, and how to modify or create a specific config in device tree ( dts|dtb ).

Discussion here is complicated by the fact that most of the people reading this forum don't really understand uart(s) in general ( some are quite good at it ), and most of the readers of this forum are brand new to the Rock64 ( RK3328 is very new ).  So, there is limited experience, and everyone is learning;  add to that the fact that most users so far don't need this function and have not researched it yet -- including me ( and I'm somebody who uses uart(s) on these SBC(s) all the time ).

You will need to research everything that I've put above;  seriously.  And then you will need to be patient with the technology and with yourself,  because there will be a learning curve and you're going to have to experiment a bit.  If you're very patient you'll catch some soul in a generous mood who has some extra time and who may be willing to do some hand-holding.  You need to know how the control registers work, and how to configure device tree ( dts|dtb ) so start there,  read what you can in the user's manual and datasheet, and see what you can figure out on your own;  then, come back ( here or on the irc ) and ask whatever 'specific' questions you're still not clear about...

PS.  GPIO_A4 and GPIO_A6 are not listed on the pinout(s) chart as yellow ( uart Interface ) but are listed as green ( general purpose ).  This is where the datasheet and user manual come in handy ( and I have not looked yet ) to find out if in fact those pins have a secondary purpose for being universal asynchronous receiver and transmitter (uart).

PSS.  what would their function numbers have to be ?   how would that be specified in dts|dtb ?

( I'll have to research it a bit  too )


The gpio(s) are discussed at length in the TRM ( technical reference manual ) part I. chapter 18.  The UART(s) are discussed at length in chapter 17 of the TRM;  there are three uart(s) and yes, uart(1) uses GPIO3_A4 and GPIO3_A6;  however, the IOMUX has to be set properly for this secondary function.  

Start with the TRM and do some research;  the uart(s) are not trivial and you may need to do some study.

I also did some looking in the TRM Part II. ( which is confidential and only disclosed upon request to certain developers ) and it seems that what you need to know is (fortunately) in part I.

Keep in mind that if you activate uart(1) you will loose those two gpio pins ( at least ) and you may also lose the rts cts pins as well;  you will need to research that also.

Blush
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using multiple UART's on Rock64. ramprasad 0 1,230 08-29-2022, 01:22 PM
Last Post: ramprasad
  Using multiple UART's on Rock64. sachineswar 0 1,124 08-29-2022, 12:31 PM
Last Post: sachineswar
Lightbulb RK3399 Linux rtl8822cu module bluetooth not working shivarj89 0 1,582 07-29-2021, 07:19 AM
Last Post: shivarj89
Question bluetooth rock64 problem deta 3 5,675 05-06-2020, 11:29 PM
Last Post: deta
  Ayufan Debian Stretch Openmediavault 4 5G Wifi Not Connecting Poincare 0 2,481 03-26-2019, 07:28 PM
Last Post: Poincare
Smile Adding a new kernel module a1w.ca 1 3,434 01-07-2019, 01:57 AM
Last Post: tllim
  Bluetooth adapter from store not working in Linux/Lakka/Retroarch Poincare 0 2,066 06-26-2018, 06:34 PM
Last Post: Poincare
  free UART drekrob 2 3,587 12-18-2017, 08:40 AM
Last Post: xalius

Forum Jump:


Users browsing this thread: 2 Guest(s)