procount
Posts: 1148
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Conditional config.txt

Mon Apr 23, 2018 11:29 pm

Is there a conditional setting in config.txt to isolate settings for the pi3B+ ?

https://www.raspberrypi.org/documentati ... itional.md only mentions the following:

[pi1]
[pi2]
[pi3]
[pi0]
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

User avatar
DougieLawson
Posts: 33334
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Conditional config.txt

Tue Apr 24, 2018 7:27 am

I'm fairly sure James Hughes (JamesH on here) from RP(T)Ltd said there was some support for conditional stanzas in /boot/config.txt for the RPi3B+ but I can't find it (Google wasn't being my friend today).

The master copy of the documentation is at: https://github.com/raspberrypi/document ... itional.md

So your, best option is to open an issue at: https://github.com/raspberrypi/documentation/issues
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

User avatar
RaTTuS
Posts: 10004
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Conditional config.txt

Tue Apr 24, 2018 7:52 am

or for temp stuff use
the serial number stuff .... i.e.
[0x12345678]
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
DougieLawson
Posts: 33334
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Conditional config.txt

Tue Apr 24, 2018 8:03 am

RaTTuS wrote:
Tue Apr 24, 2018 7:52 am
or for temp stuff use
the serial number stuff .... i.e.
[0x12345678]
I use that for all fifteen Raspberries. It means I can boot any Raspberry from any SDCard with my unified config.txt.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5362
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Conditional config.txt

Tue Apr 24, 2018 8:56 am

[pi0w] and [pi3+] both exist - yet more documentation updates required.
Looking at the code it appears you can also filter based on the state of a gpio using [gpio<num>=[0|1]], eg [gpio4=1]. One to confirm with dom and also document. (That could be really useful for switching between boot configs on a CM. Hmm).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
DougieLawson
Posts: 33334
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Conditional config.txt

Tue Apr 24, 2018 9:32 am

6by9 wrote:
Tue Apr 24, 2018 8:56 am
[pi0w] and [pi3+] both exist - yet more documentation updates required.
Looking at the code it appears you can also filter based on the state of a gpio using [gpio<num>=[0|1]], eg [gpio4=1]. One to confirm with dom and also document. (That could be really useful for switching between boot configs on a CM. Hmm).
Thanks Dave. The [gpio?=0|1] looks amusing, could that be used to detect whether a camera is attached? I assume it doesn't have to be a GPIO that's externalised to the 40-pin header.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

procount
Posts: 1148
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Conditional config.txt

Tue Apr 24, 2018 9:59 am

Thanks all.
Looks like [pi3+] is the one I want in order to ensure the reduced frequency stability settings are set for the 3B+ (in the general case, not for a specific serial number), whilst not affecting other Pi models.
I've added a github issue: https://github.com/raspberrypi/documentation/issues/892
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5362
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Conditional config.txt

Tue Apr 24, 2018 10:05 am

DougieLawson wrote:
Tue Apr 24, 2018 9:32 am
6by9 wrote:
Tue Apr 24, 2018 8:56 am
[pi0w] and [pi3+] both exist - yet more documentation updates required.
Looking at the code it appears you can also filter based on the state of a gpio using [gpio<num>=[0|1]], eg [gpio4=1]. One to confirm with dom and also document. (That could be really useful for switching between boot configs on a CM. Hmm).
Thanks Dave. The [gpio?=0|1] looks amusing, could that be used to detect whether a camera is attached? I assume it doesn't have to be a GPIO that's externalised to the 40-pin header.
As I said, I only tripped over the code rather than knowing about this (I had to work backwards from the strncmp and strchr calls to work out the syntax).
Whilst you probably can read off the GPIO expander (GPIOs 128-135), I'm not sure if the camera will affect any input pins. The I2C lines may be pulled low if neither camera nor display is connected, but I wouldn't want to rely on that.

I was thinking more for swtiching between the multiple test configs that I have, although seeing as I tend to have to switch kernel between it may not be as trivial. AFAIK it doesn't allow for different cmdline.txt files, so not trivial to drop into different NFS mounts.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5362
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Conditional config.txt

Tue Apr 24, 2018 10:05 am

procount wrote:
Tue Apr 24, 2018 9:59 am
I've added a github issue: https://github.com/raspberrypi/documentation/issues/892
JamesH will love you for doing that ;)
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
DougieLawson
Posts: 33334
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Conditional config.txt

Tue Apr 24, 2018 10:10 am

6by9 wrote:
Tue Apr 24, 2018 10:05 am
procount wrote:
Tue Apr 24, 2018 9:59 am
I've added a github issue: https://github.com/raspberrypi/documentation/issues/892
JamesH will love you for doing that ;)
It's an addendum to one I opened.

I'd like every possible external option (not the hidden secret squirrel parms) to be documented in glorious detail so we can get away from pointing folks at https://elinux.org/RPiconfig as a source of documentation. We need words written for all of the /boot/config.txt things that can be tweaked and twiddled by regular users (with reasons why they might want to twiddle them).
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20062
Joined: Sat Jul 30, 2011 7:41 pm

Re: Conditional config.txt

Tue Apr 24, 2018 10:36 am

6by9 wrote:
Tue Apr 24, 2018 10:05 am
procount wrote:
Tue Apr 24, 2018 9:59 am
I've added a github issue: https://github.com/raspberrypi/documentation/issues/892
JamesH will love you for doing that ;)
Yippeeee!!!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20062
Joined: Sat Jul 30, 2011 7:41 pm

Re: Conditional config.txt

Tue Apr 24, 2018 10:38 am

DougieLawson wrote:
Tue Apr 24, 2018 10:10 am
6by9 wrote:
Tue Apr 24, 2018 10:05 am
procount wrote:
Tue Apr 24, 2018 9:59 am
I've added a github issue: https://github.com/raspberrypi/documentation/issues/892
JamesH will love you for doing that ;)
It's an addendum to one I opened.

I'd like every possible external option (not the hidden secret squirrel parms) to be documented in glorious detail so we can get away from pointing folks at https://elinux.org/RPiconfig as a source of documentation. We need words written for all of the /boot/config.txt things that can be tweaked and twiddled by regular users (with reasons why they might want to twiddle them).
I've already, I think, done most of the work of incorporating the ELinux stuff to our docs. If there is anything missing, let me know via github.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20062
Joined: Sat Jul 30, 2011 7:41 pm

Re: Conditional config.txt

Tue Apr 24, 2018 10:49 am

Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

User avatar
DougieLawson
Posts: 33334
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Conditional config.txt

Tue Apr 24, 2018 11:28 am

jamesh wrote:
Tue Apr 24, 2018 10:38 am

I've already, I think, done most of the work of incorporating the ELinux stuff to our docs. If there is anything missing, let me know via github.
I think you're right (and it's a good job, that's been well done), but that won't stop me looking for missing pieces.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20062
Joined: Sat Jul 30, 2011 7:41 pm

Re: Conditional config.txt

Tue Apr 24, 2018 11:40 am

DougieLawson wrote:
Tue Apr 24, 2018 11:28 am
jamesh wrote:
Tue Apr 24, 2018 10:38 am

I've already, I think, done most of the work of incorporating the ELinux stuff to our docs. If there is anything missing, let me know via github.
I think you're right (and it's a good job, that's been well done), but that won't stop me looking for missing pieces.
I'm sure there are bits missing - search away!!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

procount
Posts: 1148
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Conditional config.txt

Tue Apr 24, 2018 11:53 am

6by9 wrote:
Tue Apr 24, 2018 10:05 am
procount wrote:
Tue Apr 24, 2018 9:59 am
I've added a github issue: https://github.com/raspberrypi/documentation/issues/892
JamesH will love you for doing that ;)
Procount loves JamesH for completing the task within 2 hours! ;) Thanks.

(There's no point having great features in a great product if they are not documented. If no-one knows they are there, they may as well not be there.)
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20062
Joined: Sat Jul 30, 2011 7:41 pm

Re: Conditional config.txt

Tue Apr 24, 2018 12:34 pm

procount wrote:
Tue Apr 24, 2018 11:53 am
(There's no point having great features in a great product if they are not documented. If no-one knows they are there, they may as well not be there.)
I agree entirely, which is why, whenever I see something missing, or something new and interesting that would benefit users, I try to ensure it gets included ASAP.

TBH, I didn't even know that gpio option was there....
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5362
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Conditional config.txt

Tue Apr 24, 2018 12:41 pm

jamesh wrote:
Tue Apr 24, 2018 12:34 pm
TBH, I didn't even know that gpio option was there....
Me neither. I just went looking for the pi3+ options and stumbled over it. Secret magic added by dom in May 2016, so it's been there a fair while.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

procount
Posts: 1148
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Conditional config.txt

Mon Apr 30, 2018 9:40 am

What is the expected behaviour on a Pi2, that uses old firmware (prior to the 3B+) when it encounters a config.txt file as follows? :

Code: Select all

[pi3+]
sdram_freq=450
arm_freq=1200
[all]
My experience is that this code is still processed, causing the Pi2 to halt /lock-up (maybe the freqs are too fast for it).
Is it possible to exclude such [pi3+] isolated code from firmware that don't understand it, or is it necessary to revert the above settings for every other model of Pi?
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Return to “General discussion”

Who is online

Users browsing this forum: arkader, Bing [Bot], klricks, Virgilius1995 and 50 guests