pvsub
Posts: 2
Joined: Tue Apr 09, 2019 12:12 pm

[SOLVED] Mapping from [email protected] to 40-in header, in dt-blob.dts

Tue Apr 09, 2019 12:21 pm

Hello:

My Raspberry Pi 3B runs Jessie-Lite. I would like to configure Physical pin 12/BCM pin 18/Wiring Pi pin 1 to be an output, set to low.

On previous versions, this is apparently done by editing the dt-blob.dts file (https://www.raspberrypi.org/documentati ... uration.md, https://github.com/raspberrypi/firmware ... t-blob.dts)

However, in the section for pins_3b1 or pins_3b2 (Pi 3 B), I cannot find a reference corresponding to my target pin (Physical pin 12/BCM pin 18/Wiring Pi pin 1). There is no [email protected] or [email protected] There is a [email protected] but inside the videcore {} section (which I tried anyway, but didnt do the job).

What should I be editing in the DTS file?

(I can't use Stretch, I am aware of the very simple config.txt setting for gpio)

Thank you.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2444
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Mapping from [email protected] to 40-in header, in dt-blob.dts

Tue Apr 09, 2019 12:49 pm

The dt-blob is not meant to list all pins - just those with a specific function and that require a non-default value. If you were to initialise GPIO18 from the dt-blob to be an output driving low you would need to add something like:

Code: Select all

            [email protected] { function = "output"; termination = "no_pulling"; polarity = "active_high"; };
N.B. The "pin" numbers are in the Broadcom namespace - not pin numbers on the header (which changed with the introduction of the B+, and doesn't exist on the Compute Module).

But there is an easier way now - just add the following to config.txt:

Code: Select all

gpio=18=op,dl
See here for documentation of the gpio setting.

pvsub
Posts: 2
Joined: Tue Apr 09, 2019 12:12 pm

Re: Mapping from [email protected] to 40-in header, in dt-blob.dts

Tue Apr 09, 2019 2:15 pm

Thank you, that worked!

Return to “Device Tree”