Skip to content

STM32: Fix Meowbit startup and associated bugs #3320

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

Merged
merged 4 commits into from
Aug 27, 2020
Merged

STM32: Fix Meowbit startup and associated bugs #3320

merged 4 commits into from
Aug 27, 2020

Conversation

hierophect
Copy link
Collaborator

This PR issues a number of bugfixes related to the Meowbit STM32F401 development board. These include:

  • Meowbit configuration file was incorrectly altered to include a low speed oscillator (LSE) resulting in a looping hang at startup. Fixed by removing this reference.
  • In general, boards with a LSE configuration problem would unsuccessfully attempt to auto-recover, making an already confusing problem worse. This "feature" has been removed.
  • A null pointer dereference in common_hal_pulseio_pwmout_deinit was causing a hardfault during release_displays. Fixed by moving things around and giving myself a nice hard facepalm.
  • auto_brightness was set to true in the board_init setup of the Meowbit's TFT screen, which was disabling the screen backlight. This may have been changed behavior from the initial implementation, since this didn't seem to be a problem then. Fixed by setting auto_brightness to false.

Regarding the LSE config problem, I considered adding a new safe mode category to contain issues with a board config, but quickly found that issues in the clock setup are so pervasive and confusing that any form of recovery or error management is probably misguided, especially for a theoretical audience of "board developers who mess up their clock settings and also don't have a debugger". As replacement, any issues in clock setup hang indefinitely in the config function for easy tracing with GDB.

Resolves #3314, and provides final wrap-up to #2702. Help testing would be greatly appreciated from anyone who has a Meowbit handy, I don't believe most of the usual core reviewers have them.

@hierophect hierophect added the stm label Aug 24, 2020
@tannewt tannewt requested a review from jepler August 25, 2020 01:16
@hierophect hierophect requested a review from dhalbert August 27, 2020 15:00
@tannewt
Copy link
Member

tannewt commented Aug 27, 2020

@jepler Mind reviewing this?

Copy link

@jepler jepler left a comment

Choose a reason for hiding this comment

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

Seems fine. No hardware to test. Good catch on the cause of the crash, too bad the compiler wouldn't help out with a diagnostic.

Comment on lines -242 to 247
self->tim = NULL;

//if reserved timer has no active channels, we can disable it
if (!reserved_tim[self->tim->tim_index - 1]) {
tim_frequencies[self->tim->tim_index - 1] = 0x00;
stm_peripherals_timer_free(self->handle.Instance);
}
Copy link

Choose a reason for hiding this comment

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

I am disappointed that gcc did not show a diagnostic for this. Amazing! glad you found it.

@jepler jepler merged commit 49a22b0 into adafruit:main Aug 27, 2020
@hierophect hierophect deleted the stm32-meowbit-fix branch September 21, 2020 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

STM32: Meowbit does not start
3 participants