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.

C6713 soft reset: how to do?



Hello! Please, suggest an appropriate way to generate reset from the user's firmware. Now I am using the next function:

 tgt_reset(void){

_disable_interrupts();

 

asm(" .ref _vector0");

 

asm(" NOP 5");

 

asm(" MVKL _vector0, B0"); // jump on 0 addr

 

asm(" MVKH _vector0, B0");

 

asm(" B B0");

 

asm(" NOP 5");

}

but it works strange - sometimes it goes to unknown state and I have to apply hardware reset.

Thanks!

 

  • Dmitry,

    Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages. Be sure to search those sites for helpful information and browse these forums for the questions others have asked on many topics.

    I believe the following would also work.

    software reset said:
    extern void vector0( void );

    main()
    {
     ...

     vector0();
    }

    or

    extern void c_int00( void );

    main()
    {
     ...

     c_int00();
    }

    The second case would work if your vector0 is branching to the standard _c_int00 location.

    However, I cannot think of a reason any of these methods, my two or yours, should work strange.

    You may need to explain more about what "works strange" means. And you may need to debug into your program to figure out what it is doing wrong.

    Depending on your linker initialization model, -c or -cr, your variable initializations might be wrong.

    Regards,
    RandyP

     

    If you need more help, please reply back. If this answers the question, please click  Verify Answer  , below.

  • Hello all!

    I hope this post may be helpful for somebody. I have solved my reboot problem.

    First of all I will describe my situation.  My custom board (C6713 based) has firmware update feature, when new firmware is uploaded and programmed into flash memory tgt_reset() function is called. Then init process starts. As I mentioned in my original post, jump to 0 address worked strange. It means my program execution was unpredictable. I realized I have missed something. First of all I have to reload 1KB from flash to internal SRAM (what C6713 does on hardware reset). And in second, I have to invalidate L1P and L1D cache (thru the CCFG reg). That is, cache invalidation was a key to solve my problem! Note that it is necessary to perform cache invalidation before 1KB reload, because old code will be actually executed from cache rather then new one from SRAM.

    Regards! Dmitry