Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/sam0: enable PD for MISO pin to save energy #7037

Closed

Conversation

haukepetersen
Copy link
Contributor

Factored out from #6652 to get this merged quickly (credits go to @immesys). Seems like I lost this (previously already merged change: #5868) when doing the SPI remodeling. Sorry for that...

@haukepetersen haukepetersen added Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 11, 2017
@haukepetersen haukepetersen added this to the Release 2017.07 milestone May 11, 2017
@jnohlgard
Copy link
Member

Is it not better to switch the pin to high impedance (HiZ, probably analog function in the mux) than to add a pull resistor? Some slave devices also have pull resistors, which may conflict with this and create a direct resistance path between vdd and ground.
Is pull down the correct choice for the idle state of the bus?

@haukepetersen
Copy link
Contributor Author

Is it not better to switch the pin to high impedance

I think this won't work, as this pin configuration is used while the bus is used actively also, and in this case configuring it to AIN would break the SPI functionality?!

Is pull down the correct choice for the idle state of the bus?

Actually, I am not aware of a 'correct' bus state. It seems to me, it depends on the board layout and connected devices. Now thinking of it, the 'correct' solution for us would probably to make the MISO pin mode configurable through the boards periph_conf?!

@jnohlgard
Copy link
Member

I think you misunderstood, I meant, switch the mux to analog between each transmission because there's nothing driving the bus if the master (we) does not assert any CS pins.

@immesys
Copy link
Contributor

immesys commented May 11, 2017

For correct bus state, if no CS pin is asserted, the master owns MISO and can choose whatever state it wants on it. If there are slaves with pulldowns or pullups on MISO that are active when CS is deasserted then they are at fault.

@immesys
Copy link
Contributor

immesys commented May 11, 2017

Also, I know this was factored out of #6652 because it is an uncontroversial change that was already previously merged in #5868, but the other changes I mention in #6652 are also critical.

I don't mind if there are philosphical disagreements about what the correct thing to do is, but pick anything that solves the SPI power consumption in sleep problem and go with it. Power consumption is one of the biggest metrics of fitness for purpose in a wireless sensor network operating system, and arguably should be tested before each new release. It's disheartening for us to find critical power consumption regressions, push fixes upstream, and then have them treated as low priority and ignored for months.

@haukepetersen
Copy link
Contributor Author

It's disheartening for us to find critical power consumption regressions, push fixes upstream, and then have them treated as low priority and ignored for months.

Yes indeed. I wouldn't say it's low priority on our side, I'd rather say its one of too many high priority topics... And sorry if there is not enough movement on the low-power side, we should be more pressing on these topics (PM implemenation, CI integration, ...) indeed!

@gebart: would the argument given above be enough to convince you to ACK this PR?

@jnohlgard
Copy link
Member

I won't block this PR since there is a serious problem on that platform which this PR fixes

@immesys
Copy link
Contributor

immesys commented May 12, 2017

I think we would be willing to put in the effort to help build power monitoring CI into murdock, especially for samr21 as a pilot. We have a lot of that internally. Let's chat offline and I can share some of our experiences and solutions

@thomaseichinger
Copy link
Member

@immesys I'd appreciate if you could keep me in the loop regarding CI power monitoring.

@haukepetersen
Copy link
Contributor Author

@immesys: sounds great. I'll ping you off-list so we can coordinate on a call sometime this week to sync on energy profiling in RIOT's CI if thats ok?!

@everyone: someone willing to ACK this PR so we get back to energy-niceness?

@haukepetersen
Copy link
Contributor Author

never mind, closing this in favor of #6652

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants