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
STM32L4: Timer callbacks broken after stmlib L4-1.17.0 #8732
Comments
I tried to be duplicated by running the attached script with NUCLEO-F446RE. I could not be duplicated with MicroPython v1.19.1-358-g0b26efe73. I found some changes about timer between v1.16 and v1.27.1 and the implementation of timer.c should change for v1.27.1. For workaround, specify callback when creating gps_PPS_IC like following change can prevent this issue.
|
Since L4 HAL version 1.17.0, HAL_TIM_IC_Start_IT() checks whether specified channel of timer is busy or not, which is the case if this function is called more than once without first calling HAL_TIM_IC_Stop_IT(). The fix in this commit is to call the stop function before calling start. The PWM and OC modes have the same issue with the same fix. Fixes issue #8732.
Fixed by 989b8c7 |
Since L4 HAL version 1.17.0, HAL_TIM_IC_Start_IT() checks whether specified channel of timer is busy or not, which is the case if this function is called more than once without first calling HAL_TIM_IC_Stop_IT(). The fix in this commit is to call the stop function before calling start. The PWM and OC modes have the same issue with the same fix. Fixes issue micropython#8732.
Since L4 HAL version 1.17.0, HAL_TIM_IC_Start_IT() checks whether specified channel of timer is busy or not, which is the case if this function is called more than once without first calling HAL_TIM_IC_Stop_IT(). The fix in this commit is to call the stop function before calling start. The PWM and OC modes have the same issue with the same fix. Fixes issue micropython#8732.
Timer callbacks seem to be broken for STM32L4 series after stmlib was updated to L4-1.17.0. Tested on custom L496 board and NUCLEO-L452RE. Works on F401, F411 and F405. Not tested on L0, F0, F7, H7, G0, G4 or WB.
On NUCLEO-L452RE the attached test script works on V1.17-147-gd72d699da but fails on V1.17-240-gbc1b0fd2c. I can't see any relevant changes to MicroPython code between these, except for the library update. Also fails with the latest nightly build of NUCLEO-L452RE, so not dependant on build environment.
The issue can be duplicated by running the attached test script on any board with PB15 (output) jumpered to PA1 (input). Rising edges on PA1 should trigger a calback, flash LED1 and print the capture time once per second.
callback.zip
The text was updated successfully, but these errors were encountered: