This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Non init directive for variables to avoid reset due to watchdog

I have large no of variables. Is there any directive to tell compiler not to initiliza vars on startup before disabling watchdog.

Parents Reply Children
  • Easiest is to find large arrays or structs that can be zero-initialized. Move them to a specific memory region that you specify to be unininialized. Then it's easy to memset() to zero after the watchdog has been kicked.

    While you still get the advantage that the startup files can give initial values to the variables you want specific start values for.

    Just make sure that you don't on "routine" assign zero to global variables without verifying if the compiler/linker will notice that these assigns can be done by simple zeroing instead of copying explicit values from flash on startup.