This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

FreeRTOS stops after STC reset

Other Parts Discussed in Thread: HALCOGEN

Hi,

Maybe someone has the same issue, which causes me headache..

FreeRTOS hangs-up after STC reset the CPU and generates and ESM error and the application stops working... Timming issue?

Can someone give me a tip?

Regards Burim

  • STC destroy all the information saved in the CPU.

    Did you check the e_SYSTEM_ST.SYSESR_UN.SYSESR_ST.MPCRST_B1 after the reset? Depending on the different type of reset, the application should process it differently.

    If it is a LBIST /stc reset, the application should 1) restore all the CPU contents or 2)start the initialization again.

    By the way, what is the ESM error? STC error?

    Regards,

    Haixiao

  • I read your another post. It sounds like a CPU compare error occurring during STC testing. Can you disable the IRQ bit in CPSR before the instruction “WFI”? I am afraid the RTI interrupt in RTOS ruins the STC test.

    Haixiao

  • Hm

    You mean the SysTick interrupt?  I disable the interrupts (using _diable_interrupts() instrict) but the behaviour is the same.

    But one thing I cant explain. Why it works in debug mode? The systick should ruins it too in this mode.. or do i miss something ?

    Regards

    Burim

  • I can not speculate the failure.

    If possible, can you simply and publish your project here?

    Or Send to Haixiao.weng@ti.com.

    Regards,

    Haixiao

  • Hi, here is the project

    I can't understand why in debug mode has other behaviour than in normal mode

    Regards

    Burim

    7028.TI.zip

  • The managed make project file is missing. The sys_startup.c is missing. I can not compile the project. I can not find the entry for c_int00. Can you upload the project again?

    Thanks,

    Haixiao

  • Sorry

    Here the project again

    regards

    burim1538.TI.zip

  • The problem accurs when you try to restore the CPU contents. The STC messes up everything in the CPU. Before you call the STC, it is in SVC mode. When you try to restore the stack registers, it is in system mode. Now, the LR in SVC mode is not initialized after the STC reset. When your code checks _Continue_after_STC after reset, you forced the code to enter SVC mode (when you restores the SP, you changed the CPSR). Once the program try to return by call Bx LR or MOV PC, LR, two CPU get different LR values since it is not initialized. A CPU compare error occurs.

    I do not have solid answer of a list registers that should be saved and restored and how/where to restore those registers. To make the problem simple, my opinion is:

    1. Run STC at very beginning/start up

    2. Run it only once with all 32 intervals

    3. Since it is at the very beginning, you don't need to save/restore the registers. You can re-do the initialization process.

    Here is an example of the STC test during startup. It is modified based on the FreeFTOSTxQueue example in HalCoGen help. I don’t need to backup any registers. If an STC error occurs, the ECLK will toggle at 1MHz and the nError will tie low. I tested it with a bad device and a few good devices, it works well so far.

    Regards,

    Haixiao

    7573.FreeFTOSTxQueue.zip

     

    ALL CONTENT AND MATERIALS OF THIS POST ARE PROVIDED "AS IS". TI AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY TI.  

  • Hi Haixiao

    Thank your for the example code

    Regards

    Burim