Enabling UART port in Odroid N2+

Post Reply
sujanrshr
Posts: 16
Joined: Tue Mar 22, 2022 10:40 am
languages_spoken: English, Korean, Nepali
ODROIDs: Odroid-N2+
Has thanked: 5 times
Been thanked: 0
Contact:

Enabling UART port in Odroid N2+

Post by sujanrshr »

I am developing Android app.
The Odroid board has 2 Uarts.
So far I am only able to use 1 uart that is present in 40 pin header.
The Android app detects only 1 uart. It is displayed as "Uart-1".
How do I enable the separate 4 pin Uart port ?

Luke.go
Posts: 707
Joined: Mon May 30, 2016 1:55 pm
languages_spoken: english
Has thanked: 112 times
Been thanked: 111 times
Contact:

Re: Enabling UART port in Odroid N2+

Post by Luke.go »

You can enable more UART ports via dtb overlay feature.
please check the wiki page. :)
https://wiki.odroid.com/odroid-n2/appli ... _odroid-n2

In android you should modify the /odm/env.ini file.

Or please use odroid settings apps for modify dtb overlays value.

User avatar
mad_ady
Posts: 10739
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, H2, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 647 times
Been thanked: 935 times
Contact:

Re: Enabling UART port in Odroid N2+

Post by mad_ady »

How do I enable the separate 4 pin Uart port ?
That is active and should be visible as /dev/ttyACM0 or /dev/ttyS0 or /dev/ttyAML. I'm not sure on the node name. It's used for kernel messages and also runs a shell.

User avatar
odroid
Site Admin
Posts: 39381
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2617 times
Been thanked: 1430 times
Contact:

Re: Enabling UART port in Odroid N2+

Post by odroid »

mad_ady wrote:
Tue Apr 05, 2022 6:25 pm
How do I enable the separate 4 pin Uart port ?
That is active and should be visible as /dev/ttyACM0 or /dev/ttyS0 or /dev/ttyAML. I'm not sure on the node name. It's used for kernel messages and also runs a shell.
It must be ttyS* since Android OS still uses an old kernel 4.9.

sujanrshr
Posts: 16
Joined: Tue Mar 22, 2022 10:40 am
languages_spoken: English, Korean, Nepali
ODROIDs: Odroid-N2+
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Enabling UART port in Odroid N2+

Post by sujanrshr »

I am using SD card to boot android.
I checked the website
https://wiki.odroid.com/odroid-n2/appli ... _odroid-n2

but could not find any method to open the config.ini file from Android.

The website does not tell how to open or access config.ini file from android.
It does not tell whether I should use transfer the file from USB or use other methods ?

I am confused if I should open Petitboot or Android ?

How can I modify settings to enable uart transmit and receive ?

sujanrshr
Posts: 16
Joined: Tue Mar 22, 2022 10:40 am
languages_spoken: English, Korean, Nepali
ODROIDs: Odroid-N2+
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Enabling UART port in Odroid N2+

Post by sujanrshr »

I am using SD card to boot android.
I checked the website
https://wiki.odroid.com/odroid-n2/appli ... _odroid-n2

but could not find any method to open the config.ini file from Android.

The website does not tell how to open or access config.ini file from android.
It does not tell whether I should use transfer the file from USB or use other methods ?

I am confused if I should open Petitboot or Android ?
I have no idea about setting the Odroid board and how it is done .

The website "https://wiki.odroid.com/odroid-n2/appli ... _odroid-n2" says
Open /media/boot/config.ini file with your favorite text editor.

In what should I open it ? should I open it in Android or in Petitboot or in windows 10 ?

How can I modify settings to enable uart transmit and receive ? Is there a manual for beginners to setup Odroid board ?

Luke.go
Posts: 707
Joined: Mon May 30, 2016 1:55 pm
languages_spoken: english
Has thanked: 112 times
Been thanked: 111 times
Contact:

Re: Enabling UART port in Odroid N2+

Post by Luke.go »

Oh, as I mentioned, you can set overlay value from the odroid settings apps.
Open the ODROID Settings -> DTB Overlay -> DTB Overlay List, then add uart1 at the last of line.

sujanrshr
Posts: 16
Joined: Tue Mar 22, 2022 10:40 am
languages_spoken: English, Korean, Nepali
ODROIDs: Odroid-N2+
Has thanked: 5 times
Been thanked: 0
Contact:

Re: Enabling UART port in Odroid N2+

Post by sujanrshr »

From Android, I opened Odroid and opened DTB Overlays. Without changing anything, the default values was as follows :
i2c0 i2c1 spi0 uart0 pwm_cd pwm_ef.

Here, I added
i2c0 i2c1 spi0 uart0 pwm_cd pwm_ef uart1.
and rebooted.

from Petitboot when I typed :
ls -al /dev/ttyS?
The result was
crw--w---- 1 0 0 242, 0 Jan 1 00:00 /dev/ttyS0

I think that this means the board has only one UART. IS this true ?
Maybe this means that UART present is already enabled.

Even after doing this, my app closes when I include data receive code while the data transmit code is working fine.

User avatar
joerg
Posts: 1585
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 129 times
Been thanked: 272 times
Contact:

Re: Enabling UART port in Odroid N2+

Post by joerg »

On petitboot level it is not shown. It loads only with booting the kernel. You should look from adb shell if it is there.

gid204
Posts: 2
Joined: Fri Jul 22, 2022 6:54 am
languages_spoken: english
ODROIDs: N2+
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Enabling UART port in Odroid N2+

Post by gid204 »

Hi all,

I'm currently trying to enable UART to plug in a zigbee shield for use with Home Assistant OS.
I can't seem to figure out how to enable UART.

This is the shield:
https://github.com/egony/cc2652p_cc1352p_RF-STAR

The following document explains on page 5-6 how to enable UART on the raspberry PI:
https://aeotec.attachments6.freshdesk.c ... X3F6RQIXLA

I can locate config.txt but not sure what I am meant to add for the N2+. The lines mentioned on page 6 do not work.

Cheers!

Luke.go
Posts: 707
Joined: Mon May 30, 2016 1:55 pm
languages_spoken: english
Has thanked: 112 times
Been thanked: 111 times
Contact:

Re: Enabling UART port in Odroid N2+

Post by Luke.go »

The Odroid have a different way to enable the peripheral. :)

please check here.
https://wiki.odroid.com/odroid-n2/appli ... droid-n2n2
These users thanked the author Luke.go for the post:
gid204 (Fri Jul 22, 2022 4:35 pm)

User avatar
odroid
Site Admin
Posts: 39381
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2617 times
Been thanked: 1430 times
Contact:

Re: Enabling UART port in Odroid N2+

Post by odroid »

Since Home Assistant OS has their own Linux source tree based on Kernel 5.15 LTS, our device-tree-overlay configuration in the WiKi pages might not work.
These users thanked the author odroid for the post:
gid204 (Fri Jul 22, 2022 4:35 pm)

gid204
Posts: 2
Joined: Fri Jul 22, 2022 6:54 am
languages_spoken: english
ODROIDs: N2+
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Enabling UART port in Odroid N2+

Post by gid204 »

Thanks for your responses.

I added the config from the wiki above into the location home assistant is expecting it and it is not working :/
Perhaps there is more to it. I am going to try install plain ubuntu and see if I can get it working that way.

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 3 guests