2025-12-17 5:56 AM
Hello ST!
This is a bug report of sorts, since the `UTIL_SEQ_Run()` function is still marked that it allows nested calls. (I'm looking into the sequencer as delivered with the WBA package.)
In the past two years, somebody had introduced an obvious error into `UTIL_SEQ_Run()` function (when they were adding the support for the `UTIL_SEQ_PostTask()` or the `TaskClearList` feature.)
Inside the call to `TaskCb` callback, the static variable `CurrentTaskIdx` would be changed by the nested `UTIL_SEQ_Run()` call. Yet, after return from the callback, the variable (now with incorrect value) is used twice (before being set to `UTIL_SEQ_NOTASKRUNNING`).
Two years ago when I was reviewing the code for the first time, and the bug wasn't there. (Indeed, the sequencer included with the early versions of STM32CubeWBA package has correct implementation of UTIL_SEQ_Run() that handles the nested calls correctly.)
The old version of sequencer from WBA FW package v1.0.0
https://github.com/STMicroelectronics/STM32CubeWBA/blob/v1.0.0/Utilities/sequencer/stm32_seq.c#L290
The current version of sequencer from WBA FW package v1.8.0
https://github.com/STMicroelectronics/STM32CubeWBA/blob/v1.8.0/Utilities/sequencer/stm32_seq.c#L355