Hello, thanks for the article! I'm trying to set a low value for timer it panics, e.g.
timer.start(100.millis()).unwrap();
I'm using STM32F103C8T6. Any thoughts on why?
Hello Andrey, it's been a while since I worked with STM32s and Rust, though could you possibly share what the panic message says? It's possible that it would say that you are unwrapping an error variant.
Since the start method returns a Result, maybe you can use a match statement to print out the error as well. This could give some indication.
I found out the issue, it's newbee one :)
I enabled interrupts early and it ISR is called before I initialized a device, working with that device caused an error.
Thanks for the response and the blog!
This article is very impressive
I am studying STM32F103C8T6 and looking for examples related to external clock sources based on timers. Can you please publish a similar article?
Hello, rain silent I am glad you liked it. One thing I wanted to do in the past related to your request is input capture to measure the frequency of external clock sources. It turns out at the time that the feature was not yet supported in various STM32 HALs. Nevertheless, it can still be done with software and GPIO. A very similar post you might find useful is the ultrasonic distance measurement, as it achieves something quite similar. Here is the link: apollolabsblog.hashnode.dev/stm32f4-embedded-rust…
Andrey
Hello, thanks for the article! I'm trying to set a low value for timer it panics, e.g.
timer.start(100.millis()).unwrap();I'm using STM32F103C8T6. Any thoughts on why?