I2C write failed on SAMA5D4 board

Discussion around products based on ARM Cortex-A5 core.

Moderator: nferre

suresh.sc1976@gmail.com
Posts: 1
Joined: Tue Feb 10, 2015 9:29 am

I2C write failed on SAMA5D4 board

Wed Feb 11, 2015 9:32 am

Nand don't have default I2C in SAMA5D4 board. i have configure I2C and loaded zimage and dtb file and booted from SD card. with the help of I2Cdetect i can see I2C0-3 on board. when i connect hardware through I2C1 it won't show any address and when tried to write value it's give write failed error. i have checked for all I2C getting same error.
blue_z
Location: USA
Posts: 2128
Joined: Thu Apr 19, 2007 10:15 pm

Re: I2C write failed on SAMA5D4 board

Thu Feb 12, 2015 9:23 pm

suresh.sc1976@gmail.com wrote:when i connect hardware through I2C1 ...
Check out hardware using U-Boot rather than Linux.

Regards
Jimmy.Zhu
Posts: 14
Joined: Mon Sep 14, 2015 9:15 am

Re: I2C write failed on SAMA5D4 board

Thu Apr 21, 2016 1:44 pm

QQ图片20160421193114.png
QQ图片20160421193114.png (2.36 KiB) Viewed 9986 times
Hi suresh

Would share the solution of this issue?

I also find there are some strange problems about SAMA5D4's I2C1.

I change the dts file, and configure the I2C1 for AT24C02 EEPROM

Code: Select all

			i2c1: i2c@f8018000 {
				status = "okay";

				at24c02@0x52 {
					compatible = "24c02";
					status = "okay";
					reg = <0x52>;
				};
			};

Code: Select all


			i2c0: i2c@f8014000 {
				compatible = "atmel,at91sam9x5-i2c";
				reg = <0xf8014000 0x4000>;
				interrupts = <32 IRQ_TYPE_LEVEL_HIGH 6>;
				dmas = <&dma1
					(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
					| AT91_XDMAC_DT_PERID(2))>,
				       <&dma1
					(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
					| AT91_XDMAC_DT_PERID(3))>;
				dma-names = "tx", "rx";
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_i2c0>;
				#address-cells = <1>;
				#size-cells = <0>;
				clocks = <&twi0_clk>;
				status = "disabled";
			};
			
			i2c1: i2c@f8018000 {
				compatible = "atmel,at91sam9x5-i2c";
				reg = <0xf8018000 0x4000>;
				interrupts = <33 IRQ_TYPE_LEVEL_HIGH 6>;
				dmas = <&dma1
					(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
					| AT91_XDMAC_DT_PERID(4))>,
				       <&dma1
					(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
					| AT91_XDMAC_DT_PERID(5))>;
				dma-names = "tx", "rx";
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_i2c1>;
				#address-cells = <1>;
				#size-cells = <0>;
				clocks = <&twi1_clk>;
				status = "disabled";
			};

Code: Select all

                       i2c1 {
				       pinctrl_i2c1: i2c1-0 {
						atmel,pins =
							<AT91_PIOE 29 AT91_PERIPH_C AT91_PINCTRL_NONE
							 AT91_PIOE 30 AT91_PERIPH_C AT91_PINCTRL_NONE>;
					};
				};

From the captrued timing picture, the I2C1 clock stop when reading the second data.
Jimmy.Zhu
Posts: 14
Joined: Mon Sep 14, 2015 9:15 am

Re: I2C write failed on SAMA5D4 board

Wed Apr 27, 2016 5:08 pm

Maybe there is a bug about I2C1's DMA in linux4sam_4.7, Now I disable I2C DMA and I2C1 is OK.

Return to “SAMA5D Cortex-A5 MPU”

Who is online

Users browsing this forum: No registered users and 1 guest