Showing results for 
Search instead for 
Did you mean: 

Potential Bug in stm32fxx_STLstartup.c V2.2.0


Dear Community Members,

While working on my current STM32F103 project and attempting to integrate the X-CUBE-CLASS-B Library, I've come across a potential issue in the file `stm32fxx_STLstartup.c`. Specifically, it concerns line 351:




It appears that `STL_FullRamMarchC` returns "1" upon successful testing, while returning "0" upon failure.


 91    STL_FullRamMarchC ; find in stm32fxx_STLRamMcMxKEIL.s
 92     MOVS R4, #0x1 ; Test success status by default


However, `SUCCESS` is defined as 0, causing the error branch to be executed even when the test is successful.

I'm wondering if this issue is already known and if STMicroelectronics plans to provide an updated version addressing this bug. I want to ensure that my project work is not compromised by potential errors in the library.

Any advice or information you have on this matter would be greatly appreciated.

Best regards,

ST Employee

Hi @WWagner ,

Sorry to come back late to your case. It is possible that you have already resolved your issue and it will be interesting to share with us your solution in such case .

We believe that it may help others to provide an answer here, that is why I tracked your request in an internal ticket (#182638).

I share with you the answer I got from our expert: 

Such problem occurs because of the combination of the obsolete STL FW with the latest HAL driver. If you refer to the paragraph "Incompatibility with previous versions of the STL" in AN4435, you will find the workaround.  Please apply it at the code explained there. Then, to prevent any problems with preserved registers, you can extend the function call by back-up pointer as described there, too.


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.