Jump to content

i2c and uart issue on Odroid n2+


rpineau

Recommended Posts

I'm testing the Armbian image for Odroid N2+ ( Armbian_22.08.7_Odroidn2_jammy_current_5.19.17_xfce_desktop) to see if it's a good migration path from the HardKernel base image.

Unfortunately I need to get both i2c bus running on the GPIO and so far only the first bus seems to work (i2c-0).

Looking into /sys/bus/i2c/devices , it looks like i2c-1 is tied to the hdmi port instead of the 2nd i2c bus on the GPIO :
 

lrwxrwxrwx 1 root root 0 Dec 31  1969 0-0051 -> ../../../devices/platform/soc/ffd00000.bus/ffd1c000.i2c/i2c-0/0-0051
lrwxrwxrwx 1 root root 0 Dec 31  1969 i2c-0 -> ../../../devices/platform/soc/ffd00000.bus/ffd1c000.i2c/i2c-0
lrwxrwxrwx 1 root root 0 Dec 31  1969 i2c-1 -> ../../../devices/platform/soc/ff600000.bus/ff600000.hdmi-tx/i2c-1

 

I also tried to load the uart dtbo using armbian-config, but they do not show up in /dev after a reboot. so it looks like none of the overlay are actually loading.

Here is the content of my armbianEnv.txt :

 

verbosity=1
console=both
overlay_prefix=meson
bootlogo=true
rootdev=UUID=9355737e-ddfc-4d22-a953-b2bb4bf41a56
rootfstype=ext4
overlays=g12-gxl-cma-pool-896MB i2cA i2cB uartA uartC
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

 

so.. how do I enable the i2c port properly, as well as the uarts ... and I will need to also enable pwm on pin 12 and 33 (pwm_ef pwm_cd overlay on Hardkenel images).

These is my current overlay line on Hardkernel images : overlays="i2c0 i2c1 uart0 uart1 pwm_ef pwm_cd"

 

Thanks.

 

Link to comment
Share on other sites

I booted with a serial console cable to see what was going on with the overlays ... they are apparently not compile properly :

 

Applying kernel provided DT overlay meson-g12-gxl-cma-pool-896MB.dtbo
343 bytes read in 3 ms (111.3 KiB/s)
Applying kernel provided DT overlay meson-i2cA.dtbo
failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND
343 bytes read in 3 ms (111.3 KiB/s)
Applying kernel provided DT overlay meson-i2cB.dtbo
failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
base fdt does did not have a /__symbols__ node
make sure you've compiled with -@
238 bytes read in 3 ms (77.1 KiB/s)
Applying kernel provided DT overlay meson-uartA.dtbo
failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
base fdt does did not have a /__symbols__ node
make sure you've compiled with -@
238 bytes read in 3 ms (77.1 KiB/s)
Applying kernel provided DT overlay meson-uartC.dtbo
failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
base fdt does did not have a /__symbols__ node
make sure you've compiled with -@
Error applying DT overlays, restoring original DT

 

only the meson-g12-gxl-cma-pool-896MB.dtbo seems to work ok.

the first i2c bus works as apparently it's enable in the dtb file :

fdtget /boot/dtb/amlogic/meson-g12b-odroid-n2-plus.dtb /soc/bus@ffd00000/i2c@1c000 status 
okay

 

The other ones are disabled.

fdtget /boot/dtb/amlogic/meson-g12b-odroid-n2-plus.dtb /soc/bus@ffd00000/i2c@1d000 status
disabled

 

I tried enabling it :
 

n2dev:overlay:# fdtput -t s /boot/dtb/amlogic/meson-g12b-odroid-n2-plus.dtb /soc/bus@ffd00000/i2c@1d000 status "okay"
n2dev:overlay:# fdtget /boot/dtb/amlogic/meson-g12b-odroid-n2-plus.dtb /soc/bus@ffd00000/i2c@1d000 status 
okay

 and after rebooting it does show up... but the pin are not set to the right mode (ALT1 for pin 3 and 5) and the actual i2c bus is just not working as my devices are not showing up on that bus (they do on the original hardkernel kernel 4.9.x but I want to move to 5.x :) ).

When this 2nd bus is enable, the HDMI i2c is moved to i2c-2 , but nothing is detected on bus 1 :
 

n2dev:~:% i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
n2dev:~:% i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
n2dev:~:% i2cdetect -y 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: 30 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

 

here is the state of the gpio pins :
 

 +-----+-----+---------+------+---+--- N2 ---+---+------+---------+-----+-----+
 | I/O | wPi |   Name  | Mode | V | Physical | V | Mode |  Name   | wPi | I/O |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3V |      |   |  1 || 2  |   |      | 5V      |     |     |
 | 493 |   8 |   SDA.2 |   IN | 1 |  3 || 4  |   |      | 5V      |     |     |
 | 494 |   9 |   SCL.2 |   IN | 1 |  5 || 6  |   |      | 0V      |     |     |
 | 473 |   7 |  IO.473 |   IN | 0 |  7 || 8  | 1 | IN   | TxD1    | 15  | 488 |
 |     |     |      0V |      |   |  9 || 10 | 1 | IN   | RxD1    | 16  | 489 |
 | 479 |   0 |  IO.479 |   IN | 1 | 11 || 12 | 0 | IN   | IO.492  | 1   | 492 |
 | 480 |   2 |  IO.480 |   IN | 1 | 13 || 14 |   |      | 0V      |     |     |
 | 483 |   3 |  IO.483 |   IN | 1 | 15 || 16 | 1 | IN   | IO.476  | 4   | 476 |
 |     |     |    3.3V |      |   | 17 || 18 | 1 | IN   | IO.477  | 5   | 477 |
 | 484 |  12 |    MOSI |   IN | 1 | 19 || 20 |   |      | 0V      |     |     |
 | 485 |  13 |    MISO |   IN | 1 | 21 || 22 | 0 | IN   | IO.478  | 6   | 478 |
 | 487 |  14 |    SCLK |   IN | 1 | 23 || 24 | 1 | IN   | CE0     | 10  | 486 |
 |     |     |      0V |      |   | 25 || 26 | 1 | IN   | IO.464  | 11  | 464 |
 | 474 |  30 |   SDA.3 | ALT2 | 1 | 27 || 28 | 1 | ALT2 | SCL.3   | 31  | 475 |
 | 490 |  21 |  IO.490 |   IN | 1 | 29 || 30 |   |      | 0V      |     |     |
 | 491 |  22 |  IO.491 |   IN | 1 | 31 || 32 | 0 | IN   | IO.472  | 26  | 472 |
 | 481 |  23 |  IO.481 |   IN | 0 | 33 || 34 |   |      | 0V      |     |     |
 | 482 |  24 |  IO.482 |   IN | 0 | 35 || 36 | 0 | IN   | IO.495  | 27  | 495 |
 |     |  25 |   AIN.3 |      |   | 37 || 38 |   |      | 1V8     | 28  |     |
 |     |     |      0V |      |   | 39 || 40 |   |      | AIN.2   | 29  |     |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | I/O | wPi |   Name  | Mode | V | Physical | V | Mode |  Name   | wPi | I/O |
 +-----+-----+---------+------+---+--- N2 ---+---+------+---------+-----+-----+

 

pin 3 and 5 should be in ALT1 mode as seen on a working system (original hard kernel image with their dtbo) :

 +-----+-----+---------+------+---+--- N2 ---+---+------+---------+-----+-----+
 | I/O | wPi |   Name  | Mode | V | Physical | V | Mode |  Name   | wPi | I/O |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3V |      |   |  1 || 2  |   |      | 5V      |     |     |
 | 493 |   8 |   SDA.2 | ALT1 | 1 |  3 || 4  |   |      | 5V      |     |     |
 | 494 |   9 |   SCL.2 | ALT1 | 1 |  5 || 6  |   |      | 0V      |     |     |
 | 473 |   7 |  IO.473 |  OUT | 1 |  7 || 8  | 1 | ALT1 | TxD1    | 15  | 488 |
 |     |     |      0V |      |   |  9 || 10 | 1 | ALT1 | RxD1    | 16  | 489 |
 | 479 |   0 |  IO.479 |   IN | 1 | 11 || 12 | 0 | ALT1 | IO.492  | 1   | 492 |
 | 480 |   2 |  IO.480 |  OUT | 0 | 13 || 14 |   |      | 0V      |     |     |
 | 483 |   3 |  IO.483 | ALT2 | 1 | 15 || 16 | 0 | OUT  | IO.476  | 4   | 476 |
 |     |     |    3.3V |      |   | 17 || 18 | 0 | OUT  | IO.477  | 5   | 477 |
 | 484 |  12 |    MOSI |   IN | 1 | 19 || 20 |   |      | 0V      |     |     |
 | 485 |  13 |    MISO |   IN | 1 | 21 || 22 | 0 | OUT  | IO.478  | 6   | 478 |
 | 487 |  14 |    SCLK |   IN | 1 | 23 || 24 | 1 | IN   | CE0     | 10  | 486 |
 |     |     |      0V |      |   | 25 || 26 | 1 | IN   | IO.464  | 11  | 464 |
 | 474 |  30 |   SDA.3 | ALT2 | 1 | 27 || 28 | 1 | ALT2 | SCL.3   | 31  | 475 |
 | 490 |  21 |  IO.490 | ALT1 | 1 | 29 || 30 |   |      | 0V      |     |     |
 | 491 |  22 |  IO.491 |   IN | 1 | 31 || 32 | 0 | OUT  | IO.472  | 26  | 472 |
 | 481 |  23 |  IO.481 | ALT4 | 0 | 33 || 34 |   |      | 0V      |     |     |
 | 482 |  24 |  IO.482 | ALT2 | 1 | 35 || 36 | 0 | OUT  | IO.495  | 27  | 495 |
 |     |  25 |   AIN.3 |      |   | 37 || 38 |   |      | 1V8     | 28  |     |
 |     |     |      0V |      |   | 39 || 40 |   |      | AIN.2   | 29  |     |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | I/O | wPi |   Name  | Mode | V | Physical | V | Mode |  Name   | wPi | I/O |
 +-----+-----+---------+------+---+--- N2 ---+---+------+---------+-----+-----+

 

so looks like there might be some deeper issues than just the dtbo not being properly compiled.

 

Link to comment
Share on other sites

Adding more info here, would be glad if anyone more knowledgeable than me could point me in the right direction.

 

I just updated to the latest Armbian 22.11.4 Bullseye with Linux 6.0.13-meson64 and enabled uartA and uartC overlays via armbian-config (and confirmed they are set in armbianEnv.txt).

 

Still I don't get the uartA to show up, dmesg has only

ff803000.serial: ttyAML0 at MMIO 0xff803000 (irq = 14, base_baud = 1500000) is a meson_uart

which is uartC.

 

Anything I might have missed or is this a bug? Is anyone around who could give me hint what to look for? I'm new to the topic, haven't used overlays before..

 

Maybe @martinayotte, I saw that you could help another user in an older thread for the Odroid C2 with a serial port issues, any ideas?

 

 

Highly appreciate any help 🙂

Link to comment
Share on other sites

Is there any clear solution ?

Can you help me with my problem with activation and enabling UART (RX/TX pin8 and pin 10) on the odroid n2+?

When I will use a armbian-config and switch on uartA, this pins are still not working. Do you have any idea how to get onboard uart working ?

Thanks for each help

Alex

Edited by Alda
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines