-
Notifications
You must be signed in to change notification settings - Fork 69
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
Delay panics #203
Comments
Do you have any backtrace at hand, which show, where the code panics? When building for debug mode and depending on the panic strategy this is printed out to e.g. a UART or via ITM. The Delay function is independent of the timer and PWM implementation and has nothing to do with #190. This sound like a bug and should be easy to solve. |
Because the delay is dependent on the system clock, I bet you can delay for longer, when you setup your cpu frequency at a higher rate. But this is definitely a call for improving |
The gdb window shows
and the openocd semihost shows
gdb bt gives Click to expand
which I have not figured out, but I think it is a problem in the panic code rather than the cause of the panic. I've failed previously in trying to get ITM to work, but it is about time I tried again. Let me know if above is not enough. |
Thank you for this trace back. This is exactly what I expected.
I'll look into it, to check, what can be done about it. But I am afraid, that the only thing that can be done in this case, is to return an error, instead of panicking. (which is much better than now, IMO!) But this seems like a limitation of the delay method used. For longer delays you need another method. Sadly timers are not working for this, neither. Not at least with some abstraction code, which artificially allows periods above 1 seconds. I have no good example at hand right now. Regarding ITM, remember this line: https://github.com/rust-embedded/cortex-m-quickstart/blob/18bb68071011967d957a5df6c2e5d513e80b2fcb/openocd.gdb#L30 |
There is no rush for this on my account. I have a good workaround using AsmDelay. But it is useful to know there is a problem. Thanks for the pointer on ITM. |
Alternatively, we could introduce a new counter variable, which would increase the maximum delay quite a bit. There is still a limit, but it is in a reasonable range, instead of surprising the user with a panic. Just under 3 seconds is pretty low, IMO.
Definitely. Thanks for reporting! |
Leverage a full 32 bit range instead of only 24 bit range. This will increase the maximum possible delay from ~2 seconds up to 9 minutes. Also cap the value, instead of panicking, if the value is to high. Fixes stm32-rs#203
Leverage a full 32 bit range instead of only 24 bit range. This will increase the maximum possible delay from ~2 seconds up to 9 minutes. Also cap the value, instead of panicking, if the value is to high. Fixes stm32-rs#203
Leverage a full 32 bit range instead of only 24 bit range. This will increase the maximum possible delay from ~2 seconds up to 9 minutes. Also cap the value, instead of panicking, if the value is to high. Fixes stm32-rs#203
Leverage a full 32 bit range instead of only 24 bit range. This will increase the maximum possible delay from ~2 seconds up to 9 minutes. Also cap the value, instead of panicking, if the value is to high. Fixes stm32-rs#203
(This may be related to #190 and stm32-rs/stm32f1xx-hal#225.)
The hal code for
stm32f3xx_hal::delay::Delay::new(cp.SYST, clocks)
panics when the delay time is set above 2097ms. I have found the panic behaviour in several examples but isolated time with the simple blink example below. The problem can be avoided by using another delay function, as seems to be done instm32f3xx-hal
examples.Click to view code example
The text was updated successfully, but these errors were encountered: