Please refer to section 6.1 of AN5909, you will find also an example about how to implement the step counter:
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.