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.

Problem reset vector

Other Parts Discussed in Thread: MSP430F5529

Hi, 

 

We loaded the OS Contiki on a msp430F5529, when we turned the OS after a while we go to "reset vector" (function assembler) and our CPU is reset.

We did some research and apparently it's the library "rts430.lib" which contains the "reset vector".


Can you tell me what is this library and what is the use of "reset vector "and if our problem is linked to this library.

 

thank you

Best regards

Aurélien

  • Hi Aurélien,

    because this is a very specific question related to the OS I would highly recommend posting it in a Contiki Forum too.

    Rgds
    aBUGSworstnightmare

  • Aurélien GAUDUCHEAU said:
    after a while we go to "reset vector" (function assembler) and our CPU is reset.

    Usually it is exactly the opposite: teh CPU is reset and after the reset it jumps to the "reset vector".

    The reset vector is the program entry point after power-up or system reset. More specific, the 'reset vector' is an address value stored at address 0xfffe which tells the cpu core where to start program execution after a device reset (hence the term 'vector'). But the function where this address points to is often also referred to as reset vector. This function does the necessary initialisation to make your program work. On normal C programs, it contains a loop to initialize the global variables and it also initializes the stack, then jumps to main(). It is provided by the compiler automatically. But with an external OS, this function can be much more complex, initializing the OS's internal mechanismns before proceeding to main().

    The reasons why the CPU resets are various. From a power-fail that causes a brownout  reset (BOR)  or an explicit low signal on the reset pin (also BOR) through a voltage supervisor fail, which causes a power-on-reset (POR) to many other software-related reasons (watchdog timer expired, vacant memory access, flash controller password failrure etc.) which all cause a power-up-condition (PUC).
    Each of these reasons for a reset can be caused by many other reasons. From a wrong hardware module usage (wrong register name used, wrong value written -> password violation) through nasty things like array index out-of-bounds or stack overflow. If you dynamically reserve memory, it is possible that ther eis no mor ememory available and the malloc() function returns a null pointer. If you don't test for it, your program will store its data at address 0x0000 (assuming it is the requested memory space), overwriting many hardware registers. Also, if you recurse into subroutines too deep or make excessive use of local variables, the stack may overflow into your data area, overwriting everything in its way and finally extend to vacant memory.

    All of this can sooner or later cause a system reset.

    Normally, you can check the reason of the last reset inside your main function right after program start, but in case of an external OS library, much setup work may be done before your main is called() and this info may be lost in between.

    Often it is just an endless loop or an endless recursion, and the system will either reset due to a watchdog timeout (if watchdog is active, which it should for most embedded projects) or due to a stack overflow.

  • Thank you for your answer

    We will study his cases
    Best reagars
    Aurélien

**Attention** This is a public forum