User avatar
Gavinmc42
Posts: 2071
Joined: Wed Aug 28, 2013 3:31 am

Re: New "gpio" config.txt command announcement

Mon Apr 02, 2018 12:08 pm

It's handled by start.elf and its variants
Thanks I was hoping for that ;)
Good way to get GPIO set quickly before any OS messes them up ;)
Are they set near the start of start.elf, ie quickly after booting <400ms?
Big difference between file sizes of start_cd and start_x
So quickest GPIO setting is done by reading start_cd from SD?

Hmm should be able to use two Pi's to test that now 8-)
One Pi has small OS that changes a pin state, the other Pi resets the first and can test how long start.elf takes to boot and change the pin and then how long the OS takes to change it back.

This simple Ultibo OS returns 3000C1EF, a simple GPIO status display.
Basically reading the GPIO as fast as I can to make a logic analyser.
I have set GPIO4 as GPCLK0 and I can see GPIO toggling between 3000C1EF and 3000C1FF.
By changing the clock speed it tests my capture rate, more useful when DMA/SMI reads gets going.

Some pins like the i2c have pullups, not much I can do about them ;)
But a Pi setup as a logic analyser does not need pins set as outputs on boot.

Code: Select all

  while True  do 
    Begin
     data:=GPIORead(BCM2835_GPLEV0);
     ConsoleWindowWriteLn(WindowHandle,'GPIO 0-31 = ' + IntToHex(data, 8));
    end;          
Should be able to do GPIO level interrupt timing ;)
Very weird thinking about using Pi's as test equipment :o
With the above code I have a build in logic level detector fast enough to capture i2c etc.
Pi's can have built in test equipment for self diagnostics, which is going to take some more thinking about.
Propeller is the only other one I know that can do this easily.

Hmm Digital Multimeter Hat, had not thought of that one before :lol:
Hmm logging Multimeter with bluetooth and wifi, now that could be really useful :shock:

Zero's must be the cheapest and most flexible pieces of kit I have these days.
And you guys just keep on improving them :D
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
TimG
Posts: 251
Joined: Tue Apr 03, 2012 12:15 am
Location: Switzerland

Re: New "gpio" config.txt command announcement

Fri Apr 06, 2018 11:42 pm

jamesh wrote:
Fri Mar 23, 2018 10:57 am
Does anyone actually have anything useful to say on this cool new feature?
It seems to work well to enable pull-ups on overlays that don't otherwise support them (eg. the i2c-gpio overlay which provides extra bit-banged i2c ports). So, thanks for this cool new feature!

User avatar
Gavinmc42
Posts: 2071
Joined: Wed Aug 28, 2013 3:31 am

Re: New "gpio" config.txt command announcement

Sat Apr 07, 2018 2:06 am

Does anyone actually have anything useful to say on this cool new feature?
It is cool, this means other OS's and/or baremetal can use this to set initial GPIO state after boot.
Devicetree is for Linux and not everyone(0.0001%) uses Linux ;) some don't even use Raspbian :o

Since start.elf source code is not open we cannot give you a pat on the back for everything we don't know about.
The VCOS interface is documented and there are some examples but most apply only to Raspbian Linux.

This feature helps make Pi's a bit more useful for IoT apps.
Please stick it in the documentation and don't leave it buried in a few forum posts :D
Perhaps in bootmodes doc? It is very important info and feature.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

gwideman
Posts: 44
Joined: Tue Mar 01, 2016 8:18 pm

Re: New "gpio" config.txt command announcement

Mon Apr 09, 2018 6:32 am

dh - Driving high (for outputs)
dl - Driving low (for outputs)

Do these options set the default output level (logic 1 = high, logic 0 = low), or do they select between the two drive strength options (16mA = high, and 8mA = low)? Thanks.

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

Re: New "gpio" config.txt command announcement

Mon Apr 09, 2018 6:39 am

They set the logic levels - dh for 1, dl for 0.

Embring
Posts: 3
Joined: Thu May 17, 2018 5:34 pm

Re: New "gpio" config.txt command announcement

Thu May 17, 2018 6:05 pm

Is it possible to turn off the I2C drivers forced repeated starts in the new "gpio" config.txt?
It would be great! Really have problems with this issue. The old kernel doesn't work on my brand new 3B+

Return to “Interfacing (DSI, CSI, I2C, etc.)”

Who is online

Users browsing this forum: No registered users and 7 guests