Skip to content

chassis_fans: Retry set_duty_cycles() upon NACK#158

Merged
ryan-summers merged 29 commits intodevelopfrom
feature/fans_i2c_retry
Oct 6, 2021
Merged

chassis_fans: Retry set_duty_cycles() upon NACK#158
ryan-summers merged 29 commits intodevelopfrom
feature/fans_i2c_retry

Conversation

@HarryMakes
Copy link
Copy Markdown
Contributor

Summary

This PR introduces a retry mechanism for NACK encountered while setting the MAX6639 fan speed.

Motivation

This implements the same retry mechanism as #157, except that this PR sticks with the STM32 HAL I2C driver and only considers Max6639::set_duty_cycle().

Just like #157, this aims to tackle #140 regarding random occurrence of NACK upon I2C writes to the chassis fan controllers. My original findings (see comment) supports that this retry mechanism is a good but dirty solution.

Besides, there have not been reports of similar occurrence of NACK for any other operations on MAX6639 or any other I2C devices. Thus, it should be reasonable to only implement retries for just ChassisFans::set_duty_cycles().

Testing

At the time of opening this new PR, there has not been prolonged test runs for this retry mechanism with the STM32 I2C controller. However, my bitbanging driver has empirically shown that the retry mechanism is reliable, e.g. does not trigger the watchdog. Further testing is welcome and desirable.

Related Issues

This closes #140.

occheung and others added 21 commits June 16, 2021 13:16
(afdab5f) cargo: include enc424j600 dependencies

(39e0b55) main: feature gate different eth device

(e845f56) nal: implement enc424j600 variant

(befe70a) nal: fix unnecessary w5500 dependencies

(20efdcc) settings: override eeprom MAC

(0d90470) use cargo fmt

(6e13f4f) cargo: add w5500 as default

(83380a9) cargo: simplify smoltcp dependency

(83109c3) settings/mac: remove redundant code

(a3db62f) mac: use smoltcp

(15f0964) eth_cfg: split off from main

(4ae6e82) nal: migrated to enc424j600

(e66d916) phy_config: minor fix

(3869217) clean up
* This also tells the ENC424J600 driver to use Cortex-M instructions to perform SPI CS_n delays at the current firmware CPU clock frequency.
* mqtt_control: Also fix missing feature gate for W5500
Comment thread src/chassis_fans.rs
Comment thread src/chassis_fans.rs Outdated
Comment thread src/chassis_fans.rs Outdated
Comment thread src/chassis_fans.rs Outdated
Copy link
Copy Markdown
Member

@ryan-summers ryan-summers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last little nitpick, but otherwise this PR looks good-to-go for me.

Comment thread src/chassis_fans.rs Outdated
@ryan-summers
Copy link
Copy Markdown
Member

@HarryMakes Oh, and please add a CHANGELOG.md entry for this fix

@HarryMakes
Copy link
Copy Markdown
Contributor Author

HarryMakes commented Oct 6, 2021

@ryan-summers To change CHANGELOG.md would you prefer rebasing this PR branch or merging develop into this branch?

@ryan-summers
Copy link
Copy Markdown
Member

I prefer merging into develop

@HarryMakes
Copy link
Copy Markdown
Contributor Author

Added line to the Changelog with caea06f. Thanks!

Copy link
Copy Markdown
Member

@ryan-summers ryan-summers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know why Github is showing a lot of changed files... Manual compare shows a much more reasonable changeset. Everything looks good to me though.

@ryan-summers ryan-summers merged commit 9d30584 into develop Oct 6, 2021
@ryan-summers ryan-summers deleted the feature/fans_i2c_retry branch October 6, 2021 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NACK encountered while communicating with fan controllers

4 participants