Skip to content

stm32: fix a few bugs with ADC on STM32WBxx MCUs and tweak tests so they pass on NUCLEO_WB55 #17558

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

dpgeorge
Copy link
Member

Summary

A NUCLEO_WB55 is part of the Octoprobe hardware test stack. This PR aims to get the test suite fully passing on this board.

The main thing here is to tweak the existing tests/ports/stm32 tests, which were originally written for pyboards (PYBv1.x and PYBD-SFx). These tests should now pass on a wider variety of stm32 boards.

Testing

Tested on a NUCLEO_WB55 via ./run-tests.py -t 0 -d ports/stm32.

CI and Octoprobe will also test this PR.

@dpgeorge dpgeorge added port-stm32 tests Relates to tests/ directory in source labels Jun 25, 2025
@dpgeorge
Copy link
Member Author

See related Octoprobe issue: octoprobe/testbed_micropython#31

@hmaerki FYI

Copy link

codecov bot commented Jun 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.57%. Comparing base (4bd9926) to head (ca49faa).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #17558   +/-   ##
=======================================
  Coverage   98.57%   98.57%           
=======================================
  Files         169      169           
  Lines       21968    21968           
=======================================
  Hits        21654    21654           
  Misses        314      314           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

github-actions bot commented Jun 25, 2025

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:   +36 +0.009% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@dpgeorge
Copy link
Member Author

Octoprobe run results are here: https://reports.octoprobe.org/github_selfhosted_testrun_127/octoprobe_summary_report.html

That looks a lot better, although still a few tests are failing.

@dpgeorge dpgeorge force-pushed the stm32-nucleo-wb55-tests branch from 4d02d58 to 03134b4 Compare June 25, 2025 08:32
@hmaerki
Copy link
Contributor

hmaerki commented Jun 25, 2025

@dpgeorge: Which usb connection do you use? I use the one behind 'RESET'.

    USB_STLINK CN15: located on the back side of 'LED4'
    USB_MCU    CN1 : located on the back side of 'RESET'

What I am doing next:

  • Test the crystal: make a LED blinking 1 Hz. If the blinking is too slow, the crystal may be broken.

@dpgeorge
Copy link
Member Author

My 2f2c-NUCLEO_WB55 is slow, even when I connect it to my notebook! So I assume it has to to with the board or the firmware update we did together yesterday

It could be due to left over files on the filesystem, from the BT firmware update. Can you try to reset the filesystem with:

import vfs, pyb
vfs.VfsFat.mkfs(pyb.Flash(start=0))

These are the jumper settings (according to tentacle_specs.py)

Those jumper settings are correct.

Which usb connection do you use? I use the one behind 'RESET'.

The one behind RESET is the correct USB port to use.

@dpgeorge dpgeorge force-pushed the stm32-nucleo-wb55-tests branch 2 times, most recently from 5b2fcf8 to 893cadf Compare June 25, 2025 14:33
@dpgeorge
Copy link
Member Author

I have updated the tests here so that they should all now work on NUCLEO_WB55.

If you bridge PA2/PA3 on the NUCLEO_WB55 (Arduino D0/D1 on CN9, or 35/37 on CN10) then that will allow the UART tests to pass.

@hmaerki
Copy link
Contributor

hmaerki commented Jun 25, 2025

If you bridge PA2/PA3 on the NUCLEO_WB55 (Arduino D0/D1 on CN9, or 35/37 on CN10) then that will allow the UART tests to pass.

Stupid me. Thanks for your help! I didn't read the table in datasheet correctly. I will correct it tomorrow morning and run another test.

@dpgeorge dpgeorge added this to the release-1.26.0 milestone Jun 26, 2025
dpgeorge added 4 commits June 29, 2025 08:53
Following 17898f8.

Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
It needs a divisor of 100 because the calibration temperatures are 30 and
130 degrees, similar to the H5.

Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge force-pushed the stm32-nucleo-wb55-tests branch from 893cadf to 4c2fb92 Compare June 29, 2025 12:17
dpgeorge added 6 commits June 30, 2025 11:29
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
On stm32, the hardware generates an RXIDLE IRQ after enabling the UART,
because the RX line is technically idle.

Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
There should be no change to these tests for existing PYBV1x and PYBD_SFx
boards.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge force-pushed the stm32-nucleo-wb55-tests branch from 1c56b6f to 9d7e0b8 Compare June 30, 2025 01:29
Eg on PYBV10 with THREAD variant, the firmware has both the `_thread` and
`socket` modules but no NIC.

Signed-off-by: Damien George <damien@micropython.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
port-stm32 tests Relates to tests/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants