Skip to main content
Visitor II
December 10, 2024
Question

STM32C031C6 ClassB Example Code

  • December 10, 2024
  • 4 replies
  • 911 views

Hi Community,
I came a cross with a strange error that I can not understand the reason.
As I search the read me file of the example project which is shared by ST.
It is written as below.

2. load the image into the target3. Execute the code
- LED4 toggles regularly : all the tests are executed correctly (each toggle signalizes flash test completion)
- LED4 single short flash appears once per 2 seconds: one of the tests FAILED (FailSafe_Handler keeps fail code)
- LED4 single short flash appears once per 4 seconds: one of the tests FAILED by defense programming.

When I run the code without changing any part of code. Led blink as section 1 (Toggle regularly). 
But the funny thing is so strange.
When I even only define a variable in main file like as 
uint16_t Error_Code;
The led blinks like section 2 (LED4 single short flash appears once per 2 seconds.)
And when I try to debug Error_Code shows 0(like it restart itself )when I stop the debugging it turns error code 13(TMF_ERR_CODE).
I could not understand the main reason if this error. Just defining a variable should not cause a error like Flash error etc.
Embedded_Class_0-1733854797496.png

    This topic has been closed for replies.

    4 replies

    ST Employee
    December 19, 2024

    Hello @Embedded_Class,

    Could you please specify the hardware product you are using? Additionally, mention the package used and the name of the project you worked on in STM32CubeC0, so we can analyze and assist you more effectively.

    Best Regards,

    Dor_RH

    Super User
    December 19, 2024

    @Embedded_Class wrote:

     I search the read me file of the example project which is shared by ST.


    ST share hundreds (maybe even thousands) of example projects - which one, specifically, are you referring to?

    How to write your question to maximize your chances to find a solution

    Technical Moderator
    January 15, 2025

    Hi @Dor_RH & @Andrew Neil ,

    I assume that the question is related to X-CUBE-CLASSB - Class B 60730-1 and 60335-1 Functional Safety Package with software expansion for STM32Cube.

    I will check with our Functional Safety expert to bring required help for this request.

    -Amel

     

    ST Employee
    January 15, 2025

    Hello,

    the Fail Safe handler procedure is entered when execution of any STL test module finds a problem. The fail code input parameter should help you to identify it. If you inspect call stack, you should even identify the STL procedure calling the fail handler. The code shows problem with Flash integrity check. Great probably, your code modification is not completed by adequate change of the CRC field modification or parametrization of the test (see user param structures handling) and so the Flash content integrity check simply fails.

    Best regards,

    Petr