stm32: pwm capture with four channel support skips captures #84044
Labels
area: PWM
Pulse Width Modulation
bug
The issue is a bug, or the PR is fixing a bug
platform: STM32
ST Micro STM32
Describe the bug
When trying to implement tests for pwm pattern generation, I found that, when four-channel-capture support is enabled on a pwm channel, then every second capture is only passed on to the system, and every other capture is silently dropped.
If I disable four-channel-capture-support everything works fine.
See the code in https://github.com/gumulka/zephyr/tree/pwm_pattern_generation. To be precise: main...gumulka:zephyr:pwm_pattern_generation
To Reproduce
west twister -T tests/drivers/pwm/pwm_loopback -v --inline-logs -p nucleo_h743zi --device-testing --device-serial /dev/serial/by-id/usb-STMicroelectronics_STLINK-V3_004C00243133510537363734-if02 -X pwm_loopback
four-channel-capture-support
in the overlay.Expected behavior
The description read, as if the results for four-channel-capture-support are less accurate, but not, that they are missing samples. I expected every sample to be there and captured by the system.
Impact
Annoyance
Logs and console output
I added the following patch to the code:
The resulting log:
When the samples should have been something along the lines of:
0: 800/2400
1: 1200/3600
2: 1600/4800
3: 2000/6000
4: 2400/7200
5: 2800/8400
6: 3200/9600
Environment (please complete the following information):
I'm currently only testing on a nucleo_h753zi, but compiling it as a nucleo_h743zi, because for PWM it is equal enough. If I remove the line
https://github.com/gumulka/zephyr/blob/2618a257aaf8a1bb825507bbc445c567aa2a9bf4/tests/drivers/pwm/pwm_loopback/boards/nucleo_h743zi.overlay#L38
then everything works fine. I the line is there, then every second signal is not captured.
The text was updated successfully, but these errors were encountered: