This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Value corruption

Static volatile global variable updated in systick handler gives garbage values on startup despite being initialized to 0. Is this memory corruption?

Parents Reply
  • Hey,

    **********************************

    uint32_t returnCode;

    static volatile uint32_t msTicks = 0;

    void SysTick_Handler(void)  
    {
                    msTicks++;
    }

    //in main fn

    returnCode = SysTick_Config(SystemCoreClock / 1000);               

    if(returnCode!=0)
    {
                            printf("syserr\r\n");
    }              

    ************************************

    It seems msTicks value shoots up very quickly.

    Thanks,

    Jibin

Children
Related