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

Random colored dots at startup #13

Closed
fweiss opened this issue Jul 7, 2024 · 6 comments
Closed

Random colored dots at startup #13

fweiss opened this issue Jul 7, 2024 · 6 comments

Comments

@fweiss
Copy link
Owner

fweiss commented Jul 7, 2024

When running alphabet as default, the display is random colored dots until the animation displays "C". Note base class BitmapAnimation::drawFrame(Frame &frame) does not clear frame.

When running plasma/nervous as default, it's normal. plasma does do frame.clear() at beginning of drawFrame(Frame&)

Looks like animation player should be initialized with frame.reset and/or frame.clear().

@fweiss
Copy link
Owner Author

fweiss commented Jul 24, 2024

Reproducable with power-up.

@fweiss
Copy link
Owner Author

fweiss commented Jul 27, 2024

Not much luck with RCA, but have a way to reproduce and get some observations:

  • use the alphabet animation.
  • In main.cpp, in animator.setCallback(), short circuit so that it returns after two calls

The result is after power up, "B" is displayed, but rows 1 and 2 are corrupted, each with four pixels of seemingly random colors.

When powered up from battery, same pattern. But about every three seconds:

  • a few white pixels flash
  • perhaps in the "A" pattern
  • the IMU light also flashes at same rate

This appears to be WDT or brown-out, but is probably not related to the random colored dots.

Commenting out the three lines to start BT:

  • flashing of pixels and IMU goes away
  • still pixel corruption, but different pattern

@fweiss
Copy link
Owner Author

fweiss commented Jul 27, 2024

Tried to connect BT from Android during the battery powerup. Seems to have trouble connecting until the flashing goes away. Considering that ESP32 BT is sensitive to power, this might indeed be a brown-out.

See also #17

@fweiss
Copy link
Owner Author

fweiss commented Jul 28, 2024

After some more instrumentation, noticed the following:

  • AnimationTask::run() was reporting interrupt immediately after the func() animation
  • the xSemaphoreCreateBinary() is new since v5 and has different semantics than the old vSemaphoreCreateBinary

@fweiss
Copy link
Owner Author

fweiss commented Jul 28, 2024

Refactoring the semaphore code in AnimationTask seems to have fixed the problem.

However, when running on just the battery there are some bugs. We'll revisit those in the battery monitor issue.

@fweiss
Copy link
Owner Author

fweiss commented Jul 29, 2024

Unfortunately it is not clear why the pixels got corrupted.

A bit of thought went into this:

  • MOST LIKELY recent update from esp-idf v4 to v5, deprecated APIs
  • power issue, like wifi pulling too much current
  • bad interrupt syncroniztion
  • memory corruption

Problem was solved, but not extensively tested. There may be some lingering bugs.

fweiss added a commit that referenced this issue Jul 29, 2024
@fweiss fweiss closed this as completed Aug 3, 2024
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

No branches or pull requests

1 participant