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

Panics in release mode #67

Closed
jordens opened this issue Sep 14, 2020 · 3 comments · Fixed by #72
Closed

Panics in release mode #67

jordens opened this issue Sep 14, 2020 · 3 comments · Fixed by #72
Labels
bug Something isn't working

Comments

@jordens
Copy link
Member

jordens commented Sep 14, 2020

The code should work fine in release mode.

@jordens jordens added the bug Something isn't working label Sep 14, 2020
@HarryMakes
Copy link
Contributor

HarryMakes commented Sep 21, 2020

Hi, I was testing with --release to see which part of main.rs (commit fa742bd) in the release profile would cause the panic. My observation:

  • Initialisation of the channels and fans hardware seem to cause panic; I2C SCL and SDA, if initialised separately, won't cause the panic.
  • LEDs can be initialised successfully. However, they don't seem to work (turning the lights on), e.g. by calling their update functions in a "button press" handler.

The firmware by cargo-building in the debug profile doesn't panic upon initialisation. But the ELF generated and *.DFU converted between the debug and release profile differ quite a lot:

  • release: ELF is 3033064 B, converted DFU is 173345 B
  • debug: ELF is 7081552 B, converted DFU is 514889 B

@ryan-summers
Copy link
Member

I have probed the I2C lines and looks like this has to do with resetting the ADS7924. Specifically, after issuing a software reset to the device, we currently wait 100uS for the device to come back online. A probe of the I2C lines indicates this may not be enough time for the device to come back up:

image

I think an appropriate fix here is to instead poll continuously after the reset is sent to wait for the device to come back online.

@ryan-summers
Copy link
Member

Additional testing indicates we cannot continuously poll the device either, as it will continuously NAK the request. I would recommend we just increase the delay period to 500uS and see if we have any further issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants