Slower execution speed leading to Lost Sync With Device in STM32F103

asked 2018-10-09 04:32:01 -0600

Nikhil Venkatesh gravatar image

Using the rosserial_stm32( library, I am trying to publishing a message(std_msgs/UInt32) on the /chatter topic at a rate of 5Hz. The message gets published at a rate 20% lower as seen from the screenshot below. When estimating the time of execution, I found the time taken for each loop to be around 236ms which is roughly 4.2Hz. image description

image description

I am also getting a Lost Sync with Device error very frequently (once every 2 minutes) as the code hangs. Any pointers to solutions? Thanks!

edit retag flag offensive close merge delete


Turns out I had set up the system clock incorrectly on the STMCubeMX software. Works quite well now! Closing the thread.

Nikhil Venkatesh gravatar image Nikhil Venkatesh  ( 2018-10-12 05:21:00 -0600 )edit

Please don't close questions that have a definite answer. In this case, your own.

Just post your comment as an answer and we can accept it.

gvdhoorn gravatar image gvdhoorn  ( 2018-10-12 05:43:31 -0600 )edit