Skip to content

Conversation

jaenrig-ifx
Copy link
Member

By creating this pull request you agree to the terms in CONTRIBUTING.md.
https://github.com/Infineon/.github/blob/master/CONTRIBUTING.md
--- DO NOT DELETE ANYTHING ABOVE THIS LINE ---

CONTRIBUTING.md also tells you what to expect in the PR process.

After all, the lack of complete reset of the hardware transceiver and its fw stack deinit seem not be the actual issue.
However, being aware of it, allowed me to start from a clean and fresh hardware setup and reproduceable behaviors during the debugging 😃

The issue

Calling cy_wcm_stop_scan() was the primary issue making the program to hang. Calling that function inside the callback is generating some race condition.
As anyhow we want to stop the scan unconditionally (weather it is completed or due to timeout), we just stop after the blocking scan completion wait.

Additional fix/improvements

  • In the callback, we were allowing one more scan results than the allowed. That could also cause some race condition.
  • The scan results were not reset, subsequent calls to scanNetworks() calls would overflow the array positions and/or provide previous scan results.

Beside the actions in this PR, these workflows already perform the scan before the rest of the station tests:

Copy link
Collaborator

@ramya-subramanyam ramya-subramanyam left a comment

Choose a reason for hiding this comment

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

Great! 👍

@jaenrig-ifx jaenrig-ifx merged commit b69d9c5 into main Sep 8, 2025
31 checks passed
@jaenrig-ifx jaenrig-ifx deleted the bug-fix-wifi-scan branch September 8, 2025 07:51
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.

2 participants