From nobody Mon Jul 11 03:18:59 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BB1141D0F110 for ; Mon, 11 Jul 2022 03:19:03 +0000 (UTC) (envelope-from freebsd-rj@cyclaero.com) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.161]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "*.smtp.rzone.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lh8HV2fkwz3kXd for ; Mon, 11 Jul 2022 03:19:02 +0000 (UTC) (envelope-from freebsd-rj@cyclaero.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1657509540; s=strato-dkim-0002; d=cyclaero.com; h=Message-Id:In-Reply-To:To:References:Date:Subject:From:Cc:Date:From: Subject:Sender; bh=8w5lp7EdSM6sooPTWiAkyYcAUMWmiJWXRoJn8F1dS6c=; b=cIb8TkJu73kTyv+9r1TobOw7HNnlf/UfmjpMDcppfxB0BrQZe6r/k5H7Vj7FiiBxrR zzW0IZpj878iJY1ioQ9KbzNfx7z/GHFUi2iUWSvBkeL/O3H9c8Q/YCtY85X0pwixXCmi LBOspKRhuoHO5mnwbHdrOWaNFeWhhrslYr+a7ojI+DnIJlFElKPuO3gAIYImAV6Ew990 oZ4JaU6JRIdQ4hVWKERG+hVyOtfHKTQfDwDOVhU8B2Q9bivsTYz66QiJ257vJD4beQbf rKlq/uu0Ey3Xz9Xzwcc9ykWe0paOipZhe+vnHcDMLGwk52NTwD+1quy0DJGzuubIhe3S N99g== X-RZG-AUTH: ":O2kGeEG7b/pS1F2rRHW2isrKl4DV03XBEi+I6ZuztdvN9wS3wFGySS4Lw+ldTBio08NTPnK5bNCibgxfnBg=" X-RZG-CLASS-ID: mo00 Received: from mail.obsigna.com by smtp.strato.de (RZmta 47.46.1 AUTH) with ESMTPSA id kcd9d5y6B3J0dCh (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Mon, 11 Jul 2022 05:19:00 +0200 (CEST) Received: from rolf-mini.obsigna.com (unknown [177.95.254.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.obsigna.com (Postfix) with ESMTPSA id 2471463942 for ; Mon, 11 Jul 2022 05:18:59 +0200 (CEST) From: "Dr. Rolf Jansen" Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Subject: Re: i2c bus via USB adapter Date: Mon, 11 Jul 2022 00:18:59 -0300 References: To: freebsd-arm In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3445.104.15) X-Rspamd-Queue-Id: 4Lh8HV2fkwz3kXd X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cyclaero.com header.s=strato-dkim-0002 header.b=cIb8TkJu; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-rj@cyclaero.com designates 81.169.146.161 as permitted sender) smtp.mailfrom=freebsd-rj@cyclaero.com X-Spamd-Result: default: False [-2.20 / 15.00]; FROM_NAME_HAS_TITLE(1.00)[dr]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:81.169.146.128/25:c]; R_DKIM_ALLOW(-0.20)[cyclaero.com:s=strato-dkim-0002]; RWL_MAILSPIKE_GOOD(-0.10)[81.169.146.161:from]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[81.169.146.161:from]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[cyclaero.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[freebsd-arm]; DKIM_TRACE(0.00)[cyclaero.com:+]; TO_DN_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:6724, ipnet:81.169.144.0/22, country:DE]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N > Am 10.07.2022 um 23:18 schrieb John Kennedy : >=20 > Along with trying to attach some I2C devices to my RPI4 (which has > GPIO-pin exposure issues due to heatsink-case), I tried attaching this > device from Adafruit: >=20 > Adafruit MCP2221A Breakout - General Purpose USB to GPIO ADC I2C = Stemma QT / Qwiic > https://www.adafruit.com/product/4471 I cannot help you with this piece. However, did you know that we can easily enable just some more I2C = busses of the RPi4 using other pins on the header. For example I enabled = I2C5 running on GPIO12/13. This works concurrently to the default I2C1 = on GPIO2/3. The respective numbers of the physical pins on the header for I2C5 are: 17: 3.3 V 32: SDA 33: SCL 34: GND These pins are on the other end to where you connected the vent of the = heat sink, and chances are that these are still accessible. Anyway, for enabling I2C5 (we may choose from I2C3, I2C4, I2C5 and I2C6) = on a Raspberry Pi 4, we do: # fetch = https://github.com/raspberrypi/linux/blob/rpi-5.15.y/arch/arm/boot/dts/ove= rlays/i2c5-overlay.dts # dtc -I dts -O dtb -b0 -@ -o /boot/msdos/overlays/i2c5.dtbo = i2c5-overlay.dts Then we add the following 2 lines to /boot/msdos/config.txt: gpio=3D12,13=3Da5 dtoverlay=3Di2c5,pins_12_13 While my DS3231 RTC breakout board worked on these pins (phys. #32,#33) = without any problem, I needed to add 3.3 k=CE=A9 pull-up resistors to = the SDA and SCL lines for other modules. Most probably said RTC breakout = came already with pull-ups on board. Anyway, finally I left the RTC on = the default I2C bus. In dmesg: ... iicbus0: on iichb0 iic0: on iicbus0 ds32310: at addr 0xd0 on iicbus0 iicbus1: on iichb1 iic1: on iicbus1 ...=